OSDN Git Service

vfio/migration: Fail adding device with enable-migration=on and existing blocker
authorAvihai Horon <avihaih@nvidia.com>
Wed, 6 Sep 2023 15:08:49 +0000 (18:08 +0300)
committerCédric Le Goater <clg@redhat.com>
Mon, 11 Sep 2023 06:34:06 +0000 (08:34 +0200)
commit8118349b1bc5c12e4017ddd7eb563fce752a5a9c
tree622af67e99c570fe43cd3ab2a72f2719d47084c5
parent38c482b4778595ee337761f73ec0730d6c47b404
vfio/migration: Fail adding device with enable-migration=on and existing blocker

If a device with enable-migration=on is added and it causes a migration
blocker, adding the device should fail with a proper error.

This is not the case with multiple device migration blocker when the
blocker already exists. If the blocker already exists and a device with
enable-migration=on is added which causes a migration blocker, adding
the device will succeed.

Fix it by failing adding the device in such case.

Fixes: 8bbcb64a71d8 ("vfio/migration: Make VFIO migration non-experimental")
Signed-off-by: Avihai Horon <avihaih@nvidia.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
hw/vfio/common.c