[libvirt] RFC: fixing struct name in public header

Daniel P. Berrange berrange at redhat.com
Wed Apr 12 11:31:51 UTC 2017


Take a look at this def from libvirt-domain.h:

typedef struct _virDomainInterfaceIPAddress virDomainIPAddress;
typedef virDomainIPAddress *virDomainIPAddressPtr;
struct _virDomainInterfaceIPAddress {
    int type;                /* virIPAddrType */
    char *addr;              /* IP address */
    unsigned int prefix;     /* IP address prefix */
};


Notice the struct name is different from the typedef names.

Technically renaming the struct to remove the 'Interface' word
would be an API break.

On the flip side though we don't expect any apps to use the struct
name, but rather use the typedefs, hence use of '_' in the name.

We could do what we did with the typed parameter stuff and rename
the struct, but add a

  #define _virDomainInterfaceIPAddress _virDomainIPAddress

Any thoughts ?

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|




More information about the libvir-list mailing list