]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: call networkPlugBandwidth() for all types of network
authorPavel Mores <pmores@redhat.com>
Fri, 14 Feb 2020 16:26:23 +0000 (17:26 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 17 Feb 2020 16:26:38 +0000 (17:26 +0100)
To fix the actual bug, it was necessary to make networkPlugBandwidth() be
called also for 'bridge'-type networks implemented using macvtap's 'bridge'
mode (previously it was only called for those implemented on top of an
existing bridge).

However, it seems beneficial to call it for other network types as well, at
least because it removes an inconsistency in types of bandwidth configuration
changes permissible in inactive and active domain configs.  It should also be
safe as the function pretty much amounts to NOP if no QoS is requested and the
new behaviour should not be any worse than before if it is.

Signed-off-by: Pavel Mores <pmores@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/network/bridge_driver.c

index 8b1f722eb6cad86d0e11e42cc697173e619b4092..e826f608daf57fb93eeeb39f83d2fe641dcdf3d6 100644 (file)
@@ -4571,8 +4571,6 @@ networkAllocatePort(virNetworkObjPtr obj,
             return -1;
         }
 
-        if (networkPlugBandwidth(obj, &port->mac, port->bandwidth, &port->class_id) < 0)
-            return -1;
         break;
 
     case VIR_NETWORK_FORWARD_HOSTDEV: {
@@ -4637,8 +4635,6 @@ networkAllocatePort(virNetworkObjPtr obj,
                 }
             }
 
-            if (networkPlugBandwidth(obj, &port->mac, port->bandwidth, &port->class_id) < 0)
-                return -1;
             break;
         }
 
@@ -4736,6 +4732,11 @@ networkAllocatePort(virNetworkObjPtr obj,
         return -1;
     }
 
+
+    if (networkPlugBandwidth(obj, &port->mac, port->bandwidth,
+                             &port->class_id) < 0)
+        return -1;
+
     if (virNetworkObjMacMgrAdd(obj, driver->dnsmasqStateDir,
                                port->ownername, &port->mac) < 0)
         return -1;