[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 2/6] vfio/migration: Fail adding device with enable-migration=
From: |
Avihai Horon |
Subject: |
[PATCH v3 2/6] vfio/migration: Fail adding device with enable-migration=on and existing blocker |
Date: |
Wed, 6 Sep 2023 18:08:49 +0300 |
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>
---
hw/vfio/common.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/hw/vfio/common.c b/hw/vfio/common.c
index 8a8d074e18..237101d038 100644
--- a/hw/vfio/common.c
+++ b/hw/vfio/common.c
@@ -394,8 +394,7 @@ int vfio_block_multiple_devices_migration(VFIODevice
*vbasedev, Error **errp)
{
int ret;
- if (multiple_devices_migration_blocker ||
- vfio_multiple_devices_migration_is_supported()) {
+ if (vfio_multiple_devices_migration_is_supported()) {
return 0;
}
@@ -405,6 +404,10 @@ int vfio_block_multiple_devices_migration(VFIODevice
*vbasedev, Error **errp)
return -EINVAL;
}
+ if (multiple_devices_migration_blocker) {
+ return 0;
+ }
+
error_setg(&multiple_devices_migration_blocker,
"Multiple VFIO devices migration is supported only if all of "
"them support P2P migration");
--
2.26.3
- [PATCH v3 0/6] vfio/migration: Block VFIO migration with postcopy and background snapshot, Avihai Horon, 2023/09/06
- [PATCH v3 1/6] migration: Add migration prefix to functions in target.c, Avihai Horon, 2023/09/06
- [PATCH v3 2/6] vfio/migration: Fail adding device with enable-migration=on and existing blocker,
Avihai Horon <=
- [PATCH v3 3/6] migration: Move more initializations to migrate_init(), Avihai Horon, 2023/09/06
- [PATCH v3 4/6] migration: Add .save_prepare() handler to struct SaveVMHandlers, Avihai Horon, 2023/09/06
- [PATCH v3 6/6] vfio/migration: Block VFIO migration with background snapshot, Avihai Horon, 2023/09/06
- [PATCH v3 5/6] vfio/migration: Block VFIO migration with postcopy migration, Avihai Horon, 2023/09/06
- Re: [PATCH v3 0/6] vfio/migration: Block VFIO migration with postcopy and background snapshot, Cédric Le Goater, 2023/09/07