Bug 982014 - listAllInterfaces returns empty list
Summary: listAllInterfaces returns empty list
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: libvirt
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-07 18:22 UTC by Cole Robinson
Modified: 2013-07-12 13:01 UTC (History)
9 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-07-12 13:01:20 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Cole Robinson 2013-07-07 18:22:48 UTC
$ sudo python -c 'import libvirt; conn = libvirt.open("qemu:///system"); print conn.listAllInterfaces(); print conn.listInterfaces();'
[]
['lo']

$ rpm -q libvirt-daemon
libvirt-daemon-1.0.5.2-1.fc19.x86_64

I can reproduce on two f19 machines at least.

Comment 1 Laine Stump 2013-07-08 02:26:52 UTC
This is almost surely due to differences in what anaconda and/or NM are putting in the ifcfg files. netcf assumes/requires that the ifcfg file have a "DEVICE" setting, and that the value of $DEVICE match the suffix of the ifcfg filename. This of course isn't always true, but for awhile now people have been noticing that DEVICE isn't always set.

Now I see that it's gone beyond that - I have one F19 system that was installed from scratch. It has an ethernet interface that is called 'p8p1' in the output of ifconfig. However, its ifcfg file is called "ifcfg-enp7s5", and makes no mention of "p8p1" at all, much less setting the DEVICE name.

Making netcf work with the way that NM and anaconda have started using the ifcfg files is going to "take some time" to say the least.

Note that if you change the name of the ifcgfg file to match the device's name, and add "DEVICE=whatever" (where "whatever" is the device's name) to that file, then it should be properly listed, and will also be properly recognized by NM.

Comment 2 Cole Robinson 2013-07-08 15:35:09 UTC
Yeah that likely explains why nothing but 'lo' shows up in my output. But the bug report was more about listAllInterfaces returning an empty list, but old style listInterfaces() returns ['lo']. listAllInterfaces specifically must be buggy

Comment 3 Cole Robinson 2013-07-12 13:01:20 UTC
Actually this is fixed upstream/rawhide it was the commit that triggered the CVE. Not really a big deal to backport though so just closing as RAWHIDE


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