]> xenbits.xensource.com Git - libvirt.git/commitdiff
Remove isValidIfname.
authorChris Lalancette <clalance@redhat.com>
Thu, 20 May 2010 17:20:24 +0000 (13:20 -0400)
committerChris Lalancette <clalance@redhat.com>
Fri, 21 May 2010 13:32:15 +0000 (09:32 -0400)
We shouldn't be checking validity in domain_conf, since
it can be used by multiple different hosts and hypervisors.
Remove the check completely.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
src/conf/domain_conf.c
src/conf/domain_conf.h

index c77ee599e5149414d64178a37c4c76af62ffa73f..443b8c03352034155ad463b5deb995cab4fc441e 100644 (file)
@@ -1807,12 +1807,6 @@ cleanup:
 }
 
 
-static bool
-isValidIfname(const char *ifname) {
-    return ifname[strspn(ifname, VALID_IFNAME_CHARS)] == 0;
-}
-
-
 /* Parse the XML definition for a network interface
  * @param node XML nodeset to parse for net definition
  * @return 0 on success, -1 on failure
@@ -1895,11 +1889,9 @@ virDomainNetDefParseXML(virCapsPtr caps,
                        xmlStrEqual(cur->name, BAD_CAST "target")) {
                 ifname = virXMLPropString(cur, "dev");
                 if ((ifname != NULL) &&
-                    (((flags & VIR_DOMAIN_XML_INACTIVE) &&
-                      (STRPREFIX((const char*)ifname, "vnet"))) ||
-                     (!isValidIfname(ifname)))) {
+                    ((flags & VIR_DOMAIN_XML_INACTIVE) &&
+                      (STRPREFIX((const char*)ifname, "vnet")))) {
                     /* An auto-generated target name, blank it out */
-                    /* blank out invalid interface names */
                     VIR_FREE(ifname);
                 }
             } else if ((script == NULL) &&
index 9f87fc514af916c8d93eff51a2ab25468fd39327..9fd1dd6be056e5db99b026141f8a44351e7549ca 100644 (file)
@@ -298,9 +298,6 @@ struct _virDomainNetDef {
     virNWFilterHashTablePtr filterparams;
 };
 
-# define VALID_IFNAME_CHARS \
- "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_/"
-
 enum virDomainChrTargetType {
     VIR_DOMAIN_CHR_TARGET_TYPE_NULL = 0,
     VIR_DOMAIN_CHR_TARGET_TYPE_MONITOR,