|
|
9119d9 |
From 2f2e177f52d83f004de1be7a91f1e6ad66db9237 Mon Sep 17 00:00:00 2001
|
|
|
9119d9 |
Message-Id: <2f2e177f52d83f004de1be7a91f1e6ad66db9237@dist-git>
|
|
|
9119d9 |
From: Erik Skultety <eskultet@redhat.com>
|
|
|
9119d9 |
Date: Wed, 22 Oct 2014 09:54:35 +0200
|
|
|
9119d9 |
Subject: [PATCH] qemu: Fix updating bandwidth limits in live XML
|
|
|
9119d9 |
|
|
|
9119d9 |
When trying to update bandwidth limits on a running domain, limits get
|
|
|
9119d9 |
updated in our internal structures, however XML parser reads
|
|
|
9119d9 |
bandwidth limits from network 'actual' definition. Committing this patch
|
|
|
9119d9 |
it is now available to update bandwidth 'actual' definition as well,
|
|
|
9119d9 |
thus updating domain runtime XML.
|
|
|
9119d9 |
|
|
|
9119d9 |
(cherry picked from commit f4ba3385ba6b6e9ce6468a48d1cd4637b36696b7)
|
|
|
9119d9 |
|
|
|
9119d9 |
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1146511
|
|
|
9119d9 |
|
|
|
9119d9 |
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
9119d9 |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
9119d9 |
---
|
|
|
9119d9 |
src/qemu/qemu_driver.c | 11 +++++++++++
|
|
|
9119d9 |
1 file changed, 11 insertions(+)
|
|
|
9119d9 |
|
|
|
9119d9 |
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
|
|
|
9119d9 |
index 039b987..36b394e 100644
|
|
|
9119d9 |
--- a/src/qemu/qemu_driver.c
|
|
|
9119d9 |
+++ b/src/qemu/qemu_driver.c
|
|
|
9119d9 |
@@ -10222,7 +10222,18 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
|
|
|
9119d9 |
} else {
|
|
|
9119d9 |
net->bandwidth = NULL;
|
|
|
9119d9 |
}
|
|
|
9119d9 |
+
|
|
|
9119d9 |
+ if (net->type == VIR_DOMAIN_NET_TYPE_NETWORK) {
|
|
|
9119d9 |
+ virNetDevBandwidthFree(net->data.network.actual->bandwidth);
|
|
|
9119d9 |
+ if (virNetDevBandwidthCopy(&net->data.network.actual->bandwidth,
|
|
|
9119d9 |
+ net->bandwidth) < 0)
|
|
|
9119d9 |
+ goto cleanup;
|
|
|
9119d9 |
+ }
|
|
|
9119d9 |
+
|
|
|
9119d9 |
+ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0)
|
|
|
9119d9 |
+ goto cleanup;
|
|
|
9119d9 |
}
|
|
|
9119d9 |
+
|
|
|
9119d9 |
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
|
|
9119d9 |
if (!persistentNet->bandwidth) {
|
|
|
9119d9 |
persistentNet->bandwidth = bandwidth;
|
|
|
9119d9 |
--
|
|
|
9119d9 |
2.1.3
|
|
|
9119d9 |
|