From: Ján Tomko Date: Tue, 1 Apr 2014 14:26:24 +0000 (+0200) Subject: Include PCI address in the error in virDomainNetFindIdx X-Git-Tag: v1.2.4-rc1~193 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=246317d3d98cf87b2e24932a118ebf2669462242;p=thirdparty%2Flibvirt.git Include PCI address in the error in virDomainNetFindIdx When looking up a net device by a MAC and PCI address, it is possible that we've got a match on the MAC address but failed to match the PCI address. In that case, outputting just the MAC address can be confusing. Partially resolves: https://bugzilla.redhat.com/show_bug.cgi?id=872028 --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 534c9e74e2..0c7d4e4c3e 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -10278,9 +10278,20 @@ virDomainNetFindIdx(virDomainDefPtr def, virDomainNetDefPtr net) } } if (matchidx < 0) { - virReportError(VIR_ERR_OPERATION_FAILED, - _("no device matching mac address %s found"), - virMacAddrFormat(&net->mac, mac)); + if (PCIAddrSpecified) { + virReportError(VIR_ERR_OPERATION_FAILED, + _("no device matching mac address %s found on " + "%.4x:%.2x:%.2x.%.1x"), + virMacAddrFormat(&net->mac, mac), + net->info.addr.pci.domain, + net->info.addr.pci.bus, + net->info.addr.pci.slot, + net->info.addr.pci.function); + } else { + virReportError(VIR_ERR_OPERATION_FAILED, + _("no device matching mac address %s found"), + virMacAddrFormat(&net->mac, mac)); + } } return matchidx; }