From patchwork Mon Oct 19 19:07:38 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 36420 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 1E1C8B7B79 for ; Tue, 20 Oct 2009 06:44:08 +1100 (EST) Received: from localhost ([127.0.0.1]:46312 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mzy9F-0002Da-8t for incoming@patchwork.ozlabs.org; Mon, 19 Oct 2009 15:44:05 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mzxac-00027X-Jh for qemu-devel@nongnu.org; Mon, 19 Oct 2009 15:08:18 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MzxaW-00020G-IS for qemu-devel@nongnu.org; Mon, 19 Oct 2009 15:08:17 -0400 Received: from [199.232.76.173] (port=35042 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MzxaW-0001zy-CC for qemu-devel@nongnu.org; Mon, 19 Oct 2009 15:08:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8400) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MzxaV-0001Jj-SB for qemu-devel@nongnu.org; Mon, 19 Oct 2009 15:08:12 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n9JJ8BUQ029308 for ; Mon, 19 Oct 2009 15:08:11 -0400 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n9JJ86rg030338; Mon, 19 Oct 2009 15:08:10 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Mon, 19 Oct 2009 21:07:38 +0200 Message-Id: <298287ae20c9cbd3f30f4997ac874a7cb28a7a54.1255979118.git.quintela@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH 2/2] vmstate: add VMSTATE_ARRAY_UNSAFE 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 Use offset given as an array of type given, without doing typechecking. Signed-off-by: Juan Quintela --- hw/hw.h | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/hw/hw.h b/hw/hw.h index 422cf18..9218905 100644 --- a/hw/hw.h +++ b/hw/hw.h @@ -382,6 +382,16 @@ extern const VMStateInfo vmstate_info_buffer; + type_check_array(_type,typeof_field(_state, _field),_num) \ } +#define VMSTATE_ARRAY_UNSAFE(_field, _state, _num, _version, _info, _type) {\ + .name = (stringify(_field)), \ + .version_id = (_version), \ + .num = (_num), \ + .info = &(_info), \ + .size = sizeof(_type), \ + .flags = VMS_ARRAY, \ + .offset = offsetof(_state, _field) \ +} + #define VMSTATE_ARRAY_TEST(_field, _state, _num, _test, _info, _type) {\ .name = (stringify(_field)), \ .field_exists = (_test), \