From: Juan Quintela Date: Sat, 5 Apr 2014 18:16:22 +0000 (+0200) Subject: vmstate: Return error in case of error X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=13cde50889237a516c76f38a93d7bcac3cf915da;p=qemu.git vmstate: Return error in case of error 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 Reviewed-by: Dr. David Alan Gilbert --- diff --git a/vmstate.c b/vmstate.c index b5882fae67..c9965205df 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; }