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 /hw | |
parent | 01c3ac681bd6709d2bf6a7d9591c40a394e39536 (diff) |
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 'hw')
-rw-r--r-- | hw/vfio/migration.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c index 5763c0b683..06ae40969b 100644 --- a/hw/vfio/migration.c +++ b/hw/vfio/migration.c @@ -588,12 +588,17 @@ static void vfio_save_state(QEMUFile *f, void *opaque) } } -static int vfio_load_setup(QEMUFile *f, void *opaque) +static int vfio_load_setup(QEMUFile *f, void *opaque, Error **errp) { VFIODevice *vbasedev = opaque; + int ret; - return vfio_migration_set_state(vbasedev, VFIO_DEVICE_STATE_RESUMING, + ret = vfio_migration_set_state(vbasedev, VFIO_DEVICE_STATE_RESUMING, vbasedev->migration->device_state); + if (ret) { + error_setg(errp, "%s: Failed to set RESUMING state", vbasedev->name); + } + return ret; } static int vfio_load_cleanup(void *opaque) |