[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH RESEND v2 32/32] hw/block/onenand: Let devices own the Memory
From: |
Philippe Mathieu-Daudé |
Subject: |
[RFC PATCH RESEND v2 32/32] hw/block/onenand: Let devices own the MemoryRegion they create |
Date: |
Mon, 24 Feb 2020 21:55:33 +0100 |
Avoid orphan memory regions being added in the /unattached QOM
container.
Note this change break the migration of the nSeries machines.
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
hw/block/onenand.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/hw/block/onenand.c b/hw/block/onenand.c
index 898ac563a3..f49db0b2ee 100644
--- a/hw/block/onenand.c
+++ b/hw/block/onenand.c
@@ -173,8 +173,8 @@ static int onenand_post_load(void *opaque, int version_id)
static const VMStateDescription vmstate_onenand = {
.name = "onenand",
- .version_id = 1,
- .minimum_version_id = 1,
+ .version_id = 2,
+ .minimum_version_id = 2,
.pre_save = onenand_pre_save,
.post_load = onenand_post_load,
.fields = (VMStateField[]) {
@@ -809,9 +809,8 @@ static void onenand_realize(DeviceState *dev, Error **errp)
}
s->otp = memset(g_malloc((64 + 2) << PAGE_SHIFT),
0xff, (64 + 2) << PAGE_SHIFT);
- memory_region_init_ram_nomigrate(&s->ram, OBJECT(s), "onenand.ram",
+ memory_region_init_ram(&s->ram, OBJECT(s), "onenand.ram",
0xc000 << s->shift, &error_fatal);
- vmstate_register_ram_global(&s->ram);
ram = memory_region_get_ram_ptr(&s->ram);
s->boot[0] = ram + (0x0000 << s->shift);
s->boot[1] = ram + (0x8000 << s->shift);
--
2.21.1
- [PATCH RESEND v2 22/32] scripts/cocci: Patch to let devices own their MemoryRegions, (continued)
- [PATCH RESEND v2 22/32] scripts/cocci: Patch to let devices own their MemoryRegions, Philippe Mathieu-Daudé, 2020/02/24
- [PATCH RESEND v2 23/32] hw/arm: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/02/24
- [PATCH RESEND v2 24/32] hw/char: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/02/24
- [PATCH RESEND v2 25/32] hw/core: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/02/24
- [PATCH RESEND v2 26/32] hw/display: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/02/24
- [PATCH RESEND v2 27/32] hw/dma: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/02/24
- [PATCH RESEND v2 28/32] hw/riscv: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/02/24
- [PATCH RESEND v2 29/32] hw/input/milkymist-softusb: Remove unused 'pmem_ptr' field, Philippe Mathieu-Daudé, 2020/02/24
- [RFC PATCH RESEND v2 30/32] hw/input/milkymist-softusb: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/02/24
- [RFC PATCH RESEND v2 31/32] hw/net/milkymist-minimac2: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/02/24
- [RFC PATCH RESEND v2 32/32] hw/block/onenand: Let devices own the MemoryRegion they create,
Philippe Mathieu-Daudé <=