[libvirt] [PATCH V5 1/4] Rework value part of name-value pairs

Stefan Berger stefanb at linux.vnet.ibm.com
Thu Nov 3 00:21:08 UTC 2011


On 11/02/2011 07:01 PM, Eric Blake wrote:
> On 10/31/2011 07:01 AM, Stefan Berger wrote:
>> NWFilters can be provided name-value pairs using the following
>> XML notiation:
>
> s/notiation/notation/
>
>>
>> <filterref filter='xyz'>
>> <parameter name='PORT' value='80'/>
>> <parameter name='VAL' value='abc'/>
>> </filterref>
>>
>> The internal representation currently is so that a name is stored as a
>> string and the value as well. This patch now addresses the value part 
>> of it
>> and introduces a data structure for storing a value either as a simple
>> value or as an array for later support of lists.
>>
>> This patch adjusts all code that was handling the values in hash tables
>> and makes it use the new data type.
>>
>
>> +virNWFilterVarValuePtr
>> +virNWFilterVarValueCreateSimple(char *value)
>> +{
>> +    virNWFilterVarValuePtr val;
>> +
>> +    if (!isValidVarValue(value)) {
>> +        virNWFilterReportError(VIR_ERR_INTERNAL_ERROR,
>> +                               _("Variable value contains illegal 
>> character"));
>
> I tend to prefer 'invalid' over 'illegal' - they aren't breaking the 
> law, just the program :)
>
> VIR_ERR_INTERNAL_ERROR isn't very nice, since this one is 
> user-visible; so VIR_ERR_INVALID_ARG may be the best bet.
Right...
>
> ACK with those tweaks.
>
Thanks. I'll make these changes, of course. As said, I wasn't planning 
on checking this in, though, for 0.9.7 since it's 'incomplete' and also 
because of the dependency of this patch set on this one

https://www.redhat.com/archives/libvir-list/2011-October/msg01227.html

and then after that there will be more with this one

https://www.redhat.com/archives/libvir-list/2011-October/msg01238.html

and more to come afterwards. Though having an early start on checking 
this in to 0.9.8 would be really good.

     Stefan




More information about the libvir-list mailing list