[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] Update event loop example programs to demonstrate best practice



On 03/23/2011 09:24 AM, Daniel P. Berrange wrote:
> The example C event loop code is a nasty hack and not compliant
> with the require API semantics. Delete this, so that developers
> don't mistakenly copy it. Instead call the new public event loop
> APIs.
> 
> Update the python event loop example, so that it can optionally
> use the public event APIs, as an alternative to the pure python
> code. The pure python event code is a good working example, so
> don't delete it.
> 
> * examples/domain-events/events-c/event-test.c: Replace event
>   loop code with use of public APIs
> * examples/domain-events/events-python/event-test.py: Allow
>   optional use of new public event APIs
> ---
>  examples/domain-events/events-c/event-test.c       |  163 +------------------
>  examples/domain-events/events-python/event-test.py |   29 ++++-
>  2 files changed, 36 insertions(+), 156 deletions(-)

ACK with nits addressed.

> @@ -386,17 +279,12 @@ int main(int argc, char **argv)
>  
>      action_stop.sa_handler = stop;
>  
> -    if(argc > 1 && STREQ(argv[1],"--help")) {
> +    if (argc > 1 && STREQ(argv[1],"--help")) {

As long as you are respacing this line, s/,"--help/, "--help/

>  
> -    vc = libvirt.open(uri)
> +    vc = libvirt.openReadOnly(uri)

Why this change?

-- 
Eric Blake   eblake redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]