[libvirt PATCH 1/2] qemu: allow migration of generic <hostdev> with <teaming>

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit 010ed0856b and commit db64acfbda introduced the ability to use
the <teaming> element in a generic <hostdev> (previously it could only
be used with <interface type='hostdev'>). However, the patch omitted
one crucial detail - along with parsing the <teaming> element in
<hostdev>, and adding the necessary info to the qemu commandline, we
also need to modify qemuMigrationSrcIsAllowedHostdev() to allow
migration when the generic <hostdev> has a <teaming> element.

https://bugzilla.redhat.com/1927984

Fixes: 010ed0856bb06f439e6fdf44e4f529f53441c398
Reported-by: Yalan Zhang <yalzhang@xxxxxxxxxx>
Signed-off-by: Laine Stump <laine@xxxxxxxxxx>
---
 src/qemu/qemu_migration.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 08f60c6db3..d7231f68ae 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -1247,13 +1247,17 @@ qemuMigrationSrcIsAllowedHostdev(const virDomainDef *def)
 
             case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
                 /*
-                 * if this is a network interface with <teaming
-                 * type='transient'>, migration *is* allowed because
-                 * the device will be auto-unplugged by QEMU during
-                 * migration.
+                 * if the device has a <teaming type='transient'>
+                 * element, then migration *is* allowed because the
+                 * device will be auto-unplugged by QEMU during
+                 * migration. Generic <hostdev> and <interface
+                 * type='hostdev'> have their teaming configuration
+                 * stored in different places.
                  */
-                if (hostdev->parentnet && hostdev->parentnet->teaming &&
-                    hostdev->parentnet->teaming->type == VIR_DOMAIN_NET_TEAMING_TYPE_TRANSIENT) {
+                if ((hostdev->teaming &&
+                     hostdev->teaming->type == VIR_DOMAIN_NET_TEAMING_TYPE_TRANSIENT) ||
+                    (hostdev->parentnet && hostdev->parentnet->teaming &&
+                     hostdev->parentnet->teaming->type == VIR_DOMAIN_NET_TEAMING_TYPE_TRANSIENT)) {
                     continue;
                 }
 
-- 
2.29.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux