]> xenbits.xensource.com Git - libvirt.git/commitdiff
network: Use new util function to check name
authorSławek Kapłoński <slawek@kaplonski.pl>
Wed, 19 Oct 2016 20:57:47 +0000 (22:57 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 20 Oct 2016 11:09:14 +0000 (19:09 +0800)
New util function virXMLCheckIllegalChars is now used to test if
parsed network contains illegal char '/' in it's name.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/conf/network_conf.c

index aa397768c9c43441d425db2ad844b288ca57c126..aabf315c93935739ba750f7083a850134a29a677 100644 (file)
@@ -2117,11 +2117,8 @@ virNetworkDefParseXML(xmlXPathContextPtr ctxt)
         goto error;
     }
 
-    if (strchr(def->name, '/')) {
-        virReportError(VIR_ERR_XML_ERROR,
-                       _("name %s cannot contain '/'"), def->name);
+    if (virXMLCheckIllegalChars("name", def->name, "/") < 0)
         goto error;
-    }
 
     /* Extract network uuid */
     tmp = virXPathString("string(./uuid[1])", ctxt);