migration: push Error **errp into vmstate_load_state()
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 vmstate_load_state() must report an error in errp, in case of failure. The errors are temporarily reported using error_report_err(). This is removed in the subsequent patches in this series, when we are actually able to propagate the error to the calling function using errp. Whereas, if we want the function to exit on error, then error_fatal is passed. Reviewed-by: Marc-André Lureau <marcandre.lureau@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-2-36f11a6fb9d3@redhat.com Signed-off-by: Peter Xu <peterx@redhat.com>
This commit is contained in:
parent
73b42fc58d
commit
c632ffbd74
15 changed files with 143 additions and 55 deletions
|
|
@ -1196,7 +1196,7 @@ extern const VMStateInfo vmstate_info_qlist;
|
|||
}
|
||||
|
||||
int vmstate_load_state(QEMUFile *f, const VMStateDescription *vmsd,
|
||||
void *opaque, int version_id);
|
||||
void *opaque, int version_id, Error **errp);
|
||||
int vmstate_save_state(QEMUFile *f, const VMStateDescription *vmsd,
|
||||
void *opaque, JSONWriter *vmdesc);
|
||||
int vmstate_save_state_with_err(QEMUFile *f, const VMStateDescription *vmsd,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue