aboutsummaryrefslogtreecommitdiff
path: root/migration/vmstate.c
diff options
context:
space:
mode:
Diffstat (limited to 'migration/vmstate.c')
-rw-r--r--migration/vmstate.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/migration/vmstate.c b/migration/vmstate.c
index 3226e8eb45..ae8abd3c32 100644
--- a/migration/vmstate.c
+++ b/migration/vmstate.c
@@ -308,15 +308,21 @@ bool vmstate_save_needed(const VMStateDescription *vmsd, void *opaque)
}
-void vmstate_save_state(QEMUFile *f, const VMStateDescription *vmsd,
+int vmstate_save_state(QEMUFile *f, const VMStateDescription *vmsd,
void *opaque, QJSON *vmdesc)
{
+ int ret = 0;
VMStateField *field = vmsd->fields;
trace_vmstate_save_state_top(vmsd->name);
if (vmsd->pre_save) {
- vmsd->pre_save(opaque);
+ ret = vmsd->pre_save(opaque);
+ trace_vmstate_save_state_pre_save_res(vmsd->name, ret);
+ if (ret) {
+ error_report("pre-save failed: %s", vmsd->name);
+ return ret;
+ }
}
if (vmdesc) {
@@ -381,6 +387,8 @@ void vmstate_save_state(QEMUFile *f, const VMStateDescription *vmsd,
}
vmstate_subsection_save(f, vmsd, opaque, vmdesc);
+
+ return 0;
}
static const VMStateDescription *