@@ -645,15 +645,12 @@ extern const VMStateInfo vmstate_info_bitmap;
#define VMSTATE_UINT16_2DARRAY(_f, _s, _n1, _n2) \
VMSTATE_2DARRAY(_f, _s, _n1, _n2, 0, vmstate_info_uint16, uint16_t)
+#define VMSTATE_UINT32_2DARRAY(_f, _s, _n1, _n2) \
+ VMSTATE_2DARRAY(_f, _s, _n1, _n2, 0, vmstate_info_uint32, uint32_t)
+
#define VMSTATE_UINT8_SUB_ARRAY(_f, _s, _start, _num) \
VMSTATE_SUB_ARRAY(_f, _s, _start, _num, 0, vmstate_info_uint8, uint8_t)
-#define VMSTATE_UINT32_2DARRAY_V(_f, _s, _n1, _n2, _v) \
- VMSTATE_2DARRAY(_f, _s, _n1, _n2, _v, vmstate_info_uint32, uint32_t)
-
-#define VMSTATE_UINT32_2DARRAY(_f, _s, _n1, _n2) \
- VMSTATE_UINT32_2DARRAY_V(_f, _s, _n1, _n2, 0)
-
#define VMSTATE_UINT32_SUB_ARRAY(_f, _s, _start, _num) \
VMSTATE_SUB_ARRAY(_f, _s, _start, _num, 0, vmstate_info_uint32, uint32_t)
@@ -527,6 +527,7 @@ typedef struct TestArray {
float64 f64_1[VMSTATE_ARRAY_SIZE];
uint8_t u8_1d[VMSTATE_2D_SIZE][VMSTATE_2D_SIZE];
uint16_t u16_1d[VMSTATE_2D_SIZE][VMSTATE_2D_SIZE];
+ uint32_t u32_1d[VMSTATE_2D_SIZE][VMSTATE_2D_SIZE];
} TestArray;
TestArray obj_array = {
@@ -552,6 +553,9 @@ TestArray obj_array = {
.u16_1d = { {81, 82, 83},
{84, 85, 86},
{87, 88, 89} },
+ .u32_1d = { {91, 92, 93},
+ {94, 95, 96},
+ {97, 98, 99} },
};
static const VMStateDescription vmstate_array_primitive = {
@@ -574,6 +578,8 @@ static const VMStateDescription vmstate_array_primitive = {
VMSTATE_2D_SIZE),
VMSTATE_UINT16_2DARRAY(u16_1d, TestArray, VMSTATE_2D_SIZE,
VMSTATE_2D_SIZE),
+ VMSTATE_UINT32_2DARRAY(u32_1d, TestArray, VMSTATE_2D_SIZE,
+ VMSTATE_2D_SIZE),
VMSTATE_END_OF_LIST()
}
};
@@ -611,6 +617,15 @@ uint8_t wire_array_primitive[] = {
/* u16_1d */0x00, 0x51, 0x00, 0x52, 0x00, 0x53,
0x00, 0x54, 0x00, 0x55, 0x00, 0x56,
0x00, 0x57, 0x00, 0x58, 0x00, 0x59,
+ /* u32_1d */0x00, 0x00, 0x00, 0x5b,
+ 0x00, 0x00, 0x00, 0x5c,
+ 0x00, 0x00, 0x00, 0x5d,
+ 0x00, 0x00, 0x00, 0x5e,
+ 0x00, 0x00, 0x00, 0x5f,
+ 0x00, 0x00, 0x00, 0x60,
+ 0x00, 0x00, 0x00, 0x61,
+ 0x00, 0x00, 0x00, 0x62,
+ 0x00, 0x00, 0x00, 0x63,
QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */
};
@@ -643,6 +658,7 @@ static void obj_array_copy(void *arg1, void *arg2)
for (j = 0; j < VMSTATE_2D_SIZE; j++) {
target->u8_1d[i][j] = source->u8_1d[i][j];
target->u16_1d[i][j] = source->u16_1d[i][j];
+ target->u32_1d[i][j] = source->u32_1d[i][j];
}
}
}
@@ -688,6 +704,7 @@ static void test_array_primitive(void)
for (j = 0; j < VMSTATE_2D_SIZE; j++) {
ELEM_EQUAL_2D(u8_1d, i, j);
ELEM_EQUAL_2D(u16_1d, i, j);
+ ELEM_EQUAL_2D(u32_1d, i, j);
}
}
}
Remove unused _V version. Signed-off-by: Juan Quintela <quintela@redhat.com> --- include/migration/vmstate.h | 9 +++------ tests/test-vmstate.c | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 6 deletions(-)