Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 468004

Summary: >=sys-fs/udev-200: 80-net-name-slot.rules failure with kvm-guest
Product: Gentoo Linux Reporter: Thomas Stein <himbeere>
Component: [OLD] Core systemAssignee: udev maintainers <udev-bugs>
Status: RESOLVED INVALID    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Thomas Stein 2013-04-30 13:22:29 UTC
Hello.

If i enable the type "virtio" for the interface card i only get this within the virtual machine:

hostname ~ # udevadm test-builtin net_id /sys/class/net/eth0 2> /dev/null
ID_NET_NAME_MAC=enx525400181683

In 80-net-name-slot.rules there are only this rules:

NAME=="", ENV{ID_NET_NAME_ONBOARD}!="", NAME="$env{ID_NET_NAME_ONBOARD}"
NAME=="", ENV{ID_NET_NAME_SLOT}!="", NAME="$env{ID_NET_NAME_SLOT}"
NAME=="", ENV{ID_NET_NAME_PATH}!="", NAME="$env{ID_NET_NAME_PATH}"

So it can not work. I don't know if this a kvm/libvirt or gentoo bug. But i thought i let you know.

cheers
t.


Reproducible: Always
Comment 1 Samuli Suominen (RETIRED) gentoo-dev 2013-04-30 13:28:33 UTC
It's the designed behavior.

From the referenced document:

http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames

See:

<quote>
4. Names incorporating the interfaces's MAC address (example: enx78e7d1ea46da)
5- Classic, unpredictable kernel-native ethX naming (example: eth0)

By default, systemd v197 will now name interfaces following policy 1) if that information from the firmware is applicable and available, falling back to 2) if that information from the firmware is applicable and available, falling back to 3) if applicable, falling back to 5) in all other cases. Policy 4) is not used by default, but is available if the user chooses so.
</quote>

as in, enx* is disabled by default, but you can have them if you enable them yourself by copying 80-net-name-slot.rules to /etc/udev/rules.d/ and modifying it there to use ID_NET_NAME_MAC

right now it's correctly falling back to the kernel naming
Comment 2 Thomas Stein 2013-04-30 13:37:19 UTC
Hello Samuli.

I see. So there is no problem. :-) Should i open a kernel bug then? Or do you have an idea why there is no ID_NET_NAME_SLOT/ID_NET_NAME_PATH when i enable virtio?

cheers
t.
Comment 3 Samuli Suominen (RETIRED) gentoo-dev 2013-04-30 14:05:08 UTC
(In reply to comment #2)
> Hello Samuli.
> 
> I see. So there is no problem. :-) Should i open a kernel bug then? Or do
> you have an idea why there is no ID_NET_NAME_SLOT/ID_NET_NAME_PATH when i
> enable virtio?
> 
> cheers
> t.

See the top of this file to see how SLOT and PATH construct:

http://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-net_id.c

So I don't think it would be valid for virtio to have SLOT or PATH since it's not a real device. It really looks like MAC is the only attribute you can get out of virtio and correctly so. I don't think there is a bug at all, anywhere.
Comment 4 Mike Gilbert gentoo-dev 2013-04-30 17:44:43 UTC
That's basically the same feedback I got from the people in #systemd when I asked the same question.