* [Qemu-devel] [PATCH/RFC] vmstate: add VMSTATE_ macro for pointer to array of structures
@ 2011-01-22 7:52 Dmitry Eremin-Solenikov
0 siblings, 0 replies; only message in thread
From: Dmitry Eremin-Solenikov @ 2011-01-22 7:52 UTC (permalink / raw)
To: qemu-devel
While working on cleaning up pxa2xx_timer, I stumbled upon storing
array of structures, which is referenced via a pointer. Thus I had to
add this macro.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
hw/hw.h | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/hw/hw.h b/hw/hw.h
index 163a683..acdeb6a 100644
--- a/hw/hw.h
+++ b/hw/hw.h
@@ -456,6 +456,16 @@ extern const VMStateInfo vmstate_info_unused_buffer;
.offset = vmstate_offset_value(_state, _field, _type), \
}
+#define VMSTATE_STRUCT_POINTER_ARRAY_TEST(_field, _state, _num, _test, _vmsd, _type) { \
+ .name = (stringify(_field)), \
+ .field_exists = (_test), \
+ .num = (_num), \
+ .vmsd = &(_vmsd), \
+ .size = sizeof(_type), \
+ .flags = VMS_STRUCT|VMS_POINTER|VMS_ARRAY, \
+ .offset = vmstate_offset_pointer(_state, _field, _type), \
+}
+
#define VMSTATE_STRUCT_POINTER_TEST(_field, _state, _test, _vmsd, _type) { \
.name = (stringify(_field)), \
.field_exists = (_test), \
--
1.7.2.3
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-01-22 7:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-22 7:52 [Qemu-devel] [PATCH/RFC] vmstate: add VMSTATE_ macro for pointer to array of structures Dmitry Eremin-Solenikov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).