From 9575cb855403f6aa20ffb0ae8c12179115c4aced Mon Sep 17 00:00:00 2001 From: Laine Stump Date: Wed, 27 Apr 2016 12:57:08 -0400 Subject: [PATCH] network: log error when is requested for hostdev interfaces This would previously be silently ignored. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1319044 --- src/network/bridge_driver.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index bef8a7848b..0fd2095d8c 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -3126,6 +3126,20 @@ networkValidate(virNetworkDriverStatePtr driver, def->name); return -1; } + + if (def->forward.type == VIR_NETWORK_FORWARD_HOSTDEV) { + for (i = 0; i < def->nPortGroups; i++) { + if (def->portGroups[i].bandwidth) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unsupported element " + "in of " + "network '%s' with forward mode='%s'"), + def->portGroups[i].name, def->name, + virNetworkForwardTypeToString(def->forward.type)); + return -1; + } + } + } return 0; } @@ -4305,6 +4319,17 @@ networkAllocateActualDevice(virDomainDefPtr dom, goto error; } } + if (virDomainNetGetActualBandwidth(iface)) { + /* bandwidth configuration via libvirt is not supported for + * hostdev network devices + */ + if (actualType == VIR_DOMAIN_NET_TYPE_HOSTDEV) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("bandwidth settings are not supported " + "for hostdev interfaces")); + goto error; + } + } if (netdef) { netdef->connections++; -- GitLab