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

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

 



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@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]