[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/7] hw/core: Let devices own the MemoryRegion they create
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 4/7] hw/core: Let devices own the MemoryRegion they create |
Date: |
Fri, 21 Feb 2020 18:30:46 +0100 |
To avoid orphean memory regions being added in the /unattached
QOM container, use the memory_region_owner_nonnull.cocci script
to set the correct ownership.
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
hw/core/platform-bus.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/core/platform-bus.c b/hw/core/platform-bus.c
index 22c5f76dd0..d494e5cec1 100644
--- a/hw/core/platform-bus.c
+++ b/hw/core/platform-bus.c
@@ -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);
--
2.21.1
- [PATCH 0/7] hw: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/02/21
- [PATCH 1/7] scripts/coccinelle: Add a script to let devices own their MemoryRegions, Philippe Mathieu-Daudé, 2020/02/21
- [PATCH 3/7] hw/char: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/02/21
- [PATCH 2/7] hw/arm: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/02/21
- [PATCH 4/7] hw/core: Let devices own the MemoryRegion they create,
Philippe Mathieu-Daudé <=
- [PATCH 5/7] hw/display: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/02/21
- [PATCH 7/7] hw/riscv: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/02/21
- [PATCH 6/7] hw/dma: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/02/21