From patchwork Mon Oct 19 18:42:59 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 36407 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id BFD49B7B75 for ; Tue, 20 Oct 2009 06:14:33 +1100 (EST) Received: from localhost ([127.0.0.1]:38643 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mzxgb-0000ln-SO for incoming@patchwork.ozlabs.org; Mon, 19 Oct 2009 15:14:29 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MzxDH-0006EQ-AR for qemu-devel@nongnu.org; Mon, 19 Oct 2009 14:44:11 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MzxD5-00068D-AA for qemu-devel@nongnu.org; Mon, 19 Oct 2009 14:44:04 -0400 Received: from [199.232.76.173] (port=49047 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MzxD4-00067w-Tw for qemu-devel@nongnu.org; Mon, 19 Oct 2009 14:43:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:2123) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MzxD4-0006Ke-EM for qemu-devel@nongnu.org; Mon, 19 Oct 2009 14:43:58 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n9JIhvMe031012 for ; Mon, 19 Oct 2009 14:43:57 -0400 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n9JIhcC7012656; Mon, 19 Oct 2009 14:43:56 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Mon, 19 Oct 2009 20:42:59 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH 14/25] vmstate: Add version arg to VMSTATE_SINGLE_TEST() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This allows to define VMSTATE_SINGLE with VMSTATE_SINGLE_TEST Signed-off-by: Juan Quintela --- hw/hw.h | 17 ++++++----------- target-i386/machine.c | 2 +- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/hw/hw.h b/hw/hw.h index eb199fb..3feb9df 100644 --- a/hw/hw.h +++ b/hw/hw.h @@ -355,17 +355,9 @@ extern const VMStateInfo vmstate_info_buffer; vmstate_offset_array(_state, _field, uint8_t, \ sizeof(typeof_field(_state, _field))) -#define VMSTATE_SINGLE(_field, _state, _version, _info, _type) { \ - .name = (stringify(_field)), \ - .version_id = (_version), \ - .size = sizeof(_type), \ - .info = &(_info), \ - .flags = VMS_SINGLE, \ - .offset = vmstate_offset_value(_state, _field, _type), \ -} - -#define VMSTATE_SINGLE_TEST(_field, _state, _test, _info, _type) { \ +#define VMSTATE_SINGLE_TEST(_field, _state, _test, _version, _info, _type) { \ .name = (stringify(_field)), \ + .version_id = (_version), \ .field_exists = (_test), \ .size = sizeof(_type), \ .info = &(_info), \ @@ -505,6 +497,9 @@ extern const VMStateDescription vmstate_i2c_slave; _v : version */ +#define VMSTATE_SINGLE(_field, _state, _version, _info, _type) \ + VMSTATE_SINGLE_TEST(_field, _state, NULL, _version, _info, _type) + #define VMSTATE_INT8_V(_f, _s, _v) \ VMSTATE_SINGLE(_f, _s, _v, vmstate_info_int8, int8_t) #define VMSTATE_INT16_V(_f, _s, _v) \ @@ -557,7 +552,7 @@ extern const VMStateDescription vmstate_i2c_slave; VMSTATE_SINGLE(_f, _s, 0, vmstate_info_int32_le, int32_t) #define VMSTATE_UINT32_TEST(_f, _s, _t) \ - VMSTATE_SINGLE_TEST(_f, _s, _t, vmstate_info_uint32, uint32_t) + VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_uint32, uint32_t) #define VMSTATE_TIMER_V(_f, _s, _v) \ VMSTATE_POINTER(_f, _s, _v, vmstate_info_timer, QEMUTimer *) diff --git a/target-i386/machine.c b/target-i386/machine.c index 26d012d..869c681 100644 --- a/target-i386/machine.c +++ b/target-i386/machine.c @@ -314,7 +314,7 @@ static const VMStateInfo vmstate_hack_uint64_as_uint32 = { }; #define VMSTATE_HACK_UINT32(_f, _s, _t) \ - VMSTATE_SINGLE_TEST(_f, _s, _t, vmstate_hack_uint64_as_uint32, uint64_t) + VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_hack_uint64_as_uint32, uint64_t) #endif static void cpu_pre_save(void *opaque)