diff mbox

[RFC,v4,26/28] COLO: Disable qdev hotplug when VM is in COLO mode

Message ID 1427347774-8960-27-git-send-email-zhang.zhanghailiang@huawei.com
State New
Headers show

Commit Message

Zhanghailiang March 26, 2015, 5:29 a.m. UTC
COLO do not support qdev hotplug migration, disable it.

Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
---
 migration/colo.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff mbox

Patch

diff --git a/migration/colo.c b/migration/colo.c
index 54ae184..7d57121 100644
--- a/migration/colo.c
+++ b/migration/colo.c
@@ -10,6 +10,7 @@ 
  * later.  See the COPYING file in the top-level directory.
  */
 
+#include "hw/qdev-core.h"
 #include "qemu/timer.h"
 #include "sysemu/sysemu.h"
 #include "migration/migration-colo.h"
@@ -325,6 +326,7 @@  out:
 static void *colo_thread(void *opaque)
 {
     MigrationState *s = opaque;
+    int dev_hotplug = qdev_hotplug;
     QEMUFile *colo_control = NULL;
     int64_t current_time, checkpoint_time = qemu_clock_get_ms(QEMU_CLOCK_HOST);
     int ret;
@@ -341,6 +343,8 @@  static void *colo_thread(void *opaque)
         goto out;
     }
 
+    qdev_hotplug = 0;
+
     /*
      * Wait for slave finish loading vm states and enter COLO
      * restore.
@@ -425,6 +429,8 @@  out:
     qemu_bh_schedule(s->cleanup_bh);
     qemu_mutex_unlock_iothread();
 
+    qdev_hotplug = dev_hotplug;
+
     return NULL;
 }
 
@@ -487,10 +493,13 @@  void *colo_process_incoming_checkpoints(void *opaque)
     struct colo_incoming *colo_in = opaque;
     QEMUFile *f = colo_in->file;
     int fd = qemu_get_fd(f);
+    int dev_hotplug = qdev_hotplug;
     QEMUFile *ctl = NULL, *fb = NULL;
     int ret;
     uint64_t total_size;
 
+    qdev_hotplug = 0;
+
     colo = qemu_coroutine_self();
     assert(colo != NULL);
 
@@ -659,5 +668,7 @@  out:
 
     loadvm_exit_colo();
 
+    qdev_hotplug = dev_hotplug;
+
     return NULL;
 }