summaryrefslogtreecommitdiffstats
path: root/hw/milkymist-softusb.c
diff options
context:
space:
mode:
authorAvi Kivity2011-12-20 14:59:12 +0100
committerAvi Kivity2012-01-04 12:34:48 +0100
commitc5705a7728b4a6bc9e4f2d35911adbaf28042b25 (patch)
treee96a1e0c9fbd0fa3624b5454038659775c81fba2 /hw/milkymist-softusb.c
parentmemory: introduce memory_region_name() (diff)
downloadqemu-c5705a7728b4a6bc9e4f2d35911adbaf28042b25.tar.gz
qemu-c5705a7728b4a6bc9e4f2d35911adbaf28042b25.tar.xz
qemu-c5705a7728b4a6bc9e4f2d35911adbaf28042b25.zip
vmstate, memory: decouple vmstate from memory API
Currently creating a memory region automatically registers it for live migration. This differs from other state (which is enumerated in a VMStateDescription structure) and ties the live migration code into the memory core. Decouple the two by introducing a separate API, vmstate_register_ram(), for registering a RAM block for migration. Currently the same implementation is reused, but later it can be moved into a separate list, and registrations can be moved to VMStateDescription blocks. Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'hw/milkymist-softusb.c')
-rw-r--r--hw/milkymist-softusb.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/milkymist-softusb.c b/hw/milkymist-softusb.c
index 6dd953ce9f..83bd1c4c6b 100644
--- a/hw/milkymist-softusb.c
+++ b/hw/milkymist-softusb.c
@@ -267,11 +267,13 @@ static int milkymist_softusb_init(SysBusDevice *dev)
sysbus_init_mmio(dev, &s->regs_region);
/* register pmem and dmem */
- memory_region_init_ram(&s->pmem, NULL, "milkymist-softusb.pmem",
+ memory_region_init_ram(&s->pmem, "milkymist-softusb.pmem",
s->pmem_size);
+ vmstate_register_ram_global(&s->pmem);
sysbus_add_memory(dev, s->pmem_base, &s->pmem);
- memory_region_init_ram(&s->dmem, NULL, "milkymist-softusb.dmem",
+ memory_region_init_ram(&s->dmem, "milkymist-softusb.dmem",
s->dmem_size);
+ vmstate_register_ram_global(&s->dmem);
sysbus_add_memory(dev, s->dmem_base, &s->dmem);
hid_init(&s->hid_kbd, HID_KEYBOARD, softusb_kbd_hid_datain);