aboutsummaryrefslogtreecommitdiff
path: root/hw/hw.h
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2009-09-29 22:48:33 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-10-05 09:32:38 -0500
commit840e9cef84799df41a2f25de9cd818ec468b53ef (patch)
tree6d388169308296cd5d6873a50e9667045309ad59 /hw/hw.h
parentvmstate: port max7310 device (diff)
downloadqemu-kvm-840e9cef84799df41a2f25de9cd818ec468b53ef.tar.gz
qemu-kvm-840e9cef84799df41a2f25de9cd818ec468b53ef.tar.bz2
qemu-kvm-840e9cef84799df41a2f25de9cd818ec468b53ef.zip
vmstate: create VMSTATE_STRUCT_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.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/hw/hw.h b/hw/hw.h
index 379645772..51154ab32 100644
--- a/hw/hw.h
+++ b/hw/hw.h
@@ -387,6 +387,15 @@ extern const VMStateInfo vmstate_info_buffer;
+ type_check(_type,typeof_field(_state, _field)) \
}
+#define VMSTATE_STRUCT_POINTER(_field, _state, _vmsd, _type) { \
+ .name = (stringify(_field)), \
+ .vmsd = &(_vmsd), \
+ .size = sizeof(_type), \
+ .flags = VMS_STRUCT|VMS_POINTER, \
+ .offset = offsetof(_state, _field) \
+ + type_check(_type,typeof_field(_state, _field)) \
+}
+
#define VMSTATE_STRUCT_ARRAY(_field, _state, _num, _version, _vmsd, _type) { \
.name = (stringify(_field)), \
.num = (_num), \