From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34712) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UG7Sa-00010v-V5 for qemu-devel@nongnu.org; Thu, 14 Mar 2013 08:40:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UG7SW-0001Cn-NK for qemu-devel@nongnu.org; Thu, 14 Mar 2013 08:40:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38590) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UG7SW-0001Ce-FX for qemu-devel@nongnu.org; Thu, 14 Mar 2013 08:40:36 -0400 From: Juan Quintela In-Reply-To: <1363057565-23671-5-git-send-email-david@gibson.dropbear.id.au> (David Gibson's message of "Tue, 12 Mar 2013 14:06:03 +1100") References: <1363057565-23671-1-git-send-email-david@gibson.dropbear.id.au> <1363057565-23671-5-git-send-email-david@gibson.dropbear.id.au> Date: Thu, 14 Mar 2013 13:40:37 +0100 Message-ID: <87ppz2f92y.fsf@elfo.elfo> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 4/6] savevm: Add VMSTATE_STRUCT_VARRAY_POINTER_UINT32 Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, agraf@suse.de David Gibson wrote: > 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, \ We are overridding VMS_VARRAYS_INT32 here, but if we have so many elements in the array, we have other problems to fix O:-) > + .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, \