]> Git Repo - qemu.git/commitdiff
vmstate: Return error in case of error
authorJuan Quintela <[email protected]>
Sat, 5 Apr 2014 18:16:22 +0000 (20:16 +0200)
committerJuan Quintela <[email protected]>
Mon, 23 Jun 2014 17:14:52 +0000 (19:14 +0200)
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 <[email protected]>
Reviewed-by: Dr. David Alan Gilbert <[email protected]>
vmstate.c

index b5882fae6719f324607f5e832de6b4de21dd6776..c9965205dfd608ea4b8eaddd93671fcc4ead584c 100644 (file)
--- 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;
                 }
This page took 0.0261400000000001 seconds and 4 git commands to generate.