aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2009-09-29 22:48:24 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-10-05 09:32:37 -0500
commit6680f01c8c3b7dd87e16d51d93df3ae72c237b42 (patch)
tree6087b382034a7eadc724b6944d5e83134d369bca /hw
parentdb596c53a1e67f5e239de5fc91f9a29fbd9236c6 (diff)
downloadqemu-6680f01c8c3b7dd87e16d51d93df3ae72c237b42.zip
qemu-6680f01c8c3b7dd87e16d51d93df3ae72c237b42.tar.gz
qemu-6680f01c8c3b7dd87e16d51d93df3ae72c237b42.tar.bz2
vmstate: Add support for sending partial arrays
This one is needed for changees happening on fdc. It allows you to send arrays of structs whose size we want to send it is another field with type uint8_t. (If you have been able to read the whole sentence without stoping for breathing, you can use it. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/hw.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/hw/hw.h b/hw/hw.h
index b9ae33a..9afe50a 100644
--- a/hw/hw.h
+++ b/hw/hw.h
@@ -398,6 +398,18 @@ extern const VMStateInfo vmstate_info_buffer;
+ type_check_array(_type,typeof_field(_state, _field),_num) \
}
+#define VMSTATE_STRUCT_ARRAY_SIZE_UINT8(_field, _state, _field__num, _version, _vmsd, _type) { \
+ .name = (stringify(_field)), \
+ .num_offset = offsetof(_state, _field_num) \
+ + type_check(uint8_t,typeof_field(_state, _field_num)), \
+ .version_id = (_version), \
+ .vmsd = &(_vmsd), \
+ .size = sizeof(_type), \
+ .flags = VMS_STRUCT|VMS_ARRAY, \
+ .offset = offsetof(_state, _field) \
+ + type_check_array(_type,typeof_field(_state, _field),_num) \
+}
+
#define VMSTATE_STATIC_BUFFER(_field, _state, _version) { \
.name = (stringify(_field)), \
.version_id = (_version), \