From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51784) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WX09r-0007ft-FA for qemu-devel@nongnu.org; Sun, 06 Apr 2014 23:23:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WX09j-000079-Vm for qemu-devel@nongnu.org; Sun, 06 Apr 2014 23:23:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32043) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WX09j-00006w-OW for qemu-devel@nongnu.org; Sun, 06 Apr 2014 23:23:31 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s373NVmi005584 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 6 Apr 2014 23:23:31 -0400 From: Juan Quintela Date: Mon, 7 Apr 2014 05:21:25 +0200 Message-Id: <1396840915-10384-68-git-send-email-quintela@redhat.com> In-Reply-To: <1396840915-10384-1-git-send-email-quintela@redhat.com> References: <1396840915-10384-1-git-send-email-quintela@redhat.com> Subject: [Qemu-devel] [PATCH 67/97] vmstate: Move all users of versioning of VMSTATE_STRUCT_ARRAY to _TEST List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Signed-off-by: Juan Quintela --- hw/char/escc.c | 4 ++-- hw/ide/internal.h | 3 ++- hw/timer/i8254_common.c | 5 +++-- target-i386/machine.c | 15 +++++++++------ 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/hw/char/escc.c b/hw/char/escc.c index 4875a2b..dc5768f 100644 --- a/hw/char/escc.c +++ b/hw/char/escc.c @@ -678,8 +678,8 @@ static const VMStateDescription vmstate_escc = { .version_id = 2, .minimum_version_id = 1, .fields = (VMStateField[]) { - VMSTATE_STRUCT_ARRAY(chn, ESCCState, 2, 2, vmstate_escc_chn, - ChannelState), + VMSTATE_STRUCT_ARRAY_TEST(chn, ESCCState, 2, vmstate_2_plus, 0, + vmstate_escc_chn, ChannelState), VMSTATE_END_OF_LIST() } }; diff --git a/hw/ide/internal.h b/hw/ide/internal.h index 0567a52..d771308 100644 --- a/hw/ide/internal.h +++ b/hw/ide/internal.h @@ -526,7 +526,8 @@ extern const VMStateDescription vmstate_ide_bus; extern const VMStateDescription vmstate_ide_drive; #define VMSTATE_IDE_DRIVES(_field, _state) \ - VMSTATE_STRUCT_ARRAY(_field, _state, 2, 3, vmstate_ide_drive, IDEState) + VMSTATE_STRUCT_ARRAY_TEST(_field, _state, 2, vmstate_3_plus, 0,\ + vmstate_ide_drive, IDEState) void ide_bus_reset(IDEBus *bus); int64_t ide_get_sector(IDEState *s); diff --git a/hw/timer/i8254_common.c b/hw/timer/i8254_common.c index f519864..b7bd908 100644 --- a/hw/timer/i8254_common.c +++ b/hw/timer/i8254_common.c @@ -268,8 +268,9 @@ static const VMStateDescription vmstate_pit_common = { .fields = (VMStateField[]) { VMSTATE_UINT32_TEST(channels[0].irq_disabled, PITCommonState, vmstate_3_plus), - VMSTATE_STRUCT_ARRAY(channels, PITCommonState, 3, 2, - vmstate_pit_channel, PITChannelState), + VMSTATE_STRUCT_ARRAY_TEST(channels, PITCommonState, 3, + vmstate_2_plus, 0, vmstate_pit_channel, + PITChannelState), VMSTATE_INT64(channels[0].next_transition_time, PITCommonState), /* formerly irq_timer */ VMSTATE_END_OF_LIST() diff --git a/target-i386/machine.c b/target-i386/machine.c index 09c1f50..ac9dde1 100644 --- a/target-i386/machine.c +++ b/target-i386/machine.c @@ -57,8 +57,9 @@ static const VMStateDescription vmstate_ymmh_reg = { } }; -#define VMSTATE_YMMH_REGS_VARS(_field, _state, _n, _v) \ - VMSTATE_STRUCT_ARRAY(_field, _state, _n, _v, vmstate_ymmh_reg, XMMReg) +#define VMSTATE_YMMH_REGS_VARS(_field, _state, _n, _t) \ + VMSTATE_STRUCT_ARRAY_TEST(_field, _state, _n, _t, 0,\ + vmstate_ymmh_reg, XMMReg) static const VMStateDescription vmstate_bnd_regs = { .name = "bnd_regs", @@ -85,8 +86,9 @@ static const VMStateDescription vmstate_mtrr_var = { } }; -#define VMSTATE_MTRR_VARS(_field, _state, _n, _v) \ - VMSTATE_STRUCT_ARRAY(_field, _state, _n, _v, vmstate_mtrr_var, MTRRVar) +#define VMSTATE_MTRR_VARS(_field, _state, _n, _t) \ + VMSTATE_STRUCT_ARRAY_TEST(_field, _state, _n, _t, 0,\ + vmstate_mtrr_var, MTRRVar) static void put_fpreg_error(QEMUFile *f, void *opaque, size_t size) { @@ -669,7 +671,7 @@ const VMStateDescription vmstate_x86_cpu = { /* MTRRs */ 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), + VMSTATE_MTRR_VARS(env.mtrr_var, X86CPU, 8, vmstate_8_plus), /* KVM-related states */ VMSTATE_INT32_TEST(env.interrupt_injected, X86CPU, vmstate_9_plus), VMSTATE_UINT32_TEST(env.mp_state, X86CPU, vmstate_9_plus), @@ -694,7 +696,8 @@ const VMStateDescription vmstate_x86_cpu = { /* XSAVE related fields */ VMSTATE_UINT64_TEST(env.xcr0, X86CPU, vmstate_12_plus), VMSTATE_UINT64_TEST(env.xstate_bv, X86CPU, vmstate_12_plus), - VMSTATE_YMMH_REGS_VARS(env.ymmh_regs, X86CPU, CPU_NB_REGS, 12), + VMSTATE_YMMH_REGS_VARS(env.ymmh_regs, X86CPU, CPU_NB_REGS, + vmstate_12_plus), VMSTATE_END_OF_LIST() /* The above list is not sorted /wrt version numbers, watch out! */ }, -- 1.9.0