diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 9ccc9f8f8d..1459f0401c 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -2711,6 +2711,7 @@ networkValidate(virNetworkDefPtr def, virPortGroupDefPtr defaultPortGroup = NULL; virNetworkIpDefPtr ipdef; bool ipv4def = false, ipv6def = false; + bool bandwidthAllowed = true; /* check for duplicate networks */ if (virNetworkObjIsDuplicate(&driver->networks, def, check_active) < 0) @@ -2772,6 +2773,7 @@ networkValidate(virNetworkDefPtr def, virNetworkForwardTypeToString(def->forward.type)); return -1; } + bandwidthAllowed = false; } /* We only support dhcp on one IPv4 address and @@ -2850,6 +2852,15 @@ networkValidate(virNetworkDefPtr def, } defaultPortGroup = &def->portGroups[i]; } + + if (def->portGroups[i].bandwidth && !bandwidthAllowed) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Unsupported element in network '%s' " + "in portgroup '%s' with forward mode='%s'"), + def->name, def->portGroups[i].name, + virNetworkForwardTypeToString(def->forward.type)); + return -1; + } } if (badVlanUse || (vlanUsed && !vlanAllowed && !defaultPortGroup)) {