Skip to content

RFC qom: Make composition-tree parenting mandatory

Alexander Graf qemu-arm qemu-devel qemu-riscv 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 RFC Latest137 patches 0 repliesNew
  2. v1 RFC134 patches 22 repliesSuperseded

Changes in v2 from the cover letter

--------------------

- Rebased onto v11.1.0-rc0 (eca2c16212).
- object_new_child() (patch 001): drop the runtime g_assert(parent) and g_assert(id), annotate the prototype with __attribute__((nonnull(1,2,3), returns_nonnull)) instead (Richard, Peter). Add g_assert(id[0] && !strchr(id, '/')) to reject empty names and the QOM path separator; the qdev id_wellformed() grammar does not apply here since QOM child<> names legitimately use "[*]" (Daniel, Peter).
- sysbus_create_simple()/_varargs() (patch 004): add a doc-comment note that new code should prefer qdev_new() + sysbus_realize() (Philippe).
- hw/display (patch 101): preserve the "vmsvga.fifo" RAMBlock idstr as described above (Bernhard, Thomas).
- Every hw/<arch> "Give memory regions an explicit owner" commit now states in its message that RAMBlock idstrs are unchanged and why.
- Collected 14 Reviewed-by and 1 Acked-by tags from v1. The four scoped tags (imx-only on 094, coldfire/next-cube-only on 097, hexagon-only and e500-only on 129) are carried with a "# scope" suffix rather than splitting the patches; the migration analysis above shows the remaining hunks in those patches are also safe.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/137qom: Introduce object_new_child()include/qom/object.h qom/object.c+44 -00 replies
2/137qdev: Rename qdev_new()/qdev_try_new() to *_orphan()hw/alpha/typhoon.c hw/arm/aspeed.c hw/arm/aspeed_soc_common.c +167 more+459 -4410 replies
3/137qdev: Reintroduce qdev_new() with a mandatory QOM parenthw/core/qdev.c include/hw/core/qdev.h+54 -00 replies
4/137sysbus: Make sysbus_create_simple()/_varargs() take a QOM parenthw/arm/allwinner-h3.c hw/arm/collie.c hw/arm/exynos4210.c +39 more+210 -1310 replies
5/137pci: Make pci_new*()/pci_create_simple*() take a QOM parenthw/alpha/dp264.c hw/arm/realview.c hw/arm/sbsa-ref.c +37 more+157 -780 replies
6/137isa: Make isa_new()/isa_try_new()/isa_create_simple() take a QOM parenthw/alpha/dp264.c hw/char/parallel-isa.c hw/char/serial-isa.c +19 more+91 -460 replies
7/137i2c: Make i2c_slave_new()/i2c_slave_create_simple() take a QOM parenthw/arm/aspeed.c hw/arm/aspeed_ast1040_evb.c hw/arm/aspeed_ast10x0_evb.c +41 more+260 -1920 replies
8/137ssi, usb: Make bus-layer creators take a QOM parenthw/arm/stellaris.c hw/hppa/machine.c hw/mips/loongson3_virt.c +10 more+64 -190 replies
9/137cpu: Make cpu_create() take a QOM parentbsd-user/main.c hw/alpha/dp264.c hw/arm/musicpal.c +26 more+67 -290 replies
10/137hw/avr: Give onboard devices a QOM parenthw/avr/atmega.c+2 -20 replies
11/137hw/tricore: Give onboard devices a QOM parenthw/tricore/tricore_testboard.c+5 -20 replies
12/137hw/xtensa: Give onboard devices a QOM parenthw/xtensa/sim.c hw/xtensa/virt.c hw/xtensa/xtfpga.c+11 -80 replies
13/137hw/alpha: Give onboard devices a QOM parenthw/alpha/alpha_sys.h hw/alpha/dp264.c hw/alpha/typhoon.c+12 -90 replies
14/137hw/nitro: Give onboard devices a QOM parenthw/nitro/machine.c+5 -40 replies
15/137hw/vmapple: Give onboard devices a QOM parenthw/vmapple/vmapple.c+31 -280 replies
16/137hw/hppa: Give onboard devices a QOM parenthw/hppa/machine.c+33 -270 replies
17/137hw/microblaze: Give onboard devices a QOM parenthw/microblaze/petalogix_ml605_mmu.c hw/microblaze/petalogix_s3adsp1800_mmu.c+20 -240 replies
18/137hw/sh4: Give onboard devices a QOM parenthw/sh4/r2d.c hw/sh4/sh7750.c include/hw/sh4/sh.h+19 -150 replies
19/137hw/s390x: Give onboard devices a QOM parenthw/s390x/ap-bridge.c hw/s390x/css-bridge.c hw/s390x/s390-pci-bus.c +1 more+14 -200 replies
20/137hw/or1k: Give onboard devices a QOM parenthw/or1k/or1k-sim.c hw/or1k/virt.c+32 -220 replies
21/137hw/loongarch: Give onboard devices a QOM parenthw/loongarch/virt.c+21 -270 replies
22/137hw/intc: Give onboard devices a QOM parenthw/hppa/machine.c hw/i386/isapc.c hw/i386/kvm/i8259.c +36 more+146 -1110 replies
23/137hw/pci-host: Give onboard devices a QOM parenthw/mips/fuloong2e.c hw/pci-host/articia.c hw/pci-host/astro.c +14 more+44 -340 replies
24/137hw/core: Give onboard devices a QOM parenthw/core/null-machine.c+1 -10 replies
25/137hw/remote: Give onboard devices a QOM parenthw/remote/machine.c+2 -20 replies
26/137hw/ufs: Give onboard devices a QOM parenthw/ufs/lu.c+2 -30 replies
27/137hw/nvme: Give onboard devices a QOM parenthw/nvme/ctrl.c+1 -10 replies
28/137hw/vfio: Give onboard devices a QOM parenthw/vfio/igd.c+3 -20 replies
29/137hw/mem: Give onboard devices a QOM parenthw/mem/sparse-mem.c include/hw/mem/sparse-mem.h tests/qtest/fuzz/generic_fuzz.c+5 -50 replies
30/137hw/cxl: Give onboard devices a QOM parenthw/cxl/cxl-host.c+5 -40 replies
31/137hw/hexagon: Give onboard devices a QOM parenthw/hexagon/hexagon_dsp.c hw/hexagon/virt.c+12 -160 replies
32/137hw/xen: Give onboard devices a QOM parenthw/xen/xen-bus.c hw/xen/xen-legacy-backend.c hw/xen/xen-pvh-common.c +1 more+12 -80 replies
33/137hw/display: Give onboard devices a QOM parenthw/display/sii9022.c hw/display/sm501.c hw/display/xlnx_dp.c+6 -140 replies
34/137hw/nvram: Give onboard devices a QOM parenthw/nvram/fw_cfg.c+6 -100 replies
35/137hw/dma: Give onboard devices a QOM parenthw/dma/i8257.c hw/dma/rc4030.c hw/mips/jazz.c +1 more+11 -110 replies
36/137hw/misc: Give onboard devices a QOM parenthw/m68k/next-cube.c hw/misc/empty_slot.c hw/misc/led.c +10 more+33 -290 replies
37/137hw/scsi: Give onboard devices a QOM parenthw/hppa/machine.c hw/ppc/spapr.c hw/scsi/lasi_ncr710.c +6 more+26 -250 replies
38/137hw/net: Give onboard devices a QOM parenthw/arm/integratorcp.c hw/arm/kzm.c hw/arm/mps2.c +11 more+21 -210 replies
39/137hw/ide: Give onboard devices a QOM parenthw/i386/isapc.c hw/ide/ide-bus.c hw/ide/isa.c +1 more+11 -70 replies
40/137hw/i3c: Give onboard devices a QOM parenthw/i3c/core.c include/hw/i3c/i3c.h+17 -110 replies
41/137hw/core/sysbus: Skip nested devices in foreach_dynamic_sysbus_device()hw/core/sysbus.c+9 -10 replies
42/137hw/pci-bridge: Give onboard devices a QOM parenthw/pci-bridge/pci_expander_bridge.c+7 -60 replies
43/137hw/sparc64: Give onboard devices a QOM parenthw/sparc64/sun4u.c+31 -290 replies
44/137hw/sparc: Give onboard devices a QOM parenthw/sparc/leon3.c hw/sparc/sun4m.c+85 -790 replies
45/137hw/m68k: Give onboard devices a QOM parenthw/m68k/an5206.c hw/m68k/mcf5208.c hw/m68k/mcf_intc.c +4 more+35 -320 replies
46/137hw/rtc: Give onboard devices a QOM parenthw/alpha/dp264.c hw/i386/microvm.c hw/mips/jazz.c +6 more+14 -130 replies
47/137hw/i2c: Give onboard devices a QOM parenthw/arm/aspeed_ast1040_evb.c hw/arm/aspeed_ast10x0_evb.c hw/arm/aspeed_ast2400_palmetto.c +16 more+30 -260 replies
48/137hw/block: Give onboard devices a QOM parenthw/arm/collie.c hw/arm/digic_boards.c hw/arm/musicpal.c +17 more+41 -350 replies
49/137hw/char: Give onboard devices a QOM parenthw/arm/allwinner-a10.c hw/arm/allwinner-h3.c hw/arm/allwinner-r40.c +63 more+152 -1390 replies
50/137hw/isa: Give onboard devices a QOM parenthw/isa/i82378.c hw/isa/isa-superio.c+13 -180 replies
51/137hw/pci: Give onboard devices a QOM parenthw/pci/pcie_sriov.c+2 -30 replies
52/137hw/riscv: Give onboard devices a QOM parenthw/riscv/boston-aia.c hw/riscv/microblaze-v-generic.c hw/riscv/microchip_pfsoc.c +3 more+49 -540 replies
53/137hw/mips: Give onboard devices a QOM parenthw/mips/boston.c hw/mips/fuloong2e.c hw/mips/jazz.c +2 more+56 -480 replies
54/137hw/i386: Give onboard devices a QOM parenthw/char/xen_console.c hw/i386/isapc.c hw/i386/kvm/clock.c +21 more+98 -870 replies
55/137hw/ppc: Give onboard devices a QOM parenthw/ppc/amigaone.c hw/ppc/e500.c hw/ppc/mac_newworld.c +13 more+186 -1750 replies
56/137hw/pci, hw/isa: Give VGA and slot-NIC helpers a QOM parenthw/alpha/dp264.c hw/i386/isapc.c hw/i386/pc.c +18 more+43 -420 replies
57/137hw/arm/virt: Give onboard devices a QOM parenthw/arm/virt.c+40 -450 replies
58/137hw/arm/sbsa-ref: Give onboard devices a QOM parenthw/arm/sbsa-ref.c+36 -460 replies
59/137hw/arm/xilinx-zynq: Give onboard devices a QOM parenthw/arm/xilinx_zynq.c+50 -420 replies
60/137hw/arm/xlnx-versal, xlnx-zynqmp: Give onboard devices a QOM parenthw/arm/xlnx-versal-virt.c hw/arm/xlnx-versal.c hw/arm/xlnx-zcu102.c +1 more+98 -1240 replies
61/137hw/arm/realview, integratorcp: Give onboard devices a QOM parenthw/arm/integratorcp.c hw/arm/realview.c+76 -560 replies
62/137hw/arm/npcm: Give onboard devices a QOM parenthw/arm/npcm7xx.c hw/arm/npcm7xx_boards.c hw/arm/npcm8xx_boards.c+77 -510 replies
63/137hw/arm/versatile, vexpress: Give onboard devices a QOM parenthw/arm/versatilepb.c hw/arm/vexpress.c+72 -640 replies
64/137hw/arm/stellaris, musicpal: Give onboard devices a QOM parenthw/arm/musicpal.c hw/arm/stellaris.c+53 -560 replies
65/137hw/arm/exynos: Give onboard devices a QOM parenthw/arm/exynos4210.c+34 -260 replies
66/137hw/arm/allwinner: Give onboard devices a QOM parenthw/arm/allwinner-h3.c hw/arm/bananapi_m2u.c hw/arm/cubieboard.c +1 more+24 -160 replies
67/137hw/arm/strongarm: Give onboard devices a QOM parenthw/arm/collie.c hw/arm/strongarm.c hw/arm/strongarm.h+17 -160 replies
68/137hw/arm/omap: Give onboard devices a QOM parenthw/arm/omap1.c+14 -140 replies
69/137hw/arm/mps2: Give onboard devices a QOM parenthw/arm/mps2-tz.c hw/arm/mps2.c+14 -120 replies
70/137hw/arm/imx: Give onboard devices a QOM parenthw/arm/fsl-imx6.c hw/arm/imx25_pdk.c hw/arm/imx8mm-evk.c +4 more+15 -130 replies
71/137hw/arm/misc: Give onboard devices a QOM parenthw/arm/max78000fthr.c hw/arm/msf2-som.c hw/arm/netduino2.c +4 more+17 -220 replies
72/137hw/arm/aspeed: Give onboard devices a QOM parent (part 1)hw/arm/aspeed.c hw/arm/aspeed_ast1040_evb.c hw/arm/aspeed_ast10x0_evb.c +20 more+167 -1160 replies
73/137hw/arm/aspeed: Give onboard devices a QOM parent (part 2)hw/arm/aspeed_ast2600_anacapa.c hw/arm/aspeed_ast2600_catalina.c hw/arm/aspeed_ast2600_fuji.c +1 more+155 -1080 replies
74/137hw/nvram/at24c: Give at24c_eeprom_init() a QOM parenthw/arm/aspeed_ast2500_tiogapass.c hw/arm/aspeed_ast2500_yosemitev2.c hw/arm/aspeed_ast2600_anacapa.c +9 more+94 -900 replies
75/137hw/i386/pc: Give pcspk a QOM parenthw/i386/pc.c+2 -120 replies
76/137hw/timer, hw/net: Give i8254 and isa-ne2000 helpers a QOM parenthw/i386/microvm.c hw/i386/pc.c hw/isa/i82378.c +6 more+20 -240 replies
77/137hw/misc/unimp: Give create_unimplemented_device() a QOM parenthw/arm/allwinner-a10.c hw/arm/allwinner-h3.c hw/arm/allwinner-r40.c +33 more+557 -5430 replies
78/137hw/usb: Give -usbdevice and auto-hub devices a QOM parenthw/usb/bus.c hw/usb/dev-serial.c+12 -60 replies
79/137hw/audio: Give -audio model= devices a QOM parenthw/audio/intel-hda.c hw/audio/model.c+5 -40 replies
80/137hw/xen: Give xenstore-driven backend devices a QOM parenthw/block/xen-block.c hw/char/xen_console.c hw/net/xen_nic.c+9 -60 replies
81/137hw/nitro: Give the vsock bridge a QOM parenthw/nitro/machine.c hw/nitro/nitro-vsock-bus.c include/hw/nitro/nitro-vsock-bus.h+6 -70 replies
82/137hw/isa: Give the isabus-bridge a QOM parenthw/hppa/machine.c hw/i386/isapc.c hw/i386/microvm.c +4 more+19 -160 replies
83/137net, target/mips: Give -nic and CPU-with-clock helpers a QOM parentbsd-user/main.c hw/arm/exynos4_boards.c hw/hppa/machine.c +17 more+44 -460 replies
84/137usb, ssi, i2c: Remove *_orphan() creator variantshw/i2c/core.c hw/ssi/ssi.c include/hw/i2c/i2c.h +2 more+6 -650 replies
85/137isa: Remove *_orphan() creator variantshw/isa/isa-bus.c include/hw/isa/isa.h+0 -220 replies
86/137pci: Remove *_orphan() creator variantshw/pci/pci.c include/hw/pci/pci.h+0 -400 replies
87/137cpu: Remove cpu_create_orphan()hw/core/cpu-common.c include/hw/core/cpu.h+0 -220 replies
88/137sysbus: Remove *_orphan() creator variantshw/core/sysbus.c include/hw/core/sysbus.h+0 -400 replies
89/137qdev: Remove qdev_new_orphan() and qdev_try_new_orphan()hw/core/qdev.c include/hw/core/qdev.h system/qdev-monitor.c+4 -410 replies
90/137memory: Accept non-device owners in memory_region_init_ram()system/memory.c+9 -80 replies
91/137hw/misc-boards: Give memory regions an explicit ownerhw/hexagon/hexagon_dsp.c hw/hexagon/virt.c hw/hppa/machine.c +14 more+39 -380 replies
92/137hw/mips: Give memory regions an explicit ownerhw/mips/boston.c hw/mips/fuloong2e.c hw/mips/jazz.c +2 more+22 -220 replies
93/137hw/riscv: Give memory regions an explicit ownerhw/riscv/boston-aia.c hw/riscv/microblaze-v-generic.c hw/riscv/microchip_pfsoc.c +4 more+18 -180 replies
94/137hw/i386: Give memory regions an explicit ownerhw/i386/microvm.c hw/i386/pc.c hw/i386/pc_piix.c +6 more+24 -220 replies
95/137hw/arm: Give memory regions an explicit ownerhw/arm/armsse.c hw/arm/aspeed.c hw/arm/aspeed_soc_common.c +29 more+83 -800 replies
96/137hw/arm/omap1: Give memory regions an explicit ownerhw/arm/omap1.c+94 -810 replies
97/137hw/sh4: Give memory regions an explicit ownerhw/intc/sh_intc.c hw/sh4/r2d.c hw/sh4/sh7750.c +3 more+35 -300 replies
98/137hw/m68k: Give memory regions an explicit ownerhw/m68k/an5206.c hw/m68k/mcf5206.c hw/m68k/mcf5208.c +2 more+20 -190 replies
99/137hw/ppc: Give memory regions an explicit ownerhw/ppc/amigaone.c hw/ppc/mac_newworld.c hw/ppc/mac_oldworld.c +7 more+33 -330 replies
100/137hw/tricore: Give memory regions an explicit ownerhw/tricore/tc27x_soc.c hw/tricore/tricore_testboard.c+45 -440 replies
101/137hw/xtensa: Give memory regions an explicit ownerhw/xtensa/mx_pic.c hw/xtensa/sim.c hw/xtensa/xtensa_memory.c +3 more+32 -270 replies
102/137hw/display: Give memory regions an explicit ownerhw/display/cg3.c hw/display/g364fb.c hw/display/virtio-gpu-gl.c +1 more+13 -50 replies
103/137hw/arm/omap: Give lcdc and dma memory regions an explicit ownerhw/arm/omap1.c hw/display/omap_lcdc.c hw/dma/omap_dma.c +1 more+10 -80 replies
104/137hw/char: Give parallel and htif memory regions an explicit ownerhw/char/parallel.c hw/char/riscv_htif.c hw/hppa/machine.c +4 more+15 -100 replies
105/137hw/remote: Give memory regions an explicit ownerhw/remote/machine.c hw/remote/memory.c hw/remote/vfio-user-obj.c+4 -30 replies
106/137system, backends: Give named memory regions an explicit ownerbackends/igvm.c system/physmem.c+6 -40 replies
107/137hw/ide: Let ide_init_ioport() take an explicit ownerhw/ide/ide-internal.h hw/ide/ioport.c hw/ide/isa.c +1 more+29 -140 replies
108/137memory: Require an owner for named memory regionssystem/ioport.c system/memory.c+5 -90 replies
109/137irq: Rename qemu_allocate_irq*() and friends to *_orphan()hw/alpha/typhoon.c hw/arm/armsse.c hw/arm/exynos4_boards.c +45 more+91 -760 replies
110/137irq: Reintroduce qemu_allocate_irq*() with a mandatory owner and namehw/core/irq.c include/hw/core/irq.h+59 -10 replies
111/137hw/pci, hw/usb, system: Give allocated IRQs an owner and namehw/pci/pci.c hw/usb/vt82c686-uhci-pci.c system/qtest.c+4 -40 replies
112/137hw/i386, hw/xen: Give allocated IRQs an owner and namehw/i386/isapc.c hw/i386/kvm/i8259.c hw/i386/microvm.c +9 more+21 -200 replies
113/137hw/arm: Give allocated IRQs an owner and namehw/arm/armsse.c hw/arm/exynos4_boards.c hw/arm/mps2-tz.c +6 more+44 -270 replies
114/137hw/xtensa: Give allocated IRQs an owner and namehw/xtensa/mx_pic.c hw/xtensa/pic_cpu.c hw/xtensa/xtfpga.c +1 more+7 -60 replies
115/137hw: Give allocated IRQs an owner and namehw/alpha/typhoon.c hw/char/diva-gsp.c hw/display/macfb.c +22 more+42 -300 replies
116/137hw/core: Parent GPIO input IRQs and embedded IRQState via QOMhw/core/gpio.c hw/core/qdev.c hw/ipack/ipack.c +5 more+25 -280 replies
117/137irq: Delete the *_orphan() IRQ allocation variantshw/core/irq.c include/hw/core/irq.h+1 -540 replies
118/137sysbus: Parent main-system-bus directly under /machinesystem/vl.c+1 -10 replies
119/137accel: Parent the accelerator singleton under /machineaccel/accel-system.c+3 -10 replies
120/137hw/intc/mips_gic: Register reset handler at realize, not instance_inithw/intc/mips_gic.c+1 -10 replies
121/137hw/core/reset: Give the root reset container and legacy shims a QOM pathhw/core/reset.c+9 -40 replies
122/137system: Parent per-MR helper objects under their ownersystem/ioport.c system/ram-block-attributes.c+7 -50 replies
123/137hw/virtio, hw/display: Parent per-device helper objectshw/display/vhost-user-gpu.c hw/virtio/virtio-mem.c+9 -80 replies
124/137hw/i386/amd_iommu: Parent internally-created AMDVI-PCI under the IOMMUhw/i386/amd_iommu.c+2 -10 replies
125/137hw/s390x, hw/remote: Parent per-devfn IOMMU objectshw/remote/iommu.c hw/s390x/s390-pci-bus.c+11 -50 replies
126/137hw/pci-host/raven: Parent the OR-IRQ under the host bridgehw/pci-host/raven.c+2 -10 replies
127/137hw/arm/mps2: Parent the OR-IRQ gates under the machinehw/arm/mps2.c+5 -40 replies
128/137hw/arm/digic: Parent the DIGIC SoC under the machinehw/arm/digic_boards.c+2 -10 replies
129/137hw/microblaze: Parent the CPU under the machinehw/microblaze/petalogix_ml605_mmu.c hw/microblaze/petalogix_s3adsp1800_mmu.c+4 -20 replies
130/137hw: Pair object_initialize_child() with plain realize()hw/arm/imx8mm-evk.c hw/arm/imx8mp-evk.c hw/arm/mps2.c +8 more+13 -130 replies
131/137hw: Parent board-created CPUs under the machinehw/arm/integratorcp.c hw/arm/mps3r.c hw/arm/realview.c +19 more+62 -470 replies
132/137hw/pci-host/versatile: Use object_initialize_child() for pci_devhw/pci-host/versatile.c+2 -10 replies
133/137docs, qapi, scripts, iotests: Update /machine/unattached path referencesdocs/devel/s390-cpu-topology.rst docs/system/cpu-hotplug.rst qapi/block-core.json +8 more+62 -630 replies
134/137qom: Delete /machine/unattached and error on unparented realizehw/core/qdev-user.c hw/core/qdev.c hw/i386/pc.c +4 more+18 -510 replies
135/137tests/qtest/qom-test: Add smp-max init-time ceiling testtests/qtest/qom-test.c+35 -00 replies
136/137docs/devel/qom: Document the composition-tree parenting contractdocs/devel/qom.rst+96 -00 replies
137/137MAINTAINERS: Add scripts/coccinelle/qom-parent/ under QOMMAINTAINERS+1 -00 replies

Reviews trailers per patch

14 of 137 patches have a Reviewed-by or Acked-by.

PatchRichard HendersonPhilippe Mathieu-DaudéBernhard BeschowThomas HuthBrian Cain
1/137R-b
2/137R-b
3/137R-b
4/137R-b
5/137
6/137
7/137
8/137
9/137
10/137R-b
11/137
12/137
13/137
14/137R-b
15/137
16/137
17/137
18/137
19/137
20/137
21/137
22/137
23/137
24/137
25/137
26/137
27/137
28/137
29/137
30/137
31/137
32/137
33/137R-b
34/137
35/137
36/137
37/137
38/137
39/137
40/137
41/137
42/137
43/137
44/137
45/137
46/137
47/137
48/137
49/137
50/137
51/137
52/137
53/137
54/137
55/137
56/137
57/137
58/137
59/137
60/137
61/137
62/137
63/137
64/137
65/137
66/137
67/137
68/137
69/137
70/137
71/137
72/137
73/137
74/137
75/137R-b
76/137
77/137
78/137
79/137
80/137
81/137
82/137
83/137
84/137
85/137R-b
86/137R-b
87/137
88/137R-b
89/137
90/137
91/137
92/137
93/137
94/137
95/137R-b
96/137
97/137
98/137R-b
99/137
100/137
101/137
102/137
103/137
104/137
105/137
106/137
107/137
108/137
109/137
110/137
111/137
112/137
113/137
114/137
115/137
116/137
117/137
118/137
119/137
120/137
121/137
122/137
123/137
124/137
125/137
126/137
127/137
128/137
129/137
130/137
131/137A-b R-b
132/137
133/137
134/137
135/137
136/137
137/137

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v2 thread

Cover letter [RFC PATCH v2 000/137] qom: Make composition-tree parenting mandatory

Every board-created device, memory region and IRQ in QEMU that isn't explicitly parented today ends up in /machine/unattached with an unstable device[N] name. This series makes composition-tree parenting mandatory: it introduces object_new_child() and per-bus qdev_new()/pci_new()/... variants that take a QOM parent + child<> name, converts every board and device that used the old API, gives every named MemoryRegion and IRQ an explicit owner, and finally removes the /machine/unattached fallback so device_set_realized() errors when a device has no QOM parent.

This is v2 of the RFC posted at [1].

RAMBlock idstrs and migration compatibility
--------------------------------------------

Bernhard and Thomas raised the concern that giving a MemoryRegion an owner changes its RAMBlock idstr and thus breaks cross-version migration on versioned machine types. Tracing the derivation:

idstr = [qdev_get_dev_path(dev) "/"] mr->name

where dev = object_dynamic_cast(owner, TYPE_DEVICE) (patch 089 already made this dynamic). qdev_get_dev_path() returns non-NULL only when the device's parent bus class implements .get_dev_path -- SysBus does not; PCI and several other bus classes (spapr-vio, virtual-css, USB, virtio, NuBus, VMBus, ...) do. So converting owner from NULL to a Machine or a SysBus device leaves the idstr unchanged. Only NULL to a device on one of those bus classes changes it.

Auditing all 78 NULL->owner RAM/ROM conversions on versioned machines (pc-*, q35-*, virt-*, pseries-*, s390-ccw-virtio-*, q800), exactly one is affected: hw/display/vmware_vga.c "vmsvga.fifo", whose owner becomes a PCI device. Patch 101 now uses the _nomigrate variant plus an explicit vmstate_register_ram_global() there, so the QOM owner is the PCI device but the migration idstr stays the historical bare "vmsvga.fifo".

To answer Bernhard's follow-up question directly: QOM canonical paths themselves are not part of the migration stream. Only RAMBlock idstrs and vmstate instance_ids are, and neither derives from the QOM canonical path -- idstrs go through the bus-class .get_dev_path hook as above, and CPU/device instance_ids come from cpu_index or qdev_set_legacy_instance_id().

Verified with -dump-vmstate and 'info ramblock' diffs between v11.1.0-rc0 and this branch on pc-i440fx-11.0/9.0, pc-q35-11.0/9.0 (with and without -device vmware-svga), virt-11.0/9.0, pseries-11.0, s390-ccw-virtio-11.0 and q800: all identical.

Changes since RFC v1
--------------------

- Rebased onto v11.1.0-rc0 (eca2c16212).
- object_new_child() (patch 001): drop the runtime g_assert(parent) and g_assert(id), annotate the prototype with __attribute__((nonnull(1,2,3), returns_nonnull)) instead (Richard, Peter). Add g_assert(id[0] && !strchr(id, '/')) to reject empty names and the QOM path separator; the qdev id_wellformed() grammar does not apply here since QOM child<> names legitimately use "[*]" (Daniel, Peter).
- sysbus_create_simple()/_varargs() (patch 004): add a doc-comment note that new code should prefer qdev_new() + sysbus_realize() (Philippe).
- hw/display (patch 101): preserve the "vmsvga.fifo" RAMBlock idstr as described above (Bernhard, Thomas).
- Every hw/<arch> "Give memory regions an explicit owner" commit now states in its message that RAMBlock idstrs are unchanged and why.
- Collected 14 Reviewed-by and 1 Acked-by tags from v1. The four scoped tags (imx-only on 094, coldfire/next-cube-only on 097, hexagon-only and e500-only on 129) are carried with a "# scope" suffix rather than splitting the patches; the migration analysis above shows the remaining hunks in those patches are also safe.

On the argument order of object_new_child(parent, id, typename):
kept as-is for consistency with object_initialize_child() and object_property_add_child(), which both take (parent, name, ...) first (Bernhard).

Structure
---------

001-009 Core: object_new_child() and per-bus qdev/pci/isa/i2c/
ssi/usb/cpu creators taking (parent, id, ...)
010-082 hw/*: convert every board's *_orphan() call sites, one
subdirectory per commit with a per-callsite rationale table
083-088 Delete *_orphan() device-creator variants; make
memory_region_register_ram() dynamic-cast the owner
089-107 hw/*: give every named MemoryRegion an explicit owner;

           assert !name || owner in memory_region_do_init()

108-116 IRQ: qemu_allocate_irq*() take (owner, name, ...); convert
callers; delete _orphan() variants
117-130 Non-device singletons (sysbus root, reset container,
accel, per-devfn IOMMUs, board-created CPUs, ...)
131-132 Update in-tree /machine/unattached consumers; delete the
/machine/unattached container and error on unparented realize
133-134 docs/devel/qom.rst; MAINTAINERS

Not converted in this series
----------------------------

TYPE_MIGRATION (a never-realized pseudo-DeviceState used only for -global), RamDiscardManager (unref'd from within MemoryRegion finalize), TPM backends and VFIO containers (both belong under /objects and have their own lifecycle). These are noted as follow-ups.

Testing
-------

Builds cleanly for 20 softmmu targets. Every machine of every target boots to -S under qtest with no aborts. qtest-*/qom-test, qtest-*/device-introspect-test and qtest-*/test-hmp pass on all 20 targets. info qom-tree on q35 and aarch64 virt shows no /machine/unattached. -dump-vmstate and info ramblock are identical to the base on all versioned machines listed above. checkpatch reports three pre-existing false positives.

AI assistance disclosure
------------------------

This series was developed with substantial AI assistance (Kiro, an Amazon-internal agent built on Anthropic Claude). Every patch carries an AI-used-for: tag per the convention proposed in [2]. That proposal is not yet merged; the in-tree policy still declines AI-assisted contributions, so I am posting this as an RFC under the "large-scale changes / get in touch beforehand" experiment path for design review only. Where possible the conversion is scripted (scripts/coccinelle/qom-parent/); the AI was used to drive the non-mechanical residue. I have reviewed and take DCO responsibility for every change.

[1] https://lore.kernel.org/qemu-devel/[email protected]/
[2] https://lore.kernel.org/qemu-devel/[email protected]/

Cc Laurent Vivier <[email protected]>
Cc Peter Xu <[email protected]>
Cc Fabiano Rosas <[email protected]>

Alexander Graf (137):
qom: Introduce object_new_child()
qdev: Rename qdev_new()/qdev_try_new() to *_orphan()
qdev: Reintroduce qdev_new() with a mandatory QOM parent
sysbus: Make sysbus_create_simple()/_varargs() take a QOM parent
pci: Make pci_new*()/pci_create_simple*() take a QOM parent
isa: Make isa_new()/isa_try_new()/isa_create_simple() take a QOM
parent
i2c: Make i2c_slave_new()/i2c_slave_create_simple() take a QOM parent ssi, usb: Make bus-layer creators take a QOM parent
cpu: Make cpu_create() take a QOM parent
hw/avr: Give onboard devices a QOM parent
hw/tricore: Give onboard devices a QOM parent
hw/xtensa: Give onboard devices a QOM parent
hw/alpha: Give onboard devices a QOM parent
hw/nitro: Give onboard devices a QOM parent
hw/vmapple: Give onboard devices a QOM parent
hw/hppa: Give onboard devices a QOM parent
hw/microblaze: Give onboard devices a QOM parent
hw/sh4: Give onboard devices a QOM parent
hw/s390x: Give onboard devices a QOM parent
hw/or1k: Give onboard devices a QOM parent
hw/loongarch: Give onboard devices a QOM parent
hw/intc: Give onboard devices a QOM parent
hw/pci-host: Give onboard devices a QOM parent
hw/core: Give onboard devices a QOM parent
hw/remote: Give onboard devices a QOM parent
hw/ufs: Give onboard devices a QOM parent
hw/nvme: Give onboard devices a QOM parent
hw/vfio: Give onboard devices a QOM parent
hw/mem: Give onboard devices a QOM parent
hw/cxl: Give onboard devices a QOM parent
hw/hexagon: Give onboard devices a QOM parent
hw/xen: Give onboard devices a QOM parent
hw/display: Give onboard devices a QOM parent
hw/nvram: Give onboard devices a QOM parent
hw/dma: Give onboard devices a QOM parent
hw/misc: Give onboard devices a QOM parent
hw/scsi: Give onboard devices a QOM parent
hw/net: Give onboard devices a QOM parent
hw/ide: Give onboard devices a QOM parent
hw/i3c: Give onboard devices a QOM parent
hw/core/sysbus: Skip nested devices in foreach_dynamic_sysbus_device() hw/pci-bridge: Give onboard devices a QOM parent hw/sparc64: Give onboard devices a QOM parent
hw/sparc: Give onboard devices a QOM parent
hw/m68k: Give onboard devices a QOM parent
hw/rtc: Give onboard devices a QOM parent
hw/i2c: Give onboard devices a QOM parent
hw/block: Give onboard devices a QOM parent
hw/char: Give onboard devices a QOM parent
hw/isa: Give onboard devices a QOM parent
hw/pci: Give onboard devices a QOM parent
hw/riscv: Give onboard devices a QOM parent
hw/mips: Give onboard devices a QOM parent
hw/i386: Give onboard devices a QOM parent
hw/ppc: Give onboard devices a QOM parent
hw/pci, hw/isa: Give VGA and slot-NIC helpers a QOM parent hw/arm/virt: Give onboard devices a QOM parent hw/arm/sbsa-ref: Give onboard devices a QOM parent hw/arm/xilinx-zynq: Give onboard devices a QOM parent hw/arm/xlnx-versal, xlnx-zynqmp: Give onboard devices a QOM parent hw/arm/realview, integratorcp: Give onboard devices a QOM parent hw/arm/npcm: Give onboard devices a QOM parent hw/arm/versatile, vexpress: Give onboard devices a QOM parent hw/arm/stellaris, musicpal: Give onboard devices a QOM parent hw/arm/exynos: Give onboard devices a QOM parent hw/arm/allwinner: Give onboard devices a QOM parent hw/arm/strongarm: Give onboard devices a QOM parent hw/arm/omap: Give onboard devices a QOM parent hw/arm/mps2: Give onboard devices a QOM parent
hw/arm/imx: Give onboard devices a QOM parent
hw/arm/misc: Give onboard devices a QOM parent hw/arm/aspeed: Give onboard devices a QOM parent (part 1) hw/arm/aspeed: Give onboard devices a QOM parent (part 2) hw/nvram/at24c: Give at24c_eeprom_init() a QOM parent hw/i386/pc: Give pcspk a QOM parent
hw/timer, hw/net: Give i8254 and isa-ne2000 helpers a QOM parent hw/misc/unimp: Give create_unimplemented_device() a QOM parent hw/usb: Give -usbdevice and auto-hub devices a QOM parent hw/audio: Give -audio model= devices a QOM parent
hw/xen: Give xenstore-driven backend devices a QOM parent hw/nitro: Give the vsock bridge a QOM parent
hw/isa: Give the isabus-bridge a QOM parent
net, target/mips: Give -nic and CPU-with-clock helpers a QOM parent usb, ssi, i2c: Remove *_orphan() creator variants
isa: Remove *_orphan() creator variants
pci: Remove *_orphan() creator variants
cpu: Remove cpu_create_orphan()
sysbus: Remove *_orphan() creator variants
qdev: Remove qdev_new_orphan() and qdev_try_new_orphan()
memory: Accept non-device owners in memory_region_init_ram() hw/misc-boards: Give memory regions an explicit owner hw/mips: Give memory regions an explicit owner
hw/riscv: Give memory regions an explicit owner
hw/i386: Give memory regions an explicit owner
hw/arm: Give memory regions an explicit owner hw/arm/omap1: Give memory regions an explicit owner hw/sh4: Give memory regions an explicit owner
hw/m68k: Give memory regions an explicit owner
hw/ppc: Give memory regions an explicit owner
hw/tricore: Give memory regions an explicit owner hw/xtensa: Give memory regions an explicit owner hw/display: Give memory regions an explicit owner hw/arm/omap: Give lcdc and dma memory regions an explicit owner hw/char: Give parallel and htif memory regions an explicit owner hw/remote: Give memory regions an explicit owner
system, backends: Give named memory regions an explicit owner hw/ide: Let ide_init_ioport() take an explicit owner
memory: Require an owner for named memory regions
irq: Rename qemu_allocate_irq*() and friends to *_orphan()
irq: Reintroduce qemu_allocate_irq*() with a mandatory owner and name hw/pci, hw/usb, system: Give allocated IRQs an owner and name hw/i386, hw/xen: Give allocated IRQs an owner and name hw/arm: Give allocated IRQs an owner and name
hw/xtensa: Give allocated IRQs an owner and name
hw: Give allocated IRQs an owner and name
hw/core: Parent GPIO input IRQs and embedded IRQState via QOM
irq: Delete the *_orphan() IRQ allocation variants
sysbus: Parent main-system-bus directly under /machine
accel: Parent the accelerator singleton under /machine hw/intc/mips_gic: Register reset handler at realize, not instance_init hw/core/reset: Give the root reset container and legacy shims a QOM
path
system: Parent per-MR helper objects under their owner hw/virtio, hw/display: Parent per-device helper objects hw/i386/amd_iommu: Parent internally-created AMDVI-PCI under the IOMMU hw/s390x, hw/remote: Parent per-devfn IOMMU objects hw/pci-host/raven: Parent the OR-IRQ under the host bridge hw/arm/mps2: Parent the OR-IRQ gates under the machine hw/arm/digic: Parent the DIGIC SoC under the machine hw/microblaze: Parent the CPU under the machine
hw: Pair object_initialize_child() with plain realize()
hw: Parent board-created CPUs under the machine hw/pci-host/versatile: Use object_initialize_child() for pci_dev docs, qapi, scripts, iotests: Update /machine/unattached path
references
qom: Delete /machine/unattached and error on unparented realize tests/qtest/qom-test: Add smp-max init-time ceiling test docs/devel/qom: Document the composition-tree parenting contract
MAINTAINERS: Add scripts/coccinelle/qom-parent/ under QOM

 MAINTAINERS                                   |   1 +
 accel/accel-system.c                          |   4 +-
 backends/igvm.c                               |   6 +-
 bsd-user/main.c                               |   3 +-
 docs/devel/qom.rst                            |  96 +++++++
 docs/devel/s390-cpu-topology.rst              |   2 +-
 docs/system/cpu-hotplug.rst                   |   4 +-
 hw/alpha/alpha_sys.h                          |   3 +-
 hw/alpha/dp264.c                              |  16 +-
 hw/alpha/typhoon.c                            |  10 +-
 hw/arm/allwinner-a10.c                        |   4 +-
 hw/arm/allwinner-h3.c                         |  34 ++-
 hw/arm/allwinner-r40.c                        |   4 +-
 hw/arm/armsse.c                               |  13 +-
 hw/arm/aspeed.c                               |  39 +--
 hw/arm/aspeed_ast1040_evb.c                   |   6 +-
 hw/arm/aspeed_ast10x0_evb.c                   |  12 +-
 hw/arm/aspeed_ast2400_palmetto.c              |   8 +-
 hw/arm/aspeed_ast2400_quanta-q71l.c           |  18 +-
 hw/arm/aspeed_ast2400_supermicrox11.c         |   8 +-
 hw/arm/aspeed_ast2500_evb.c                   |   7 +-
 hw/arm/aspeed_ast2500_g220a.c                 |  11 +-
 hw/arm/aspeed_ast2500_romulus.c               |   3 +-
 hw/arm/aspeed_ast2500_supermicro-x11spi.c     |   8 +-
 hw/arm/aspeed_ast2500_tiogapass.c             |  13 +-
 hw/arm/aspeed_ast2500_witherspoon.c           |  34 +--
 hw/arm/aspeed_ast2500_yosemitev2.c            |  13 +-
 hw/arm/aspeed_ast2600_anacapa.c               |  51 ++--
 hw/arm/aspeed_ast2600_bletchley.c             |  33 ++-
 hw/arm/aspeed_ast2600_catalina.c              |  99 +++----
 hw/arm/aspeed_ast2600_evb.c                   |   7 +-
 hw/arm/aspeed_ast2600_fby35.c                 |  20 +-
 hw/arm/aspeed_ast2600_fuji.c                  | 111 ++++----
 hw/arm/aspeed_ast2600_gb200nvl.c              |  24 +-
 hw/arm/aspeed_ast2600_rainier.c               | 188 ++++++++------
 hw/arm/aspeed_ast27x0-fc.c                    |   9 +-
 hw/arm/aspeed_ast27x0_evb.c                   |   3 +-
 hw/arm/aspeed_soc_common.c                    |  14 +-
 hw/arm/bananapi_m2u.c                         |   6 +-
 hw/arm/collie.c                               |   6 +-
 hw/arm/cubieboard.c                           |   6 +-
 hw/arm/digic_boards.c                         |   5 +-
 hw/arm/exynos4210.c                           |  70 ++---
 hw/arm/exynos4_boards.c                       |  15 +-
 hw/arm/fsl-imx25.c                            |   2 +-
 hw/arm/fsl-imx31.c                            |   2 +-
 hw/arm/fsl-imx6.c                             |   7 +-
 hw/arm/fsl-imx6ul.c                           |  37 +--
 hw/arm/fsl-imx7.c                             |  41 +--
 hw/arm/fsl-imx8mm.c                           |   2 +-
 hw/arm/fsl-imx8mp.c                           |   2 +-
 hw/arm/imx25_pdk.c                            |   6 +-
 hw/arm/imx8mm-evk.c                           |   6 +-
 hw/arm/imx8mp-evk.c                           |   6 +-
 hw/arm/integratorcp.c                         |  56 ++--
 hw/arm/kzm.c                                  |   6 +-
 hw/arm/max78000_soc.c                         | 107 ++++----
 hw/arm/max78000fthr.c                         |   5 +-
 hw/arm/mcimx6ul-evk.c                         |   4 +-
 hw/arm/mcimx7d-sabre.c                        |   4 +-
 hw/arm/mps2-tz.c                              |  27 +-
 hw/arm/mps2.c                                 |  91 ++++---
 hw/arm/mps3r.c                                |  20 +-
 hw/arm/msf2-soc.c                             |  24 +-
 hw/arm/msf2-som.c                             |  12 +-
 hw/arm/musca.c                                |   4 +-
 hw/arm/musicpal.c                             |  50 ++--
 hw/arm/netduino2.c                            |   5 +-
 hw/arm/netduinoplus2.c                        |   5 +-
 hw/arm/npcm7xx.c                              |  95 +++----
 hw/arm/npcm7xx_boards.c                       | 117 +++++----
 hw/arm/npcm8xx.c                              | 147 +++++------
 hw/arm/npcm8xx_boards.c                       |  19 +-
 hw/arm/nrf51_soc.c                            |   4 +-
 hw/arm/olimex-stm32-h405.c                    |   5 +-
 hw/arm/omap1.c                                | 244 ++++++++++--------
 hw/arm/omap_sx1.c                             |  20 +-
 hw/arm/orangepi.c                             |   4 +-
 hw/arm/raspi.c                                |   4 +-
 hw/arm/realview.c                             | 113 ++++----
 hw/arm/sabrelite.c                            |   5 +-
 hw/arm/sbsa-ref.c                             |  89 +++----
 hw/arm/stellaris.c                            |  99 ++++---
 hw/arm/stm32f100_soc.c                        |  62 ++---
 hw/arm/stm32f205_soc.c                        |   2 +-
 hw/arm/stm32f405_soc.c                        |  88 +++----
 hw/arm/stm32l4x5_soc.c                        |  88 +++----
 hw/arm/stm32vldiscovery.c                     |   5 +-
 hw/arm/strongarm.c                            |  27 +-
 hw/arm/strongarm.h                            |   2 +-
 hw/arm/versatilepb.c                          |  85 +++---
 hw/arm/vexpress.c                             |  87 ++++---
 hw/arm/virt.c                                 | 103 ++++----
 hw/arm/xilinx_zynq.c                          | 160 ++++++------
 hw/arm/xlnx-versal-virt.c                     |   5 +-
 hw/arm/xlnx-versal.c                          | 197 ++++++--------
 hw/arm/xlnx-zcu102.c                          |  14 +-
 hw/arm/xlnx-zynqmp.c                          |   8 +-
 hw/audio/intel-hda.c                          |   4 +-
 hw/audio/model.c                              |   5 +-
 hw/avr/atmega.c                               |  24 +-
 hw/block/fdc-sysbus.c                         |  13 +-
 hw/block/fdc.c                                |   4 +-
 hw/block/pflash_cfi01.c                       |   6 +-
 hw/block/pflash_cfi02.c                       |   6 +-
 hw/block/xen-block.c                          |   5 +-
 hw/char/diva-gsp.c                            |   3 +-
 hw/char/exynos4210_uart.c                     |   6 +-
 hw/char/mcf_uart.c                            |  11 +-
 hw/char/mchp_pfsoc_mmuart.c                   |   4 +-
 hw/char/omap_uart.c                           |   4 +-
 hw/char/parallel-isa.c                        |  10 +-
 hw/char/parallel.c                            |   5 +-
 hw/char/pl011.c                               |   6 +-
 hw/char/riscv_htif.c                          |   5 +-
 hw/char/serial-isa.c                          |  11 +-
 hw/char/serial-mm.c                           |   6 +-
 hw/char/sifive_uart.c                         |   8 +-
 hw/char/spapr_vty.c                           |   6 +-
 hw/char/xen_console.c                         |   7 +-
 hw/core/cpu-common.c                          |   6 +-
 hw/core/gpio.c                                |  24 +-
 hw/core/irq.c                                 |  38 +--
 hw/core/null-machine.c                        |   2 +-
 hw/core/qdev-user.c                           |   6 +-
 hw/core/qdev.c                                |  40 ++-
 hw/core/reset.c                               |  13 +-
 hw/core/sysbus.c                              |  32 ++-
 hw/cxl/cxl-host.c                             |   9 +-
 hw/display/cg3.c                              |   2 +-
 hw/display/g364fb.c                           |   2 +-
 hw/display/macfb.c                            |   2 +-
 hw/display/omap_lcdc.c                        |   5 +-
 hw/display/sii9022.c                          |   2 +-
 hw/display/sm501.c                            |   6 +-
 hw/display/vhost-user-gpu.c                   |  12 +-
 hw/display/virtio-gpu-gl.c                    |   2 +-
 hw/display/vmware_vga.c                       |  12 +-
 hw/display/xlnx_dp.c                          |  14 +-
 hw/dma/i8257.c                                |  10 +-
 hw/dma/omap_dma.c                             |   9 +-
 hw/dma/rc4030.c                               |   7 +-
 hw/hexagon/hexagon_dsp.c                      |  21 +-
 hw/hexagon/virt.c                             |  29 +--
 hw/hppa/machine.c                             |  96 ++++---
 hw/i2c/aspeed_i2c.c                           |   4 +-
 hw/i2c/core.c                                 |  22 +-
 hw/i2c/smbus_eeprom.c                         |  11 +-
 hw/i386/amd_iommu.c                           |   3 +-
 hw/i386/isapc.c                               |  17 +-
 hw/i386/kvm/clock.c                           |   4 +-
 hw/i386/kvm/clock.h                           |   2 +-
 hw/i386/kvm/i8259.c                           |   8 +-
 hw/i386/kvm/xen-stubs.c                       |   2 +-
 hw/i386/kvm/xen_evtchn.c                      |   6 +-
 hw/i386/kvm/xen_evtchn.h                      |   3 +-
 hw/i386/kvm/xen_gnttab.c                      |   6 +-
 hw/i386/kvm/xen_gnttab.h                      |   2 +-
 hw/i386/kvm/xen_overlay.c                     |   6 +-
 hw/i386/kvm/xen_overlay.h                     |   2 +-
 hw/i386/kvm/xen_primary_console.c             |   5 +-
 hw/i386/kvm/xen_primary_console.h             |   2 +-
 hw/i386/kvm/xen_xenstore.c                    |   5 +-
 hw/i386/kvm/xen_xenstore.h                    |   2 +-
 hw/i386/microvm.c                             |  34 +--
 hw/i386/nitro_enclave.c                       |   9 +-
 hw/i386/pc.c                                  |  96 +++----
 hw/i386/pc_piix.c                             |  28 +-
 hw/i386/pc_q35.c                              |  42 +--
 hw/i386/pc_sysfw.c                            |  16 +-
 hw/i386/sgx.c                                 |   5 +-
 hw/i386/x86-common.c                          |  33 ++-
 hw/i386/x86-cpu.c                             |   4 +-
 hw/i386/xen/xen-hvm.c                         |  12 +-
 hw/i386/xen/xen-pvh.c                         |   5 +-
 hw/i386/xen/xen_pvdevice.c                    |   2 +-
 hw/i3c/core.c                                 |  19 +-
 hw/ide/ahci.c                                 |   2 +-
 hw/ide/ide-bus.c                              |   5 +-
 hw/ide/ide-internal.h                         |   2 +-
 hw/ide/ioport.c                               |  37 ++-
 hw/ide/isa.c                                  |   9 +-
 hw/ide/pci.c                                  |   2 +-
 hw/ide/piix.c                                 |   2 +-
 hw/intc/apic_common.c                         |   3 +-
 hw/intc/exynos4210_gic.c                      |   4 +-
 hw/intc/i8259.c                               |   6 +-
 hw/intc/i8259_common.c                        |   7 +-
 hw/intc/mips_gic.c                            |   2 +-
 hw/intc/riscv_aclint.c                        |  16 +-
 hw/intc/riscv_aplic.c                         |  13 +-
 hw/intc/riscv_imsic.c                         |   7 +-
 hw/intc/s390_flic.c                           |  12 +-
 hw/intc/sh_intc.c                             |  21 +-
 hw/intc/sifive_plic.c                         |   7 +-
 hw/ipack/ipack.c                              |  11 +-
 hw/ipmi/ipmi_bt.c                             |   2 +-
 hw/ipmi/ipmi_kcs.c                            |   2 +-
 hw/isa/i82378.c                               |  13 +-
 hw/isa/isa-bus.c                              |  44 ++--
 hw/isa/isa-superio.c                          |  25 +-
 hw/isa/lpc_ich9.c                             |   2 +-
 hw/isa/piix.c                                 |   4 +-
 hw/isa/vt82c686.c                             |   7 +-
 hw/loongarch/virt.c                           |  62 +++--
 hw/m68k/an5206.c                              |  13 +-
 hw/m68k/mcf5206.c                             |   8 +-
 hw/m68k/mcf5208.c                             |  32 ++-
 hw/m68k/mcf_intc.c                            |   7 +-
 hw/m68k/next-cube.c                           |  26 +-
 hw/m68k/q800.c                                |  28 +-
 hw/m68k/virt.c                                |  25 +-
 hw/mem/sparse-mem.c                           |   6 +-
 hw/microblaze/petalogix_ml605_mmu.c           |  40 ++-
 hw/microblaze/petalogix_s3adsp1800_mmu.c      |  27 +-
 hw/microblaze/xlnx-zynqmp-pmu.c               |   4 +-
 hw/mips/boston.c                              |  32 +--
 hw/mips/cps.c                                 |   5 +-
 hw/mips/fuloong2e.c                           |  24 +-
 hw/mips/jazz.c                                |  73 +++---
 hw/mips/loongson3_virt.c                      |  40 +--
 hw/mips/malta.c                               |  49 ++--
 hw/mips/mips_int.c                            |   2 +-
 hw/misc/empty_slot.c                          |   7 +-
 hw/misc/led.c                                 |  15 +-
 hw/misc/macio/macio.c                         |   2 +-
 hw/misc/sifive_e_prci.c                       |   6 +-
 hw/misc/sifive_test.c                         |   6 +-
 hw/net/can/can_kvaser_pci.c                   |   2 +-
 hw/net/imx_fec.c                              |   4 +-
 hw/net/lan9118.c                              |  10 +-
 hw/net/smc91c111.c                            |   6 +-
 hw/net/spapr_llan.c                           |   6 +-
 hw/net/xen_nic.c                              |   5 +-
 hw/nitro/machine.c                            |  11 +-
 hw/nitro/nitro-vsock-bus.c                    |   9 +-
 hw/nubus/nubus-virtio-mmio.c                  |   2 +-
 hw/nvme/ctrl.c                                |   2 +-
 hw/nvram/eeprom_at24c.c                       |  12 +-
 hw/nvram/fw_cfg.c                             |  16 +-
 hw/or1k/or1k-sim.c                            |  25 +-
 hw/or1k/virt.c                                |  43 +--
 hw/pci-bridge/pci_expander_bridge.c           |  13 +-
 hw/pci-host/articia.c                         |   6 +-
 hw/pci-host/astro.c                           |   8 +-
 hw/pci-host/bonito.c                          |  28 +-
 hw/pci-host/grackle.c                         |   2 +-
 hw/pci-host/gt64120.c                         |   5 +-
 hw/pci-host/i440fx.c                          |   2 +-
 hw/pci-host/mv64361.c                         |   4 +-
 hw/pci-host/pnv_phb.c                         |   5 +-
 hw/pci-host/pnv_phb3.c                        |   3 +-
 hw/pci-host/pnv_phb3_msi.c                    |   3 +-
 hw/pci-host/pnv_phb4.c                        |   3 +-
 hw/pci-host/pnv_phb4_pec.c                    |   3 +-
 hw/pci-host/ppc4xx_pci.c                      |   2 +-
 hw/pci-host/ppce500.c                         |   2 +-
 hw/pci-host/raven.c                           |   6 +-
 hw/pci-host/sabre.c                           |  12 +-
 hw/pci-host/sh_pci.c                          |   3 +-
 hw/pci-host/uninorth.c                        |  11 +-
 hw/pci-host/versatile.c                       |   3 +-
 hw/pci/pci.c                                  |  60 +++--
 hw/pci/pcie_sriov.c                           |   5 +-
 hw/ppc/amigaone.c                             |  24 +-
 hw/ppc/e500.c                                 |  70 ++---
 hw/ppc/mac_newworld.c                         |  58 +++--
 hw/ppc/mac_oldworld.c                         |  32 +--
 hw/ppc/pegasos.c                              |  22 +-
 hw/ppc/pnv.c                                  |  33 +--
 hw/ppc/pnv_bmc.c                              |   4 +-
 hw/ppc/pnv_lpc.c                              |   6 +-
 hw/ppc/pnv_psi.c                              |   6 +-
 hw/ppc/ppc440.h                               |   2 +-
 hw/ppc/ppc440_bamboo.c                        |  17 +-
 hw/ppc/ppc440_uc.c                            |  10 +-
 hw/ppc/ppc4xx_sdram.c                         |  34 +--
 hw/ppc/prep.c                                 |  50 ++--
 hw/ppc/sam460ex.c                             |  72 +++---
 hw/ppc/spapr.c                                |  38 +--
 hw/ppc/spapr_irq.c                            |   6 +-
 hw/ppc/spapr_vio.c                            |   6 +-
 hw/ppc/virtex_ml507.c                         |  23 +-
 hw/remote/iommu.c                             |   7 +-
 hw/remote/machine.c                           |   6 +-
 hw/remote/memory.c                            |   3 +-
 hw/remote/vfio-user-obj.c                     |   2 +-
 hw/riscv/aia.c                                |  12 +-
 hw/riscv/aia.h                                |   3 +-
 hw/riscv/boston-aia.c                         |  31 ++-
 hw/riscv/cps.c                                |  14 +-
 hw/riscv/k230.c                               | 127 ++++-----
 hw/riscv/microblaze-v-generic.c               |  51 ++--
 hw/riscv/microchip_pfsoc.c                    |  90 +++----
 hw/riscv/opentitan.c                          |  52 ++--
 hw/riscv/shakti_c.c                           |   8 +-
 hw/riscv/sifive_e.c                           |  25 +-
 hw/riscv/sifive_u.c                           |  39 +--
 hw/riscv/spike.c                              |   8 +-
 hw/riscv/tt_atlantis.c                        |  17 +-
 hw/riscv/virt.c                               |  62 ++---
 hw/riscv/xiangshan_kmh.c                      |  20 +-
 hw/rtc/ls7a_rtc.c                             |   2 +-
 hw/rtc/mc146818rtc.c                          |   6 +-
 hw/rtc/sun4v-rtc.c                            |   6 +-
 hw/s390x/ap-bridge.c                          |   6 +-
 hw/s390x/css-bridge.c                         |   7 +-
 hw/s390x/s390-pci-bus.c                       |  13 +-
 hw/s390x/s390-virtio-ccw.c                    |  41 ++-
 hw/scsi/esp-pci.c                             |   2 +-
 hw/scsi/lasi_ncr710.c                         |   8 +-
 hw/scsi/lasi_ncr710.h                         |   4 +-
 hw/scsi/ncr53c710.c                           |  15 +-
 hw/scsi/ncr53c710.h                           |   7 +-
 hw/scsi/scsi-bus.c                            |   5 +-
 hw/scsi/spapr_vscsi.c                         |   6 +-
 hw/sh4/r2d.c                                  |  38 +--
 hw/sh4/sh7750.c                               |  35 +--
 hw/sparc/leon3.c                              |  27 +-
 hw/sparc/sun4m.c                              | 167 ++++++------
 hw/sparc64/niagara.c                          |  20 +-
 hw/sparc64/sparc64.c                          |   3 +-
 hw/sparc64/sun4u.c                            |  69 ++---
 hw/ssi/ssi.c                                  |   7 +-
 hw/timer/arm_timer.c                          |   6 +-
 hw/timer/sh_timer.c                           |   9 +-
 hw/tricore/tc27x_soc.c                        |  77 +++---
 hw/tricore/tricore_testboard.c                |  19 +-
 hw/ufs/lu.c                                   |   5 +-
 hw/usb/bus.c                                  |  15 +-
 hw/usb/dev-serial.c                           |   3 +-
 hw/usb/vt82c686-uhci-pci.c                    |   4 +-
 hw/vfio/igd.c                                 |   5 +-
 hw/virtio/virtio-mem.c                        |   5 +-
 hw/vmapple/vmapple.c                          |  66 ++---
 hw/xen/xen-bus.c                              |   5 +-
 hw/xen/xen-legacy-backend.c                   |   5 +-
 hw/xen/xen-pvh-common.c                       |  26 +-
 hw/xen/xen_pt_graphics.c                      |   3 +-
 hw/xtensa/mx_pic.c                            |   8 +-
 hw/xtensa/pic_cpu.c                           |   5 +-
 hw/xtensa/sim.c                               |  15 +-
 hw/xtensa/virt.c                              |   4 +-
 hw/xtensa/xtensa_memory.c                     |   5 +-
 hw/xtensa/xtensa_memory.h                     |   3 +-
 hw/xtensa/xtfpga.c                            |  51 ++--
 include/hw/arm/aspeed.h                       |   6 +-
 include/hw/arm/aspeed_soc.h                   |   3 +-
 include/hw/arm/exynos4210.h                   |   2 +-
 include/hw/arm/omap.h                         |  11 +-
 include/hw/block/fdc.h                        |   5 +-
 include/hw/block/flash.h                      |   4 +-
 include/hw/char/mchp_pfsoc_mmuart.h           |   2 +-
 include/hw/char/parallel.h                    |   5 +-
 include/hw/char/pl011.h                       |   2 +-
 include/hw/char/riscv_htif.h                  |   3 +-
 include/hw/char/serial-isa.h                  |   2 +-
 include/hw/char/serial-mm.h                   |   2 +-
 include/hw/char/sifive_uart.h                 |   4 +-
 include/hw/core/cpu.h                         |  11 +-
 include/hw/core/irq.h                         |  27 +-
 include/hw/core/qdev.h                        |  50 ++--
 include/hw/core/sysbus.h                      |  33 ++-
 include/hw/i2c/i2c.h                          |  29 ++-
 include/hw/i2c/smbus_eeprom.h                 |   5 +-
 include/hw/i386/pc.h                          |   6 +-
 include/hw/i386/vmport.h                      |   5 -
 include/hw/i386/x86.h                         |   7 +-
 include/hw/i3c/i3c.h                          |   9 +-
 include/hw/ide/isa.h                          |   3 +-
 include/hw/intc/i8259.h                       |   4 +-
 include/hw/intc/riscv_aclint.h                |   6 +-
 include/hw/intc/riscv_aplic.h                 |   5 +-
 include/hw/intc/riscv_imsic.h                 |   3 +-
 include/hw/intc/sifive_plic.h                 |   3 +-
 include/hw/isa/i8259_internal.h               |   3 +-
 include/hw/isa/isa.h                          |  11 +-
 include/hw/m68k/mcf.h                         |   7 +-
 include/hw/mem/sparse-mem.h                   |   2 +-
 include/hw/mips/mips.h                        |   5 +-
 include/hw/misc/empty_slot.h                  |   3 +-
 include/hw/misc/sifive_e_prci.h               |   2 +-
 include/hw/misc/sifive_test.h                 |   2 +-
 include/hw/misc/unimp.h                       |   9 +-
 include/hw/net/lan9118.h                      |   2 +-
 include/hw/net/ne2000-isa.h                   |   8 +-
 include/hw/net/smc91c111.h                    |   2 +-
 include/hw/nitro/nitro-vsock-bus.h            |   2 +-
 include/hw/nvram/eeprom_at24c.h               |   6 +-
 include/hw/pci/pci.h                          |  19 +-
 include/hw/ppc/pnv.h                          |   2 +-
 include/hw/ppc/spapr_vio.h                    |   8 +-
 include/hw/rtc/mc146818rtc.h                  |   2 +-
 include/hw/rtc/sun4v-rtc.h                    |   2 +-
 include/hw/sh4/sh.h                           |   3 +-
 include/hw/sh4/sh_intc.h                      |   3 +-
 include/hw/ssi/ssi.h                          |   3 +-
 include/hw/timer/i8254.h                      |  13 +-
 include/hw/timer/tmu012.h                     |   3 +-
 include/hw/usb/usb.h                          |  13 +-
 include/hw/xen/xen.h                          |   2 +-
 include/hw/xtensa/mx_pic.h                    |   4 +-
 include/net/net.h                             |   5 +-
 include/qom/object.h                          |  32 +++
 linux-user/main.c                             |   6 +-
 net/net.c                                     |  10 +-
 qapi/block-core.json                          |  12 +-
 qapi/block.json                               |   2 +-
 qapi/machine.json                             |  12 +-
 qapi/qom.json                                 |   4 +-
 qom/object.c                                  |  12 +
 scripts/arm_processor_error.py                |   3 +-
 .../qom-parent/cpu-create-orphan.cocci        |  13 +
 .../qom-parent/i2c-slave-new-orphan.cocci     |  18 ++
 .../coccinelle/qom-parent/irq-rename.cocci    |  15 ++
 .../qom-parent/isa-new-orphan.cocci           |  23 ++
 .../qom-parent/pci-new-orphan.cocci           |  28 ++
 .../qom-parent/qdev-new-orphan.cocci          |  18 ++
 .../qom-parent/ssi-usb-orphan.cocci           |  18 ++
 .../qom-parent/sysbus-create-orphan.cocci     |  18 ++
 scripts/qmp_helper.py                         |   2 +-
 stubs/xen-hw-stub.c                           |   2 +-
 system/ioport.c                               |  12 +-
 system/memory.c                               |  24 +-
 system/physmem.c                              |   4 +-
 system/qdev-monitor.c                         |   2 +-
 system/qtest.c                                |   2 +-
 system/ram-block-attributes.c                 |   7 +-
 system/vl.c                                   |   3 +-
 target/mips/cpu.c                             |   5 +-
 target/mips/cpu.h                             |   3 +-
 target/xtensa/cpu.c                           |  11 -
 target/xtensa/cpu.h                           |   2 -
 tests/qemu-iotests/172.out                    |  72 +++---
 tests/qemu-iotests/186.out                    |  10 +-
 tests/qemu-iotests/common.filter              |   2 +-
 tests/qtest/fuzz/generic_fuzz.c               |   2 +-
 tests/qtest/qom-test.c                        |  35 +++
 tests/unit/test-qdev-global-props.c           |  17 +-
 tests/unit/test-qdev.c                        |  12 +-
 440 files changed, 4588 insertions(+), 3817 deletions(-)
 create mode 100644 scripts/coccinelle/qom-parent/cpu-create-orphan.cocci
 create mode 100644 scripts/coccinelle/qom-parent/i2c-slave-new-orphan.cocci
 create mode 100644 scripts/coccinelle/qom-parent/irq-rename.cocci
 create mode 100644 scripts/coccinelle/qom-parent/isa-new-orphan.cocci
 create mode 100644 scripts/coccinelle/qom-parent/pci-new-orphan.cocci
 create mode 100644 scripts/coccinelle/qom-parent/qdev-new-orphan.cocci
 create mode 100644 scripts/coccinelle/qom-parent/ssi-usb-orphan.cocci
 create mode 100644 scripts/coccinelle/qom-parent/sysbus-create-orphan.cocci

base-commit: eca2c16212ef9dcb0871de39bb9d1c2efebe76be

Signature · 1 line
2.47.1