render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
032100
From 8f2cd77dc208cfa90b37faa18b092ca4a76a0716 Mon Sep 17 00:00:00 2001
032100
Message-Id: <8f2cd77dc208cfa90b37faa18b092ca4a76a0716@dist-git>
032100
From: Laine Stump <laine@redhat.com>
032100
Date: Thu, 21 Jul 2022 02:03:49 -0400
032100
Subject: [PATCH] qemu: skip hardcoded hostdev migration check if QEMU can do
032100
 it for us
032100
032100
libvirt currently will block migration for any vfio-assigned device
032100
unless it is a network device that is associated with a virtio-net
032100
failover device (ie. if the hostdev object has a teaming->type ==
032100
VIR_DOMAIN_NET_TEAMING_TYPE_TRANSIENT).
032100
032100
In the future there will be other vfio devices that can be migrated,
032100
so we don't want to rely on this hardcoded block. QEMU 6.0+ will
032100
anyway inform us of any devices that will block migration (as a part
032100
of qemuDomainGetMigrationBlockers()), so we only need to do the
032100
hardcoded check in the case of old QEMU that can't provide that
032100
information.
032100
032100
Signed-off-by: Laine Stump <laine@redhat.com>
032100
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
032100
(cherry picked from commit 25883cd5f0b188f2417f294b7d219a77b219f7c2)
032100
032100
https://bugzilla.redhat.com/show_bug.cgi?id=1497907
032100
032100
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
032100
---
032100
 src/qemu/qemu_migration.c | 11 ++++++++---
032100
 1 file changed, 8 insertions(+), 3 deletions(-)
032100
032100
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
032100
index f571c9eb27..76903d612b 100644
032100
--- a/src/qemu/qemu_migration.c
032100
+++ b/src/qemu/qemu_migration.c
032100
@@ -1495,6 +1495,14 @@ qemuMigrationSrcIsAllowed(virQEMUDriver *driver,
032100
                                _("cannot migrate domain: %s"), reasons);
032100
                 return false;
032100
             }
032100
+        } else {
032100
+            /* checks here are for anything that doesn't need to be
032100
+             * checked by libvirt if running QEMU that can be queried
032100
+             * about migration blockers.
032100
+             */
032100
+
032100
+            if (!qemuMigrationSrcIsAllowedHostdev(vm->def))
032100
+                return false;
032100
         }
032100
 
032100
         if (remote) {
032100
@@ -1521,9 +1529,6 @@ qemuMigrationSrcIsAllowed(virQEMUDriver *driver,
032100
             return false;
032100
         }
032100
 
032100
-        if (!qemuMigrationSrcIsAllowedHostdev(vm->def))
032100
-            return false;
032100
-
032100
         if (vm->def->cpu) {
032100
             /* QEMU blocks migration and save with invariant TSC enabled
032100
              * unless TSC frequency is explicitly set.
032100
-- 
032100
2.35.1
032100