mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-11-05 20:35:44 +00:00
hw/core: Let devices own the MemoryRegion they create
Avoid orphan memory regions being added in the /unattached QOM container. This commit was produced with the Coccinelle script scripts/coccinelle/memory-region-housekeeping.cocci. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
This commit is contained in:
parent
84969111e6
commit
de95af9967
1 changed files with 2 additions and 1 deletions
|
@ -187,7 +187,8 @@ static void platform_bus_realize(DeviceState *dev, Error **errp)
|
|||
d = SYS_BUS_DEVICE(dev);
|
||||
pbus = PLATFORM_BUS_DEVICE(dev);
|
||||
|
||||
memory_region_init(&pbus->mmio, NULL, "platform bus", pbus->mmio_size);
|
||||
memory_region_init(&pbus->mmio, OBJECT(dev), "platform bus",
|
||||
pbus->mmio_size);
|
||||
sysbus_init_mmio(d, &pbus->mmio);
|
||||
|
||||
pbus->used_irqs = bitmap_new(pbus->num_irqs);
|
||||
|
|
Loading…
Reference in a new issue