[netcf-devel] [PATCH 2/2] Remove all config-origined info from ncf_if_xml_state output.

David Lutterkort lutter at redhat.com
Wed Oct 7 18:28:37 UTC 2009


On Wed, 2009-10-07 at 09:50 -0400, Laine Stump wrote:
> Modify ncf_if_xml_state() to return *only* information queried from
> the running device/kernel. Because this makes the "source='device'"
> attribute redundant, also remove that.
> 
> Currently, we only query for the ipv4 address of the interface; if
> there is none, don't even add a protocol node to the tree - just
> return an "interface" document that has only a name, and nothing else.

Looks good. There was one minor nit which I fixed up before committing:

> diff --git a/src/drv_initscripts.c b/src/drv_initscripts.c
> index 90103e9..98d3280 100644
> --- a/src/drv_initscripts.c
> +++ b/src/drv_initscripts.c
> @@ -756,27 +756,34 @@ char *drv_xml_state(struct netcf_if *nif) {
>      char *result = NULL;
>      int r, result_len;
>      struct netcf *ncf;
> -    xmlDocPtr aug_xml = NULL, ncf_xml = NULL;
> +    xmlDocPtr ncf_xml;

Generally, any variable that gets freed in some error exit needs to be
initialized as NULL - in this case it's not an issue since ncf_xml will
be set before a jump to the error label.

David




More information about the netcf-devel mailing list