mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -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
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue