diff options
author | Kunkun Jiang <jiangkunkun@huawei.com> | 2021-05-27 20:31:01 +0800 |
---|---|---|
committer | Michael Roth <michael.roth@amd.com> | 2021-10-14 16:02:34 -0500 |
commit | 5b55370e28e262fba0c95f5dc05e9551c875671a (patch) | |
tree | 4b866b314357252ec325a3d0d0dab27d64a87d1f | |
parent | d1000ee07b02c3a6f87a39b45d1b8c5689a14aa9 (diff) | |
download | qemu-5b55370e28e262fba0c95f5dc05e9551c875671a.zip qemu-5b55370e28e262fba0c95f5dc05e9551c875671a.tar.gz qemu-5b55370e28e262fba0c95f5dc05e9551c875671a.tar.bz2 |
vfio: Fix unregister SaveVMHandler in vfio_migration_finalize
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 <ganqixin@huawei.com>
Signed-off-by: Kunkun Jiang <jiangkunkun@huawei.com>
Message-Id: <20210527123101.289-1-jiangkunkun@huawei.com>
Reviewed by: Kirti Wankhede <kwankhede@nvidia.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
(cherry picked from commit 22fca190e25b10761925bb1eeadeda07aabf3c26)
Signed-off-by: Michael Roth <michael.roth@amd.com>
-rw-r--r-- | hw/vfio/migration.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c index 384576c..3ed3d59 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); } |