[PATCH] qemu: Update balloon state after migration finishes

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

 



Since qemu doesn't know at the beginning of migration what the actual
balloon size is until the migration stream transfers the appropriate
fields we also need to update the balloon size unconditionally in the
finish phase of the migration.
---
 src/qemu/qemu_migration.c | 4 ++++
 src/qemu/qemu_process.c   | 2 +-
 src/qemu/qemu_process.h   | 4 ++++
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 903612b..38649ed 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -5701,6 +5701,10 @@ qemuMigrationFinish(virQEMUDriverPtr driver,
         if (qemuMigrationStopNBDServer(driver, vm, mig) < 0)
             goto endjob;

+        if (qemuProcessRefreshBalloonState(driver, vm,
+                                           QEMU_ASYNC_JOB_MIGRATION_IN) < 0)
+            goto endjob;
+
         if (flags & VIR_MIGRATE_PERSIST_DEST) {
             if (qemuMigrationPersist(driver, vm, mig, !v3proto) < 0) {
                 /* Hmpf.  Migration was successful, but making it persistent
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 7187dc1..f14582b 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -2091,7 +2091,7 @@ qemuProcessReconnectRefreshChannelVirtioState(virQEMUDriverPtr driver,
 }


-static int
+int
 qemuProcessRefreshBalloonState(virQEMUDriverPtr driver,
                                virDomainObjPtr vm,
                                int asyncJob)
diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h
index d40f68d..b198c2b 100644
--- a/src/qemu/qemu_process.h
+++ b/src/qemu/qemu_process.h
@@ -115,4 +115,8 @@ virDomainDiskDefPtr qemuProcessFindDomainDiskByAlias(virDomainObjPtr vm,

 int qemuConnectAgent(virQEMUDriverPtr driver, virDomainObjPtr vm);

+int qemuProcessRefreshBalloonState(virQEMUDriverPtr driver,
+                                   virDomainObjPtr vm,
+                                   int asyncJob);
+
 #endif /* __QEMU_PROCESS_H__ */
-- 
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]