|
@@ -684,17 +684,9 @@ DeviceState *qdev_device_add_from_qdict(const QDict *opts,
|
|
|
dev = qdev_new(driver);
|
|
|
|
|
|
/* Check whether the hotplug is allowed by the machine */
|
|
|
- if (phase_check(PHASE_MACHINE_READY)) {
|
|
|
- if (!qdev_hotplug_allowed(dev, bus, errp)) {
|
|
|
- goto err_del_dev;
|
|
|
- }
|
|
|
-
|
|
|
- if (!bus && !qdev_get_machine_hotplug_handler(dev)) {
|
|
|
- /* No bus, no machine hotplug handler --> device is not hotpluggable */
|
|
|
- error_setg(errp, "Device '%s' can not be hotplugged on this machine",
|
|
|
- driver);
|
|
|
- goto err_del_dev;
|
|
|
- }
|
|
|
+ if (phase_check(PHASE_MACHINE_READY) &&
|
|
|
+ !qdev_hotplug_allowed(dev, bus, errp)) {
|
|
|
+ goto err_del_dev;
|
|
|
}
|
|
|
|
|
|
/*
|