From: Kunkun Jiang <[email protected]> In the vfio_migration_init(), the SaveVMHandler is registered for VFIO device. But it lacks the operation of 'unregister'. It will lead to 'Segmentation fault (core dumped)' in qemu_savevm_state_setup(), if performing live migration after a VFIO device is hot deleted.
Fixes: 7c2f5f75f94 (vfio: Register SaveVMHandlers for VFIO device) Reported-by: Qixin Gan <[email protected]> Signed-off-by: Kunkun Jiang <[email protected]> Message-Id: <[email protected]> Reviewed by: Kirti Wankhede <[email protected]> Signed-off-by: Alex Williamson <[email protected]> (cherry picked from commit 22fca190e25b10761925bb1eeadeda07aabf3c26) Signed-off-by: Michael Roth <[email protected]> --- hw/vfio/migration.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c index 384576cfc0..3ed3d595b8 100644 --- a/hw/vfio/migration.c +++ b/hw/vfio/migration.c @@ -893,6 +893,7 @@ void vfio_migration_finalize(VFIODevice *vbasedev) remove_migration_state_change_notifier(&migration->migration_state); qemu_del_vm_change_state_handler(migration->vm_state); + unregister_savevm(VMSTATE_IF(vbasedev->dev), "vfio", vbasedev); vfio_migration_exit(vbasedev); } -- 2.25.1
