[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 44/84] isa: New isa_new(), isa_realize_and_unref() etc.
From: |
Markus Armbruster |
Subject: |
[PULL 44/84] isa: New isa_new(), isa_realize_and_unref() etc. |
Date: |
Mon, 15 Jun 2020 22:39:28 +0200 |
I'm converting from qdev_create()/qdev_init_nofail() to
qdev_new()/qdev_realize_and_unref(); recent commit "qdev: New
qdev_new(), qdev_realize(), etc." explains why.
ISA devices use qdev_create() through isa_create() and
isa_try_create().
Provide isa_new(), isa_try_new(), and isa_realize_and_unref() for
converting ISA devices.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-19-armbru@redhat.com>
---
include/hw/isa/isa.h | 3 +++
hw/isa/isa-bus.c | 15 +++++++++++++++
2 files changed, 18 insertions(+)
diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h
index 02c2350274..3b6215fafe 100644
--- a/include/hw/isa/isa.h
+++ b/include/hw/isa/isa.h
@@ -105,6 +105,9 @@ MemoryRegion *isa_address_space(ISADevice *dev);
MemoryRegion *isa_address_space_io(ISADevice *dev);
ISADevice *isa_create(ISABus *bus, const char *name);
ISADevice *isa_try_create(ISABus *bus, const char *name);
+ISADevice *isa_new(const char *name);
+ISADevice *isa_try_new(const char *name);
+bool isa_realize_and_unref(ISADevice *dev, ISABus *bus, Error **errp);
ISADevice *isa_create_simple(ISABus *bus, const char *name);
ISADevice *isa_vga_init(ISABus *bus);
diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c
index 1c9d7e19ab..e6412d39b4 100644
--- a/hw/isa/isa-bus.c
+++ b/hw/isa/isa-bus.c
@@ -176,6 +176,16 @@ ISADevice *isa_try_create(ISABus *bus, const char *name)
return ISA_DEVICE(dev);
}
+ISADevice *isa_new(const char *name)
+{
+ return ISA_DEVICE(qdev_new(name));
+}
+
+ISADevice *isa_try_new(const char *name)
+{
+ return ISA_DEVICE(qdev_try_new(name));
+}
+
ISADevice *isa_create_simple(ISABus *bus, const char *name)
{
ISADevice *dev;
@@ -185,6 +195,11 @@ ISADevice *isa_create_simple(ISABus *bus, const char *name)
return dev;
}
+bool isa_realize_and_unref(ISADevice *dev, ISABus *bus, Error **errp)
+{
+ return qdev_realize_and_unref(&dev->parent_obj, &bus->parent_obj, errp);
+}
+
ISADevice *isa_vga_init(ISABus *bus)
{
switch (vga_interface_type) {
--
2.26.2
- [PULL 46/84] isa: Convert uses of isa_create(), isa_try_create() manually, (continued)
- [PULL 46/84] isa: Convert uses of isa_create(), isa_try_create() manually, Markus Armbruster, 2020/06/15
- [PULL 41/84] pci: Convert uses of pci_create() etc. with Coccinelle, Markus Armbruster, 2020/06/15
- [PULL 47/84] isa: isa_create(), isa_try_create() are now unused, drop, Markus Armbruster, 2020/06/15
- [PULL 51/84] ssi: ssi_create_slave_no_init() is now unused, drop, Markus Armbruster, 2020/06/15
- [PULL 53/84] usb: Convert uses of usb_create(), Markus Armbruster, 2020/06/15
- [PULL 32/84] qdev: Convert to qbus_realize(), qbus_unrealize(), Markus Armbruster, 2020/06/15
- [PULL 69/84] sysbus: Tidy up sysbus_init_child_obj()'s @childsize arg, part 2, Markus Armbruster, 2020/06/15
- [PULL 68/84] hw/arm/armsse: Pass correct child size to sysbus_init_child_obj(), Markus Armbruster, 2020/06/15
- [PULL 38/84] qdev: Convert uses of qdev_set_parent_bus() manually, Markus Armbruster, 2020/06/15
- [PULL 49/84] ssi: Convert uses of ssi_create_slave_no_init() with Coccinelle, Markus Armbruster, 2020/06/15
- [PULL 44/84] isa: New isa_new(), isa_realize_and_unref() etc.,
Markus Armbruster <=
- [PULL 42/84] pci: Convert uses of pci_create() etc. manually, Markus Armbruster, 2020/06/15
- [PULL 01/84] qom: Constify object_get_canonical_path{, _component}()'s parameter, Markus Armbruster, 2020/06/15
- [PULL 45/84] isa: Convert uses of isa_create() with Coccinelle, Markus Armbruster, 2020/06/15
- [PULL 57/84] auxbus: Rename aux_init_bus() to aux_bus_init(), Markus Armbruster, 2020/06/15
- [PULL 50/84] ssi: Convert last use of ssi_create_slave_no_init() manually, Markus Armbruster, 2020/06/15
- [PULL 52/84] usb: New usb_new(), usb_realize_and_unref(), Markus Armbruster, 2020/06/15
- [PULL 58/84] auxbus: New aux_bus_realize(), pairing with aux_bus_init(), Markus Armbruster, 2020/06/15
- [PULL 56/84] qdev: qdev_create(), qdev_try_create() are now unused, drop, Markus Armbruster, 2020/06/15
- [PULL 39/84] pci: New pci_new(), pci_realize_and_unref() etc., Markus Armbruster, 2020/06/15
- [PULL 65/84] sysbus: Drop useless OBJECT() in sysbus_init_child_obj() calls, Markus Armbruster, 2020/06/15