[libvirt] broken api.xml file

Nehal discovered by accident that our libvirt-api.xml file is broken, which in turn leads to broken python bindings. Right now, if you look at docs/libvirt-api.xml, you'll find: <enum name='VIR_IP_ADDR_TYPE_IPV4' file='libvirt' value='1' type='virIPAddrType'/> but if you look at the libvirt.h.in file, you see: typedef enum { VIR_IP_ADDR_TYPE_IPV4, VIR_IP_ADDR_TYPE_IPV6, which, by C rules, means that the enum is value 0, not 1. We need to fix whatever in libvirt is generating the api.xml file, because that in turn is leading to incorrect code in the python bindings. We could, of course, work around the bug by adding explicit 'VIR_IP_ADDR_TYPE_IPV4 = 0,' in our libvirt.h.in file, but I'd rather fix the root cause. It's not my area of expertise, so I'd appreciate a hand in finding the problem spot, although I'm still trying to take a look. We'll probably need to backport the patch to stable branches, and any distro that has picked up broken definitions will want to respin python bindings. In a quick audit, I found three impacted enums: virDomainCoreDumpFormat (such as VIR_DOMAIN_CORE_DUMP_FORMAT_RAW) virDomainEventGraphicsAddressType (such as VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV4) virIPAddrType (such as VIR_IP_ADDR_TYPE_IPV4) -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 06/25/2014 02:46 PM, Eric Blake wrote:
Nehal discovered by accident that our libvirt-api.xml file is broken, which in turn leads to broken python bindings.
fix the root cause. It's not my area of expertise, so I'd appreciate a hand in finding the problem spot, although I'm still trying to take a look. We'll probably need to backport the patch to stable branches, and any distro that has picked up broken definitions will want to respin python bindings.
The fix turned out to be a one-liner: https://www.redhat.com/archives/libvir-list/2014-June/msg01290.html -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Wed, Jun 25, 2014 at 07:36:41PM -0600, Eric Blake wrote:
On 06/25/2014 02:46 PM, Eric Blake wrote:
Nehal discovered by accident that our libvirt-api.xml file is broken, which in turn leads to broken python bindings.
fix the root cause. It's not my area of expertise, so I'd appreciate a hand in finding the problem spot, although I'm still trying to take a look. We'll probably need to backport the patch to stable branches, and any distro that has picked up broken definitions will want to respin python bindings.
The fix turned out to be a one-liner: https://www.redhat.com/archives/libvir-list/2014-June/msg01290.html
Whoops, I guess it's my fault :-) Daniel -- Daniel Veillard | Open Source and Standards, Red Hat veillard@redhat.com | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | virtualization library http://libvirt.org/
participants (2)
-
Daniel Veillard
-
Eric Blake