Blame SOURCES/libvirt-qemu-don-t-call-qemuMigrationSrcIsAllowedHostdev-from-qemuMigrationDstPrepareFresh.patch

a1c947
From d51e6092ed7977daf662ed1def0f6cd5cc6ba33d Mon Sep 17 00:00:00 2001
a1c947
Message-Id: <d51e6092ed7977daf662ed1def0f6cd5cc6ba33d@dist-git>
a1c947
From: Laine Stump <laine@redhat.com>
a1c947
Date: Wed, 27 Jul 2022 12:14:10 -0400
a1c947
Subject: [PATCH] qemu: don't call qemuMigrationSrcIsAllowedHostdev() from
a1c947
 qemuMigrationDstPrepareFresh()
a1c947
a1c947
This call to qemuMigrationSrcIsAllowedHostdev() (which does a
a1c947
hardcoded fail of the migration if there is any PCI or mdev hostdev
a1c947
device in the domain) while doing the destination side of migration
a1c947
prep was found once the call to that same function was removed from
a1c947
the source side migration prep (commit 25883cd5).
a1c947
a1c947
According to jdenemar, for the V2 migration protocol, prep of the
a1c947
destination is the first step, so this *was* the proper place to do
a1c947
the check, but for V3 migration this is in a way redundant (since we
a1c947
will have already done the check on the source side (updated by
a1c947
25883cd5 to query QEMU rather than do a hardcoded fail)).
a1c947
a1c947
Of course it's possible that the source could support migration of a
a1c947
particular VFIO device, but the destination doesn't. But the current
a1c947
check on the destination side is worthless even in that case, since it
a1c947
is just *always* failing rather than querying QEMU; and QEMU can't be
a1c947
queried at the point where the destination check is happening, since
a1c947
it isn't yet running.
a1c947
a1c947
Anyway QEMU should complain when it's started if it's going to fail,
a1c947
so removing this check should just move the failure to happen a bit
a1c947
later. So the best solution to this problem is to simply remove the
a1c947
hardcoded check/fail from qemuMigrationDstPrepareFresh() and rely on
a1c947
QEMU to fail if it needs to.
a1c947
a1c947
Fixes: 25883cd5f0b188f2417f294b7d219a77b219f7c2
a1c947
Signed-off-by: Laine Stump <laine@redhat.com>
a1c947
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
a1c947
(cherry picked from commit 640d185f01858b7a8db401235c929ac4798592d0)
a1c947
a1c947
https://bugzilla.redhat.com/show_bug.cgi?id=1497907
a1c947
a1c947
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
a1c947
---
a1c947
 src/qemu/qemu_migration.c | 3 ---
a1c947
 1 file changed, 3 deletions(-)
a1c947
a1c947
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
a1c947
index 61fcaf4258..e3ba4c3f78 100644
a1c947
--- a/src/qemu/qemu_migration.c
a1c947
+++ b/src/qemu/qemu_migration.c
a1c947
@@ -3382,9 +3382,6 @@ qemuMigrationDstPrepareFresh(virQEMUDriver *driver,
a1c947
                       QEMU_MIGRATION_COOKIE_CAPS;
a1c947
     }
a1c947
 
a1c947
-    if (!qemuMigrationSrcIsAllowedHostdev(*def))
a1c947
-        goto cleanup;
a1c947
-
a1c947
     /* Let migration hook filter domain XML */
a1c947
     if (virHookPresent(VIR_HOOK_DRIVER_QEMU)) {
a1c947
         g_autofree char *xml = NULL;
a1c947
-- 
a1c947
2.35.1
a1c947