From patchwork Mon Apr 21 14:40:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 340991 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 1EA731400E0 for ; Tue, 22 Apr 2014 13:12:44 +1000 (EST) Received: from localhost ([::1]:49446 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WcFom-0007CB-VJ for incoming@patchwork.ozlabs.org; Mon, 21 Apr 2014 11:07:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59249) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WcFRU-0005gn-6E for qemu-devel@nongnu.org; Mon, 21 Apr 2014 10:43:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WcFRN-0004Gh-Eb for qemu-devel@nongnu.org; Mon, 21 Apr 2014 10:43:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8769) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WcFRN-0004GO-70 for qemu-devel@nongnu.org; Mon, 21 Apr 2014 10:43:25 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s3LEhOFQ015743 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 21 Apr 2014 10:43:24 -0400 Received: from trasno.mitica (ovpn-116-41.ams2.redhat.com [10.36.116.41]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s3LEfi7I019220; Mon, 21 Apr 2014 10:43:23 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Mon, 21 Apr 2014 16:40:52 +0200 Message-Id: <1398091304-10677-73-git-send-email-quintela@redhat.com> In-Reply-To: <1398091304-10677-1-git-send-email-quintela@redhat.com> References: <1398091304-10677-1-git-send-email-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 072/124] vmstate: Move all users of versioning of VMSTATE_STRUCT_ARRAY to _TEST X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@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 2686390..7bb3c14 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) { @@ -672,7 +674,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), @@ -697,7 +699,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! */ },