]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: match alias when looking for proper <interface> to detach.
authorLaine Stump <laine@redhat.com>
Wed, 10 Feb 2021 19:52:25 +0000 (14:52 -0500)
committerLaine Stump <laine@redhat.com>
Thu, 11 Feb 2021 21:07:09 +0000 (16:07 -0500)
Previously we only checked MAC address and PCI address (or CCW
address). This is not enough information in cases where PCI address
isn't provided and multiple interfaces have the same MAC address (for
example, a virtio + hostdev "teaming" pair - their MAC addresses are
always the same).

Resolves: https://bugzilla.redhat.com/1926190
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
src/conf/domain_conf.c

index 07e6f39256a9538413c7119e4212202e2cff7fab..8f2207bdf6749f5fbda076176bdd6352bce3b0df 100644 (file)
@@ -16431,6 +16431,11 @@ virDomainNetFindIdx(virDomainDefPtr def, virDomainNetDefPtr net)
                                             &net->info.addr.ccw))
             continue;
 
+        if (net->info.alias &&
+            STRNEQ_NULLABLE(def->nets[i]->info.alias, net->info.alias)) {
+            continue;
+        }
+
         if (matchidx >= 0) {
             /* there were multiple matches on mac address, and no
              * qualifying guest-side PCI/CCW address was given, so we must