Patchwork [09/20] vmstate: create VMSTATE_STRUCT_POINTER

login
register
mail settings
Submitter Juan Quintela
Date Sept. 11, 2009, 10:10 a.m.
Message ID <b35f77100d94e1d23fe7b555c61bc4062154cee3.1252662256.git.quintela@redhat.com>
Download mbox | patch
Permalink /patch/33431/
State Superseded
Headers show

Comments

Juan Quintela - Sept. 11, 2009, 10:10 a.m.
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 hw/hw.h |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

Patch

diff --git a/hw/hw.h b/hw/hw.h
index b967670..649eb24 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),                                            \