From a74ff9ceea076a92a4dd3b9b26a31f14c513da0a Mon Sep 17 00:00:00 2001
From: AlexChen <alex.chen@huawei.com>
Date: Sat, 25 Nov 2023 09:55:08 +0800
Subject: [PATCH] vdpa: support vdpa device migrate

support vdpa device migrate

Signed-off-by: jiangdongxu <jiangdongxu1@huawei.com>
Signed-off-by: AlexChen <alex.chen@huawei.com>
---
 src/qemu/qemu_migration.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 0a89d102df..9c7eea0d6d 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -1304,14 +1304,13 @@ qemuMigrationSrcIsAllowedHostdev(const virDomainDef *def)
         case VIR_DOMAIN_HOSTDEV_MODE_SUBSYS:
             switch (hostdev->source.subsys.type) {
             case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
-                /* USB devices can be "migrated" */
+            case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA:
+                /* USB and VDPA devices can be "migrated" */
                 continue;
 
             case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI:
             case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST:
             case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV:
-                /* The vDPA devices don't support migration for now */
-            case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_VDPA:
                 virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
                                _("cannot migrate a domain with <hostdev mode='subsystem' type='%1$s'>"),
                                virDomainHostdevSubsysTypeToString(hostdev->source.subsys.type));
-- 
2.27.0

