[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 4/5] migration: Disable hotplug/unplug during migrat
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 4/5] migration: Disable hotplug/unplug during migration |
Date: |
Thu, 6 Apr 2017 15:13:25 +0200 |
Until we have reviewed what can/can't be hotplug during migration,
disable it. We can enable it later for the things that we know that
work. For instance, memory hotplug during postcopy don't work
currently.
Signed-off-by: Juan Quintela <address@hidden>
--
- Fix typo. Thanks Thomas.
- Delay migration check after we have checked that we can hotplug that
device.
Signed-off-by: Juan Quintela <address@hidden>
---
qdev-monitor.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/qdev-monitor.c b/qdev-monitor.c
index bb3d8ba..752c362 100644
--- a/qdev-monitor.c
+++ b/qdev-monitor.c
@@ -29,6 +29,7 @@
#include "qemu/error-report.h"
#include "qemu/help_option.h"
#include "sysemu/block-backend.h"
+#include "migration/migration.h"
/*
* Aliases were a bad idea from the start. Let's keep them
@@ -603,6 +604,11 @@ DeviceState *qdev_device_add(QemuOpts *opts, Error **errp)
return NULL;
}
+ if (!migration_is_idle()) {
+ error_setg(errp, "device_add not allowed while migrating");
+ return NULL;
+ }
+
/* create device */
dev = DEVICE(object_new(driver));
@@ -853,6 +859,11 @@ void qdev_unplug(DeviceState *dev, Error **errp)
return;
}
+ if (!migration_is_idle()) {
+ error_setg(errp, "device_add not allowed while migrating");
+ return;
+ }
+
qdev_hot_removed = true;
hotplug_ctrl = qdev_get_hotplug_handler(dev);
--
2.9.3
- [Qemu-devel] [PATCH v2 0/5] Disable hotplug during migration, Juan Quintela, 2017/04/06
- [Qemu-devel] [PATCH 1/5] qdev: qdev_hotplug is really a bool, Juan Quintela, 2017/04/06
- [Qemu-devel] [PATCH 3/5] qdev: Move qdev_unplug() to qdev-monitor.c, Juan Quintela, 2017/04/06
- [Qemu-devel] [PATCH 2/5] qdev: Export qdev_hot_removed, Juan Quintela, 2017/04/06
- [Qemu-devel] [PATCH 4/5] migration: Disable hotplug/unplug during migration,
Juan Quintela <=
- [Qemu-devel] [PATCH 5/5] ram: Remove migration_bitmap_extend(), Juan Quintela, 2017/04/06
- Re: [Qemu-devel] [PATCH v2 0/5] Disable hotplug during migration, Hailiang Zhang, 2017/04/10