And as no user used the version_id, just remove the parameter. Signed-off-by: Juan Quintela <quint...@redhat.com> --- hw/nvram/eeprom93xx.c | 2 +- hw/nvram/fw_cfg.c | 2 +- hw/timer/twl92230.c | 2 +- include/migration/vmstate.h | 36 +++++++++++++++++------------------- target-i386/machine.c | 2 +- 5 files changed, 21 insertions(+), 23 deletions(-)
diff --git a/hw/nvram/eeprom93xx.c b/hw/nvram/eeprom93xx.c index d07bafb..7e09037 100644 --- a/hw/nvram/eeprom93xx.c +++ b/hw/nvram/eeprom93xx.c @@ -114,7 +114,7 @@ static const VMStateInfo vmstate_hack_uint16_from_uint8 = { }; #define VMSTATE_UINT16_HACK_TEST(_f, _s, _t) \ - VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_hack_uint16_from_uint8, uint16_t) + VMSTATE_SINGLE(_f, _s, _t, vmstate_hack_uint16_from_uint8, uint16_t) static bool is_old_eeprom_version(void *opaque, int version_id) { diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index 8ea3ac8..97218c7 100644 --- a/hw/nvram/fw_cfg.c +++ b/hw/nvram/fw_cfg.c @@ -365,7 +365,7 @@ static const VMStateInfo vmstate_hack_uint32_as_uint16 = { }; #define VMSTATE_UINT16_HACK(_f, _s, _t) \ - VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_hack_uint32_as_uint16, uint32_t) + VMSTATE_SINGLE(_f, _s, _t, vmstate_hack_uint32_as_uint16, uint32_t) static bool is_version_1(void *opaque, int version_id) diff --git a/hw/timer/twl92230.c b/hw/timer/twl92230.c index 3aacaeb..26c6001 100644 --- a/hw/timer/twl92230.c +++ b/hw/timer/twl92230.c @@ -765,7 +765,7 @@ static const VMStateInfo vmstate_hack_int32_as_uint16 = { }; #define VMSTATE_UINT16_HACK(_f, _s) \ - VMSTATE_SINGLE_TEST(_f, _s, NULL, 0, vmstate_hack_int32_as_uint16, int32_t) + VMSTATE_SINGLE(_f, _s, NULL, vmstate_hack_int32_as_uint16, int32_t) static const VMStateDescription vmstate_menelaus_tm = { diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index f64ad8c..977a35a 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -193,9 +193,8 @@ extern const VMStateInfo vmstate_info_bitmap; vmstate_offset_array(_state, _field, uint8_t, \ sizeof(typeof_field(_state, _field))) -#define VMSTATE_SINGLE_TEST(_field, _state, _test, _version, _info, _type) { \ +#define VMSTATE_SINGLE(_field, _state, _test, _info, _type) { \ .name = (stringify(_field)), \ - .version_id = (_version), \ .field_exists = (_test), \ .size = sizeof(_type), \ .info = &(_info), \ @@ -491,25 +490,24 @@ extern const VMStateInfo vmstate_info_bitmap; _vmsd, _type) #define VMSTATE_BOOL_TEST(_f, _s, _t) \ - VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_bool, bool) + VMSTATE_SINGLE(_f, _s, _t, vmstate_info_bool, bool) #define VMSTATE_INT8_TEST(_f, _s, _t) \ - VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_int8, int8_t) + VMSTATE_SINGLE(_f, _s, _t, vmstate_info_int8, int8_t) #define VMSTATE_INT16_TEST(_f, _s, _t) \ - VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_int16, int16_t) + VMSTATE_SINGLE(_f, _s, _t, vmstate_info_int16, int16_t) #define VMSTATE_INT32_TEST(_f, _s, _t) \ - VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_int32, int32_t) + VMSTATE_SINGLE(_f, _s, _t, vmstate_info_int32, int32_t) #define VMSTATE_INT64_TEST(_f, _s, _t) \ - VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_int64, int64_t) - + VMSTATE_SINGLE(_f, _s, _t, vmstate_info_int64, int64_t) #define VMSTATE_UINT8_TEST(_f, _s, _t) \ - VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_uint8, uint8_t) + VMSTATE_SINGLE(_f, _s, _t, vmstate_info_uint8, uint8_t) #define VMSTATE_UINT16_TEST(_f, _s, _t) \ - VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_uint16, uint16_t) + VMSTATE_SINGLE(_f, _s, _t, vmstate_info_uint16, uint16_t) #define VMSTATE_UINT32_TEST(_f, _s, _t) \ - VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_uint32, uint32_t) + VMSTATE_SINGLE(_f, _s, _t, vmstate_info_uint32, uint32_t) #define VMSTATE_UINT64_TEST(_f, _s, _t) \ - VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_uint64, uint64_t) + VMSTATE_SINGLE(_f, _s, _t, vmstate_info_uint64, uint64_t) #define VMSTATE_BOOL(_f, _s) \ VMSTATE_BOOL_TEST(_f, _s, NULL) @@ -533,28 +531,28 @@ extern const VMStateInfo vmstate_info_bitmap; VMSTATE_UINT64_TEST(_f, _s, NULL) #define VMSTATE_UINT8_EQUAL(_f, _s) \ - VMSTATE_SINGLE_TEST(_f, _s, NULL, 0, vmstate_info_uint8_equal, uint8_t) + VMSTATE_SINGLE(_f, _s, NULL, vmstate_info_uint8_equal, uint8_t) #define VMSTATE_UINT16_EQUAL_TEST(_f, _s, _t) \ - VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_uint16_equal, uint16_t) + VMSTATE_SINGLE(_f, _s, _t, vmstate_info_uint16_equal, uint16_t) #define VMSTATE_UINT16_EQUAL(_f, _s) \ VMSTATE_UINT16_EQUAL_TEST(_f, _s, NULL) #define VMSTATE_UINT32_EQUAL(_f, _s) \ - VMSTATE_SINGLE_TEST(_f, _s, NULL, 0, vmstate_info_uint32_equal, uint32_t) + VMSTATE_SINGLE(_f, _s, NULL, vmstate_info_uint32_equal, uint32_t) #define VMSTATE_UINT64_EQUAL(_f, _s) \ - VMSTATE_SINGLE_TEST(_f, _s, NULL, 0, vmstate_info_uint64_equal, uint64_t) + VMSTATE_SINGLE(_f, _s, NULL, vmstate_info_uint64_equal, uint64_t) #define VMSTATE_INT32_EQUAL(_f, _s) \ - VMSTATE_SINGLE_TEST(_f, _s, NULL, 0, vmstate_info_int32_equal, int32_t) + VMSTATE_SINGLE(_f, _s, NULL, vmstate_info_int32_equal, int32_t) #define VMSTATE_INT32_POSITIVE_LE(_f, _s) \ - VMSTATE_SINGLE_TEST(_f, _s, NULL, 0, vmstate_info_int32_le, int32_t) + VMSTATE_SINGLE(_f, _s, NULL, vmstate_info_int32_le, int32_t) #define VMSTATE_FLOAT64(_f, _s) \ - VMSTATE_SINGLE_TEST(_f, _s, NULL, 0, vmstate_info_float64, float64) + VMSTATE_SINGLE(_f, _s, NULL, vmstate_info_float64, float64) #define VMSTATE_TIMER_TEST(_f, _s, _test) \ VMSTATE_POINTER_TEST(_f, _s, _test, vmstate_info_timer, QEMUTimer *) diff --git a/target-i386/machine.c b/target-i386/machine.c index 1b8e3c4..8e4a518 100644 --- a/target-i386/machine.c +++ b/target-i386/machine.c @@ -245,7 +245,7 @@ static const VMStateInfo vmstate_hack_uint64_as_uint32 = { }; #define VMSTATE_HACK_UINT32(_f, _s, _t) \ - VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_hack_uint64_as_uint32, uint64_t) + VMSTATE_SINGLE(_f, _s, _t, vmstate_hack_uint64_as_uint32, uint64_t) #endif static void cpu_pre_save(void *opaque) -- 1.9.0