From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:45051) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7XNA-000534-Bx for qemu-devel@nongnu.org; Tue, 13 Mar 2012 15:27:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S7XN8-0000F4-7P for qemu-devel@nongnu.org; Tue, 13 Mar 2012 15:27:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7089) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7XN7-0000Ev-Vg for qemu-devel@nongnu.org; Tue, 13 Mar 2012 15:27:02 -0400 From: Juan Quintela In-Reply-To: <4F5F781C.4080502@suse.de> ("Andreas =?utf-8?Q?F=C3=A4rber=22?= =?utf-8?Q?'s?= message of "Tue, 13 Mar 2012 17:38:52 +0100") References: <20120313060536.7941.37036.stgit@dhcp-8-167.nay.redhat.com> <4F5F781C.4080502@suse.de> Date: Tue, 13 Mar 2012 18:46:55 +0100 Message-ID: <8762e8tmuo.fsf@elfo.elfo> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RESEND PATCH] vmstate: fix varrays with uint32_t indexes Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?utf-8?Q?F=C3=A4rber?= Cc: aliguori@us.ibm.com, jasowang@redhat.com, qemu-devel@nongnu.org, blauwirbel@gmail.com, hpoussin@reactos.org, Amos Kong Andreas F=C3=A4rber wrote: > Am 13.03.2012 07:05, schrieb Amos Kong: >> VMSTATE_VARRAY_UINT32() is used in hw/ds1225y.c, and we checked >> VMS_VARRAY_UINT32 bit of field->flags in vmstate_load_state(), >> but we don't check this bit in vmstate_save_state(). > > So what were the symptoms? Does this need to be backported to stable? You don't initialize n_elems correctly when saving. It is only used (currently) with ds1225y.c, that is used on mips_jazz, and mips_jazz don't support migration. So it is up to you if it is needed for stable or not (it is not urgent, though). Later, Juan. > Andreas > >>=20 >> Signed-off-by: Amos Kong >> --- >> savevm.c | 2 ++ >> 1 files changed, 2 insertions(+), 0 deletions(-) >>=20 >> diff --git a/savevm.c b/savevm.c >> index 80be1ff..694eaa4 100644 >> --- a/savevm.c >> +++ b/savevm.c >> @@ -1486,6 +1486,8 @@ void vmstate_save_state(QEMUFile *f, const VMState= Description *vmsd, >> n_elems =3D field->num; >> } else if (field->flags & VMS_VARRAY_INT32) { >> n_elems =3D *(int32_t *)(opaque+field->num_offset); >> + } else if (field->flags & VMS_VARRAY_UINT32) { >> + n_elems =3D *(uint32_t *)(opaque+field->num_offset); >> } else if (field->flags & VMS_VARRAY_UINT16) { >> n_elems =3D *(uint16_t *)(opaque+field->num_offset); >> } else if (field->flags & VMS_VARRAY_UINT8) {