[libvirt] [libvirt-go PATCH 3/3] Enforce new flags types in DomainSaveImageGetXMLDesc and GetXMLDesc

Eric Blake eblake at redhat.com
Fri Feb 22 16:43:37 UTC 2019


On 2/22/19 9:32 AM, Erik Skultety wrote:
> This breaks API compatibility! Recently libvirt introduced 2 new
> separate flag enums in order to stop recycling the old virDomainXMLFlags
> since 2/3 flags were discouraged to use. While it's fine for libvirt
> to introduce such a change since it uses plain 'int' for flags, not so
> much for the Go bindings which already enforced the now deprecated
> DomainXMLFlags type.

And a quick google search says that Go lacks function overloading (use
of variadic functions to provide optional arguments being as much as it
is willing to support).  Can you declare some sort of meta-type which is
a union between the old enum and new enum types, where you can pass in
either enum value and still satisfy the function type?  Otherwise, I
don't know Go well enough to make any suggestions on how to avoid the
API break.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org




More information about the libvir-list mailing list