mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-13 00:01:55 +00:00
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 <clalance@redhat.com>
This commit is contained in:
parent
66823690e4
commit
8583b947b1
@ -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
|
/* Parse the XML definition for a network interface
|
||||||
* @param node XML nodeset to parse for net definition
|
* @param node XML nodeset to parse for net definition
|
||||||
* @return 0 on success, -1 on failure
|
* @return 0 on success, -1 on failure
|
||||||
@ -1895,11 +1889,9 @@ virDomainNetDefParseXML(virCapsPtr caps,
|
|||||||
xmlStrEqual(cur->name, BAD_CAST "target")) {
|
xmlStrEqual(cur->name, BAD_CAST "target")) {
|
||||||
ifname = virXMLPropString(cur, "dev");
|
ifname = virXMLPropString(cur, "dev");
|
||||||
if ((ifname != NULL) &&
|
if ((ifname != NULL) &&
|
||||||
(((flags & VIR_DOMAIN_XML_INACTIVE) &&
|
((flags & VIR_DOMAIN_XML_INACTIVE) &&
|
||||||
(STRPREFIX((const char*)ifname, "vnet"))) ||
|
(STRPREFIX((const char*)ifname, "vnet")))) {
|
||||||
(!isValidIfname(ifname)))) {
|
|
||||||
/* An auto-generated target name, blank it out */
|
/* An auto-generated target name, blank it out */
|
||||||
/* blank out invalid interface names */
|
|
||||||
VIR_FREE(ifname);
|
VIR_FREE(ifname);
|
||||||
}
|
}
|
||||||
} else if ((script == NULL) &&
|
} else if ((script == NULL) &&
|
||||||
|
@ -298,9 +298,6 @@ struct _virDomainNetDef {
|
|||||||
virNWFilterHashTablePtr filterparams;
|
virNWFilterHashTablePtr filterparams;
|
||||||
};
|
};
|
||||||
|
|
||||||
# define VALID_IFNAME_CHARS \
|
|
||||||
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_/"
|
|
||||||
|
|
||||||
enum virDomainChrTargetType {
|
enum virDomainChrTargetType {
|
||||||
VIR_DOMAIN_CHR_TARGET_TYPE_NULL = 0,
|
VIR_DOMAIN_CHR_TARGET_TYPE_NULL = 0,
|
||||||
VIR_DOMAIN_CHR_TARGET_TYPE_MONITOR,
|
VIR_DOMAIN_CHR_TARGET_TYPE_MONITOR,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user