qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 72/97] vmstate: Introduce VMSTATE_VARRAY_UINT32_TEST


From: Juan Quintela
Subject: [Qemu-devel] [PATCH 72/97] vmstate: Introduce VMSTATE_VARRAY_UINT32_TEST
Date: Mon, 7 Apr 2014 05:21:30 +0200

Use it on the only case were a version was used.

Signed-off-by: Juan Quintela <address@hidden>
---
 hw/misc/arm_sysctl.c        | 5 +++--
 include/migration/vmstate.h | 7 +++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/hw/misc/arm_sysctl.c b/hw/misc/arm_sysctl.c
index 0f61241..668681f 100644
--- a/hw/misc/arm_sysctl.c
+++ b/hw/misc/arm_sysctl.c
@@ -67,8 +67,9 @@ static const VMStateDescription vmstate_arm_sysctl = {
         VMSTATE_UINT32_TEST(sys_clcd, arm_sysctl_state, vmstate_3_plus),
         VMSTATE_UINT32_ARRAY_TEST(mb_clock, arm_sysctl_state, 6,
                                   vmstate_4_plus),
-        VMSTATE_VARRAY_UINT32(db_clock, arm_sysctl_state, db_num_clocks,
-                              4, vmstate_info_uint32, uint32_t),
+        VMSTATE_VARRAY_UINT32_TEST(db_clock, arm_sysctl_state, db_num_clocks,
+                                   vmstate_4_plus, vmstate_info_uint32,
+                                   uint32_t),
         VMSTATE_END_OF_LIST()
     }
 };
diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
index 47219ad..2a914ec 100644
--- a/include/migration/vmstate.h
+++ b/include/migration/vmstate.h
@@ -257,9 +257,9 @@ extern const VMStateInfo vmstate_info_bitmap;
     .offset     = vmstate_offset_pointer(_state, _field, _type),     \
 }

-#define VMSTATE_VARRAY_UINT32(_field, _state, _field_num, _version, _info, 
_type) {\
+#define VMSTATE_VARRAY_UINT32_TEST(_field, _state, _field_num, _test, _info, 
_type) {\
     .name       = (stringify(_field)),                               \
-    .version_id = (_version),                                        \
+    .field_exists = (_test),                                         \
     .num_offset = vmstate_offset_value(_state, _field_num, uint32_t),\
     .info       = &(_info),                                          \
     .size       = sizeof(_type),                                     \
@@ -611,6 +611,9 @@ extern const VMStateInfo vmstate_info_bitmap;
 #define VMSTATE_UNUSED(_size)                                         \
     VMSTATE_UNUSED_TEST(NULL, _size)

+#define VMSTATE_VARRAY_UINT32(_field, _state, _field_num, _version, _info, 
_type) \
+    VMSTATE_VARRAY_UINT32_TEST(_field, _state, _field_num, NULL, _info, _type)
+
 #define VMSTATE_END_OF_LIST()                                         \
     {}

-- 
1.9.0




reply via email to

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