summary refs log tree commit diff stats
path: root/migration/savevm.h
diff options
context:
space:
mode:
authorArun Menon <armenon@redhat.com>2025-09-18 20:53:26 +0530
committerPeter Xu <peterx@redhat.com>2025-10-03 09:48:02 -0400
commitdeecb4e7133c573a85558e29dff61ae428a9cfe8 (patch)
tree3f44d0a638e376f781515e37b9dd47884cf7f7bb /migration/savevm.h
parent84279d5dc1afb115c673007d65bae575da04e115 (diff)
downloadfocaccia-qemu-deecb4e7133c573a85558e29dff61ae428a9cfe8.tar.gz
focaccia-qemu-deecb4e7133c573a85558e29dff61ae428a9cfe8.zip
migration: push Error **errp into qemu_loadvm_state_main()
This is an incremental step in converting vmstate loading
code to report error via Error objects instead of directly
printing it to console/monitor.
It is ensured that qemu_loadvm_state_main() must report an error
in errp, in case of failure.

Set errp explicitly if it is NULL in case of failure in the out
section. This will be removed in the subsequent patch when all of
the calls are converted to passing errp.

The error message in the default case of qemu_loadvm_state_main()
has the word "savevm". This is removed because it can confuse the
user while reading destination side error logs.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Arun Menon <armenon@redhat.com>
Tested-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Link: https://lore.kernel.org/r/20250918-propagate_tpm_error-v14-9-36f11a6fb9d3@redhat.com
Signed-off-by: Peter Xu <peterx@redhat.com>
Diffstat (limited to 'migration/savevm.h')
-rw-r--r--migration/savevm.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/migration/savevm.h b/migration/savevm.h
index b12681839f..c337e3e3d1 100644
--- a/migration/savevm.h
+++ b/migration/savevm.h
@@ -66,7 +66,8 @@ int qemu_save_device_state(QEMUFile *f);
 
 int qemu_loadvm_state(QEMUFile *f, Error **errp);
 void qemu_loadvm_state_cleanup(MigrationIncomingState *mis);
-int qemu_loadvm_state_main(QEMUFile *f, MigrationIncomingState *mis);
+int qemu_loadvm_state_main(QEMUFile *f, MigrationIncomingState *mis,
+                           Error **errp);
 int qemu_load_device_state(QEMUFile *f, Error **errp);
 int qemu_loadvm_approve_switchover(void);
 int qemu_savevm_state_complete_precopy_non_iterable(QEMUFile *f,