mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-26 19:42:33 -06:00
migration: Add Error** argument to .load_setup() handler
This will be useful to report errors at a higher level, mostly in VFIO today. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Peter Xu <peterx@redhat.com> Signed-off-by: Cédric Le Goater <clg@redhat.com> Link: https://lore.kernel.org/r/20240320064911.545001-9-clg@redhat.com [peterx: drop comment for ERRP_GUARD, per Markus] Signed-off-by: Peter Xu <peterx@redhat.com>
This commit is contained in:
parent
01c3ac681b
commit
e4fa064d56
4 changed files with 18 additions and 8 deletions
|
@ -2768,8 +2768,9 @@ static void qemu_loadvm_state_switchover_ack_needed(MigrationIncomingState *mis)
|
|||
trace_loadvm_state_switchover_ack_needed(mis->switchover_ack_pending_num);
|
||||
}
|
||||
|
||||
static int qemu_loadvm_state_setup(QEMUFile *f)
|
||||
static int qemu_loadvm_state_setup(QEMUFile *f, Error **errp)
|
||||
{
|
||||
ERRP_GUARD();
|
||||
SaveStateEntry *se;
|
||||
int ret;
|
||||
|
||||
|
@ -2784,10 +2785,11 @@ static int qemu_loadvm_state_setup(QEMUFile *f)
|
|||
}
|
||||
}
|
||||
|
||||
ret = se->ops->load_setup(f, se->opaque);
|
||||
ret = se->ops->load_setup(f, se->opaque, errp);
|
||||
if (ret < 0) {
|
||||
error_prepend(errp, "Load state of device %s failed: ",
|
||||
se->idstr);
|
||||
qemu_file_set_error(f, ret);
|
||||
error_report("Load state of device %s failed", se->idstr);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
@ -2968,7 +2970,8 @@ int qemu_loadvm_state(QEMUFile *f)
|
|||
return ret;
|
||||
}
|
||||
|
||||
if (qemu_loadvm_state_setup(f) != 0) {
|
||||
if (qemu_loadvm_state_setup(f, &local_err) != 0) {
|
||||
error_report_err(local_err);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue