From: Laine Stump Date: Wed, 10 Feb 2021 19:52:25 +0000 (-0500) Subject: qemu: match alias when looking for proper to detach. X-Git-Tag: v7.1.0-rc1~143 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=114e3b423210d316b3326816fd2c33335b1167fe;p=thirdparty%2Flibvirt.git qemu: match alias when looking for proper to detach. 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 Reviewed-by: Martin Kletzander --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 07e6f39256..8f2207bdf6 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -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