diff options
author | Juan Quintela <quintela@redhat.com> | 2009-12-02 12:36:40 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-12-03 10:04:54 -0600 |
commit | 0c7c8b32ac51a69a1001bf2518d9bf3eb575e187 (patch) | |
tree | 8767162b55355f7dd010520743e18a4a274293d9 /hw | |
parent | f5a8d28a4e734e02f16858a61987bad7410e5b8d (diff) | |
download | qemu-0c7c8b32ac51a69a1001bf2518d9bf3eb575e187.tar.gz qemu-0c7c8b32ac51a69a1001bf2518d9bf3eb575e187.tar.bz2 qemu-0c7c8b32ac51a69a1001bf2518d9bf3eb575e187.zip |
vmstate: Introduce VMSTATE_STRUCT_POINTER_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.h | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -446,12 +446,13 @@ extern const VMStateInfo vmstate_info_unused_buffer; .offset = vmstate_offset_value(_state, _field, _type), \ } -#define VMSTATE_STRUCT_POINTER(_field, _state, _vmsd, _type) { \ - .name = (stringify(_field)), \ - .vmsd = &(_vmsd), \ - .size = sizeof(_type), \ - .flags = VMS_STRUCT|VMS_POINTER, \ - .offset = vmstate_offset_value(_state, _field, _type), \ +#define VMSTATE_STRUCT_POINTER_TEST(_field, _state, _test, _vmsd, _type) { \ + .name = (stringify(_field)), \ + .field_exists = (_test), \ + .vmsd = &(_vmsd), \ + .size = sizeof(_type), \ + .flags = VMS_STRUCT|VMS_POINTER, \ + .offset = vmstate_offset_value(_state, _field, _type), \ } #define VMSTATE_ARRAY_OF_POINTER(_field, _state, _num, _version, _info, _type) {\ @@ -578,6 +579,9 @@ extern const VMStateDescription vmstate_i2c_slave; #define VMSTATE_STRUCT(_field, _state, _version, _vmsd, _type) \ VMSTATE_STRUCT_TEST(_field, _state, NULL, _version, _vmsd, _type) +#define VMSTATE_STRUCT_POINTER(_field, _state, _vmsd, _type) \ + VMSTATE_STRUCT_POINTER_TEST(_field, _state, NULL, _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) \ |