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>,
"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>,
"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>,
"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>,
"Philippe Mathieu-Daudé" <philmd@mailo.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>,
"Daniel P . Berrangé" <berrange@redhat.com>
Subject: [RFC PATCH 090/134] hw/misc-boards: Give memory regions an explicit owner
Date: Sat, 11 Jul 2026 22:36:23 +0000 [thread overview]
Message-ID: <20260711223707.42139-91-graf@amazon.com> (raw)
In-Reply-To: <20260711223707.42139-1-graf@amazon.com>
memory_region_init*() takes an @owner argument that becomes the
QOM parent of the MemoryRegion object. When NULL is passed the
region is silently reparented under /machine/unattached, hiding
its lifetime owner.
Convert trivial owner==NULL sites in board init functions and
device realize functions across small subdirectories. The owner
is the enclosing machine or device in every case:
hw/hexagon OBJECT(machine|ms|vms) virt, hexagon_dsp
hw/hppa parent, OBJECT(machine)
hw/ipmi OBJECT(ii) IPMIInterface implementations
hw/loongarch OBJECT(machine)
hw/microblaze OBJECT(machine)
hw/or1k OBJECT(machine)
hw/pci-host OBJECT(dev) bonito realize
hw/rtc OBJECT(dev) ls7a realize
hw/sparc OBJECT(machine)
hw/sparc64 OBJECT(machine)
hw/vmapple OBJECT(vms)
hw/xen OBJECT(s) xen-pvh-common ram init
No functional change: memory_region_do_init() would have parented
these under /machine/unattached; they now sit under their creator.
Assisted-by: Kiro
Signed-off-by: Alexander Graf <graf@amazon.com>
---
hw/hexagon/hexagon_dsp.c | 4 ++--
hw/hexagon/virt.c | 8 ++++----
hw/hppa/machine.c | 6 +++---
hw/ipmi/ipmi_bt.c | 2 +-
hw/ipmi/ipmi_kcs.c | 2 +-
hw/loongarch/virt.c | 4 ++--
hw/microblaze/petalogix_ml605_mmu.c | 4 ++--
hw/microblaze/petalogix_s3adsp1800_mmu.c | 4 ++--
hw/microblaze/xlnx-zynqmp-pmu.c | 4 ++--
hw/or1k/or1k-sim.c | 2 +-
hw/or1k/virt.c | 2 +-
hw/pci-host/bonito.c | 4 ++--
hw/rtc/ls7a_rtc.c | 2 +-
hw/sparc/leon3.c | 2 +-
hw/sparc64/niagara.c | 13 +++++++------
hw/vmapple/vmapple.c | 2 +-
hw/xen/xen-pvh-common.c | 12 ++++++------
17 files changed, 39 insertions(+), 38 deletions(-)
diff --git a/hw/hexagon/hexagon_dsp.c b/hw/hexagon/hexagon_dsp.c
index ccd9a06f51..53dfe6741e 100644
--- a/hw/hexagon/hexagon_dsp.c
+++ b/hw/hexagon/hexagon_dsp.c
@@ -122,12 +122,12 @@ static void hexagon_common_init(MachineState *machine, Rev_t rev,
address_space = get_system_memory();
- memory_region_init_rom(&hms->cfgtable_rom, NULL, "config_table.rom",
+ memory_region_init_rom(&hms->cfgtable_rom, OBJECT(machine), "config_table.rom",
sizeof(m_cfg->cfgtable), &error_fatal);
memory_region_add_subregion(address_space, m_cfg->cfgbase,
&hms->cfgtable_rom);
- memory_region_init_ram(&hms->ram, NULL, "ddr.ram",
+ memory_region_init_ram(&hms->ram, OBJECT(machine), "ddr.ram",
machine->ram_size, &error_fatal);
memory_region_add_subregion(address_space, 0x0, &hms->ram);
diff --git a/hw/hexagon/virt.c b/hw/hexagon/virt.c
index 0619f06c41..fb23cda19f 100644
--- a/hw/hexagon/virt.c
+++ b/hw/hexagon/virt.c
@@ -74,7 +74,7 @@ static void fdt_add_hvx(HexagonVirtMachineState *vms,
const MachineState *ms = MACHINE(vms);
uint32_t vtcm_size_bytes = m_cfg->cfgtable.vtcm_size_kb * 1024;
if (vtcm_size_bytes > 0) {
- memory_region_init_ram(&vms->vtcm, NULL, "vtcm.ram", vtcm_size_bytes,
+ memory_region_init_ram(&vms->vtcm, OBJECT(vms), "vtcm.ram", vtcm_size_bytes,
&error_fatal);
memory_region_add_subregion(vms->sys, m_cfg->cfgtable.vtcm_base << 16,
&vms->vtcm);
@@ -250,18 +250,18 @@ static void virt_init(MachineState *ms)
vms->apb_clk = clock_new(OBJECT(ms), "apb-pclk");
clock_set_hz(vms->apb_clk, 24000000);
- memory_region_init_ram(&vms->parent_obj.ram, NULL, "ddr.ram",
+ memory_region_init_ram(&vms->parent_obj.ram, OBJECT(ms), "ddr.ram",
ms->ram_size, &error_fatal);
memory_region_add_subregion(vms->sys, 0x0, &vms->parent_obj.ram);
if (m_cfg->l2tcm_size) {
- memory_region_init_ram(&vms->tcm, NULL, "tcm.ram", m_cfg->l2tcm_size,
+ memory_region_init_ram(&vms->tcm, OBJECT(ms), "tcm.ram", m_cfg->l2tcm_size,
&error_fatal);
memory_region_add_subregion(vms->sys, m_cfg->cfgtable.l2tcm_base << 16,
&vms->tcm);
}
- memory_region_init_rom(&vms->parent_obj.cfgtable_rom, NULL,
+ memory_region_init_rom(&vms->parent_obj.cfgtable_rom, OBJECT(ms),
"config_table.rom", sizeof(m_cfg->cfgtable),
&error_fatal);
memory_region_add_subregion(vms->sys, m_cfg->cfgbase,
diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c
index 4fcb3e5e37..233cf6318b 100644
--- a/hw/hppa/machine.c
+++ b/hw/hppa/machine.c
@@ -104,7 +104,7 @@ static ISABus *hppa_isa_bus(Object *parent, hwaddr addr)
MemoryRegion *isa_region;
isa_region = g_new(MemoryRegion, 1);
- memory_region_init_io(isa_region, NULL, &hppa_pci_ignore_ops,
+ memory_region_init_io(isa_region, parent, &hppa_pci_ignore_ops,
NULL, "isa-io", 0x800);
memory_region_add_subregion(get_system_memory(), addr, isa_region);
@@ -337,7 +337,7 @@ static TranslateFn *machine_HP_common_init_cpus(MachineState *machine)
*/
cflush_name = g_strdup_printf("cpu%u-T600-cacheflush", i);
cflush = g_new(MemoryRegion, 1);
- memory_region_init_io(cflush, NULL, &hppa_pci_ignore_ops,
+ memory_region_init_io(cflush, OBJECT(machine), &hppa_pci_ignore_ops,
NULL, cflush_name, 4);
memory_region_add_subregion(addr_space,
translate(NULL, CPU_HPA + i * 0x1000 + 0x500),
@@ -498,7 +498,7 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus,
}
rom_region = g_new(MemoryRegion, 1);
- memory_region_init_ram(rom_region, NULL, "firmware",
+ memory_region_init_ram(rom_region, OBJECT(machine), "firmware",
(FIRMWARE_END - FIRMWARE_START), &error_fatal);
memory_region_add_subregion(addr_space,
translate(NULL, FIRMWARE_START), rom_region);
diff --git a/hw/ipmi/ipmi_bt.c b/hw/ipmi/ipmi_bt.c
index e01d02fe52..173e2e52c6 100644
--- a/hw/ipmi/ipmi_bt.c
+++ b/hw/ipmi/ipmi_bt.c
@@ -361,7 +361,7 @@ static void ipmi_bt_init(IPMIInterface *ii, unsigned int min_size, Error **errp)
ib->size_mask = min_size - 1;
ib->io_length = 3;
- memory_region_init_io(&ib->io, NULL, &ipmi_bt_io_ops, ii, "ipmi-bt",
+ memory_region_init_io(&ib->io, OBJECT(ii), &ipmi_bt_io_ops, ii, "ipmi-bt",
min_size);
}
diff --git a/hw/ipmi/ipmi_kcs.c b/hw/ipmi/ipmi_kcs.c
index d5cfe6c068..9bd678e725 100644
--- a/hw/ipmi/ipmi_kcs.c
+++ b/hw/ipmi/ipmi_kcs.c
@@ -339,7 +339,7 @@ static void ipmi_kcs_init(IPMIInterface *ii, unsigned int min_size,
}
ik->size_mask = min_size - 1;
ik->io_length = 2;
- memory_region_init_io(&ik->io, NULL, &ipmi_kcs_io_ops, ii, "ipmi-kcs",
+ memory_region_init_io(&ik->io, OBJECT(ii), &ipmi_kcs_io_ops, ii, "ipmi-kcs",
min_size);
}
diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c
index 8c6d2ad122..580ef0bb3e 100644
--- a/hw/loongarch/virt.c
+++ b/hw/loongarch/virt.c
@@ -966,13 +966,13 @@ static void virt_init(MachineState *machine)
size = VIRT_LOWMEM_SIZE;
}
- memory_region_init_alias(&lvms->lowmem, NULL, "loongarch.lowram",
+ memory_region_init_alias(&lvms->lowmem, OBJECT(machine), "loongarch.lowram",
machine->ram, base, size);
memory_region_add_subregion(address_space_mem, base, &lvms->lowmem);
base += size;
if (ram_size - size) {
base = VIRT_HIGHMEM_BASE;
- memory_region_init_alias(&lvms->highmem, NULL, "loongarch.highram",
+ memory_region_init_alias(&lvms->highmem, OBJECT(machine), "loongarch.highram",
machine->ram, VIRT_LOWMEM_BASE + size, ram_size - size);
memory_region_add_subregion(address_space_mem, base, &lvms->highmem);
base += ram_size - size;
diff --git a/hw/microblaze/petalogix_ml605_mmu.c b/hw/microblaze/petalogix_ml605_mmu.c
index 1dc34dc247..26470b0251 100644
--- a/hw/microblaze/petalogix_ml605_mmu.c
+++ b/hw/microblaze/petalogix_ml605_mmu.c
@@ -94,11 +94,11 @@ petalogix_ml605_init(MachineState *machine)
qdev_realize(DEVICE(cpu), NULL, &error_abort);
/* Attach emulated BRAM through the LMB. */
- memory_region_init_ram(phys_lmb_bram, NULL, "petalogix_ml605.lmb_bram",
+ memory_region_init_ram(phys_lmb_bram, OBJECT(machine), "petalogix_ml605.lmb_bram",
LMB_BRAM_SIZE, &error_fatal);
memory_region_add_subregion(address_space_mem, 0x00000000, phys_lmb_bram);
- memory_region_init_ram(phys_ram, NULL, "petalogix_ml605.ram", ram_size,
+ memory_region_init_ram(phys_ram, OBJECT(machine), "petalogix_ml605.ram", ram_size,
&error_fatal);
memory_region_add_subregion(address_space_mem, MEMORY_BASEADDR, phys_ram);
diff --git a/hw/microblaze/petalogix_s3adsp1800_mmu.c b/hw/microblaze/petalogix_s3adsp1800_mmu.c
index 6986eb7732..83bf325b2b 100644
--- a/hw/microblaze/petalogix_s3adsp1800_mmu.c
+++ b/hw/microblaze/petalogix_s3adsp1800_mmu.c
@@ -92,12 +92,12 @@ petalogix_s3adsp1800_init(MachineState *machine)
qdev_realize(DEVICE(cpu), NULL, &error_abort);
/* Attach emulated BRAM through the LMB. */
- memory_region_init_ram(phys_lmb_bram, NULL,
+ memory_region_init_ram(phys_lmb_bram, OBJECT(machine),
"petalogix_s3adsp1800.lmb_bram", LMB_BRAM_SIZE,
&error_fatal);
memory_region_add_subregion(sysmem, 0x00000000, phys_lmb_bram);
- memory_region_init_ram(phys_ram, NULL, "petalogix_s3adsp1800.ram",
+ memory_region_init_ram(phys_ram, OBJECT(machine), "petalogix_s3adsp1800.ram",
ram_size, &error_fatal);
memory_region_add_subregion(sysmem, ddr_base, phys_ram);
diff --git a/hw/microblaze/xlnx-zynqmp-pmu.c b/hw/microblaze/xlnx-zynqmp-pmu.c
index 00154236bf..cf9314f86c 100644
--- a/hw/microblaze/xlnx-zynqmp-pmu.c
+++ b/hw/microblaze/xlnx-zynqmp-pmu.c
@@ -155,13 +155,13 @@ static void xlnx_zynqmp_pmu_init(MachineState *machine)
MemoryRegion *pmu_ram = g_new(MemoryRegion, 1);
/* Create the ROM */
- memory_region_init_rom(pmu_rom, NULL, "xlnx-zynqmp-pmu.rom",
+ memory_region_init_rom(pmu_rom, OBJECT(machine), "xlnx-zynqmp-pmu.rom",
XLNX_ZYNQMP_PMU_ROM_SIZE, &error_fatal);
memory_region_add_subregion(address_space_mem, XLNX_ZYNQMP_PMU_ROM_ADDR,
pmu_rom);
/* Create the RAM */
- memory_region_init_ram(pmu_ram, NULL, "xlnx-zynqmp-pmu.ram",
+ memory_region_init_ram(pmu_ram, OBJECT(machine), "xlnx-zynqmp-pmu.ram",
machine->ram_size, &error_fatal);
memory_region_add_subregion(address_space_mem, XLNX_ZYNQMP_PMU_RAM_ADDR,
pmu_ram);
diff --git a/hw/or1k/or1k-sim.c b/hw/or1k/or1k-sim.c
index 293970f156..ca2852fa87 100644
--- a/hw/or1k/or1k-sim.c
+++ b/hw/or1k/or1k-sim.c
@@ -312,7 +312,7 @@ static void openrisc_sim_init(MachineState *machine)
}
ram = g_malloc(sizeof(*ram));
- memory_region_init_ram(ram, NULL, "openrisc.ram", ram_size, &error_fatal);
+ memory_region_init_ram(ram, OBJECT(machine), "openrisc.ram", ram_size, &error_fatal);
memory_region_add_subregion(get_system_memory(), 0, ram);
openrisc_create_fdt(state, or1ksim_memmap, smp_cpus, machine->ram_size,
diff --git a/hw/or1k/virt.c b/hw/or1k/virt.c
index c0e0e3c48b..8cd520b320 100644
--- a/hw/or1k/virt.c
+++ b/hw/or1k/virt.c
@@ -498,7 +498,7 @@ static void openrisc_virt_init(MachineState *machine)
}
ram = g_malloc(sizeof(*ram));
- memory_region_init_ram(ram, NULL, "openrisc.ram", ram_size, &error_fatal);
+ memory_region_init_ram(ram, OBJECT(machine), "openrisc.ram", ram_size, &error_fatal);
memory_region_add_subregion(get_system_memory(), 0, ram);
openrisc_create_fdt(state, virt_memmap, smp_cpus, machine->ram_size,
diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c
index 7b4259c0e7..48135a7fc0 100644
--- a/hw/pci-host/bonito.c
+++ b/hw/pci-host/bonito.c
@@ -639,7 +639,7 @@ static void bonito_host_realize(DeviceState *dev, Error **errp)
for (size_t i = 0; i < 3; i++) {
char *name = g_strdup_printf("pci.lomem%zu", i);
- memory_region_init_alias(&pcimem_lo_alias[i], NULL, name,
+ memory_region_init_alias(&pcimem_lo_alias[i], OBJECT(dev), name,
&bs->pci_mem, i * 64 * MiB, 64 * MiB);
memory_region_add_subregion(get_system_memory(),
BONITO_PCILO_BASE + i * 64 * MiB,
@@ -713,7 +713,7 @@ static void bonito_pci_realize(PCIDevice *dev, Error **errp)
create_unimplemented_device(OBJECT(dev), "IOCS[3]", BONITO_DEV_BASE + 3 * 256 * KiB,
256 * KiB);
- memory_region_init_alias(pcimem_alias, NULL, "pci.mem.alias",
+ memory_region_init_alias(pcimem_alias, OBJECT(dev), "pci.mem.alias",
&bs->pci_mem, 0, BONITO_PCIHI_SIZE);
memory_region_add_subregion(host_mem, BONITO_PCIHI_BASE, pcimem_alias);
create_unimplemented_device(OBJECT(dev), "PCI_2",
diff --git a/hw/rtc/ls7a_rtc.c b/hw/rtc/ls7a_rtc.c
index 158c815505..77206b6636 100644
--- a/hw/rtc/ls7a_rtc.c
+++ b/hw/rtc/ls7a_rtc.c
@@ -388,7 +388,7 @@ static void ls7a_rtc_realize(DeviceState *dev, Error **errp)
int i;
SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
LS7ARtcState *d = LS7A_RTC(sbd);
- memory_region_init_io(&d->iomem, NULL, &ls7a_rtc_ops,
+ memory_region_init_io(&d->iomem, OBJECT(dev), &ls7a_rtc_ops,
(void *)d, "ls7a_rtc", 0x100);
sysbus_init_irq(sbd, &d->irq);
diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c
index a96ccca8e3..f9ef2758e1 100644
--- a/hw/sparc/leon3.c
+++ b/hw/sparc/leon3.c
@@ -345,7 +345,7 @@ static void leon3_generic_hw_init(MachineState *machine)
/* Allocate BIOS */
prom_size = 8 * MiB;
- memory_region_init_rom(prom, NULL, "Leon3.bios", prom_size, &error_fatal);
+ memory_region_init_rom(prom, OBJECT(machine), "Leon3.bios", prom_size, &error_fatal);
memory_region_add_subregion(address_space_mem, LEON3_PROM_OFFSET, prom);
/* Load boot prom */
diff --git a/hw/sparc64/niagara.c b/hw/sparc64/niagara.c
index 8fb9937127..58384e80da 100644
--- a/hw/sparc64/niagara.c
+++ b/hw/sparc64/niagara.c
@@ -106,23 +106,23 @@ static void niagara_init(MachineState *machine)
/* init CPUs */
sparc64_cpu_devinit(machine->cpu_type, NIAGARA_PROM_BASE);
/* set up devices */
- memory_region_init_ram(&s->hv_ram, NULL, "sun4v-hv.ram",
+ memory_region_init_ram(&s->hv_ram, OBJECT(machine), "sun4v-hv.ram",
NIAGARA_HV_RAM_SIZE, &error_fatal);
memory_region_add_subregion(sysmem, NIAGARA_HV_RAM_BASE, &s->hv_ram);
memory_region_add_subregion(sysmem, NIAGARA_PARTITION_RAM_BASE,
machine->ram);
- memory_region_init_ram(&s->nvram, NULL, "sun4v.nvram", NIAGARA_NVRAM_SIZE,
+ memory_region_init_ram(&s->nvram, OBJECT(machine), "sun4v.nvram", NIAGARA_NVRAM_SIZE,
&error_fatal);
memory_region_add_subregion(sysmem, NIAGARA_NVRAM_BASE, &s->nvram);
- memory_region_init_ram(&s->md_rom, NULL, "sun4v-md.rom",
+ memory_region_init_ram(&s->md_rom, OBJECT(machine), "sun4v-md.rom",
NIAGARA_MD_ROM_SIZE, &error_fatal);
memory_region_add_subregion(sysmem, NIAGARA_MD_ROM_BASE, &s->md_rom);
- memory_region_init_ram(&s->hv_rom, NULL, "sun4v-hv.rom",
+ memory_region_init_ram(&s->hv_rom, OBJECT(machine), "sun4v-hv.rom",
NIAGARA_HV_ROM_SIZE, &error_fatal);
memory_region_add_subregion(sysmem, NIAGARA_HV_ROM_BASE, &s->hv_rom);
- memory_region_init_ram(&s->prom, NULL, "sun4v.prom", PROM_SIZE_MAX,
+ memory_region_init_ram(&s->prom, OBJECT(machine), "sun4v.prom", PROM_SIZE_MAX,
&error_fatal);
memory_region_add_subregion(sysmem, NIAGARA_PROM_BASE, &s->prom);
@@ -140,7 +140,8 @@ static void niagara_init(MachineState *machine)
BlockBackend *blk = blk_by_legacy_dinfo(dinfo);
int size = blk_getlength(blk);
if (size > 0) {
- memory_region_init_ram(&s->vdisk_ram, NULL, "sun4v_vdisk.ram", size,
+ memory_region_init_ram(&s->vdisk_ram, OBJECT(machine), "sun4v_vdisk.ram",
+ size,
&error_fatal);
memory_region_add_subregion(get_system_memory(),
NIAGARA_VDISK_BASE, &s->vdisk_ram);
diff --git a/hw/vmapple/vmapple.c b/hw/vmapple/vmapple.c
index 67e499b74a..cea7e3d2f4 100644
--- a/hw/vmapple/vmapple.c
+++ b/hw/vmapple/vmapple.c
@@ -357,7 +357,7 @@ static void vmapple_firmware_init(VMAppleMachineState *vms,
exit(1);
}
- memory_region_init_ram(&vms->fw_mr, NULL, "firmware", size, &error_fatal);
+ memory_region_init_ram(&vms->fw_mr, OBJECT(vms), "firmware", size, &error_fatal);
image_size = load_image_mr(fname, &vms->fw_mr);
g_free(fname);
diff --git a/hw/xen/xen-pvh-common.c b/hw/xen/xen-pvh-common.c
index dae523f723..1047aabd57 100644
--- a/hw/xen/xen-pvh-common.c
+++ b/hw/xen/xen-pvh-common.c
@@ -109,12 +109,12 @@ static void xen_pvh_init_ram(XenPVHMachineState *s,
}
if (s->cfg.mapcache) {
- memory_region_init_ram(&xen_memory, NULL, "xen.ram",
+ memory_region_init_ram(&xen_memory, OBJECT(s), "xen.ram",
block_len, &error_fatal);
- memory_region_init_alias(&s->ram.low, NULL, "xen.ram.lo", &xen_memory,
+ memory_region_init_alias(&s->ram.low, OBJECT(s), "xen.ram.lo", &xen_memory,
s->cfg.ram_low.base, ram_size[0]);
if (ram_size[1] > 0) {
- memory_region_init_alias(&s->ram.high, NULL, "xen.ram.hi",
+ memory_region_init_alias(&s->ram.high, OBJECT(s), "xen.ram.hi",
&xen_memory,
s->cfg.ram_high.base, ram_size[1]);
}
@@ -122,11 +122,11 @@ static void xen_pvh_init_ram(XenPVHMachineState *s,
void *p;
p = xen_map_guest_ram(s, s->cfg.ram_low.base, ram_size[0]);
- memory_region_init_ram_ptr(&s->ram.low, NULL, "xen.ram.lo",
+ memory_region_init_ram_ptr(&s->ram.low, OBJECT(s), "xen.ram.lo",
ram_size[0], p);
if (ram_size[1] > 0) {
p = xen_map_guest_ram(s, s->cfg.ram_high.base, ram_size[1]);
- memory_region_init_ram_ptr(&s->ram.high, NULL, "xen.ram.hi",
+ memory_region_init_ram_ptr(&s->ram.high, OBJECT(s), "xen.ram.hi",
ram_size[1], p);
}
}
@@ -140,7 +140,7 @@ static void xen_pvh_init_ram(XenPVHMachineState *s,
/* Grants are only supported when the mapcache is on. */
if (s->cfg.mapcache) {
/* Setup support for grants. */
- memory_region_init_ram(&xen_grants, NULL, "xen.grants", block_len,
+ memory_region_init_ram(&xen_grants, OBJECT(s), "xen.grants", block_len,
&error_fatal);
memory_region_add_subregion(sysmem, XEN_GRANT_ADDR_OFF, &xen_grants);
}
--
2.47.1
next prev parent reply other threads:[~2026-07-11 23:01 UTC|newest]
Thread overview: 156+ 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-13 16:49 ` Richard Henderson
2026-07-13 18:15 ` Peter Maydell
2026-07-13 18:47 ` Daniel P. Berrangé
2026-07-13 19:07 ` Peter Maydell
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 ` Alexander Graf [this message]
2026-07-11 22:36 ` [RFC PATCH 091/134] hw/mips: Give memory regions an explicit owner 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
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=20260711223707.42139-91-graf@amazon.com \
--to=graf@amazon.com \
--cc=17746591750@163.com \
--cc=adityag@linux.ibm.com \
--cc=aik@ozlabs.ru \
--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=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=philmd@mailo.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.