[libvirt] [PATCH 2/2] Include PCI address in the error in virDomainNetFindIdx
Ján Tomko
jtomko at redhat.com
Thu Apr 3 07:07:42 UTC 2014
On 04/02/2014 01:53 PM, Laine Stump wrote:
> On 04/01/2014 06:11 PM, Ján Tomko wrote:
>> 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
>> ---
>> src/conf/domain_conf.c | 17 ++++++++++++++---
>> 1 file changed, 14 insertions(+), 3 deletions(-)
>>
>> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
>> index 1624c7e..35defaf 100644
>> --- a/src/conf/domain_conf.c
>> +++ b/src/conf/domain_conf.c
>> @@ -10456,9 +10456,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);
>
> We really should make a virPCIAddrFormat() function and start using it...
>
> That's a separate issue though. ACK to this patch.
>
Thanks, I've pushed the series.
Jan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140403/179176f3/attachment-0001.sig>
More information about the libvir-list
mailing list