|
@@ -832,14 +832,6 @@ static void device_set_realized(Object *obj, bool value, Error **errp)
|
|
|
|
|
|
DEVICE_LISTENER_CALL(realize, Forward, dev);
|
|
|
|
|
|
- if (hotplug_ctrl) {
|
|
|
- hotplug_handler_plug(hotplug_ctrl, dev, &local_err);
|
|
|
- }
|
|
|
-
|
|
|
- if (local_err != NULL) {
|
|
|
- goto post_realize_fail;
|
|
|
- }
|
|
|
-
|
|
|
/*
|
|
|
* always free/re-initialize here since the value cannot be cleaned up
|
|
|
* in device_unrealize due to its usage later on in the unplug path
|
|
@@ -869,8 +861,12 @@ static void device_set_realized(Object *obj, bool value, Error **errp)
|
|
|
dev->pending_deleted_event = false;
|
|
|
|
|
|
if (hotplug_ctrl) {
|
|
|
- hotplug_handler_post_plug(hotplug_ctrl, dev);
|
|
|
- }
|
|
|
+ hotplug_handler_plug(hotplug_ctrl, dev, &local_err);
|
|
|
+ if (local_err != NULL) {
|
|
|
+ goto child_realize_fail;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
} else if (!value && dev->realized) {
|
|
|
Error **local_errp = NULL;
|
|
|
QLIST_FOREACH(bus, &dev->child_bus, sibling) {
|