• E
    public API: prefer unsigned int for flags · 18d561c7
    Eric Blake 提交于
    Most APIs use 'unsigned int flags'; but a few stragglers were using
    a signed value.  In particular, the vir*GetXMLDesc APIs were
    split-brain, with inconsistent choice of types.  Although it is
    an API break to use 'int' instead of 'unsigned int', it is ABI
    compatible (pre-compiled apps will have no difference in behavior),
    and generally apps can be recompiled without any issue (only rare
    apps that compiled with extremely high warning levels, or which
    pass libvirt API around as typed function pointers, would have to
    make any code changes to deal with the change).
    
    The migrate APIs use 'unsigned long flags', which can't be changed,
    due to ABI constraints.
    
    This patch intentionally touches only the public API, to prove the
    claim that most existing code (including driver callbacks and virsh)
    still compiles just fine in spite of the type change.
    
    * include/libvirt/libvirt.h.in (virConnectOpenAuth)
    (virDomainCoreDump, virDomainGetXMLDesc, virNetworkGetXMLDesc)
    (virNWFilterGetXMLDesc): Use unsigned int for flags.
    (virDomainHasCurrentSnapshot): Use consistent spelling.
    * src/libvirt.c (virConnectOpenAuth, virDomainCoreDump)
    (virDomainGetXMLDesc, virNetworkGetXMLDesc)
    (virNWFilterGetXMLDesc, do_open): Update accordingly.
    18d561c7
libvirt.c 423.2 KB