|
@@ -263,8 +263,7 @@ static DeviceClass *qdev_get_device_class(const char **driver, Error **errp)
|
|
}
|
|
}
|
|
|
|
|
|
dc = DEVICE_CLASS(oc);
|
|
dc = DEVICE_CLASS(oc);
|
|
- if (!dc->user_creatable ||
|
|
|
|
- (phase_check(PHASE_MACHINE_READY) && !dc->hotpluggable)) {
|
|
|
|
|
|
+ if (!dc->user_creatable) {
|
|
error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "driver",
|
|
error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "driver",
|
|
"a pluggable device type");
|
|
"a pluggable device type");
|
|
return NULL;
|
|
return NULL;
|
|
@@ -904,7 +903,6 @@ static DeviceState *find_device_state(const char *id, bool use_generic_error,
|
|
|
|
|
|
void qdev_unplug(DeviceState *dev, Error **errp)
|
|
void qdev_unplug(DeviceState *dev, Error **errp)
|
|
{
|
|
{
|
|
- DeviceClass *dc = DEVICE_GET_CLASS(dev);
|
|
|
|
HotplugHandler *hotplug_ctrl;
|
|
HotplugHandler *hotplug_ctrl;
|
|
HotplugHandlerClass *hdc;
|
|
HotplugHandlerClass *hdc;
|
|
Error *local_err = NULL;
|
|
Error *local_err = NULL;
|
|
@@ -919,12 +917,6 @@ void qdev_unplug(DeviceState *dev, Error **errp)
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- if (!dc->hotpluggable) {
|
|
|
|
- error_setg(errp, "Device '%s' does not support hotplugging",
|
|
|
|
- object_get_typename(OBJECT(dev)));
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
if (migration_is_running() && !dev->allow_unplug_during_migration) {
|
|
if (migration_is_running() && !dev->allow_unplug_during_migration) {
|
|
error_setg(errp, "device_del not allowed while migrating");
|
|
error_setg(errp, "device_del not allowed while migrating");
|
|
return;
|
|
return;
|