qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH COLO-Frame v6 17/31] COLO failover: Don't do failove


From: zhanghailiang
Subject: [Qemu-devel] [PATCH COLO-Frame v6 17/31] COLO failover: Don't do failover during loading VM's state
Date: Thu, 18 Jun 2015 16:58:41 +0800

Signed-off-by: zhanghailiang <address@hidden>
Signed-off-by: Li Zhijian <address@hidden>
Signed-off-by: Lai Jiangshan <address@hidden>
---
 migration/colo.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/migration/colo.c b/migration/colo.c
index a65f9ea..76bdd44 100644
--- a/migration/colo.c
+++ b/migration/colo.c
@@ -53,6 +53,7 @@ enum {
 };
 
 static QEMUBH *colo_bh;
+static bool vmstate_loading;
 static Coroutine *colo;
 /* colo buffer */
 #define COLO_BUFFER_BASE_SIZE (4 * 1024 * 1024)
@@ -89,6 +90,11 @@ static bool colo_runstate_is_stopped(void)
  */
 static void secondary_vm_do_failover(void)
 {
+    /* Wait for incoming thread loading vmstate */
+    while (vmstate_loading) {
+        ;
+    }
+
     colo = NULL;
 
     if (!autostart) {
@@ -511,11 +517,15 @@ void *colo_process_incoming_checkpoints(void *opaque)
 
         qemu_mutex_lock_iothread();
         qemu_system_reset(VMRESET_SILENT);
+        vmstate_loading = true;
         if (qemu_loadvm_state(fb) < 0) {
             error_report("COLO: loadvm failed");
+            vmstate_loading = false;
             qemu_mutex_unlock_iothread();
             goto out;
         }
+
+        vmstate_loading = false;
         qemu_mutex_unlock_iothread();
 
         ret = colo_ctl_put(ctl, COLO_CHECKPOINT_LOADED);
-- 
1.7.12.4





reply via email to

[Prev in Thread] Current Thread [Next in Thread]