Bug 585441 - virsh 'iface-name' command can't convert any interface MAC address to interface name
Summary: virsh 'iface-name' command can't convert any interface MAC address to interf...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: netcf
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Laine Stump
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-04-24 02:29 UTC by Laine Stump
Modified: 2010-05-13 19:34 UTC (History)
2 users (show)

Fixed In Version: netcf-0.1.6-1.fc12
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-05-04 06:07:49 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Laine Stump 2010-04-24 02:29:28 UTC
Description of problem:
using 'virsh iface-mac' command can convert interface name 'lo' to MAC address,but 'virsh iface-name' command can't convert interface MAC to name.
the operation isn't reversible.

How reproducible:
always

Steps to Reproduce:
1.using 'virsh iface-list' to list current interface 
2.using 'virsh iface-mac eth0' to get interface MAC address
  using 'virsh iface-mac lo' to get interface MAC address
3.using 'virsh iface-name' + the MAC address of the eth0 to get its 
  interface name
  using 'virsh iface-name' + the MAC address of the lo to get its 
  interface name

Actual results:
'virsh iface-mac' and 'virsh iface-name' operation is reversible for eth0,
but it is failed to lo:
error: failed to get interface '00:00:00:00:00:00'
error: multiple matching interfaces found: multiple interfaces with matching MAC address


Expected results:
'virsh iface-mac' and 'virsh iface-name' operation is reversible for any interface, or strictly check argument validity and fixed it.

Additional info:
[root@dhcp-66-70-62 libvirt-test-API]# virsh iface-list
Name                 State      MAC Address
--------------------------------------------
eth0                 active     00:23:ae:6f:f1:d7
lo                   active     00:00:00:00:00:00

[root@dhcp-66-70-62 libvirt-test-API]# virsh iface-mac eth0
00:23:ae:6f:f1:d7

[root@dhcp-66-70-62 libvirt-test-API]# virsh iface-mac lo
00:00:00:00:00:00

[root@dhcp-66-70-62 libvirt-test-API]# virsh iface-name 00:23:ae:6f:f1:d7
eth0

[root@dhcp-66-70-62 libvirt-test-API]# virsh iface-name 00:00:00:00:00:00
error: failed to get interface '00:00:00:00:00:00'
error: multiple matching interfaces found: multiple interfaces with matching MAC address


--- Additional comment from laine on 2010-04-08 14:44:13 EDT ---

The problem is that, while libvirt's iface-name command can only handle a single interface for any given mac address, the netcf function that handles this (ncf_lookup_by_mac_string) can report multiple interfaces matching the same mac, and for some reason it will report transient interfaces as well as those configured with ifcfg-* files. It happens that the virbr0 interface also has a mac address of 00:00:00:00:00:00, so netcf reports back to libvirt that it has found more than one interface with the requested mac address. Rather than quietly reporting incomplete data, libvirt drops an error when it sees this.

Note that when it actually gets around to dumping the xml for an interface, only those interfaces with a corresponding ifcfg file can be dumped

To fix this specific error, ncf_lookup_by_mac_string should be changed to only list interfaces that have matching ifcfg files, to make it consistent with ncf_get_xml_desc.

--- Additional comment from berrange on 2010-04-09 05:49:49 EDT ---

Yes, given the sequence of events shown in the initial report here, it is reasonable to expect ncf_lookup_by_mac_string() to only lookup wrt interfaces that it is actually reporting, not other random interfaces like virbr0 that it is ignoring elsewhere in its APIs.

--- Additional comment from laine on 2010-04-16 23:24:29 EDT ---

A patch to netcf that makes it behave as described in Comment 3 was posted to the netcf-devel mailing list, and will be in netcf-0.1.6.

https://fedorahosted.org/pipermail/netcf-devel/2010-April/000413.html

Comment 1 Fedora Update System 2010-04-24 02:39:52 UTC
netcf-0.1.6-1.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/netcf-0.1.6-1.fc12

Comment 2 Fedora Update System 2010-04-24 04:14:52 UTC
netcf-0.1.6-1.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/netcf-0.1.6-1.fc13

Comment 3 Fedora Update System 2010-04-24 04:16:36 UTC
netcf-0.1.6-1.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/netcf-0.1.6-1.fc11

Comment 4 Fedora Update System 2010-04-25 14:00:39 UTC
netcf-0.1.6-1.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update netcf'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/netcf-0.1.6-1.fc13

Comment 5 Fedora Update System 2010-04-27 02:15:08 UTC
netcf-0.1.6-1.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update netcf'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/netcf-0.1.6-1.fc12

Comment 6 Fedora Update System 2010-05-04 06:07:36 UTC
netcf-0.1.6-1.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2010-05-13 19:24:08 UTC
netcf-0.1.6-1.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2010-05-13 19:33:49 UTC
netcf-0.1.6-1.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.