]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Set default qdisc before setting bandwidth
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 4 Dec 2020 12:02:53 +0000 (13:02 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 6 Jan 2021 12:29:43 +0000 (13:29 +0100)
While the code that's setting default qdisc is clever enough to
not overwrite any bandwidth (potentially) set by
virNetDevBandwidthSet() (and thus the root qdisc htb is not
replaced with noqueue), it does print a debug message when that's
the case. It's needless. We can set the root qdisc beforehand and
let virNetDevBandwidthSet() overwrite it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/qemu/qemu_command.c
src/qemu/qemu_hotplug.c

index 9fcbb6c4137cf56b8261738aa76d6cb1d9d0931f..02f956ce484c4a30aef9f0a603c794364405b657 100644 (file)
@@ -8132,6 +8132,8 @@ qemuBuildInterfaceCommandLine(virQEMUDriverPtr driver,
        break;
     }
 
+    qemuDomainInterfaceSetDefaultQDisc(driver, net);
+
     /* Set bandwidth or warn if requested and not supported. */
     actualBandwidth = virDomainNetGetActualBandwidth(net);
     if (actualBandwidth) {
@@ -8146,8 +8148,6 @@ qemuBuildInterfaceCommandLine(virQEMUDriverPtr driver,
         }
     }
 
-    qemuDomainInterfaceSetDefaultQDisc(driver, net);
-
     if (net->mtu &&
         virNetDevSetMTU(net->ifname, net->mtu) < 0)
         goto cleanup;
index 57635cd419ab3a5ea35fe9da2f04fe5a6f737095..e5848d7de453af2d9bfd220dcca9744e121135a8 100644 (file)
@@ -1371,6 +1371,8 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver,
     if (qemuInterfaceStartDevice(net) < 0)
         goto cleanup;
 
+    qemuDomainInterfaceSetDefaultQDisc(driver, net);
+
     /* Set bandwidth or warn if requested and not supported. */
     actualBandwidth = virDomainNetGetActualBandwidth(net);
     if (actualBandwidth) {
@@ -1389,8 +1391,6 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver,
         virNetDevSetMTU(net->ifname, net->mtu) < 0)
         goto cleanup;
 
-    qemuDomainInterfaceSetDefaultQDisc(driver, net);
-
     for (i = 0; i < tapfdSize; i++) {
         if (qemuSecuritySetTapFDLabel(driver->securityManager,
                                       vm->def, tapfd[i]) < 0)