From patchwork Tue Mar 12 03:06:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 226752 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)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id AD2732C0095 for ; Tue, 12 Mar 2013 14:09:17 +1100 (EST) Received: from localhost ([::1]:51658 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFFaV-0000pD-RR for incoming@patchwork.ozlabs.org; Mon, 11 Mar 2013 23:09:15 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44253) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFFXi-0004cr-TG for qemu-devel@nongnu.org; Mon, 11 Mar 2013 23:06:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UFFXY-0000Ry-2p for qemu-devel@nongnu.org; Mon, 11 Mar 2013 23:06:22 -0400 Received: from ozlabs.org ([2402:b800:7003:1:1::1]:39245) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFFXX-0000RT-Mg for qemu-devel@nongnu.org; Mon, 11 Mar 2013 23:06:12 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 9B1CE2C02B4; Tue, 12 Mar 2013 14:06:09 +1100 (EST) From: David Gibson To: aliguori@us.ibm.com, quintela@redhat.com Date: Tue, 12 Mar 2013 14:06:03 +1100 Message-Id: <1363057565-23671-5-git-send-email-david@gibson.dropbear.id.au> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1363057565-23671-1-git-send-email-david@gibson.dropbear.id.au> References: <1363057565-23671-1-git-send-email-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2402:b800:7003:1:1::1 Cc: David Gibson , qemu-devel@nongnu.org, agraf@suse.de Subject: [Qemu-devel] [PATCH 4/6] savevm: Add VMSTATE_STRUCT_VARRAY_POINTER_UINT32 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 Currently the savevm code contains a VMSTATE_STRUCT_VARRAY_POINTER_INT32 helper (a variably sized array with the number of elements in an int32_t), but not VMSTATE_STRUCT_VARRAY_POINTER_UINT32 (... with the number of elements in a uint32_t). This patch (trivially) fixes the deficiency. Signed-off-by: David Gibson --- include/migration/vmstate.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index f0a6374..fe39cd9 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -339,6 +339,16 @@ extern const VMStateInfo vmstate_info_bitmap; .offset = vmstate_offset_pointer(_state, _field, _type), \ } +#define VMSTATE_STRUCT_VARRAY_POINTER_UINT32(_field, _state, _field_num, _vmsd, _type) { \ + .name = (stringify(_field)), \ + .version_id = 0, \ + .num_offset = vmstate_offset_value(_state, _field_num, uint32_t),\ + .size = sizeof(_type), \ + .vmsd = &(_vmsd), \ + .flags = VMS_POINTER | VMS_VARRAY_INT32 | VMS_STRUCT, \ + .offset = vmstate_offset_pointer(_state, _field, _type), \ +} + #define VMSTATE_STRUCT_VARRAY_POINTER_UINT16(_field, _state, _field_num, _vmsd, _type) { \ .name = (stringify(_field)), \ .version_id = 0, \