mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
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: 8bbcb64a71
("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>
This commit is contained in:
parent
38c482b477
commit
8118349b1b
1 changed files with 5 additions and 2 deletions
|
@ -394,8 +394,7 @@ int vfio_block_multiple_devices_migration(VFIODevice *vbasedev, Error **errp)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (multiple_devices_migration_blocker ||
|
if (vfio_multiple_devices_migration_is_supported()) {
|
||||||
vfio_multiple_devices_migration_is_supported()) {
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -405,6 +404,10 @@ int vfio_block_multiple_devices_migration(VFIODevice *vbasedev, Error **errp)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (multiple_devices_migration_blocker) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
error_setg(&multiple_devices_migration_blocker,
|
error_setg(&multiple_devices_migration_blocker,
|
||||||
"Multiple VFIO devices migration is supported only if all of "
|
"Multiple VFIO devices migration is supported only if all of "
|
||||||
"them support P2P migration");
|
"them support P2P migration");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue