From patchwork Wed Oct 14 17:34:53 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 36000 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 6D16EB7B72 for ; Thu, 15 Oct 2009 04:39:40 +1100 (EST) Received: from localhost ([127.0.0.1]:50997 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1My7p3-0004il-FA for incoming@patchwork.ozlabs.org; Wed, 14 Oct 2009 13:39:37 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1My7lH-0002I8-5P for qemu-devel@nongnu.org; Wed, 14 Oct 2009 13:35:43 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1My7lC-0002Fc-Gx for qemu-devel@nongnu.org; Wed, 14 Oct 2009 13:35:42 -0400 Received: from [199.232.76.173] (port=55241 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1My7lC-0002FZ-Aq for qemu-devel@nongnu.org; Wed, 14 Oct 2009 13:35:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32935) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1My7lB-0008MH-Ta for qemu-devel@nongnu.org; Wed, 14 Oct 2009 13:35:38 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n9EHZbwT003677 for ; Wed, 14 Oct 2009 13:35:37 -0400 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n9EHZXFn001016; Wed, 14 Oct 2009 13:35:36 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 14 Oct 2009 19:34:53 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH 02/16] vmstate: Add support for partial buffers transmission 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 | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/hw/hw.h b/hw/hw.h index 8c223f8..6f7b7d4 100644 --- a/hw/hw.h +++ b/hw/hw.h @@ -464,6 +464,16 @@ extern const VMStateInfo vmstate_info_buffer; + type_check_array(uint8_t,typeof_field(_state, _field),sizeof(typeof_field(_state,_field))) \ } +#define VMSTATE_PARTIAL_BUFFER(_field, _state, _version, _size) { \ + .name = (stringify(_field)), \ + .version_id = (_version), \ + .size = (_size), \ + .info = &vmstate_info_buffer, \ + .flags = VMS_BUFFER, \ + .offset = offsetof(_state, _field) \ + + type_check_array(uint8_t,typeof_field(_state, _field),sizeof(typeof_field(_state,_field))) \ +} + #define VMSTATE_BUFFER_START_MIDDLE(_field, _state, start) { \ .name = (stringify(_field)), \ .size = sizeof(typeof_field(_state,_field)) - start, \