summary refs log tree commit diff stats
path: root/include/migration/vmstate.h
diff options
context:
space:
mode:
authorAlexey Kardashevskiy <aik@ozlabs.ru>2014-10-02 19:56:02 +1000
committerJuan Quintela <quintela@trasno.org>2014-10-14 09:35:48 +0200
commit94ed706d53a9018f24c67374c71f358fca2f0413 (patch)
treec152b50ee203d0f6cf9a52b7b65054490f0deeda /include/migration/vmstate.h
parent7ea2d269cb84ca7a2f4b7c3735634176f7c1dc35 (diff)
downloadfocaccia-qemu-94ed706d53a9018f24c67374c71f358fca2f0413.tar.gz
focaccia-qemu-94ed706d53a9018f24c67374c71f358fca2f0413.zip
vmstate: Allow dynamic allocation for VBUFFER during migration
This extends use of VMS_ALLOC flag from arrays to VBUFFER as well.

This defines VMSTATE_VBUFFER_ALLOC_UINT32 which makes use of VMS_ALLOC
and uses uint32_t type for a size.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'include/migration/vmstate.h')
-rw-r--r--include/migration/vmstate.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
index 9a001bd28f..e45fc49cb1 100644
--- a/include/migration/vmstate.h
+++ b/include/migration/vmstate.h
@@ -484,6 +484,17 @@ extern const VMStateInfo vmstate_info_bitmap;
     .start        = (_start),                                        \
 }
 
+#define VMSTATE_VBUFFER_ALLOC_UINT32(_field, _state, _version, _test, _start, _field_size) { \
+    .name         = (stringify(_field)),                             \
+    .version_id   = (_version),                                      \
+    .field_exists = (_test),                                         \
+    .size_offset  = vmstate_offset_value(_state, _field_size, uint32_t),\
+    .info         = &vmstate_info_buffer,                            \
+    .flags        = VMS_VBUFFER|VMS_POINTER|VMS_ALLOC,               \
+    .offset       = offsetof(_state, _field),                        \
+    .start        = (_start),                                        \
+}
+
 #define VMSTATE_BUFFER_UNSAFE_INFO(_field, _state, _version, _info, _size) { \
     .name       = (stringify(_field)),                               \
     .version_id = (_version),                                        \