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
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
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
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
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
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
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.
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.
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.