[libvirt] [PATCH] fix python events

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

 



This patch gets python events working again after upstream changes, and
make the test implementation properly clean up after itself and
implement the new EventImpl API properly.

Note that the Python RemoveHandle and RemoveTimeout implementations
should return the opaque object registered by the corresponding
AddHandle/Timeout calls, in lieu of calling the (C) freefunc.  (The
binding code will then call freefunc if it's not NULL.)  Ignoring this
means you'll leak memory in the same way that C RemoveHandle/Timeout
leak if they don't (now) call the freefunc.

I also moved around some of the error checking code to unclutter (and
speed up) the common code paths.  For instance, we now check that the
virRegisterEventImpl arguments are callable just once (and return
failure if they're not), rather than checking them before every call and
blithely ignoring them if they're not callable.

Dave



 examples/domain-events/events-python/event-test.py |   29 +--
 python/libvir.c                                    |  200+++++++++++++++----
 python/libvir.py                                   |    4 
 python/libvirt_wrap.h                              |    8 
 python/types.c                                     |    1 
 python/virConnect.py                               |    4 
 6 files changed, 194 insertions(+), 52 deletions(-)

--
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]