[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 21/22] vmstate: Return error in case of error
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PULL 21/22] vmstate: Return error in case of error |
Date: |
Tue, 24 Jun 2014 15:10:11 +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 <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
---
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;
}
--
1.9.3
- [Qemu-devel] [PULL 10/22] tests: vmstate static checker: remove a field, (continued)
- [Qemu-devel] [PULL 10/22] tests: vmstate static checker: remove a field, Juan Quintela, 2014/06/24
- [Qemu-devel] [PULL 11/22] tests: vmstate static checker: remove last field in a struct, Juan Quintela, 2014/06/24
- [Qemu-devel] [PULL 12/22] tests: vmstate static checker: change description name, Juan Quintela, 2014/06/24
- [Qemu-devel] [PULL 13/22] tests: vmstate static checker: remove Fields, Juan Quintela, 2014/06/24
- [Qemu-devel] [PULL 14/22] tests: vmstate static checker: remove Description, Juan Quintela, 2014/06/24
- [Qemu-devel] [PULL 15/22] tests: vmstate static checker: remove Description inside Fields, Juan Quintela, 2014/06/24
- [Qemu-devel] [PULL 16/22] tests: vmstate static checker: remove a subsection, Juan Quintela, 2014/06/24
- [Qemu-devel] [PULL 17/22] tests: vmstate static checker: remove Subsections, Juan Quintela, 2014/06/24
- [Qemu-devel] [PULL 18/22] tests: vmstate static checker: add substructure for usb-kbd for hid section, Juan Quintela, 2014/06/24
- [Qemu-devel] [PULL 19/22] tests: vmstate static checker: add size mismatch inside substructure, Juan Quintela, 2014/06/24
- [Qemu-devel] [PULL 21/22] vmstate: Return error in case of error,
Juan Quintela <=
- [Qemu-devel] [PULL 20/22] migration: Remove unneeded minimum_version_id_old, Juan Quintela, 2014/06/24
- [Qemu-devel] [PULL 22/22] vmstate: Refactor & increase tests for primitive types, Juan Quintela, 2014/06/24
- Re: [Qemu-devel] [PULL 00/22] Migration queue, Peter Maydell, 2014/06/24