From 114e3b423210d316b3326816fd2c33335b1167fe Mon Sep 17 00:00:00 2001 From: Laine Stump Date: Wed, 10 Feb 2021 14:52:25 -0500 Subject: [PATCH] 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 --- src/conf/domain_conf.c | 5 +++++ 1 file changed, 5 insertions(+) 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 -- 2.47.3