QEMU-Arm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <graf@amazon.com>
To: <qemu-devel@nongnu.org>
Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org,
	qemu-s390x@nongnu.org, "Song Gao" <17746591750@163.com>,
	"Aditya Gupta" <adityag@linux.ibm.com>,
	"Alexey Kardashevskiy" <aik@ozlabs.ru>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Farhan Ali" <alifm@linux.ibm.com>,
	"Alistair Francis" <alistair.francis@wdc.com>,
	"Alistair Francis" <alistair@alistair23.me>,
	"Antony Pavlov" <antonynpavlov@gmail.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Artyom Tarasenko" <atar4qemu@gmail.com>,
	"BALATON Zoltan" <balaton@eik.bme.hu>,
	"Felipe Balbi" <balbi@kernel.org>,
	"Daniel P . Berrangé" <berrange@redhat.com>,
	"Christian Borntraeger" <borntraeger@linux.ibm.com>,
	"Brian Cain" <brian.cain@oss.qualcomm.com>,
	"Hendrik Brueckner" <brueckner@linux.ibm.com>,
	"Chao Liu" <chao.liu@processmission.com>,
	"Huacai Chen" <chenhuacai@kernel.org>,
	"Clément Chigot" <chigot@adacore.com>,
	"Cédric Le Goater" <clg@kaod.org>, "Helge Deller" <deller@gmx.de>,
	"Dorjoy Chowdhury" <dorjoychy111@gmail.com>,
	"Edgar E . Iglesias" <edgar.iglesias@gmail.com>,
	"Alexandre Iooss" <erdnaxe@crans.org>,
	"Eric Farman" <farman@linux.ibm.com>,
	"Fabiano Rosas" <farosas@suse.de>,
	"Francisco Iglesias" <francisco.iglesias@amd.com>,
	"Gaurav Sharma" <gaurav.sharma_7@nxp.com>,
	"Gautam Gala" <ggala@linux.ibm.com>,
	"Harsh Prateek Bora" <harshpb@linux.ibm.com>,
	"Hervé Poussineau" <hpoussin@reactos.org>,
	"Jan Kiszka" <jan.kiszka@web.de>,
	"Max Filippov" <jcmvbkbc@gmail.com>,
	"Joel Stanley" <joel@jms.id.au>,
	"Jared Rossi" <jrossi@linux.ibm.com>,
	"Tyrone Ting" <kfting@nuvoton.com>,
	"Frederic Konrad" <konrad.frederic@yahoo.fr>,
	"Laurent Vivier" <laurent@vivier.eu>,
	"Manos Pitsidianakis" <manos.pitsidianakis@linaro.org>,
	"Bibo Mao" <maobibo@loongson.cn>,
	"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
	"Glenn Miles" <milesg@linux.ibm.com>,
	"Matthew Rosato" <mjrosato@linux.ibm.com>,
	"Michael Rolnik" <mrolnik@gmail.com>,
	"Michael S . Tsirkin" <mst@redhat.com>,
	"Niek Linnenbank" <nieklinnenbank@gmail.com>,
	"Nicholas Piggin" <npiggin@gmail.com>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Halil Pasic" <pasic@linux.ibm.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Peter Xu" <peterx@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@mailo.com>,
	"Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>,
	"Pierrick Bouvier" <pierrick.bouvier@oss.qualcomm.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Sai Pavan Boddu" <sai.pavan.boddu@amd.com>,
	"Samuel Tardieu" <sam@rfc1149.net>,
	"Bernhard Beschow" <shentey@gmail.com>,
	"Stafford Horne" <shorne@gmail.com>,
	"Sergio Lopez" <slp@redhat.com>,
	"Subbaraya Sundeep" <sundeep.lkml@gmail.com>,
	"Thomas Huth" <th.huth+qemu@posteo.eu>,
	"Ran Wang" <wangran@bosc.ac.cn>, "Hao Wu" <wuhaotsh@google.com>
Subject: [RFC PATCH v2 006/137] isa: Make isa_new()/isa_try_new()/isa_create_simple() take a QOM parent
Date: Sat, 18 Jul 2026 21:34:41 +0000	[thread overview]
Message-ID: <20260718213652.37673-7-graf@amazon.com> (raw)
In-Reply-To: <20260718213652.37673-1-graf@amazon.com>

Same rename-and-reintroduce treatment as the qdev, sysbus and PCI
layers: mechanically rename the three ISA creation helpers to
*_orphan() and reintroduce the short names with a leading
(parent, id, ...) pair.

The parented isa_create_simple() calls qdev_realize() (not
isa_realize_and_unref()) since the child<> property already holds
the sole reference.

The mechanical rename part is generated by

  spatch --sp-file scripts/coccinelle/qom-parent/isa-new-orphan.cocci \
         --in-place --include-headers --dir .

or equivalently

  git ls-files '*.[ch]' '*.[ch].inc' '*.rst' '*.py' | \
      grep -v '^subprojects/' | \
      xargs sed -i \
          's/\bisa_create_simple\b/&_orphan/g;
           s/\bisa_try_new\b/&_orphan/g;
           s/\bisa_new\b/&_orphan/g'

AI-used-for: code (refactoring)
Signed-off-by: Alexander Graf <graf@amazon.com>
---
 hw/alpha/dp264.c                              |  2 +-
 hw/char/parallel-isa.c                        |  2 +-
 hw/char/serial-isa.c                          |  2 +-
 hw/dma/i8257.c                                |  4 +--
 hw/i386/isapc.c                               |  2 +-
 hw/i386/pc.c                                  | 12 ++++----
 hw/ide/isa.c                                  |  2 +-
 hw/intc/i8259_common.c                        |  2 +-
 hw/isa/i82378.c                               |  4 +--
 hw/isa/isa-bus.c                              | 30 +++++++++++++++----
 hw/isa/isa-superio.c                          | 10 +++----
 hw/mips/jazz.c                                |  2 +-
 hw/mips/malta.c                               |  2 +-
 hw/ppc/pnv.c                                  |  2 +-
 hw/ppc/prep.c                                 | 12 ++++----
 hw/rtc/mc146818rtc.c                          |  2 +-
 hw/sparc64/sun4u.c                            |  4 +--
 include/hw/i386/vmport.h                      |  2 +-
 include/hw/isa/isa.h                          | 10 +++++--
 include/hw/net/ne2000-isa.h                   |  2 +-
 include/hw/timer/i8254.h                      |  4 +--
 .../qom-parent/isa-new-orphan.cocci           | 23 ++++++++++++++
 22 files changed, 91 insertions(+), 46 deletions(-)
 create mode 100644 scripts/coccinelle/qom-parent/isa-new-orphan.cocci

diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c
index 6999168df6..b07dcebaa0 100644
--- a/hw/alpha/dp264.c
+++ b/hw/alpha/dp264.c
@@ -126,7 +126,7 @@ static void clipper_init(MachineState *machine)
     pci_init_nic_devices(pci_bus, mc->default_nic);
 
     /* Super I/O */
-    isa_create_simple(isa_bus, TYPE_SMC37C669_SUPERIO);
+    isa_create_simple_orphan(isa_bus, TYPE_SMC37C669_SUPERIO);
 
     /* IDE disk setup.  */
     pci_dev = pci_create_simple_orphan(pci_bus, -1, "cmd646-ide");
diff --git a/hw/char/parallel-isa.c b/hw/char/parallel-isa.c
index 92e94138f4..19583c0f23 100644
--- a/hw/char/parallel-isa.c
+++ b/hw/char/parallel-isa.c
@@ -22,7 +22,7 @@ static void parallel_init(ISABus *bus, int index, Chardev *chr)
     DeviceState *dev;
     ISADevice *isadev;
 
-    isadev = isa_new(TYPE_ISA_PARALLEL);
+    isadev = isa_new_orphan(TYPE_ISA_PARALLEL);
     dev = DEVICE(isadev);
     qdev_prop_set_uint32(dev, "index", index);
     qdev_prop_set_chr(dev, "chardev", chr);
diff --git a/hw/char/serial-isa.c b/hw/char/serial-isa.c
index eaa4e843c0..4dbdc0df91 100644
--- a/hw/char/serial-isa.c
+++ b/hw/char/serial-isa.c
@@ -165,7 +165,7 @@ static void serial_isa_init(ISABus *bus, int index, Chardev *chr)
     DeviceState *dev;
     ISADevice *isadev;
 
-    isadev = isa_new(TYPE_ISA_SERIAL);
+    isadev = isa_new_orphan(TYPE_ISA_SERIAL);
     dev = DEVICE(isadev);
     qdev_prop_set_uint32(dev, "index", index);
     qdev_prop_set_chr(dev, "chardev", chr);
diff --git a/hw/dma/i8257.c b/hw/dma/i8257.c
index 5771549889..d1ab17b80d 100644
--- a/hw/dma/i8257.c
+++ b/hw/dma/i8257.c
@@ -651,7 +651,7 @@ void i8257_dma_init(Object *parent, ISABus *bus, bool high_page_enable)
     ISADevice *isa1, *isa2;
     DeviceState *d;
 
-    isa1 = isa_new(TYPE_I8257);
+    isa1 = isa_new_orphan(TYPE_I8257);
     object_property_add_child(parent, "dma[*]", OBJECT(isa1));
     d = DEVICE(isa1);
     qdev_prop_set_int32(d, "base", 0x00);
@@ -660,7 +660,7 @@ void i8257_dma_init(Object *parent, ISABus *bus, bool high_page_enable)
     qdev_prop_set_int32(d, "dshift", 0);
     isa_realize_and_unref(isa1, bus, &error_fatal);
 
-    isa2 = isa_new(TYPE_I8257);
+    isa2 = isa_new_orphan(TYPE_I8257);
     object_property_add_child(parent, "dma[*]", OBJECT(isa2));
     d = DEVICE(isa2);
     qdev_prop_set_int32(d, "base", 0xc0);
diff --git a/hw/i386/isapc.c b/hw/i386/isapc.c
index 1ba9ae22cc..03d68f748f 100644
--- a/hw/i386/isapc.c
+++ b/hw/i386/isapc.c
@@ -112,7 +112,7 @@ static void pc_init_isa(MachineState *machine)
                           &error_abort);
     isa_bus_register_input_irqs(isa_bus, x86ms->gsi);
 
-    x86ms->rtc = isa_new(TYPE_MC146818_RTC);
+    x86ms->rtc = isa_new_orphan(TYPE_MC146818_RTC);
     qdev_prop_set_int32(DEVICE(x86ms->rtc), "base_year", 2000);
     isa_realize_and_unref(x86ms->rtc, isa_bus, &error_fatal);
     irq = object_property_get_uint(OBJECT(x86ms->rtc), "irq",
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 11a9d5df97..905b4960a3 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -998,7 +998,7 @@ static void pc_superio_init(ISABus *isa_bus, bool create_fdctrl,
     }
     if (create_fdctrl) {
 #ifdef CONFIG_FDC_ISA
-        ISADevice *fdc = isa_new(TYPE_ISA_FDC);
+        ISADevice *fdc = isa_new_orphan(TYPE_ISA_FDC);
         if (fdc) {
             isa_realize_and_unref(fdc, isa_bus, &error_fatal);
             isa_fdc_init_drives(fdc, fd);
@@ -1014,10 +1014,10 @@ static void pc_superio_init(ISABus *isa_bus, bool create_fdctrl,
         return;
     }
 
-    i8042 = isa_create_simple(isa_bus, TYPE_I8042);
+    i8042 = isa_create_simple_orphan(isa_bus, TYPE_I8042);
     if (!no_vmport) {
-        isa_create_simple(isa_bus, TYPE_VMPORT);
-        vmmouse = isa_try_new("vmmouse");
+        isa_create_simple_orphan(isa_bus, TYPE_VMPORT);
+        vmmouse = isa_try_new_orphan("vmmouse");
     } else {
         vmmouse = NULL;
     }
@@ -1026,7 +1026,7 @@ static void pc_superio_init(ISABus *isa_bus, bool create_fdctrl,
                                  &error_abort);
         isa_realize_and_unref(vmmouse, isa_bus, &error_fatal);
     }
-    port92 = isa_create_simple(isa_bus, TYPE_PORT92);
+    port92 = isa_create_simple_orphan(isa_bus, TYPE_PORT92);
 
     a20_line = qemu_allocate_irqs(handle_a20_line_change, first_cpu, 2);
     qdev_connect_gpio_out_named(DEVICE(i8042),
@@ -1639,7 +1639,7 @@ static void pc_machine_initfn(Object *obj)
     pcms->default_bus_bypass_iommu = false;
 
     pc_system_flash_create(pcms);
-    pcms->pcspk = isa_new(TYPE_PC_SPEAKER);
+    pcms->pcspk = isa_new_orphan(TYPE_PC_SPEAKER);
     object_property_add_alias(OBJECT(pcms), "pcspk-audiodev",
                               OBJECT(pcms->pcspk), "audiodev");
     if (pcmc->pci_enabled) {
diff --git a/hw/ide/isa.c b/hw/ide/isa.c
index c97b7a1ff4..c9c997344b 100644
--- a/hw/ide/isa.c
+++ b/hw/ide/isa.c
@@ -84,7 +84,7 @@ ISADevice *isa_ide_init(ISABus *bus, int iobase, int iobase2, int irqnum,
     ISADevice *isadev;
     ISAIDEState *s;
 
-    isadev = isa_new(TYPE_ISA_IDE);
+    isadev = isa_new_orphan(TYPE_ISA_IDE);
     dev = DEVICE(isadev);
     qdev_prop_set_uint32(dev, "iobase",  iobase);
     qdev_prop_set_uint32(dev, "iobase2", iobase2);
diff --git a/hw/intc/i8259_common.c b/hw/intc/i8259_common.c
index 8ceb5841b9..45eb0e14a8 100644
--- a/hw/intc/i8259_common.c
+++ b/hw/intc/i8259_common.c
@@ -94,7 +94,7 @@ ISADevice *i8259_init_chip(const char *name, ISABus *bus, bool master)
     DeviceState *dev;
     ISADevice *isadev;
 
-    isadev = isa_new(name);
+    isadev = isa_new_orphan(name);
     dev = DEVICE(isadev);
     qdev_prop_set_uint32(dev, "iobase", master ? 0x20 : 0xa0);
     qdev_prop_set_uint32(dev, "elcr_addr", master ? 0x4d0 : 0x4d1);
diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c
index dfa8a3775c..63d4050db2 100644
--- a/hw/isa/i82378.c
+++ b/hw/isa/i82378.c
@@ -103,14 +103,14 @@ static void i82378_realize(PCIDevice *pci, Error **errp)
     pit = i8254_pit_init(isabus, 0x40, 0, NULL);
 
     /* speaker */
-    pcspk = isa_new(TYPE_PC_SPEAKER);
+    pcspk = isa_new_orphan(TYPE_PC_SPEAKER);
     object_property_set_link(OBJECT(pcspk), "pit", OBJECT(pit), &error_fatal);
     if (!isa_realize_and_unref(pcspk, isabus, errp)) {
         return;
     }
 
     /* 2 82C37 (dma) */
-    isa_create_simple(isabus, "i82374");
+    isa_create_simple_orphan(isabus, "i82374");
 }
 
 static void i82378_init(Object *obj)
diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c
index 5e6340f635..c15cf53469 100644
--- a/hw/isa/isa-bus.c
+++ b/hw/isa/isa-bus.c
@@ -153,21 +153,39 @@ int isa_register_portio_list(ISADevice *dev,
     return 0;
 }
 
-ISADevice *isa_new(const char *name)
+ISADevice *isa_new(Object *parent, const char *id, const char *type)
+{
+    return ISA_DEVICE(qdev_new(parent, id, type));
+}
+
+ISADevice *isa_try_new(Object *parent, const char *id, const char *type)
+{
+    return ISA_DEVICE(qdev_try_new(parent, id, type));
+}
+
+ISADevice *isa_create_simple(Object *parent, const char *id,
+                             ISABus *bus, const char *type)
+{
+    ISADevice *dev = isa_new(parent, id, type);
+    qdev_realize(DEVICE(dev), BUS(bus), &error_fatal);
+    return dev;
+}
+
+ISADevice *isa_new_orphan(const char *name)
 {
     return ISA_DEVICE(qdev_new_orphan(name));
 }
 
-ISADevice *isa_try_new(const char *name)
+ISADevice *isa_try_new_orphan(const char *name)
 {
     return ISA_DEVICE(qdev_try_new_orphan(name));
 }
 
-ISADevice *isa_create_simple(ISABus *bus, const char *name)
+ISADevice *isa_create_simple_orphan(ISABus *bus, const char *name)
 {
     ISADevice *dev;
 
-    dev = isa_new(name);
+    dev = isa_new_orphan(name);
     isa_realize_and_unref(dev, bus, &error_fatal);
     return dev;
 }
@@ -187,12 +205,12 @@ ISADevice *isa_vga_init(ISABus *bus)
     vga_interface_created = true;
     switch (vga_interface_type) {
     case VGA_CIRRUS:
-        return isa_create_simple(bus, "isa-cirrus-vga");
+        return isa_create_simple_orphan(bus, "isa-cirrus-vga");
     case VGA_QXL:
         error_report("%s: qxl: no PCI bus", __func__);
         return NULL;
     case VGA_STD:
-        return isa_create_simple(bus, "isa-vga");
+        return isa_create_simple_orphan(bus, "isa-vga");
     case VGA_VMWARE:
         error_report("%s: vmware_vga: no PCI bus", __func__);
         return NULL;
diff --git a/hw/isa/isa-superio.c b/hw/isa/isa-superio.c
index dc6ae3cb10..2d65255f34 100644
--- a/hw/isa/isa-superio.c
+++ b/hw/isa/isa-superio.c
@@ -54,7 +54,7 @@ static void isa_superio_realize(DeviceState *dev, Error **errp)
             } else {
                 name = g_strdup_printf("parallel%d", i);
             }
-            isa = isa_new(TYPE_ISA_PARALLEL);
+            isa = isa_new_orphan(TYPE_ISA_PARALLEL);
             d = DEVICE(isa);
             qdev_prop_set_uint32(d, "index", i);
             if (k->parallel.get_iobase) {
@@ -93,7 +93,7 @@ static void isa_superio_realize(DeviceState *dev, Error **errp)
             } else {
                 name = g_strdup_printf("serial%d", i);
             }
-            isa = isa_new(TYPE_ISA_SERIAL);
+            isa = isa_new_orphan(TYPE_ISA_SERIAL);
             d = DEVICE(isa);
             qdev_prop_set_uint32(d, "index", i);
             if (k->serial.get_iobase) {
@@ -120,7 +120,7 @@ static void isa_superio_realize(DeviceState *dev, Error **errp)
     assert(k->floppy.count <= 1);
     if (k->floppy.count &&
         (!k->floppy.is_enabled || k->floppy.is_enabled(sio, 0))) {
-        isa = isa_new(TYPE_ISA_FDC);
+        isa = isa_new_orphan(TYPE_ISA_FDC);
         d = DEVICE(isa);
         if (k->floppy.get_iobase) {
             qdev_prop_set_uint32(d, "iobase", k->floppy.get_iobase(sio, 0));
@@ -144,14 +144,14 @@ static void isa_superio_realize(DeviceState *dev, Error **errp)
     }
 
     /* Keyboard, mouse */
-    isa = isa_new(TYPE_I8042);
+    isa = isa_new_orphan(TYPE_I8042);
     object_property_add_child(OBJECT(sio), TYPE_I8042, OBJECT(isa));
     isa_realize_and_unref(isa, bus, &error_fatal);
     sio->kbc = isa;
 
     /* IDE */
     if (k->ide.count && (!k->ide.is_enabled || k->ide.is_enabled(sio, 0))) {
-        isa = isa_new("isa-ide");
+        isa = isa_new_orphan("isa-ide");
         d = DEVICE(isa);
         if (k->ide.get_iobase) {
             qdev_prop_set_uint32(d, "iobase", k->ide.get_iobase(sio, 0));
diff --git a/hw/mips/jazz.c b/hw/mips/jazz.c
index a902e400cf..849c97eb10 100644
--- a/hw/mips/jazz.c
+++ b/hw/mips/jazz.c
@@ -289,7 +289,7 @@ static void mips_jazz_init(MachineState *machine,
     isa_bus_register_input_irqs(isa_bus, i8259);
     i8257_dma_init(OBJECT(rc4030), isa_bus, 0);
     pit = i8254_pit_init(isa_bus, 0x40, 0, NULL);
-    pcspk = isa_new(TYPE_PC_SPEAKER);
+    pcspk = isa_new_orphan(TYPE_PC_SPEAKER);
     object_property_set_link(OBJECT(pcspk), "pit", OBJECT(pit), &error_fatal);
     isa_realize_and_unref(pcspk, isa_bus, &error_fatal);
 
diff --git a/hw/mips/malta.c b/hw/mips/malta.c
index 38edbbadd6..da6dd15a59 100644
--- a/hw/mips/malta.c
+++ b/hw/mips/malta.c
@@ -1253,7 +1253,7 @@ void mips_malta_init(MachineState *machine)
     g_free(smbus_eeprom_buf);
 
     /* Super I/O: SMS FDC37M817 */
-    isa_create_simple(isa_bus, TYPE_FDC37M81X_SUPERIO);
+    isa_create_simple_orphan(isa_bus, TYPE_FDC37M81X_SUPERIO);
 
     /* Network card */
     network_init(pci_bus);
diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
index b85b6dd46c..8346613a68 100644
--- a/hw/ppc/pnv.c
+++ b/hw/ppc/pnv.c
@@ -1010,7 +1010,7 @@ static bool pnv_match_cpu(const char *default_type, const char *cpu_type)
 
 static void pnv_ipmi_bt_init(ISABus *bus, IPMIBmc *bmc, uint32_t irq)
 {
-    ISADevice *dev = isa_new("isa-ipmi-bt");
+    ISADevice *dev = isa_new_orphan("isa-ipmi-bt");
 
     object_property_set_link(OBJECT(dev), "bmc", OBJECT(bmc), &error_fatal);
     object_property_set_int(OBJECT(dev), "irq", irq, &error_fatal);
diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
index a716d5da6a..32a28bc12a 100644
--- a/hw/ppc/prep.c
+++ b/hw/ppc/prep.c
@@ -309,20 +309,20 @@ static void ibm_40p_init(MachineState *machine)
     isa_bus = ISA_BUS(qdev_get_child_bus(i82378_dev, "isa.0"));
 
     /* system control ports */
-    isa_dev = isa_new("prep-systemio");
+    isa_dev = isa_new_orphan("prep-systemio");
     dev = DEVICE(isa_dev);
     qdev_prop_set_uint32(dev, "ibm-planar-id", 0xfc);
     qdev_prop_set_uint32(dev, "equipment", 0xc0);
     isa_realize_and_unref(isa_dev, isa_bus, &error_fatal);
 
     /* Memory controller */
-    isa_dev = isa_new("rs6000-mc");
+    isa_dev = isa_new_orphan("rs6000-mc");
     dev = DEVICE(isa_dev);
     qdev_prop_set_uint32(dev, "ram-size", machine->ram_size);
     isa_realize_and_unref(isa_dev, isa_bus, &error_fatal);
 
     /* RTC */
-    isa_dev = isa_new(TYPE_MC146818_RTC);
+    isa_dev = isa_new_orphan(TYPE_MC146818_RTC);
     dev = DEVICE(isa_dev);
     qdev_prop_set_int32(dev, "base_year", 1900);
     isa_realize_and_unref(isa_dev, isa_bus, &error_fatal);
@@ -334,9 +334,9 @@ static void ibm_40p_init(MachineState *machine)
 
     /* add some more devices */
     if (defaults_enabled()) {
-        m48t59 = NVRAM(isa_create_simple(isa_bus, "isa-m48t59"));
+        m48t59 = NVRAM(isa_create_simple_orphan(isa_bus, "isa-m48t59"));
 
-        isa_dev = isa_new("cs4231a");
+        isa_dev = isa_new_orphan("cs4231a");
         dev = DEVICE(isa_dev);
         qdev_prop_set_uint32(dev, "iobase", 0x830);
         qdev_prop_set_uint32(dev, "irq", 10);
@@ -345,7 +345,7 @@ static void ibm_40p_init(MachineState *machine)
         }
         isa_realize_and_unref(isa_dev, isa_bus, &error_fatal);
 
-        isa_dev = isa_new("pc87312");
+        isa_dev = isa_new_orphan("pc87312");
         dev = DEVICE(isa_dev);
         qdev_prop_set_uint32(dev, "config", 12);
         isa_realize_and_unref(isa_dev, isa_bus, &error_fatal);
diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c
index ba396435d1..b9e5ec6ff6 100644
--- a/hw/rtc/mc146818rtc.c
+++ b/hw/rtc/mc146818rtc.c
@@ -930,7 +930,7 @@ MC146818RtcState *mc146818_rtc_init(ISABus *bus, int base_year,
     ISADevice *isadev;
     MC146818RtcState *s;
 
-    isadev = isa_new(TYPE_MC146818_RTC);
+    isadev = isa_new_orphan(TYPE_MC146818_RTC);
     dev = DEVICE(isadev);
     s = MC146818_RTC(isadev);
     qdev_prop_set_int32(dev, "base_year", base_year);
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index 5de873126c..b60588cf7d 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -329,13 +329,13 @@ static void ebus_realize(PCIDevice *pci_dev, Error **errp)
     parallel_hds_isa_init(s->isa_bus, MAX_PARALLEL_PORTS);
 
     /* Keyboard */
-    isa_create_simple(s->isa_bus, TYPE_I8042);
+    isa_create_simple_orphan(s->isa_bus, TYPE_I8042);
 
     /* Floppy */
     for (i = 0; i < MAX_FD; i++) {
         fd[i] = drive_get(IF_FLOPPY, 0, i);
     }
-    isa_dev = isa_new(TYPE_ISA_FDC);
+    isa_dev = isa_new_orphan(TYPE_ISA_FDC);
     dev = DEVICE(isa_dev);
     qdev_prop_set_uint32(dev, "dma", -1);
     isa_realize_and_unref(isa_dev, s->isa_bus, &error_fatal);
diff --git a/include/hw/i386/vmport.h b/include/hw/i386/vmport.h
index 8f5e27c6f5..22dd3645d2 100644
--- a/include/hw/i386/vmport.h
+++ b/include/hw/i386/vmport.h
@@ -20,7 +20,7 @@ typedef enum {
 
 static inline void vmport_init(ISABus *bus)
 {
-    isa_create_simple(bus, TYPE_VMPORT);
+    isa_create_simple_orphan(bus, TYPE_VMPORT);
 }
 
 void vmport_register(VMPortCommand command, VMPortReadFunc *func, void *opaque);
diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h
index 94bff33fcc..af8e07c253 100644
--- a/include/hw/isa/isa.h
+++ b/include/hw/isa/isa.h
@@ -80,10 +80,14 @@ IsaDma *isa_bus_get_dma(ISABus *bus, int nchan);
  * Return IRQ @irqnum from the PIC associated on ISA @bus.
  */
 qemu_irq isa_bus_get_irq(ISABus *bus, unsigned irqnum);
-ISADevice *isa_new(const char *name);
-ISADevice *isa_try_new(const char *name);
+ISADevice *isa_new(Object *parent, const char *id, const char *type);
+ISADevice *isa_try_new(Object *parent, const char *id, const char *type);
+ISADevice *isa_create_simple(Object *parent, const char *id,
+                             ISABus *bus, const char *type);
+ISADevice *isa_new_orphan(const char *name);
+ISADevice *isa_try_new_orphan(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_create_simple_orphan(ISABus *bus, const char *name);
 
 ISADevice *isa_vga_init(ISABus *bus);
 
diff --git a/include/hw/net/ne2000-isa.h b/include/hw/net/ne2000-isa.h
index 1e14d1afc0..ef8b3334d7 100644
--- a/include/hw/net/ne2000-isa.h
+++ b/include/hw/net/ne2000-isa.h
@@ -22,7 +22,7 @@ static inline ISADevice *isa_ne2000_init(ISABus *bus, int base, int irq,
 {
     ISADevice *d;
 
-    d = isa_try_new(TYPE_ISA_NE2000);
+    d = isa_try_new_orphan(TYPE_ISA_NE2000);
     if (d) {
         DeviceState *dev = DEVICE(d);
 
diff --git a/include/hw/timer/i8254.h b/include/hw/timer/i8254.h
index 65775b789d..38f896063e 100644
--- a/include/hw/timer/i8254.h
+++ b/include/hw/timer/i8254.h
@@ -51,7 +51,7 @@ static inline ISADevice *i8254_pit_init(ISABus *bus, int base, int isa_irq,
     DeviceState *dev;
     ISADevice *d;
 
-    d = isa_new(TYPE_I8254);
+    d = isa_new_orphan(TYPE_I8254);
     dev = DEVICE(d);
     qdev_prop_set_uint32(dev, "iobase", base);
     isa_realize_and_unref(d, bus, &error_fatal);
@@ -67,7 +67,7 @@ static inline ISADevice *kvm_pit_init(ISABus *bus, int base)
     DeviceState *dev;
     ISADevice *d;
 
-    d = isa_new(TYPE_KVM_I8254);
+    d = isa_new_orphan(TYPE_KVM_I8254);
     dev = DEVICE(d);
     qdev_prop_set_uint32(dev, "iobase", base);
     isa_realize_and_unref(d, bus, &error_fatal);
diff --git a/scripts/coccinelle/qom-parent/isa-new-orphan.cocci b/scripts/coccinelle/qom-parent/isa-new-orphan.cocci
new file mode 100644
index 0000000000..75393543c8
--- /dev/null
+++ b/scripts/coccinelle/qom-parent/isa-new-orphan.cocci
@@ -0,0 +1,23 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+//
+// Rename isa_new()/isa_try_new()/isa_create_simple() to *_orphan()
+// so that the short names can be reintroduced with a mandatory
+// (parent, id, ...) signature.
+//
+// spatch --sp-file scripts/coccinelle/qom-parent/isa-new-orphan.cocci \
+//        --in-place --include-headers --dir .
+
+@@
+@@
+- isa_new
++ isa_new_orphan
+
+@@
+@@
+- isa_try_new
++ isa_try_new_orphan
+
+@@
+@@
+- isa_create_simple
++ isa_create_simple_orphan
-- 
2.47.1



  parent reply	other threads:[~2026-07-18 21:39 UTC|newest]

Thread overview: 290+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-11 22:34 [RFC PATCH 000/134] qom: Make composition-tree parenting mandatory Alexander Graf
2026-07-11 22:34 ` [RFC PATCH 001/134] qom: Introduce object_new_child() Alexander Graf
2026-07-13  8:47   ` Daniel P. Berrangé
2026-07-13  9:01     ` Graf (AWS), Alexander
2026-07-11 22:34 ` [RFC PATCH 002/134] qdev: Rename qdev_new()/qdev_try_new() to *_orphan() Alexander Graf
2026-07-13  8:22   ` Philippe Mathieu-Daudé
2026-07-11 22:34 ` [RFC PATCH 003/134] qdev: Reintroduce qdev_new() with a mandatory QOM parent Alexander Graf
2026-07-13 10:55   ` Philippe Mathieu-Daudé
2026-07-11 22:34 ` [RFC PATCH 004/134] sysbus: Make sysbus_create_simple()/_varargs() take a " Alexander Graf
2026-07-13 10:54   ` Philippe Mathieu-Daudé
2026-07-11 22:34 ` [RFC PATCH 005/134] pci: Make pci_new*()/pci_create_simple*() " Alexander Graf
2026-07-11 22:34 ` [RFC PATCH 006/134] isa: Make isa_new()/isa_try_new()/isa_create_simple() " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 007/134] i2c: Make i2c_slave_new()/i2c_slave_create_simple() " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 008/134] ssi, usb: Make bus-layer creators " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 009/134] cpu: Make cpu_create() " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 010/134] hw/avr: Give onboard devices " Alexander Graf
2026-07-13  8:25   ` Philippe Mathieu-Daudé
2026-07-11 22:35 ` [RFC PATCH 011/134] hw/tricore: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 012/134] hw/xtensa: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 013/134] hw/alpha: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 014/134] hw/nitro: " Alexander Graf
2026-07-13  8:29   ` Philippe Mathieu-Daudé
2026-07-11 22:35 ` [RFC PATCH 015/134] hw/vmapple: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 016/134] hw/hppa: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 017/134] hw/microblaze: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 018/134] hw/sh4: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 019/134] hw/s390x: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 020/134] hw/or1k: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 021/134] hw/loongarch: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 022/134] hw/intc: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 023/134] hw/pci-host: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 024/134] hw/core: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 025/134] hw/remote: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 026/134] hw/ufs: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 027/134] hw/nvme: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 028/134] hw/vfio: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 029/134] hw/mem: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 030/134] hw/cxl: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 031/134] hw/hexagon: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 032/134] hw/xen: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 033/134] hw/display: " Alexander Graf
2026-07-13  8:32   ` Philippe Mathieu-Daudé
2026-07-11 22:35 ` [RFC PATCH 034/134] hw/nvram: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 035/134] hw/dma: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 036/134] hw/misc: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 037/134] hw/scsi: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 038/134] hw/net: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 039/134] hw/ide: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 040/134] hw/i3c: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 041/134] hw/pci-bridge: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 042/134] hw/sparc64: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 043/134] hw/sparc: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 044/134] hw/m68k: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 045/134] hw/rtc: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 046/134] hw/i2c: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 047/134] hw/block: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 048/134] hw/char: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 049/134] hw/isa: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 050/134] hw/pci: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 051/134] hw/riscv: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 052/134] hw/mips: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 053/134] hw/i386: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 054/134] hw/ppc: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 055/134] hw/pci, hw/isa: Give VGA and slot-NIC helpers " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 056/134] hw/arm/virt: Give onboard devices " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 057/134] hw/arm/sbsa-ref: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 058/134] hw/arm/xilinx-zynq: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 059/134] hw/arm/xlnx-versal, xlnx-zynqmp: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 060/134] hw/arm/realview, integratorcp: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 061/134] hw/arm/npcm: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 062/134] hw/arm/versatile, vexpress: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 063/134] hw/arm/stellaris, musicpal: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 064/134] hw/arm/exynos: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 065/134] hw/arm/allwinner: " Alexander Graf
2026-07-11 22:35 ` [RFC PATCH 066/134] hw/arm/strongarm: " Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 067/134] hw/arm/omap: " Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 068/134] hw/arm/mps2: " Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 069/134] hw/arm/imx: " Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 070/134] hw/arm/misc: " Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 071/134] hw/arm/aspeed: Give onboard devices a QOM parent (part 1) Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 072/134] hw/arm/aspeed: Give onboard devices a QOM parent (part 2) Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 073/134] hw/nvram/at24c: Give at24c_eeprom_init() a QOM parent Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 074/134] hw/i386/pc: Give pcspk " Alexander Graf
2026-07-13  8:34   ` Philippe Mathieu-Daudé
2026-07-11 22:36 ` [RFC PATCH 075/134] hw/timer, hw/net: Give i8254 and isa-ne2000 helpers " Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 076/134] hw/misc/unimp: Give create_unimplemented_device() " Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 077/134] hw/usb: Give -usbdevice and auto-hub devices " Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 078/134] hw/audio: Give -audio model= " Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 079/134] hw/xen: Give xenstore-driven backend " Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 080/134] hw/nitro: Give the vsock bridge " Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 081/134] hw/isa: Give the isabus-bridge " Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 082/134] net, target/mips: Give -nic and CPU-with-clock helpers " Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 083/134] usb, ssi, i2c: Remove *_orphan() creator variants Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 084/134] isa: " Alexander Graf
2026-07-13  8:35   ` Philippe Mathieu-Daudé
2026-07-11 22:36 ` [RFC PATCH 085/134] pci: " Alexander Graf
2026-07-13  8:36   ` Philippe Mathieu-Daudé
2026-07-11 22:36 ` [RFC PATCH 086/134] cpu: Remove cpu_create_orphan() Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 087/134] sysbus: Remove *_orphan() creator variants Alexander Graf
2026-07-13  8:36   ` Philippe Mathieu-Daudé
2026-07-11 22:36 ` [RFC PATCH 088/134] qdev: Remove qdev_new_orphan() and qdev_try_new_orphan() Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 089/134] memory: Accept non-device owners in memory_region_init_ram() Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 090/134] hw/misc-boards: Give memory regions an explicit owner Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 091/134] hw/mips: " Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 092/134] hw/riscv: " Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 093/134] hw/i386: " Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 094/134] hw/arm: " Alexander Graf
2026-07-12 15:12   ` Bernhard Beschow
2026-07-11 22:36 ` [RFC PATCH 095/134] hw/arm/omap1: " Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 096/134] hw/sh4: " Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 097/134] hw/m68k: " Alexander Graf
2026-07-12 14:20   ` Thomas Huth
2026-07-11 22:36 ` [RFC PATCH 098/134] hw/ppc: " Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 099/134] hw/tricore: " Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 100/134] hw/xtensa: " Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 101/134] hw/display: " Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 102/134] hw/arm/omap: Give lcdc and dma " Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 103/134] hw/char: Give parallel and htif " Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 104/134] hw/remote: Give " Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 105/134] system, backends: Give named " Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 106/134] hw/ide: Let ide_init_ioport() take " Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 107/134] memory: Require an owner for named memory regions Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 108/134] irq: Rename qemu_allocate_irq*() and friends to *_orphan() Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 109/134] irq: Reintroduce qemu_allocate_irq*() with a mandatory owner and name Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 110/134] hw/pci, hw/usb, system: Give allocated IRQs an " Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 111/134] hw/i386, hw/xen: " Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 112/134] hw/arm: " Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 113/134] hw/xtensa: " Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 114/134] hw: " Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 115/134] hw/core: Parent GPIO input IRQs and embedded IRQState via QOM Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 116/134] irq: Delete the *_orphan() IRQ allocation variants Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 117/134] sysbus: Parent main-system-bus directly under /machine Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 118/134] accel: Parent the accelerator singleton " Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 119/134] hw/core/reset: Give the root reset container and legacy shims a QOM path Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 120/134] system: Parent per-MR helper objects under their owner Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 121/134] hw/virtio, hw/display: Parent per-device helper objects Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 122/134] hw/i386/amd_iommu: Parent internally-created AMDVI-PCI under the IOMMU Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 123/134] hw/s390x, hw/remote: Parent per-devfn IOMMU objects Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 124/134] hw/pci-host/raven: Parent the OR-IRQ under the host bridge Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 125/134] hw/arm/mps2: Parent the OR-IRQ gates under the machine Alexander Graf
2026-07-11 22:36 ` [RFC PATCH 126/134] hw/arm/digic: Parent the DIGIC SoC " Alexander Graf
2026-07-11 22:37 ` [RFC PATCH 127/134] hw/microblaze: Parent the CPU " Alexander Graf
2026-07-11 22:37 ` [RFC PATCH 128/134] hw: Pair object_initialize_child() with plain realize() Alexander Graf
2026-07-11 22:37 ` [RFC PATCH 129/134] hw: Parent board-created CPUs under the machine Alexander Graf
2026-07-13 16:35   ` Bernhard Beschow
2026-07-13 20:01   ` Brian Cain
2026-07-11 22:37 ` [RFC PATCH 130/134] hw/pci-host/versatile: Use object_initialize_child() for pci_dev Alexander Graf
2026-07-11 22:37 ` [RFC PATCH 131/134] docs, qapi, scripts, iotests: Update /machine/unattached path references Alexander Graf
2026-07-11 22:37 ` [RFC PATCH 132/134] qom: Delete /machine/unattached and error on unparented realize Alexander Graf
2026-07-11 22:37 ` [RFC PATCH 133/134] docs/devel/qom: Document the composition-tree parenting contract Alexander Graf
2026-07-11 22:37 ` [RFC PATCH 134/134] MAINTAINERS: Add scripts/coccinelle/qom-parent/ under QOM Alexander Graf
2026-07-12 10:56 ` [RFC PATCH 000/134] qom: Make composition-tree parenting mandatory Bernhard Beschow
2026-07-18 21:34 ` [RFC PATCH v2 000/137] " Alexander Graf
2026-07-18 21:34   ` [RFC PATCH v2 001/137] qom: Introduce object_new_child() Alexander Graf
2026-07-18 21:34   ` [RFC PATCH v2 002/137] qdev: Rename qdev_new()/qdev_try_new() to *_orphan() Alexander Graf
2026-07-18 21:34   ` [RFC PATCH v2 003/137] qdev: Reintroduce qdev_new() with a mandatory QOM parent Alexander Graf
2026-07-18 21:34   ` [RFC PATCH v2 004/137] sysbus: Make sysbus_create_simple()/_varargs() take a " Alexander Graf
2026-07-18 21:34   ` [RFC PATCH v2 005/137] pci: Make pci_new*()/pci_create_simple*() " Alexander Graf
2026-07-18 21:34   ` Alexander Graf [this message]
2026-07-18 21:34   ` [RFC PATCH v2 007/137] i2c: Make i2c_slave_new()/i2c_slave_create_simple() " Alexander Graf
2026-07-18 21:34   ` [RFC PATCH v2 008/137] ssi, usb: Make bus-layer creators " Alexander Graf
2026-07-18 21:34   ` [RFC PATCH v2 009/137] cpu: Make cpu_create() " Alexander Graf
2026-07-18 21:34   ` [RFC PATCH v2 010/137] hw/avr: Give onboard devices " Alexander Graf
2026-07-18 21:34   ` [RFC PATCH v2 011/137] hw/tricore: " Alexander Graf
2026-07-18 21:34   ` [RFC PATCH v2 012/137] hw/xtensa: " Alexander Graf
2026-07-18 21:34   ` [RFC PATCH v2 013/137] hw/alpha: " Alexander Graf
2026-07-18 21:34   ` [RFC PATCH v2 014/137] hw/nitro: " Alexander Graf
2026-07-18 21:34   ` [RFC PATCH v2 015/137] hw/vmapple: " Alexander Graf
2026-07-18 21:34   ` [RFC PATCH v2 016/137] hw/hppa: " Alexander Graf
2026-07-18 21:34   ` [RFC PATCH v2 017/137] hw/microblaze: " Alexander Graf
2026-07-18 21:34   ` [RFC PATCH v2 018/137] hw/sh4: " Alexander Graf
2026-07-18 21:34   ` [RFC PATCH v2 019/137] hw/s390x: " Alexander Graf
2026-07-18 21:34   ` [RFC PATCH v2 020/137] hw/or1k: " Alexander Graf
2026-07-18 21:34   ` [RFC PATCH v2 021/137] hw/loongarch: " Alexander Graf
2026-07-18 21:34   ` [RFC PATCH v2 022/137] hw/intc: " Alexander Graf
2026-07-18 21:34   ` [RFC PATCH v2 023/137] hw/pci-host: " Alexander Graf
2026-07-18 21:34   ` [RFC PATCH v2 024/137] hw/core: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 025/137] hw/remote: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 026/137] hw/ufs: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 027/137] hw/nvme: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 028/137] hw/vfio: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 029/137] hw/mem: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 030/137] hw/cxl: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 031/137] hw/hexagon: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 032/137] hw/xen: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 033/137] hw/display: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 034/137] hw/nvram: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 035/137] hw/dma: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 036/137] hw/misc: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 037/137] hw/scsi: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 038/137] hw/net: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 039/137] hw/ide: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 040/137] hw/i3c: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 041/137] hw/core/sysbus: Skip nested devices in foreach_dynamic_sysbus_device() Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 042/137] hw/pci-bridge: Give onboard devices a QOM parent Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 043/137] hw/sparc64: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 044/137] hw/sparc: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 045/137] hw/m68k: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 046/137] hw/rtc: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 047/137] hw/i2c: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 048/137] hw/block: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 049/137] hw/char: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 050/137] hw/isa: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 051/137] hw/pci: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 052/137] hw/riscv: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 053/137] hw/mips: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 054/137] hw/i386: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 055/137] hw/ppc: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 056/137] hw/pci, hw/isa: Give VGA and slot-NIC helpers " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 057/137] hw/arm/virt: Give onboard devices " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 058/137] hw/arm/sbsa-ref: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 059/137] hw/arm/xilinx-zynq: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 060/137] hw/arm/xlnx-versal, xlnx-zynqmp: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 061/137] hw/arm/realview, integratorcp: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 062/137] hw/arm/npcm: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 063/137] hw/arm/versatile, vexpress: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 064/137] hw/arm/stellaris, musicpal: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 065/137] hw/arm/exynos: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 066/137] hw/arm/allwinner: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 067/137] hw/arm/strongarm: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 068/137] hw/arm/omap: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 069/137] hw/arm/mps2: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 070/137] hw/arm/imx: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 071/137] hw/arm/misc: " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 072/137] hw/arm/aspeed: Give onboard devices a QOM parent (part 1) Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 073/137] hw/arm/aspeed: Give onboard devices a QOM parent (part 2) Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 074/137] hw/nvram/at24c: Give at24c_eeprom_init() a QOM parent Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 075/137] hw/i386/pc: Give pcspk " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 076/137] hw/timer, hw/net: Give i8254 and isa-ne2000 helpers " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 077/137] hw/misc/unimp: Give create_unimplemented_device() " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 078/137] hw/usb: Give -usbdevice and auto-hub devices " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 079/137] hw/audio: Give -audio model= " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 080/137] hw/xen: Give xenstore-driven backend " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 081/137] hw/nitro: Give the vsock bridge " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 082/137] hw/isa: Give the isabus-bridge " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 083/137] net, target/mips: Give -nic and CPU-with-clock helpers " Alexander Graf
2026-07-18 21:35   ` [RFC PATCH v2 084/137] usb, ssi, i2c: Remove *_orphan() creator variants Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 085/137] isa: " Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 086/137] pci: " Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 087/137] cpu: Remove cpu_create_orphan() Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 088/137] sysbus: Remove *_orphan() creator variants Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 089/137] qdev: Remove qdev_new_orphan() and qdev_try_new_orphan() Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 090/137] memory: Accept non-device owners in memory_region_init_ram() Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 091/137] hw/misc-boards: Give memory regions an explicit owner Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 092/137] hw/mips: " Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 093/137] hw/riscv: " Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 094/137] hw/i386: " Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 095/137] hw/arm: " Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 096/137] hw/arm/omap1: " Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 097/137] hw/sh4: " Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 098/137] hw/m68k: " Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 099/137] hw/ppc: " Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 100/137] hw/tricore: " Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 101/137] hw/xtensa: " Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 102/137] hw/display: " Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 103/137] hw/arm/omap: Give lcdc and dma " Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 104/137] hw/char: Give parallel and htif " Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 105/137] hw/remote: Give " Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 106/137] system, backends: Give named " Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 107/137] hw/ide: Let ide_init_ioport() take " Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 108/137] memory: Require an owner for named memory regions Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 109/137] irq: Rename qemu_allocate_irq*() and friends to *_orphan() Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 110/137] irq: Reintroduce qemu_allocate_irq*() with a mandatory owner and name Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 111/137] hw/pci, hw/usb, system: Give allocated IRQs an " Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 112/137] hw/i386, hw/xen: " Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 113/137] hw/arm: " Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 114/137] hw/xtensa: " Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 115/137] hw: " Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 116/137] hw/core: Parent GPIO input IRQs and embedded IRQState via QOM Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 117/137] irq: Delete the *_orphan() IRQ allocation variants Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 118/137] sysbus: Parent main-system-bus directly under /machine Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 119/137] accel: Parent the accelerator singleton " Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 120/137] hw/intc/mips_gic: Register reset handler at realize, not instance_init Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 121/137] hw/core/reset: Give the root reset container and legacy shims a QOM path Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 122/137] system: Parent per-MR helper objects under their owner Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 123/137] hw/virtio, hw/display: Parent per-device helper objects Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 124/137] hw/i386/amd_iommu: Parent internally-created AMDVI-PCI under the IOMMU Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 125/137] hw/s390x, hw/remote: Parent per-devfn IOMMU objects Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 126/137] hw/pci-host/raven: Parent the OR-IRQ under the host bridge Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 127/137] hw/arm/mps2: Parent the OR-IRQ gates under the machine Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 128/137] hw/arm/digic: Parent the DIGIC SoC " Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 129/137] hw/microblaze: Parent the CPU " Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 130/137] hw: Pair object_initialize_child() with plain realize() Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 131/137] hw: Parent board-created CPUs under the machine Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 132/137] hw/pci-host/versatile: Use object_initialize_child() for pci_dev Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 133/137] docs, qapi, scripts, iotests: Update /machine/unattached path references Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 134/137] qom: Delete /machine/unattached and error on unparented realize Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 135/137] tests/qtest/qom-test: Add smp-max init-time ceiling test Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 136/137] docs/devel/qom: Document the composition-tree parenting contract Alexander Graf
2026-07-18 21:36   ` [RFC PATCH v2 137/137] MAINTAINERS: Add scripts/coccinelle/qom-parent/ under QOM Alexander Graf

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=20260718213652.37673-7-graf@amazon.com \
    --to=graf@amazon.com \
    --cc=17746591750@163.com \
    --cc=adityag@linux.ibm.com \
    --cc=aik@ozlabs.ru \
    --cc=alex.bennee@linaro.org \
    --cc=alifm@linux.ibm.com \
    --cc=alistair.francis@wdc.com \
    --cc=alistair@alistair23.me \
    --cc=antonynpavlov@gmail.com \
    --cc=armbru@redhat.com \
    --cc=atar4qemu@gmail.com \
    --cc=balaton@eik.bme.hu \
    --cc=balbi@kernel.org \
    --cc=berrange@redhat.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=brian.cain@oss.qualcomm.com \
    --cc=brueckner@linux.ibm.com \
    --cc=chao.liu@processmission.com \
    --cc=chenhuacai@kernel.org \
    --cc=chigot@adacore.com \
    --cc=clg@kaod.org \
    --cc=deller@gmx.de \
    --cc=dorjoychy111@gmail.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=erdnaxe@crans.org \
    --cc=farman@linux.ibm.com \
    --cc=farosas@suse.de \
    --cc=francisco.iglesias@amd.com \
    --cc=gaurav.sharma_7@nxp.com \
    --cc=ggala@linux.ibm.com \
    --cc=harshpb@linux.ibm.com \
    --cc=hpoussin@reactos.org \
    --cc=jan.kiszka@web.de \
    --cc=jcmvbkbc@gmail.com \
    --cc=joel@jms.id.au \
    --cc=jrossi@linux.ibm.com \
    --cc=kfting@nuvoton.com \
    --cc=konrad.frederic@yahoo.fr \
    --cc=laurent@vivier.eu \
    --cc=manos.pitsidianakis@linaro.org \
    --cc=maobibo@loongson.cn \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=milesg@linux.ibm.com \
    --cc=mjrosato@linux.ibm.com \
    --cc=mrolnik@gmail.com \
    --cc=mst@redhat.com \
    --cc=nieklinnenbank@gmail.com \
    --cc=npiggin@gmail.com \
    --cc=palmer@dabbelt.com \
    --cc=pasic@linux.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=peterx@redhat.com \
    --cc=philmd@mailo.com \
    --cc=philmd@oss.qualcomm.com \
    --cc=pierrick.bouvier@oss.qualcomm.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=sai.pavan.boddu@amd.com \
    --cc=sam@rfc1149.net \
    --cc=shentey@gmail.com \
    --cc=shorne@gmail.com \
    --cc=slp@redhat.com \
    --cc=sundeep.lkml@gmail.com \
    --cc=th.huth+qemu@posteo.eu \
    --cc=wangran@bosc.ac.cn \
    --cc=wuhaotsh@google.com \
    /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