]> git.ipfire.org Git - thirdparty/systemd.git/commit
udev: fix id_net_name_path for virtio-ccw interfaces (#5357)
authorViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
Fri, 17 Feb 2017 15:18:01 +0000 (16:18 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 17 Feb 2017 15:18:01 +0000 (16:18 +0100)
commitecc11cf70cf5c6eb18f431e9d29d4823fa0c2ed8
tree71615aa0c25038cc14c95f0c9e5d2441153a9663
parente4363cd8ae9e0db02aeb4fa45cc785925e78c80e
udev: fix id_net_name_path for virtio-ccw interfaces (#5357)

The CCW id_net_name_path detection didn't account for virtio
interfaces on the CCW bus. As a result the default interface
names for virtio-ccw interfaces would use the old eth<x>
format instead of enc<busid>.

Since virtio-pci interface naming follows the naming rules
of the parent bus, the names_ccw() logic was changed to apply
the CCW interface naming rules to virtio interfaces as well,
e.g. enc2000 for an interface with a CCW bus id 0.0.2000.
As virtio interfaces are apt to get the otherwise unusual
CCW bus id 0.0.0000, the last '0' is now preserved in this
case.

The virtio subsystem skipping loop has been moved from
names_pci() into a function skip_virtio() that can be reused
for all bus types with virtio network devices.

Since virtio-ccw interfaces use single CCW addresses the ccwgroup
requirement was relaxed and the C definitions were changed
accordingly.
src/udev/udev-builtin-net_id.c