提交 543fc7b2 编写于 作者: J Juan Quintela 提交者: Anthony Liguori

vmstate: Introduce VMSTATE_STRUCT_POINTER_TEST

Signed-off-by: NJuan Quintela <quintela@redhat.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 11fe0e6e
...@@ -446,12 +446,13 @@ extern const VMStateInfo vmstate_info_unused_buffer; ...@@ -446,12 +446,13 @@ extern const VMStateInfo vmstate_info_unused_buffer;
.offset = vmstate_offset_value(_state, _field, _type), \ .offset = vmstate_offset_value(_state, _field, _type), \
} }
#define VMSTATE_STRUCT_POINTER(_field, _state, _vmsd, _type) { \ #define VMSTATE_STRUCT_POINTER_TEST(_field, _state, _test, _vmsd, _type) { \
.name = (stringify(_field)), \ .name = (stringify(_field)), \
.vmsd = &(_vmsd), \ .field_exists = (_test), \
.size = sizeof(_type), \ .vmsd = &(_vmsd), \
.flags = VMS_STRUCT|VMS_POINTER, \ .size = sizeof(_type), \
.offset = vmstate_offset_value(_state, _field, _type), \ .flags = VMS_STRUCT|VMS_POINTER, \
.offset = vmstate_offset_value(_state, _field, _type), \
} }
#define VMSTATE_ARRAY_OF_POINTER(_field, _state, _num, _version, _info, _type) {\ #define VMSTATE_ARRAY_OF_POINTER(_field, _state, _num, _version, _info, _type) {\
...@@ -578,6 +579,9 @@ extern const VMStateDescription vmstate_i2c_slave; ...@@ -578,6 +579,9 @@ extern const VMStateDescription vmstate_i2c_slave;
#define VMSTATE_STRUCT(_field, _state, _version, _vmsd, _type) \ #define VMSTATE_STRUCT(_field, _state, _version, _vmsd, _type) \
VMSTATE_STRUCT_TEST(_field, _state, NULL, _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) \ #define VMSTATE_INT8_V(_f, _s, _v) \
VMSTATE_SINGLE(_f, _s, _v, vmstate_info_int8, int8_t) VMSTATE_SINGLE(_f, _s, _v, vmstate_info_int8, int8_t)
#define VMSTATE_INT16_V(_f, _s, _v) \ #define VMSTATE_INT16_V(_f, _s, _v) \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册