diff options
author | Juan Quintela <quintela@redhat.com> | 2009-10-16 12:35:27 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-10-27 12:28:50 -0500 |
commit | c29d8b1e9b927606b83cd7c56ddb350c9a9fbd5f (patch) | |
tree | 1e7a8ba169395a27fac6d8f83ac93c9bbf0a5721 /hw/hw.h | |
parent | 904ca304e5f9b610fa29f7549c9424d232c91855 (diff) | |
download | qemu-c29d8b1e9b927606b83cd7c56ddb350c9a9fbd5f.zip qemu-c29d8b1e9b927606b83cd7c56ddb350c9a9fbd5f.tar.gz qemu-c29d8b1e9b927606b83cd7c56ddb350c9a9fbd5f.tar.bz2 |
vmstate: factor vmstate_offset_pointer
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/hw.h')
-rw-r--r-- | hw/hw.h | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -342,6 +342,10 @@ extern const VMStateInfo vmstate_info_buffer; (offsetof(_state, _field) + \ type_check(_type, typeof_field(_state, _field))) +#define vmstate_offset_pointer(_state, _field, _type) \ + (offsetof(_state, _field) + \ + type_check_pointer(_type, typeof_field(_state, _field))) + #define VMSTATE_SINGLE(_field, _state, _version, _info, _type) { \ .name = (stringify(_field)), \ .version_id = (_version), \ @@ -398,8 +402,7 @@ extern const VMStateInfo vmstate_info_buffer; .info = &(_info), \ .size = sizeof(_type), \ .flags = VMS_VARRAY_INT32|VMS_POINTER, \ - .offset = offsetof(_state, _field) \ - + type_check_pointer(_type,typeof_field(_state, _field)) \ + .offset = vmstate_offset_pointer(_state, _field, _type), \ } #define VMSTATE_STRUCT(_field, _state, _version, _vmsd, _type) { \ |