From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:58702) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBXPv-0006tL-Tk for qemu-devel@nongnu.org; Wed, 05 Oct 2011 15:46:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RBXPu-0007Gp-Fn for qemu-devel@nongnu.org; Wed, 05 Oct 2011 15:46:11 -0400 Received: from mail-iy0-f173.google.com ([209.85.210.173]:44911) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBXPu-0007Ga-BO for qemu-devel@nongnu.org; Wed, 05 Oct 2011 15:46:10 -0400 Received: by iakc1 with SMTP id c1so1170694iak.4 for ; Wed, 05 Oct 2011 12:46:09 -0700 (PDT) Message-ID: <4E8CB3FE.1070606@codemonkey.ws> Date: Wed, 05 Oct 2011 14:46:06 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <52f527437b109e2cb82e80c37fec4e3b2d7c2cae.1317738629.git.quintela@redhat.com> In-Reply-To: <52f527437b109e2cb82e80c37fec4e3b2d7c2cae.1317738629.git.quintela@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 4/4] Revert "savevm: fix corruption in vmstate_subsection_load()." List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: pbonzini@redhat.com, qemu-devel@nongnu.org On 10/04/2011 09:38 AM, Juan Quintela wrote: > This reverts commit eb60260de0b050a5e8ab725e84d377d0b44c43ae. > > Conflicts: > > savevm.c > > We changed qemu_peek_byte() prototype, just fixed the rejects. > > Signed-off-by: Juan Quintela Reviewed-by: Anthony Liguori Regards, Anthony Liguori > --- > savevm.c | 10 +--------- > 1 files changed, 1 insertions(+), 9 deletions(-) > > diff --git a/savevm.c b/savevm.c > index db6ea12..aaa303e 100644 > --- a/savevm.c > +++ b/savevm.c > @@ -1715,12 +1715,6 @@ static const VMStateDescription *vmstate_get_subsection(const VMStateSubsection > static int vmstate_subsection_load(QEMUFile *f, const VMStateDescription *vmsd, > void *opaque) > { > - const VMStateSubsection *sub = vmsd->subsections; > - > - if (!sub || !sub->needed) { > - return 0; > - } > - > while (qemu_peek_byte(f, 0) == QEMU_VM_SUBSECTION) { > char idstr[256]; > int ret; > @@ -1742,7 +1736,7 @@ static int vmstate_subsection_load(QEMUFile *f, const VMStateDescription *vmsd, > /* it don't have a valid subsection name */ > return 0; > } > - sub_vmsd = vmstate_get_subsection(sub, idstr); > + sub_vmsd = vmstate_get_subsection(vmsd->subsections, idstr); > if (sub_vmsd == NULL) { > return -ENOENT; > } > @@ -1752,7 +1746,6 @@ static int vmstate_subsection_load(QEMUFile *f, const VMStateDescription *vmsd, > idstr[len] = 0; > version_id = qemu_get_be32(f); > > - assert(!sub_vmsd->subsections); > ret = vmstate_load_state(f, sub_vmsd, opaque, version_id); > if (ret) { > return ret; > @@ -1776,7 +1769,6 @@ static void vmstate_subsection_save(QEMUFile *f, const VMStateDescription *vmsd, > qemu_put_byte(f, len); > qemu_put_buffer(f, (uint8_t *)vmsd->name, len); > qemu_put_be32(f, vmsd->version_id); > - assert(!vmsd->subsections); > vmstate_save_state(f, vmsd, opaque); > } > sub++;