[PATCH v2] qemu: Refresh memory size only on fresh starts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Qemu unfortunately doesn't update internal state right after migration
and so the actual balloon size as returned by 'query-balloon' are
invalid for a while after the CPUs are started after migration. If we'd
refresh our internal state at this point we would report invalid current
memory size until the next balloon event would arrive.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1242940
---
Version 2:
- completely different from original posting due to unexpected qemu behavior

 src/qemu/qemu_process.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 7187dc1..b961f40 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -5023,7 +5023,8 @@ int qemuProcessStart(virConnectPtr conn,
     /* Since CPUs were not started yet, the balloon could not return the memory
      * to the host and thus cur_balloon needs to be updated so that GetXMLdesc
      * and friends return the correct size in case they can't grab the job */
-    if (qemuProcessRefreshBalloonState(driver, vm, asyncJob) < 0)
+    if (!migrateFrom && !snapshot &&
+        qemuProcessRefreshBalloonState(driver, vm, asyncJob) < 0)
         goto cleanup;

     VIR_DEBUG("Detecting actual memory size for video device");
-- 
2.4.5

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]