[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH RESEND v2 30/32] hw/input/milkymist-softusb: Let devices own
From: |
Philippe Mathieu-Daudé |
Subject: |
[RFC PATCH RESEND v2 30/32] hw/input/milkymist-softusb: Let devices own the MemoryRegion they create |
Date: |
Mon, 24 Feb 2020 21:55:31 +0100 |
Avoid orphan memory regions being added in the /unattached QOM
container.
Note this change break the migration of the LM32 milkymist machine.
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
hw/input/milkymist-softusb.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/hw/input/milkymist-softusb.c b/hw/input/milkymist-softusb.c
index 7deeb1294f..72bc7bae1e 100644
--- a/hw/input/milkymist-softusb.c
+++ b/hw/input/milkymist-softusb.c
@@ -259,13 +259,11 @@ static void milkymist_softusb_realize(DeviceState *dev,
Error **errp)
sysbus_init_mmio(sbd, &s->regs_region);
/* register pmem and dmem */
- memory_region_init_ram_nomigrate(&s->pmem, OBJECT(s),
"milkymist-softusb.pmem",
+ memory_region_init_ram(&s->pmem, OBJECT(s), "milkymist-softusb.pmem",
s->pmem_size, &error_fatal);
- vmstate_register_ram_global(&s->pmem);
sysbus_init_mmio(sbd, &s->pmem);
- memory_region_init_ram_nomigrate(&s->dmem, OBJECT(s),
"milkymist-softusb.dmem",
+ memory_region_init_ram(&s->dmem, OBJECT(s), "milkymist-softusb.dmem",
s->dmem_size, &error_fatal);
- vmstate_register_ram_global(&s->dmem);
s->dmem_ptr = memory_region_get_ram_ptr(&s->dmem);
sysbus_init_mmio(sbd, &s->dmem);
@@ -275,8 +273,8 @@ static void milkymist_softusb_realize(DeviceState *dev,
Error **errp)
static const VMStateDescription vmstate_milkymist_softusb = {
.name = "milkymist-softusb",
- .version_id = 1,
- .minimum_version_id = 1,
+ .version_id = 2,
+ .minimum_version_id = 2,
.fields = (VMStateField[]) {
VMSTATE_UINT32_ARRAY(regs, MilkymistSoftUsbState, R_MAX),
VMSTATE_HID_KEYBOARD_DEVICE(hid_kbd, MilkymistSoftUsbState),
--
2.21.1
- [PATCH RESEND v2 20/32] scripts/cocci: Patch to remove unnecessary memory_region_set_readonly(), (continued)
- [PATCH RESEND v2 20/32] scripts/cocci: Patch to remove unnecessary memory_region_set_readonly(), Philippe Mathieu-Daudé, 2020/02/24
- [PATCH RESEND v2 21/32] hw/arm: Remove unnecessary memory_region_set_readonly() on ROM alias, Philippe Mathieu-Daudé, 2020/02/24
- [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é <=
- [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é, 2020/02/24