[libvirt] [PATCH 05/27] network: add missing bandwidth limits for bridge forward type
Michal Privoznik
mprivozn at redhat.com
Tue Jan 8 16:16:25 UTC 2019
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;
> +
> + if (def->bandwidth &&
> + !bandwidthAllowed) {
> virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
> _("Unsupported network-wide <bandwidth> element "
> "in network %s with forward mode='%s'"),
Michal
More information about the libvir-list
mailing list