diff options
author | Cédric Le Goater <clg@redhat.com> | 2024-03-20 07:49:04 +0100 |
---|---|---|
committer | Peter Xu <peterx@redhat.com> | 2024-04-23 18:36:01 -0400 |
commit | e4fa064d5610a96e50b49c1ea34c98ef12d0034a (patch) | |
tree | ffcbdf0f6dc90c3142859ff6d6fabe103d1f92a3 /migration/savevm.c | |
parent | 01c3ac681bd6709d2bf6a7d9591c40a394e39536 (diff) | |
download | qemu-e4fa064d5610a96e50b49c1ea34c98ef12d0034a.zip qemu-e4fa064d5610a96e50b49c1ea34c98ef12d0034a.tar.gz qemu-e4fa064d5610a96e50b49c1ea34c98ef12d0034a.tar.bz2 |
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>
Diffstat (limited to 'migration/savevm.c')
-rw-r--r-- | migration/savevm.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/migration/savevm.c b/migration/savevm.c index a2679ba..5d200cf 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -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; } |