summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2009-12-02 12:36:39 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2009-12-03 10:04:54 -0600
commitf5a8d28a4e734e02f16858a61987bad7410e5b8d (patch)
tree7e0230d68f23beb45cd42c5f391e5c30a8d9eee9 /hw
parentc52bfb2a91eec9b8c21e5450fb6dacfebde7485d (diff)
downloadqemu-f5a8d28a4e734e02f16858a61987bad7410e5b8d.tar.gz
qemu-f5a8d28a4e734e02f16858a61987bad7410e5b8d.tar.bz2
qemu-f5a8d28a4e734e02f16858a61987bad7410e5b8d.zip
vmstate: Introduce VMSTATE_STRUCT_TEST
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.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/hw/hw.h b/hw/hw.h
index 47fb12b143..0f4442a867 100644
--- a/hw/hw.h
+++ b/hw/hw.h
@@ -436,13 +436,14 @@ extern const VMStateInfo vmstate_info_unused_buffer;
.offset = offsetof(_state, _field), \
}
-#define VMSTATE_STRUCT(_field, _state, _version, _vmsd, _type) { \
- .name = (stringify(_field)), \
- .version_id = (_version), \
- .vmsd = &(_vmsd), \
- .size = sizeof(_type), \
- .flags = VMS_STRUCT, \
- .offset = vmstate_offset_value(_state, _field, _type), \
+#define VMSTATE_STRUCT_TEST(_field, _state, _test, _version, _vmsd, _type) { \
+ .name = (stringify(_field)), \
+ .version_id = (_version), \
+ .field_exists = (_test), \
+ .vmsd = &(_vmsd), \
+ .size = sizeof(_type), \
+ .flags = VMS_STRUCT, \
+ .offset = vmstate_offset_value(_state, _field, _type), \
}
#define VMSTATE_STRUCT_POINTER(_field, _state, _vmsd, _type) { \
@@ -574,6 +575,9 @@ extern const VMStateDescription vmstate_i2c_slave;
#define VMSTATE_SINGLE(_field, _state, _version, _info, _type) \
VMSTATE_SINGLE_TEST(_field, _state, NULL, _version, _info, _type)
+#define VMSTATE_STRUCT(_field, _state, _version, _vmsd, _type) \
+ VMSTATE_STRUCT_TEST(_field, _state, NULL, _version, _vmsd, _type)
+
#define VMSTATE_INT8_V(_f, _s, _v) \
VMSTATE_SINGLE(_f, _s, _v, vmstate_info_int8, int8_t)
#define VMSTATE_INT16_V(_f, _s, _v) \