]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: allow migration of generic <hostdev> with <teaming>
authorLaine Stump <laine@redhat.com>
Tue, 23 Feb 2021 22:21:56 +0000 (17:21 -0500)
committerLaine Stump <laine@redhat.com>
Wed, 24 Feb 2021 17:31:51 +0000 (12:31 -0500)
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@redhat.com>
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_migration.c

index 08f60c6db37d43a282039d7e72d3cf68485b63e7..d7231f68ae5ae2d741aae53219f71123f8878936 100644 (file)
@@ -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;
                 }