On 12/24/18 3:58 PM, Daniel P. Berrangé wrote: > In the case of a network with forward=bridge, which has a bridge device > listed, we are capable of setting bandwidth limits but fail to call the > function to register them. > > Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx> > --- > src/network/bridge_driver.c | 17 +++++++++++++++-- > 1 file changed, 15 insertions(+), 2 deletions(-) > > diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c > index b5aac9350b..2639b5ce61 100644 > --- a/src/network/bridge_driver.c > +++ b/src/network/bridge_driver.c > @@ -3374,7 +3374,13 @@ networkValidate(virNetworkDriverStatePtr driver, > virNetworkForwardTypeToString(def->forward.type)); > return -1; > } > - if (def->bandwidth) { > + > + bandwidthAllowed = ( > + def->forward.type == VIR_NETWORK_FORWARD_BRIDGE && > + def->bridge != NULL); Whoa. This looks ugly. Can you please turn it into: bool bandwidthAllowed = false; if (...) bandwidthAllowed = true; > + > + if (def->bandwidth && > + !bandwidthAllowed) { > virReportError(VIR_ERR_CONFIG_UNSUPPORTED, > _("Unsupported network-wide <bandwidth> element " > "in network %s with forward mode='%s'"), Michal -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list