qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 51/61] vmstate: add a macro for pointer to struct, V


From: Isaku Yamahata
Subject: [Qemu-devel] [PATCH 51/61] vmstate: add a macro for pointer to struct, VMSTATE_STRUCT_POINTER.
Date: Wed, 30 Sep 2009 19:18:27 +0900

introduce VMSTATE_STRUCT_POINTER which is for a pointer to a struct.

Signed-off-by: Isaku Yamahata <address@hidden>
---
 hw/hw.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/hw/hw.h b/hw/hw.h
index 478b0b2..19e9199 100644
--- a/hw/hw.h
+++ b/hw/hw.h
@@ -387,6 +387,16 @@ extern const VMStateInfo vmstate_info_buffer;
             + type_check(_type,typeof_field(_state, _field))         \
 }
 
+#define VMSTATE_STRUCT_POINTER(_field, _state, _version, _vmsd, _type) { \
+    .name       = (stringify(_field)),                               \
+    .version_id = (_version),                                        \
+    .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),                                            \
-- 
1.6.0.2





reply via email to

[Prev in Thread] Current Thread [Next in Thread]