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 <quint...@redhat.com> --- 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