diff options
author | Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com> | 2017-03-01 21:30:17 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-03-01 15:30:17 -0500 |
commit | fb92fbb1b171ef94207a1ebc111ef0e414d49b4c (patch) | |
tree | 965b26d293599759ca975ae333e5741dffed0b8a /src/udev/udev-builtin-path_id.c | |
parent | 2a75df743bcca334e17a8a513e6a66011b5047f3 (diff) |
udev: Use parent bus id for virtio disk builtin path-id (#5500)
The builtin path id for virtio block devices has been changed
to use the bus id without a prefix "virtio-pci" to be
compatible with all virtio transport types.
In order to not break existing setups, the by-path symlinks for
virtio block devices on the PCI bus are reintroduced by udev rules.
The virtio-pci symlinks are considered to be deprecated and
should be replaced by the native PCI symlinks.
Example output for a virtio disk in PCI slot 7:
$ ls /dev/disk/by-path
pci-0000:00:07.0
pci-0000:00:07.0-part1
virtio-pci-0000:00:07.0
virtio-pci-0000:00:07.0-part1
See also
[1] https://lists.freedesktop.org/archives/systemd-devel/2017-February/038326.html
[2] https://lists.freedesktop.org/archives/systemd-devel/2017-March/038397.html
This reverts f073b1b but keeps the same symlinks for compatibility.
Diffstat (limited to 'src/udev/udev-builtin-path_id.c')
-rw-r--r-- | src/udev/udev-builtin-path_id.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/udev/udev-builtin-path_id.c b/src/udev/udev-builtin-path_id.c index 527f0bff2d..8cb330dba1 100644 --- a/src/udev/udev-builtin-path_id.c +++ b/src/udev/udev-builtin-path_id.c @@ -664,11 +664,8 @@ static int builtin_path_id(struct udev_device *dev, int argc, char *argv[], bool parent = skip_subsystem(parent, "xen"); supported_parent = true; } else if (streq(subsys, "virtio")) { - while (parent && streq_ptr("virtio", udev_device_get_subsystem(parent))) - parent = udev_device_get_parent(parent); - path_prepend(&path, "virtio-pci-%s", udev_device_get_sysname(parent)); + parent = skip_subsystem(parent, "virtio"); supported_transport = true; - supported_parent = true; } else if (streq(subsys, "scm")) { path_prepend(&path, "scm-%s", udev_device_get_sysname(parent)); parent = skip_subsystem(parent, "scm"); |