As we haven't yet moved everything that uses VMSTATE_STRUCT_TEST we create a temporary VMSTATE_STRUCT_INFO. This would allows us to not having to move fields to VMSTATE_STRUCT_TEST and then remove the version parameter.
Signed-off-by: Juan Quintela <quint...@redhat.com> --- hw/acpi/piix4.c | 2 +- include/migration/vmstate.h | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 252bbf2..091dca3 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -270,7 +270,7 @@ static const VMStateDescription vmstate_acpi = { acpi_pci_hotplug.acpi_pcihp_pci_status[ACPI_PCIHP_BSEL_DEFAULT], PIIX4PMState, vmstate_test_no_use_acpi_pci_hotplug, - 2, vmstate_pci_status, + vmstate_pci_status, struct AcpiPciHpPciStatus), VMSTATE_PCI_HOTPLUG(acpi_pci_hotplug, PIIX4PMState, vmstate_test_use_acpi_pci_hotplug), diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index 7bbac50..c6590cb 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -276,7 +276,7 @@ extern const VMStateInfo vmstate_info_bitmap; .offset = offsetof(_state, _field), \ } -#define VMSTATE_STRUCT_TEST(_field, _state, _test, _version, _vmsd, _type) { \ +#define VMSTATE_STRUCT_INFO(_field, _state, _test, _version, _vmsd, _type) { \ .name = (stringify(_field)), \ .version_id = (_version), \ .field_exists = (_test), \ @@ -447,8 +447,11 @@ extern const VMStateInfo vmstate_info_bitmap; _v : version */ +#define VMSTATE_STRUCT_TEST(_field, _state, _test, _vmsd, _type) \ + VMSTATE_STRUCT_INFO(_field, _state, _test, 0, _vmsd, _type) + #define VMSTATE_STRUCT(_field, _state, _version, _vmsd, _type) \ - VMSTATE_STRUCT_TEST(_field, _state, NULL, _version, _vmsd, _type) + VMSTATE_STRUCT_INFO(_field, _state, NULL, _version, _vmsd, _type) #define VMSTATE_STRUCT_POINTER(_field, _state, _vmsd, _type) \ VMSTATE_STRUCT_POINTER_TEST(_field, _state, NULL, _vmsd, _type) -- 1.9.0