From patchwork Fri Sep 11 10:10:29 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 33431 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 5E1D9B6F34 for ; Fri, 11 Sep 2009 20:33:28 +1000 (EST) Received: from localhost ([127.0.0.1]:53811 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mm3RV-00048d-9n for incoming@patchwork.ozlabs.org; Fri, 11 Sep 2009 06:33:25 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mm38M-0004Re-HH for qemu-devel@nongnu.org; Fri, 11 Sep 2009 06:13:38 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mm38H-0004Oy-PU for qemu-devel@nongnu.org; Fri, 11 Sep 2009 06:13:37 -0400 Received: from [199.232.76.173] (port=36110 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mm38H-0004Oq-CR for qemu-devel@nongnu.org; Fri, 11 Sep 2009 06:13:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:26839) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mm38G-0000z7-2R for qemu-devel@nongnu.org; Fri, 11 Sep 2009 06:13:32 -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 n8BADUqg001410 for ; Fri, 11 Sep 2009 06:13:30 -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 n8BADJVa025817; Fri, 11 Sep 2009 06:13:29 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Fri, 11 Sep 2009 12:10:29 +0200 Message-Id: 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 09/20] vmstate: create VMSTATE_STRUCT_POINTER 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 Signed-off-by: Juan Quintela --- hw/hw.h | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/hw/hw.h b/hw/hw.h index b967670..649eb24 100644 --- a/hw/hw.h +++ b/hw/hw.h @@ -387,6 +387,15 @@ extern const VMStateInfo vmstate_info_buffer; + type_check(_type,typeof_field(_state, _field)) \ } +#define VMSTATE_STRUCT_POINTER(_field, _state, _vmsd, _type) { \ + .name = (stringify(_field)), \ + .vmsd = &(_vmsd), \ + .size = sizeof(_type), \ + .flags = VMS_STRUCT|VMS_POINTER, \ + .offset = offsetof(_state, _field) \ + + type_check(_type,typeof_field(_state, _field)) \ +} + #define VMSTATE_STRUCT_ARRAY(_field, _state, _num, _version, _vmsd, _type) { \ .name = (stringify(_field)), \ .num = (_num), \