CHange users of _V to _TEST. Signed-off-by: Juan Quintela <quint...@redhat.com> --- include/migration/vmstate.h | 12 ++++++------ target-i386/machine.c | 5 +++-- tests/test-vmstate.c | 22 ++++++++++++++++++++++ 3 files changed, 31 insertions(+), 8 deletions(-)
diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index 703f07b..3271114 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -618,6 +618,12 @@ extern const VMStateInfo vmstate_info_bitmap; #define VMSTATE_UINT32_ARRAY(_f, _s, _n) \ VMSTATE_UINT32_ARRAY_TEST(_f, _s, _n, NULL) +#define VMSTATE_UINT64_ARRAY_TEST(_f, _s, _n, _t) \ + VMSTATE_ARRAY_TEST(_f, _s, _n, _t, vmstate_info_uint64, uint64_t) + +#define VMSTATE_UINT64_ARRAY(_f, _s, _n) \ + VMSTATE_UINT64_ARRAY_TEST(_f, _s, _n, NULL) + #define VMSTATE_UINT16_2DARRAY_V(_f, _s, _n1, _n2, _v) \ VMSTATE_2DARRAY(_f, _s, _n1, _n2, _v, vmstate_info_uint16, uint16_t) @@ -639,12 +645,6 @@ extern const VMStateInfo vmstate_info_bitmap; #define VMSTATE_UINT32_2DARRAY(_f, _s, _n1, _n2) \ VMSTATE_UINT32_2DARRAY_V(_f, _s, _n1, _n2, 0) -#define VMSTATE_UINT64_ARRAY_V(_f, _s, _n, _v) \ - VMSTATE_ARRAY(_f, _s, _n, _v, vmstate_info_uint64, uint64_t) - -#define VMSTATE_UINT64_ARRAY(_f, _s, _n) \ - VMSTATE_UINT64_ARRAY_V(_f, _s, _n, 0) - #define VMSTATE_INT16_ARRAY_V(_f, _s, _n, _v) \ VMSTATE_ARRAY(_f, _s, _n, _v, vmstate_info_int16, int16_t) diff --git a/target-i386/machine.c b/target-i386/machine.c index d4ffe8e..1b8e3c4 100644 --- a/target-i386/machine.c +++ b/target-i386/machine.c @@ -667,7 +667,7 @@ const VMStateDescription vmstate_x86_cpu = { VMSTATE_UINT32_TEST(env.intercept_exceptions, X86CPU, vmstate_5_plus), VMSTATE_UINT8_TEST(env.v_tpr, X86CPU, vmstate_5_plus), /* MTRRs */ - VMSTATE_UINT64_ARRAY_V(env.mtrr_fixed, X86CPU, 11, 8), + VMSTATE_UINT64_ARRAY_TEST(env.mtrr_fixed, X86CPU, 11, vmstate_8_plus), VMSTATE_UINT64_TEST(env.mtrr_deftype, X86CPU, vmstate_8_plus), VMSTATE_MTRR_VARS(env.mtrr_var, X86CPU, 8, 8), /* KVM-related states */ @@ -684,7 +684,8 @@ const VMStateDescription vmstate_x86_cpu = { VMSTATE_UINT64_TEST(env.mcg_cap, X86CPU, vmstate_10_plus), VMSTATE_UINT64_TEST(env.mcg_status, X86CPU, vmstate_10_plus), VMSTATE_UINT64_TEST(env.mcg_ctl, X86CPU, vmstate_10_plus), - VMSTATE_UINT64_ARRAY_V(env.mce_banks, X86CPU, MCE_BANKS_DEF * 4, 10), + VMSTATE_UINT64_ARRAY_TEST(env.mce_banks, X86CPU, MCE_BANKS_DEF * 4, + vmstate_10_plus), /* rdtscp */ VMSTATE_UINT64_TEST(env.tsc_aux, X86CPU, vmstate_11_plus), /* KVM pvclock msr */ diff --git a/tests/test-vmstate.c b/tests/test-vmstate.c index 76ad401..1f50948 100644 --- a/tests/test-vmstate.c +++ b/tests/test-vmstate.c @@ -545,6 +545,8 @@ typedef struct TestArray { uint16_t u16_1[VMSTATE_ARRAY_SIZE]; uint32_t u32_1[VMSTATE_ARRAY_SIZE]; uint32_t u32_2[VMSTATE_ARRAY_SIZE]; + uint64_t u64_1[VMSTATE_ARRAY_SIZE]; + uint64_t u64_2[VMSTATE_ARRAY_SIZE]; } TestArray; TestArray obj_array = { @@ -556,6 +558,8 @@ TestArray obj_array = { .u16_1 = {11, 12, 13, 14, 15}, .u32_1 = {21, 22, 23, 24, 25}, .u32_2 = {25, 24, 23, 22, 21}, + .u64_1 = {31, 32, 33, 34, 35}, + .u64_2 = {35, 34, 33, 32, 31}, }; static const VMStateDescription vmstate_array_primitive = { @@ -569,6 +573,7 @@ static const VMStateDescription vmstate_array_primitive = { VMSTATE_UINT8_ARRAY(u8_1, TestArray, VMSTATE_ARRAY_SIZE), VMSTATE_UINT16_ARRAY(u16_1, TestArray, VMSTATE_ARRAY_SIZE), VMSTATE_UINT32_ARRAY(u32_1, TestArray, VMSTATE_ARRAY_SIZE), + VMSTATE_UINT64_ARRAY(u64_1, TestArray, VMSTATE_ARRAY_SIZE), VMSTATE_END_OF_LIST() } }; @@ -581,6 +586,11 @@ uint8_t wire_array_primitive[] = { /* u32_1 */ 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x19, + /* u64_1 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */ }; @@ -639,6 +649,7 @@ static void test_array_primitive(void) ELEM_NOT_ASSERT(u8_2, i); ELEM_ASSERT(u16_1, i); ELEM_ASSERT(u32_1, i); + ELEM_ASSERT(u64_1, i); } /* We save the file again. We want the EOF this time */ @@ -669,6 +680,10 @@ static const VMStateDescription vmstate_array_test = { test_true), VMSTATE_UINT32_ARRAY_TEST(u32_2, TestArray, VMSTATE_ARRAY_SIZE, test_false), + VMSTATE_UINT64_ARRAY_TEST(u64_1, TestArray, VMSTATE_ARRAY_SIZE, + test_true), + VMSTATE_UINT64_ARRAY_TEST(u64_2, TestArray, VMSTATE_ARRAY_SIZE, + test_false), VMSTATE_END_OF_LIST() } }; @@ -679,6 +694,11 @@ uint8_t wire_array_test[] = { /* u32_1 */ 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x19, + /* u64_1 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */ }; @@ -730,6 +750,8 @@ static void test_array_test(void) ELEM_ASSERT(b_1, i); ELEM_ASSERT(u32_1, i); ELEM_NOT_ASSERT(u32_2, i); + ELEM_ASSERT(u64_1, i); + ELEM_NOT_ASSERT(u64_2, i); } } #undef FIELD_ASSERT -- 1.9.0