[libvirt] [PATCHv2 2/7] conf: clear and parse functions for dns host/srv/txt records

Eric Blake eblake at redhat.com
Tue Dec 11 00:01:55 UTC 2012


On 12/10/2012 02:23 PM, Laine Stump wrote:
> Since there is only a single virNetworkDNSDef for any virNetworkDef,
> and it's trivial to determine whether or not it contains any real
> data, it's much simpler (and fits more uniformly with the parse
> function calling sequence of the parsers for many other objects that
> are subordinates of virNetworkDef) if virNetworkDef *contains* an
> virNetworkDNSDef rather than pointing to one.
> 
> Since it is now just a part of another object rather than its own
> object, it no longer makes sense to have a *Free() function, so that
> is changed to a *Clear() function.
> 
> More importantly though, ParseXML and Clear functions are needed for
> the individual items contained in a virNetworkDNSDef (srv, txt, and
> host records), but none of them have a *Clear(), and only two of the
> three had *ParseXML() functions (both of which used a non-uniform
> arglist). Those problems are cleared up by this patch - it splits the
> higher-level Clear function into separate functions for each of the
> three, creates a parse for txt records, and cleans up the srv and host
> parsers, so we now have all the utility functions necessary to
> implement virNetworkDefUpdateDNS(Host|Srv|Txt).
> ---
>  src/conf/network_conf.c     | 412 ++++++++++++++++++++++++++------------------
>  src/conf/network_conf.h     |   8 +-
>  src/network/bridge_driver.c |  89 +++++-----
>  3 files changed, 286 insertions(+), 223 deletions(-)

Looks big, but rather straightforward.

> +virNetworkDNSHostDefParseXML(const char *networkName,
> +                             xmlNodePtr node,
> +                             virNetworkDNSHostDefPtr def,
> +                             bool partialOkay)
>  {

> +    if (def->nnames == 0&& !partialOkay) {

Spacing is off before &&.

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/c5228842/attachment-0001.sig>


More information about the libvir-list mailing list