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

Laine Stump laine at laine.org
Wed Oct 7 19:42:49 UTC 2009


On 10/07/2009 02:28 PM, David Lutterkort wrote:
> 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.
>    

I actually removed that initialization as a pre-emptive move against Jim 
ever running clang on netcf - ncf_xml is guaranteed to be initialized in 
every code path, so the initialization in the definition will (from what 
I understood of the emails about running clang against libvirt) make 
clang ring its bell (or blow its whistle, or whatever it is that clang 
does ;-)

I'm not clang, though, so it's okay with me to leave it in!


More information about the netcf-devel mailing list