From 8583b947b15775ebb3dba8790dfa4487448c3d9b Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Thu, 20 May 2010 13:20:24 -0400 Subject: [PATCH] Remove isValidIfname. 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 --- src/conf/domain_conf.c | 12 ++---------- src/conf/domain_conf.h | 3 --- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index c77ee599e5..443b8c0335 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -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) && diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 9f87fc514a..9fd1dd6be0 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -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,