summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2009-08-20 19:42:30 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-08-27 20:30:21 -0500
commit79c451b9d86359ea9a82b1d72db93b13f887e663 (patch)
tree632a27a1e1166435bf43fc485236f690ad58030a /hw
parentec245e2111ec59cd04e2510a183e43dee3fb85ce (diff)
downloadhqemu-79c451b9d86359ea9a82b1d72db93b13f887e663.zip
hqemu-79c451b9d86359ea9a82b1d72db93b13f887e663.tar.gz
Add VMState support for arrays of structs
This patch add supports for arrays of structs 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.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/hw/hw.h b/hw/hw.h
index 2ee307e..98afd22 100644
--- a/hw/hw.h
+++ b/hw/hw.h
@@ -361,6 +361,17 @@ extern const VMStateInfo vmstate_info_timer;
+ type_check(_type,typeof_field(_state, _field)) \
}
+#define VMSTATE_STRUCT_ARRAY(_field, _state, _num, _version, _vmsd, _type) { \
+ .name = (stringify(_field)), \
+ .num = (_num), \
+ .version_id = (_version), \
+ .vmsd = &(_vmsd), \
+ .size = sizeof(_type), \
+ .flags = VMS_STRUCT|VMS_ARRAY, \
+ .offset = offsetof(_state, _field) \
+ + type_check_array(_type,typeof_field(_state, _field),_num) \
+}
+
/* _f : field name
_n : num of elements
_s : struct state name
OpenPOWER on IntegriCloud