]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu_hotplug: Clear QoS if required in qemuDomainChangeNet()
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 30 May 2024 09:51:07 +0000 (11:51 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 30 May 2024 12:08:07 +0000 (14:08 +0200)
commit805b1eec7decebd9849d391d990891d9dae3ff89
tree21c11cdd9a3aae4d2ccdc496f3021347fabc7000
parent2ea493598fd5a3efe4f25d842b2f09bc5c74c6c1
qemu_hotplug: Clear QoS if required in qemuDomainChangeNet()

In one of my recent commits, I've introduced
virDomainInterfaceClearQoS() which is a helper that either calls
virNetDevBandwidthClear() ('tc' implementation) or
virNetDevOpenvswitchInterfaceClearQos() (for ovs ifaces). But I
made a micro optimization which leads to a bug: the function
checks whether passed iface has any QoS set and returns early if
it has none. In majority of cases this is right thing to do, but
when removing QoS on virDomainUpdateDeviceFlags() this is
problematic. The new definition (passed as argument to
virDomainInterfaceClearQoS()) contains no QoS (because user
requested its removal) and thus instead of removing the old QoS
setting nothing is done.

Fortunately, the fix is simple - pass olddev which contains the
old QoS setting.

Fixes: 812a146dfe784315edece43d09f8d9e432f8230e
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
src/qemu/qemu_hotplug.c