aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2009-10-16 11:35:18 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-10-27 12:28:51 -0500
commitbdb4941d07b510fa12f00c8904a209a4ad6956a5 (patch)
treed8758b024781aa1a542646ef4fab3e1a9a1f4688 /hw
parentc7bde572058ab22ee166f5040a34bbb2a3c97f7a (diff)
vmstate: add VMS_VARRAY_UINT16_UNSAFE (varrays with uint16 indexes)
It don't check types. 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.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/hw/hw.h b/hw/hw.h
index 531031dc1f..4260e039e7 100644
--- a/hw/hw.h
+++ b/hw/hw.h
@@ -285,9 +285,10 @@ enum VMStateFlags {
VMS_POINTER = 0x002,
VMS_ARRAY = 0x004,
VMS_STRUCT = 0x008,
- VMS_VARRAY_INT32 = 0x010, /* Array with size in another field */
+ VMS_VARRAY_INT32 = 0x010, /* Array with size in int32_t field*/
VMS_BUFFER = 0x020, /* static sized buffer */
VMS_ARRAY_OF_POINTER = 0x040,
+ VMS_VARRAY_UINT16 = 0x080, /* Array with size in uint16_t field */
};
typedef struct {
@@ -411,6 +412,16 @@ extern const VMStateInfo vmstate_info_buffer;
.offset = vmstate_offset_pointer(_state, _field, _type), \
}
+#define VMSTATE_VARRAY_UINT16_UNSAFE(_field, _state, _field_num, _version, _info, _type) {\
+ .name = (stringify(_field)), \
+ .version_id = (_version), \
+ .num_offset = vmstate_offset_value(_state, _field_num, uint16_t),\
+ .info = &(_info), \
+ .size = sizeof(_type), \
+ .flags = VMS_VARRAY_UINT16, \
+ .offset = offsetof(_state, _field), \
+}
+
#define VMSTATE_STRUCT(_field, _state, _version, _vmsd, _type) { \
.name = (stringify(_field)), \
.version_id = (_version), \