[libvirt] [PATCHv2 1/7] conf: rename network dns host/srv/txt arrays

Eric Blake eblake at redhat.com
Mon Dec 10 23:51:13 UTC 2012


On 12/10/2012 02:23 PM, Laine Stump wrote:
> This shortens the name of the structs for srv and txt, and their
> instances in virNetworkDNSDef, to be more compact and uniform with the
> naming of the dns host array.
> ---
>  src/conf/network_conf.c     | 102 ++++++++++++++++++++++----------------------
>  src/conf/network_conf.h     |  32 +++++++-------
>  src/network/bridge_driver.c |  34 +++++++--------
>  3 files changed, 85 insertions(+), 83 deletions(-)

ACK; mostly mechanical.

> @@ -95,21 +95,23 @@ struct _virNetworkDNSSrvRecordsDef {
>      int weight;
>  };
>  
> -struct _virNetworkDNSHostsDef {
> +typedef struct _virNetworkDNSHostDef virNetworkDNSHostDef;
> +typedef virNetworkDNSHostDef *virNetworkDNSHostDefPtr;
> +struct _virNetworkDNSHostDef {
>      virSocketAddr ip;
>      int nnames;
>      char **names;
>  };
>  
> -typedef struct _virNetworkDNSHostsDef *virNetworkDNSHostsDefPtr;
> -
> +typedef struct _virNetworkDNSDef virNetworkDNSDef;
> +typedef virNetworkDNSDef *virNetworkDNSDefPtr;
>  struct _virNetworkDNSDef {
> -    unsigned int ntxtrecords;
> -    virNetworkDNSTxtRecordsDefPtr txtrecords;
> -    unsigned int nhosts;
> -    virNetworkDNSHostsDefPtr hosts;
> -    unsigned int nsrvrecords;
> -    virNetworkDNSSrvRecordsDefPtr srvrecords;
> +    size_t ntxts;
> +    virNetworkDNSTxtDefPtr txts;
> +    size_t nhosts;
> +    virNetworkDNSHostDefPtr hosts;
> +    size_t nsrvs;
> +    virNetworkDNSSrvDefPtr srvs;

You are also canonicalizing on size_t instead of unsigned int for array
lengths; may be worth mentioning in the commit message, but still okay
for this patch (doesn't change my ack).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20121210/d9712ca6/attachment-0001.sig>


More information about the libvir-list mailing list