1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-09 20:58:33 +03:00

qemu: match alias when looking for proper <interface> 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 <laine@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Laine Stump 2021-02-10 14:52:25 -05:00
parent afb823fc50
commit 114e3b4232

View File

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