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

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

 



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

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

  Powered by Linux