From c5705a7728b4a6bc9e4f2d35911adbaf28042b25 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Tue, 20 Dec 2011 15:59:12 +0200 Subject: 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 --- memory.h | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'memory.h') diff --git a/memory.h b/memory.h index 55e7830ec0..8041e9028a 100644 --- a/memory.h +++ b/memory.h @@ -224,14 +224,10 @@ void memory_region_init_io(MemoryRegion *mr, * region will modify memory directly. * * @mr: the #MemoryRegion to be initialized. - * @dev: a device associated with the region; may be %NULL. - * @name: the name of the region; the pair (@dev, @name) must be globally - * unique. The name is part of the save/restore ABI and so cannot be - * changed. + * @name: the name of the region. * @size: size of the region. */ void memory_region_init_ram(MemoryRegion *mr, - DeviceState *dev, /* FIXME: layering violation */ const char *name, uint64_t size); @@ -241,15 +237,11 @@ void memory_region_init_ram(MemoryRegion *mr, * memory directly. * * @mr: the #MemoryRegion to be initialized. - * @dev: a device associated with the region; may be %NULL. - * @name: the name of the region; the pair (@dev, @name) must be globally - * unique. The name is part of the save/restore ABI and so cannot be - * changed. + * @name: the name of the region. * @size: size of the region. * @ptr: memory to be mapped; must contain at least @size bytes. */ void memory_region_init_ram_ptr(MemoryRegion *mr, - DeviceState *dev, /* FIXME: layering violation */ const char *name, uint64_t size, void *ptr); @@ -277,16 +269,12 @@ void memory_region_init_alias(MemoryRegion *mr, * * @mr: the #MemoryRegion to be initialized. * @ops: callbacks for write access handling. - * @dev: a device associated with the region; may be %NULL. - * @name: the name of the region; the pair (@dev, @name) must be globally - * unique. The name is part of the save/restore ABI and so cannot be - * changed. + * @name: the name of the region. * @size: size of the region. */ void memory_region_init_rom_device(MemoryRegion *mr, const MemoryRegionOps *ops, void *opaque, - DeviceState *dev, /* FIXME: layering violation */ const char *name, uint64_t size); -- cgit v1.2.3