qemu/include/migration
Alexey Kardashevskiy f32935ea22 vmstate: Add preallocation for migrating arrays (VMS_ALLOC flag)
There are few helpers already to support array migration. However they all
require the destination side to preallocate arrays before migration which
is not always possible due to unknown array size as it might be some
sort of dynamic state. One of the examples is an array of MSIX-enabled
devices in SPAPR PHB - this array may vary from 0 to 65536 entries and
its size depends on guest's ability to enable MSIX or do PCI hotplug.

This adds new VMSTATE_VARRAY_STRUCT_ALLOC macro which is pretty similar to
VMSTATE_STRUCT_VARRAY_POINTER_INT32 but it can alloc memory for migratign
array on the destination side.

This defines VMS_ALLOC flag for a field.

This changes vmstate_base_addr() to do the allocation when receiving
migration.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Juan Quintela <quintela@redhat.com>
[agraf: drop g_malloc_n usage]
Signed-off-by: Alexander Graf <agraf@suse.de>
2014-06-27 13:48:27 +02:00
..
block.h
migration.h migration: expose xbzrle cache miss rate 2014-05-05 22:15:03 +02:00
page_cache.h Fix two XBZRLE corruption issues 2014-02-25 14:30:28 +01:00
qemu-file.h Make qemu_peek_buffer loop until it gets it's data 2014-05-05 22:15:03 +02:00
vmstate.h vmstate: Add preallocation for migrating arrays (VMS_ALLOC flag) 2014-06-27 13:48:27 +02:00