Re: [PATCH] implement virDomainSetInterfaceParameters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jul 06, 2019 at 01:24:22PM +0200, Ilias Stamatis wrote:
> Signed-off-by: Ilias Stamatis <stamatis.iliass@xxxxxxxxx>
> ---
...

> +
> +    /* average or floor are mandatory, peak and burst are optional */
> +    if (!bandwidth->in->average && !bandwidth->in->floor)
> +        VIR_FREE(bandwidth->in);
> +    if (!bandwidth->out->average)
> +        VIR_FREE(bandwidth->out);
> +
> +    if (!net->bandwidth) {
> +        VIR_STEAL_PTR(net->bandwidth, bandwidth);
> +    } else {
> +        if (bandwidth->in) {
> +            VIR_FREE(net->bandwidth->in);
> +            VIR_STEAL_PTR(net->bandwidth->in, bandwidth->in);
> +        }
> +        if (bandwidth->out) {
> +            VIR_FREE(net->bandwidth->out);
> +            VIR_STEAL_PTR(net->bandwidth->out, bandwidth->out);
> +        }
> +    }

Doesn't look quite right, you just lost any way of resetting the bandwidth when
in fact this should be possible simply with setting .average=0, that's why the
original QEMU code uses booleans, because then at the end, the whole
net->bandwidth structure is set to NULL if reset was requested.

Erik

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux