Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Created attachment 1689905[details]
libvirtd debug log
Description of problem:
Can't detach interface specified by its address but not mac
Version-Release number of selected component (if applicable):
libvirt-6.0.0-19.module+el8.2.1+6538+c148631f.s390x
How reproducible:
100%
Preconditions
Guest has two interfaces of same type but on different addresses, e.g.
A. Given iface.xml =
<interface type='network'>
<source network='default'/>
<model type='virtio'/>
</interface>
B. Run virsh attach-device vm iface.xml twice on vm (previously without any interface devices).
Steps to Reproduce:
1. Add iface address of one of the interfaces to iface.xml, e.g.
<interface type='network'>
<source network='default'/>
<model type='virtio'/>
<address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0009'/>
</interface>
2. virsh detach-device vm iface.xml
Actual results:
error: Failed to detach device from iface.xml
error: operation failed: multiple matching devices found
Expected results:
Device detached successfully
Additional info:
1. The ccw addresses in dumpxml after B. were confirmed to be different (interfaces correctly attached)
2. Expected result can be established when running steps on x86_64 using pci type address.
3. Using <mac/> instead of <address/> in step 1. leads to correct results
4. libvirtd.log indicates src/conf/domain_conf.c->virDomainNetFindIdx is involved but that code makes explicit reference only to PCI:
int
virDomainNetFindIdx(virDomainDefPtr def, virDomainNetDefPtr net)
{
...
bool PCIAddrSpecified = virDomainDeviceAddressIsValid(&net->info,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI);
for (i = 0; i < def->nnets; i++) {
...
if (PCIAddrSpecified &&
!virPCIDeviceAddressEqual(&def->nets[i]->info.addr.pci,
&net->info.addr.pci))
continue;
if (matchidx >= 0) {
/* there were multiple matches on mac address, and no
* qualifying guest-side PCI address was given, so we must
* fail (NB: a USB address isn't adequate, since it may
* specify only vendor and product ID, and there may be
* multiples of those.
*/
if (MACAddrSpecified) {
virReportError(VIR_ERR_OPERATION_FAILED,
_("multiple devices matching MAC address %s found"),
virMacAddrFormat(&net->mac, mac));
} else {
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("multiple matching devices found"));
}
return -1;
}
matchidx = i;
}
if (matchidx < 0) {
if (MACAddrSpecified && PCIAddrSpecified) {
virReportError(VIR_ERR_DEVICE_MISSING,
...
} else if (PCIAddrSpecified) {
virReportError(VIR_ERR_DEVICE_MISSING,
...
} else if (MACAddrSpecified) {
virReportError(VIR_ERR_DEVICE_MISSING,
_("no device matching MAC address %s found"),
virMacAddrFormat(&net->mac, mac));
} else {
virReportError(VIR_ERR_DEVICE_MISSING, "%s",
_("no matching device found"));
}
}
return matchidx;
}
Pushed upstream:
commit 2fefbd03ab09f32b1b15d093096fa44870817751
Author: Cornelia Huck <cohuck>
CommitDate: 2020-09-24 13:48:31 +0200
virDomainNetFindIdx: add support for CCW addresses
Allow to match with CCW addresses in addition to PCI addresses
(and MAC addresses).
Signed-off-by: Cornelia Huck <cohuck>
Reviewed-by: Ján Tomko <jtomko>
Signed-off-by: Ján Tomko <jtomko>
git describe: v6.7.0-344-g2fefbd03ab
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (Moderate: virt:rhel and virt-devel:rhel security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHSA-2021:1762
Created attachment 1689905 [details] libvirtd debug log Description of problem: Can't detach interface specified by its address but not mac Version-Release number of selected component (if applicable): libvirt-6.0.0-19.module+el8.2.1+6538+c148631f.s390x How reproducible: 100% Preconditions Guest has two interfaces of same type but on different addresses, e.g. A. Given iface.xml = <interface type='network'> <source network='default'/> <model type='virtio'/> </interface> B. Run virsh attach-device vm iface.xml twice on vm (previously without any interface devices). Steps to Reproduce: 1. Add iface address of one of the interfaces to iface.xml, e.g. <interface type='network'> <source network='default'/> <model type='virtio'/> <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0009'/> </interface> 2. virsh detach-device vm iface.xml Actual results: error: Failed to detach device from iface.xml error: operation failed: multiple matching devices found Expected results: Device detached successfully Additional info: 1. The ccw addresses in dumpxml after B. were confirmed to be different (interfaces correctly attached) 2. Expected result can be established when running steps on x86_64 using pci type address. 3. Using <mac/> instead of <address/> in step 1. leads to correct results 4. libvirtd.log indicates src/conf/domain_conf.c->virDomainNetFindIdx is involved but that code makes explicit reference only to PCI: int virDomainNetFindIdx(virDomainDefPtr def, virDomainNetDefPtr net) { ... bool PCIAddrSpecified = virDomainDeviceAddressIsValid(&net->info, VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI); for (i = 0; i < def->nnets; i++) { ... if (PCIAddrSpecified && !virPCIDeviceAddressEqual(&def->nets[i]->info.addr.pci, &net->info.addr.pci)) continue; if (matchidx >= 0) { /* there were multiple matches on mac address, and no * qualifying guest-side PCI address was given, so we must * fail (NB: a USB address isn't adequate, since it may * specify only vendor and product ID, and there may be * multiples of those. */ if (MACAddrSpecified) { virReportError(VIR_ERR_OPERATION_FAILED, _("multiple devices matching MAC address %s found"), virMacAddrFormat(&net->mac, mac)); } else { virReportError(VIR_ERR_OPERATION_FAILED, "%s", _("multiple matching devices found")); } return -1; } matchidx = i; } if (matchidx < 0) { if (MACAddrSpecified && PCIAddrSpecified) { virReportError(VIR_ERR_DEVICE_MISSING, ... } else if (PCIAddrSpecified) { virReportError(VIR_ERR_DEVICE_MISSING, ... } else if (MACAddrSpecified) { virReportError(VIR_ERR_DEVICE_MISSING, _("no device matching MAC address %s found"), virMacAddrFormat(&net->mac, mac)); } else { virReportError(VIR_ERR_DEVICE_MISSING, "%s", _("no matching device found")); } } return matchidx; }