[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 55/58] qdev: Use qdev_realize() in qdev_device_add()
From: |
Markus Armbruster |
Subject: |
[PATCH v2 55/58] qdev: Use qdev_realize() in qdev_device_add() |
Date: |
Fri, 29 May 2020 15:45:20 +0200 |
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
qdev-monitor.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/qdev-monitor.c b/qdev-monitor.c
index 20cfa7615b..22da107484 100644
--- a/qdev-monitor.c
+++ b/qdev-monitor.c
@@ -661,9 +661,7 @@ DeviceState *qdev_device_add(QemuOpts *opts, Error **errp)
goto err_del_dev;
}
- if (bus) {
- qdev_set_parent_bus(dev, bus);
- } else if (qdev_hotplug && !qdev_get_machine_hotplug_handler(dev)) {
+ if (!bus && qdev_hotplug && !qdev_get_machine_hotplug_handler(dev)) {
/* No bus, no machine hotplug handler --> device is not hotpluggable */
error_setg(&err, "Device '%s' can not be hotplugged on this machine",
driver);
@@ -678,7 +676,7 @@ DeviceState *qdev_device_add(QemuOpts *opts, Error **errp)
}
dev->opts = opts;
- object_property_set_bool(OBJECT(dev), true, "realized", &err);
+ qdev_realize(DEVICE(dev), bus, &err);
if (err != NULL) {
dev->opts = NULL;
goto err_del_dev;
--
2.21.3
- [PATCH v2 54/58] qdev: Make qdev_realize() support bus-less devices, (continued)
- [PATCH v2 54/58] qdev: Make qdev_realize() support bus-less devices, Markus Armbruster, 2020/05/29
- [PATCH v2 57/58] qdev: qdev_init_nofail() is now unused, drop, Markus Armbruster, 2020/05/29
- [PATCH v2 49/58] sysbus: Convert qdev_set_parent_bus() use with Coccinelle, part 3, Markus Armbruster, 2020/05/29
- [PATCH v2 47/58] sysbus: Convert qdev_set_parent_bus() use with Coccinelle, part 1, Markus Armbruster, 2020/05/29
- [PATCH v2 56/58] qdev: Convert bus-less devices to qdev_realize() with Coccinelle, Markus Armbruster, 2020/05/29
- [PATCH v2 45/58] sysbus: Convert to sysbus_realize() etc. with Coccinelle, Markus Armbruster, 2020/05/29
- [PATCH v2 43/58] sysbus: Tidy up sysbus_init_child_obj()'s @childsize arg, part 2, Markus Armbruster, 2020/05/29
- [PATCH v2 04/58] qdev: New qdev_new(), qdev_realize(), etc., Markus Armbruster, 2020/05/29
- [PATCH v2 11/58] qdev: Convert uses of qdev_set_parent_bus() with Coccinelle, Markus Armbruster, 2020/05/29
- [PATCH v2 55/58] qdev: Use qdev_realize() in qdev_device_add(),
Markus Armbruster <=
- [PATCH v2 29/58] usb: Eliminate usb_try_create_simple(), Markus Armbruster, 2020/05/29
- [PATCH v2 53/58] s390x/event-facility: Simplify creation of SCLP event devices, Markus Armbruster, 2020/05/29
- [PATCH v2 48/58] sysbus: Convert qdev_set_parent_bus() use with Coccinelle, part 2, Markus Armbruster, 2020/05/29
- Re: [PATCH v2 00/58] qdev: Rework how we plug into the parent bus, Markus Armbruster, 2020/05/29
- Re: [PATCH v2 00/58] qdev: Rework how we plug into the parent bus, no-reply, 2020/05/29
- Re: [PATCH v2 00/58] qdev: Rework how we plug into the parent bus, no-reply, 2020/05/30
- Re: [PATCH v2 00/58] qdev: Rework how we plug into the parent bus, no-reply, 2020/05/30
- Re: [PATCH v2 00/58] qdev: Rework how we plug into the parent bus, no-reply, 2020/05/30
- Re: [PATCH v2 00/58] qdev: Rework how we plug into the parent bus, no-reply, 2020/05/30