|
@@ -29,6 +29,7 @@
|
|
#include "qemu/error-report.h"
|
|
#include "qemu/error-report.h"
|
|
#include "qemu/help_option.h"
|
|
#include "qemu/help_option.h"
|
|
#include "sysemu/block-backend.h"
|
|
#include "sysemu/block-backend.h"
|
|
|
|
+#include "migration/migration.h"
|
|
|
|
|
|
/*
|
|
/*
|
|
* Aliases were a bad idea from the start. Let's keep them
|
|
* 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;
|
|
return NULL;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (!migration_is_idle()) {
|
|
|
|
+ error_setg(errp, "device_add not allowed while migrating");
|
|
|
|
+ return NULL;
|
|
|
|
+ }
|
|
|
|
+
|
|
/* create device */
|
|
/* create device */
|
|
dev = DEVICE(object_new(driver));
|
|
dev = DEVICE(object_new(driver));
|
|
|
|
|
|
@@ -853,6 +859,11 @@ void qdev_unplug(DeviceState *dev, Error **errp)
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (!migration_is_idle()) {
|
|
|
|
+ error_setg(errp, "device_del not allowed while migrating");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
qdev_hot_removed = true;
|
|
qdev_hot_removed = true;
|
|
|
|
|
|
hotplug_ctrl = qdev_get_hotplug_handler(dev);
|
|
hotplug_ctrl = qdev_get_hotplug_handler(dev);
|