]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
qemu: Fix updating bandwidth limits in live XML
authorErik Skultety <eskultet@redhat.com>
Thu, 2 Oct 2014 12:48:01 +0000 (14:48 +0200)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 2 Oct 2014 20:10:53 +0000 (16:10 -0400)
When trying to update bandwidth limits on a running domain, limits get
updated in our internal structures, however XML parser reads
bandwidth limits from network 'actual' definition. Committing this patch
it is now available to update bandwidth 'actual' definition as well,
thus updating domain runtime XML.

src/qemu/qemu_driver.c

index 5cf235b4c8ffa5b5aada894d50dadb01b3e5a68f..421faa23016bf338966e7f834b0a2b3acb7de6ec 100644 (file)
@@ -10215,7 +10215,18 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
         } else {
             net->bandwidth = NULL;
         }
+
+        if (net->type == VIR_DOMAIN_NET_TYPE_NETWORK) {
+            virNetDevBandwidthFree(net->data.network.actual->bandwidth);
+            if (virNetDevBandwidthCopy(&net->data.network.actual->bandwidth,
+                                       net->bandwidth) < 0)
+                goto cleanup;
+        }
+
+        if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0)
+            goto cleanup;
     }
+
     if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
         if (!persistentNet->bandwidth) {
             persistentNet->bandwidth = bandwidth;