From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58411) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwqrH-000066-2b for qemu-devel@nongnu.org; Tue, 17 Jun 2014 06:43:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WwqrA-0001Mk-SR for qemu-devel@nongnu.org; Tue, 17 Jun 2014 06:43:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:13758) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwqrA-0001MY-K5 for qemu-devel@nongnu.org; Tue, 17 Jun 2014 06:43:12 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s5HAhBHN013908 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 17 Jun 2014 06:43:11 -0400 Date: Tue, 17 Jun 2014 11:43:05 +0100 From: "Dr. David Alan Gilbert" Message-ID: <20140617104304.GE2503@work-vm> References: <1402912703-28195-1-git-send-email-quintela@redhat.com> <1402912703-28195-3-git-send-email-quintela@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1402912703-28195-3-git-send-email-quintela@redhat.com> Subject: Re: [Qemu-devel] [PATCH 02/27] vmstate: Return error in case of error List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: qemu-devel@nongnu.org * Juan Quintela (quintela@redhat.com) wrote: > If there is an error while loading a field, we should stop reading and > not continue with the rest of fields. And we should also set an error > in qemu_file. > > Signed-off-by: Juan Quintela > --- > vmstate.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/vmstate.c b/vmstate.c > index b5882fa..c996520 100644 > --- a/vmstate.c > +++ b/vmstate.c > @@ -98,7 +98,11 @@ int vmstate_load_state(QEMUFile *f, const VMStateDescription *vmsd, > ret = field->info->get(f, addr, size); > > } > + if (ret >= 0) { > + ret = qemu_file_get_error(f); > + } > if (ret < 0) { > + qemu_file_set_error(f, ret); > trace_vmstate_load_field_error(field->name, ret); > return ret; > } Reviewed-by: Dr. David Alan Gilbert I wonder about turning that trace into an error_report; the process is doomed anyway at this point and it would be nice to know why. Dave -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK