[libvirt] [PATCH] fix python events

David Lively dlively at virtualiron.com
Fri Nov 21 19:14:57 UTC 2008

On Fri, 2008-11-21 at 17:51 +0100, Jim Meyering wrote:
> No big deal, but there are several debug printf uses here that look
> like they try to print NULL pointers upon memory allocation failure.
> It's ok with glibc's printf of course, but not for others.

You're right.  Attached patch fixes those issues.  It also fixes some
cases in which I got some printf string operands switched around ...

I'm printing the (user-supplied) object names to help in debugging
misbehaving python EventImpls (since there's no static type checking to
catch these kinds of things).  So instead of printing "<NULL>" when we
can't alloc the name, I'm printing something a little more helpful (the
appropriate "generic" name).


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-python-events.patch
Type: text/x-patch
Size: 17284 bytes
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20081121/d426449c/attachment-0001.bin>

More information about the libvir-list mailing list