qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>
Subject: [PULL 56/84] qdev: qdev_create(), qdev_try_create() are now unused, drop
Date: Mon, 15 Jun 2020 22:39:40 +0200	[thread overview]
Message-ID: <20200615204008.3069956-57-armbru@redhat.com> (raw)
In-Reply-To: <20200615204008.3069956-1-armbru@redhat.com>

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-31-armbru@redhat.com>
---
 include/hw/qdev-core.h |  2 --
 hw/core/qdev.c         | 48 ------------------------------------------
 hw/core/sysbus.c       |  1 -
 migration/migration.c  |  2 +-
 4 files changed, 1 insertion(+), 52 deletions(-)

diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
index be6f7c4736..ef6137b6a8 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -320,8 +320,6 @@ compat_props_add(GPtrArray *arr,
 
 /*** Board API.  This should go away once we have a machine config file.  ***/
 
-DeviceState *qdev_create(BusState *bus, const char *name);
-DeviceState *qdev_try_create(BusState *bus, const char *name);
 DeviceState *qdev_new(const char *name);
 DeviceState *qdev_try_new(const char *name);
 void qdev_init_nofail(DeviceState *dev);
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 4768244f31..a1fdebb3aa 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -128,54 +128,6 @@ void qdev_set_parent_bus(DeviceState *dev, BusState *bus)
     }
 }
 
-/* Create a new device.  This only initializes the device state
-   structure and allows properties to be set.  The device still needs
-   to be realized.  See qdev-core.h.  */
-DeviceState *qdev_create(BusState *bus, const char *name)
-{
-    DeviceState *dev;
-
-    dev = qdev_try_create(bus, name);
-    if (!dev) {
-        if (bus) {
-            error_report("Unknown device '%s' for bus '%s'", name,
-                         object_get_typename(OBJECT(bus)));
-        } else {
-            error_report("Unknown device '%s' for default sysbus", name);
-        }
-        abort();
-    }
-
-    return dev;
-}
-
-DeviceState *qdev_try_create(BusState *bus, const char *type)
-{
-    DeviceState *dev;
-
-    if (object_class_by_name(type) == NULL) {
-        return NULL;
-    }
-    dev = DEVICE(object_new(type));
-    if (!dev) {
-        return NULL;
-    }
-
-    if (!bus) {
-        /* Assert that the device really is a SysBusDevice before
-         * we put it onto the sysbus. Non-sysbus devices which aren't
-         * being put onto a bus should be created with object_new(TYPE_FOO),
-         * not qdev_create(NULL, TYPE_FOO).
-         */
-        g_assert(object_dynamic_cast(OBJECT(dev), TYPE_SYS_BUS_DEVICE));
-        bus = sysbus_get_default();
-    }
-
-    qdev_set_parent_bus(dev, bus);
-    object_unref(OBJECT(dev));
-    return dev;
-}
-
 /*
  * Create a device on the heap.
  * A type @name must exist.
diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c
index b5db0d179f..7ff1b5f2de 100644
--- a/hw/core/sysbus.c
+++ b/hw/core/sysbus.c
@@ -325,7 +325,6 @@ static const TypeInfo sysbus_device_type_info = {
     .class_init = sysbus_device_class_init,
 };
 
-/* This is a nasty hack to allow passing a NULL bus to qdev_create.  */
 static BusState *main_system_bus;
 
 static void main_system_bus_create(void)
diff --git a/migration/migration.c b/migration/migration.c
index b63ad91d34..481a590f72 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -3778,7 +3778,7 @@ static const TypeInfo migration_type = {
     .name = TYPE_MIGRATION,
     /*
      * NOTE: TYPE_MIGRATION is not really a device, as the object is
-     * not created using qdev_create(), it is not attached to the qdev
+     * not created using qdev_new(), it is not attached to the qdev
      * device tree, and it is never realized.
      *
      * TODO: Make this TYPE_OBJECT once QOM provides something like
-- 
2.26.2



  parent reply	other threads:[~2020-06-15 21:19 UTC|newest]

Thread overview: 94+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-15 20:38 [PULL 00/84] QOM patches for 2020-06-15 Markus Armbruster
2020-06-15 20:38 ` [PULL 01/84] qom: Constify object_get_canonical_path{, _component}()'s parameter Markus Armbruster
2020-06-15 20:38 ` [PULL 02/84] qom: Make "info qom-tree" show children sorted Markus Armbruster
2020-06-15 20:38 ` [PULL 03/84] arm/stm32f405: Fix realization of "stm32f2xx-adc" devices Markus Armbruster
2020-06-15 20:38 ` [PULL 04/84] display/xlnx_dp: Fix to realize "i2c-ddc" and "aux-to-i2c-bridge" Markus Armbruster
2020-06-15 20:38 ` [PULL 05/84] sd/pxa2xx_mmci: Fix to realize "pxa2xx-mmci" device Markus Armbruster
2020-06-15 20:38 ` [PULL 06/84] arm/aspeed: Compute the number of CPUs from the SoC definition Markus Armbruster
2020-06-15 20:38 ` [PULL 07/84] arm/aspeed: Rework NIC attachment Markus Armbruster
2020-06-15 20:38 ` [PULL 08/84] armv7m: Delete unused "ARM,bitband-memory" devices Markus Armbruster
2020-06-15 20:38 ` [PULL 09/84] auxbus: Fix aux-to-i2c-bridge to be a subtype of aux-slave Markus Armbruster
2020-06-15 20:38 ` [PULL 10/84] mac_via: Fix to realize "mos6522-q800-via*" devices Markus Armbruster
2020-06-15 20:38 ` [PULL 11/84] macio: Fix to realize "mos6522-cuda" and "mos6522-pmu" devices Markus Armbruster
2020-06-15 20:38 ` [PULL 12/84] macio: Delete unused "macio-gpio" devices Markus Armbruster
2020-06-15 20:38 ` [PULL 13/84] pnv/phb4: Delete unused "pnv-phb4-pec-stack" devices Markus Armbruster
2020-06-15 20:38 ` [PULL 14/84] MAINTAINERS: Make section PowerNV cover pci-host/pnv* as well Markus Armbruster
2020-06-15 20:38 ` [PULL 15/84] ppc4xx: Drop redundant device realization Markus Armbruster
2020-06-15 20:39 ` [PULL 16/84] macio: Put "macio-nvram" device on the macio bus Markus Armbruster
2020-06-15 20:58   ` BALATON Zoltan
2020-06-16  6:48     ` Philippe Mathieu-Daudé
2020-06-15 20:39 ` [PULL 17/84] macio: Fix macio-bus to be a subtype of System bus Markus Armbruster
2020-06-15 20:39 ` [PULL 18/84] ppc/pnv: Put "*-pnv-chip" and "pnv-xive" on the main system bus Markus Armbruster
2020-06-15 20:39 ` [PULL 19/84] pnv/psi: Correct the pnv-psi* devices not to be sysbus devices Markus Armbruster
2020-06-15 20:39 ` [PULL 20/84] display/sm501 display/ati: Fix to realize "i2c-ddc" Markus Armbruster
2020-06-15 20:39 ` [PULL 21/84] riscv: Fix to put "riscv.hart_array" devices on sysbus Markus Armbruster
2020-06-15 20:39 ` [PULL 22/84] riscv: Fix type of SiFive[EU]SocState, member parent_obj Markus Armbruster
2020-06-15 20:39 ` [PULL 23/84] sparc/leon3: Fix to put grlib,* devices on sysbus Markus Armbruster
2020-06-15 20:39 ` [PULL 24/84] qdev: Assert devices are plugged into a bus that can take them Markus Armbruster
2020-06-15 20:39 ` [PULL 25/84] sd: Hide the qdev-but-not-quite thing created by sd_init() Markus Armbruster
2020-06-15 20:39 ` [PULL 26/84] qdev: Assert onboard devices all get realized properly Markus Armbruster
2020-06-15 20:39 ` [PULL 27/84] qdev: Rename qbus_realize() to qbus_init() Markus Armbruster
2020-06-15 20:39 ` [PULL 28/84] Revert "hw/prep: realize the PCI root bus as part of the prep init" Markus Armbruster
2020-06-15 20:39 ` [PULL 29/84] Revert "hw/versatile: realize the PCI root bus as part of the versatile init" Markus Armbruster
2020-06-15 20:39 ` [PULL 30/84] qdev: New qdev_new(), qdev_realize(), etc Markus Armbruster
2020-06-15 20:39 ` [PULL 31/84] qdev: Put qdev_new() to use with Coccinelle Markus Armbruster
2020-06-15 20:39 ` [PULL 32/84] qdev: Convert to qbus_realize(), qbus_unrealize() Markus Armbruster
2020-06-15 20:39 ` [PULL 33/84] qdev: Convert to qdev_unrealize() with Coccinelle Markus Armbruster
2020-06-15 20:39 ` [PULL 34/84] qdev: Convert to qdev_unrealize() manually Markus Armbruster
2020-06-15 20:39 ` [PULL 35/84] qdev: Convert uses of qdev_create() with Coccinelle Markus Armbruster
2020-06-15 20:39 ` [PULL 36/84] qdev: Convert uses of qdev_create() manually Markus Armbruster
2020-06-15 20:39 ` [PULL 37/84] qdev: Convert uses of qdev_set_parent_bus() with Coccinelle Markus Armbruster
2020-06-15 20:39 ` [PULL 38/84] qdev: Convert uses of qdev_set_parent_bus() manually Markus Armbruster
2020-06-15 20:39 ` [PULL 39/84] pci: New pci_new(), pci_realize_and_unref() etc Markus Armbruster
2020-06-15 20:39 ` [PULL 40/84] hw/ppc: Eliminate two superfluous QOM casts Markus Armbruster
2020-06-15 20:39 ` [PULL 41/84] pci: Convert uses of pci_create() etc. with Coccinelle Markus Armbruster
2020-06-15 20:39 ` [PULL 42/84] pci: Convert uses of pci_create() etc. manually Markus Armbruster
2020-06-15 20:39 ` [PULL 43/84] pci: pci_create(), pci_create_multifunction() are now unused, drop Markus Armbruster
2020-06-15 20:39 ` [PULL 44/84] isa: New isa_new(), isa_realize_and_unref() etc Markus Armbruster
2020-06-15 20:39 ` [PULL 45/84] isa: Convert uses of isa_create() with Coccinelle Markus Armbruster
2020-06-15 20:39 ` [PULL 46/84] isa: Convert uses of isa_create(), isa_try_create() manually Markus Armbruster
2020-06-15 20:39 ` [PULL 47/84] isa: isa_create(), isa_try_create() are now unused, drop Markus Armbruster
2020-06-15 20:39 ` [PULL 48/84] ssi: ssi_auto_connect_slaves() never does anything, drop Markus Armbruster
2020-06-15 20:39 ` [PULL 49/84] ssi: Convert uses of ssi_create_slave_no_init() with Coccinelle Markus Armbruster
2020-06-15 20:39 ` [PULL 50/84] ssi: Convert last use of ssi_create_slave_no_init() manually Markus Armbruster
2020-06-15 20:39 ` [PULL 51/84] ssi: ssi_create_slave_no_init() is now unused, drop Markus Armbruster
2020-06-15 20:39 ` [PULL 52/84] usb: New usb_new(), usb_realize_and_unref() Markus Armbruster
2020-06-15 20:39 ` [PULL 53/84] usb: Convert uses of usb_create() Markus Armbruster
2020-06-15 20:39 ` [PULL 54/84] usb: usb_create() is now unused, drop Markus Armbruster
2020-06-15 20:39 ` [PULL 55/84] usb: Eliminate usb_try_create_simple() Markus Armbruster
2020-06-15 20:39 ` Markus Armbruster [this message]
2020-06-15 20:39 ` [PULL 57/84] auxbus: Rename aux_init_bus() to aux_bus_init() Markus Armbruster
2020-06-15 20:39 ` [PULL 58/84] auxbus: New aux_bus_realize(), pairing with aux_bus_init() Markus Armbruster
2020-06-15 20:39 ` [PULL 59/84] auxbus: Convert a use of qdev_set_parent_bus() Markus Armbruster
2020-06-15 20:39 ` [PULL 60/84] auxbus: Eliminate aux_create_slave() Markus Armbruster
2020-06-15 20:39 ` [PULL 61/84] qom: Tidy up a few object_initialize_child() calls Markus Armbruster
2020-06-15 20:39 ` [PULL 62/84] qom: Less verbose object_initialize_child() Markus Armbruster
2020-06-15 20:39 ` [PULL 63/84] macio: Convert use of qdev_set_parent_bus() Markus Armbruster
2020-06-15 20:39 ` [PULL 64/84] macio: Eliminate macio_init_child_obj() Markus Armbruster
2020-06-15 20:39 ` [PULL 65/84] sysbus: Drop useless OBJECT() in sysbus_init_child_obj() calls Markus Armbruster
2020-06-15 20:39 ` [PULL 66/84] microbit: Tidy up sysbus_init_child_obj() @child argument Markus Armbruster
2020-06-15 20:39 ` [PULL 67/84] sysbus: Tidy up sysbus_init_child_obj()'s @childsize arg, part 1 Markus Armbruster
2020-06-15 20:39 ` [PULL 68/84] hw/arm/armsse: Pass correct child size to sysbus_init_child_obj() Markus Armbruster
2020-06-15 20:39 ` [PULL 69/84] sysbus: Tidy up sysbus_init_child_obj()'s @childsize arg, part 2 Markus Armbruster
2020-06-15 20:39 ` [PULL 70/84] sysbus: New sysbus_realize(), sysbus_realize_and_unref() Markus Armbruster
2020-06-15 20:39 ` [PULL 71/84] sysbus: Convert to sysbus_realize() etc. with Coccinelle Markus Armbruster
2020-06-15 20:39 ` [PULL 72/84] qdev: Drop qdev_realize() support for null bus Markus Armbruster
2020-06-15 20:39 ` [PULL 73/84] sysbus: Convert qdev_set_parent_bus() use with Coccinelle, part 1 Markus Armbruster
2020-06-15 20:39 ` [PULL 74/84] sysbus: Convert qdev_set_parent_bus() use with Coccinelle, part 2 Markus Armbruster
2020-06-15 20:39 ` [PULL 75/84] sysbus: Convert qdev_set_parent_bus() use with Coccinelle, part 3 Markus Armbruster
2020-06-15 20:40 ` [PULL 76/84] sysbus: Convert qdev_set_parent_bus() use with Coccinelle, part 4 Markus Armbruster
2020-06-15 20:40 ` [PULL 77/84] sysbus: sysbus_init_child_obj() is now unused, drop Markus Armbruster
2020-06-15 20:40 ` [PULL 78/84] microbit: Eliminate two local variables in microbit_init() Markus Armbruster
2020-06-15 20:40 ` [PULL 79/84] s390x/event-facility: Simplify creation of SCLP event devices Markus Armbruster
2020-06-15 20:40 ` [PULL 80/84] qdev: Make qdev_realize() support bus-less devices Markus Armbruster
2020-06-15 20:40 ` [PULL 81/84] qdev: Use qdev_realize() in qdev_device_add() Markus Armbruster
2020-06-15 20:40 ` [PULL 82/84] qdev: Convert bus-less devices to qdev_realize() with Coccinelle Markus Armbruster
2020-06-15 20:40 ` [PULL 83/84] qdev: qdev_init_nofail() is now unused, drop Markus Armbruster
2020-06-15 20:40 ` [PULL 84/84] MAINTAINERS: Make section QOM cover hw/core/*bus.c as well Markus Armbruster
2020-06-16 12:26 ` [PULL 00/84] QOM patches for 2020-06-15 Peter Maydell
2020-06-16 15:26   ` Thomas Huth
2020-06-17  3:30     ` Philippe Mathieu-Daudé
2020-06-26 18:28 ` Peter Maydell
2020-06-27 11:53   ` Markus Armbruster
2020-06-27 15:11     ` Peter Maydell
2020-06-29  7:25       ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200615204008.3069956-57-armbru@redhat.com \
    --to=armbru@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).