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.

ACK with those tweaks.

--
Eric Blake   ebl...@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to