[libvirt] [PATCH 05/27] network: add missing bandwidth limits for bridge forward type
Daniel P. Berrangé
berrange at redhat.com
Tue Jan 29 15:06:34 UTC 2019
On Tue, Jan 08, 2019 at 05:16:25PM +0100, Michal Privoznik wrote:
> 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 at redhat.com>
> > ---
> > 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;
Ok, i'll refactor this a little
>
> > +
> > + if (def->bandwidth &&
> > + !bandwidthAllowed) {
> > virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
> > _("Unsupported network-wide <bandwidth> element "
> > "in network %s with forward mode='%s'"),
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
More information about the libvir-list
mailing list