From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50882) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WX08R-000565-OO for qemu-devel@nongnu.org; Sun, 06 Apr 2014 23:22:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WX08K-0007qz-9z for qemu-devel@nongnu.org; Sun, 06 Apr 2014 23:22:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:65218) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WX08K-0007om-2s for qemu-devel@nongnu.org; Sun, 06 Apr 2014 23:22:04 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s373M3tq031134 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 6 Apr 2014 23:22:03 -0400 From: Juan Quintela Date: Mon, 7 Apr 2014 05:20:21 +0200 Message-Id: <1396840915-10384-4-git-send-email-quintela@redhat.com> In-Reply-To: <1396840915-10384-1-git-send-email-quintela@redhat.com> References: <1396840915-10384-1-git-send-email-quintela@redhat.com> Subject: [Qemu-devel] [PATCH 03/97] vmstate: return error in case of error List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org If there is an error while loading a field, we should stop reading and not continue with the rest of fields. Signed-off-by: Juan Quintela --- vmstate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vmstate.c b/vmstate.c index bfa34cc..d82cccf 100644 --- a/vmstate.c +++ b/vmstate.c @@ -74,6 +74,9 @@ 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) { trace_vmstate_load_field_error(field->name, ret); return ret; -- 1.9.0