Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

by-path symlinks for virtio-blk devices #2501

Closed
msekletar opened this issue Feb 1, 2016 · 1 comment
Closed

by-path symlinks for virtio-blk devices #2501

msekletar opened this issue Feb 1, 2016 · 1 comment
Labels

Comments

@msekletar
Copy link
Contributor

We have reverted support for virtio devices in bf81e79. However, we have reintroduced support for virtio network devices in net_id by 54683f0. Can't we do the similar thing for virtio-blk devices in path_id? Skip the virtio part and base path_id symlink on parent pci device?

@msekletar msekletar added the udev label Feb 1, 2016
@teg
Copy link
Contributor

teg commented Feb 3, 2016

Sounds good to me. @kaysievers ?

msekletar added a commit to msekletar/systemd that referenced this issue Feb 9, 2016
Enumeration of virtio buses is global and hence
non-deterministic. However, we are guaranteed there is never going to be
more than one virtio bus per parent PCI device. While populating
ID_PATH we simply skip virtio part of the syspath and we extend the path
using the sysname of the parent PCI device.

With this patch udev creates following by-path links for virtio-blk
device /dev/vda which contains two partitions.

ls -l /dev/disk/by-path/
total 0
lrwxrwxrwx 1 root root  9 Feb  9 10:47 virtio-pci-0000:00:05.0 -> ../../vda
lrwxrwxrwx 1 root root 10 Feb  9 10:47 virtio-pci-0000:00:05.0-part1 -> ../../vda1
lrwxrwxrwx 1 root root 10 Feb  9 10:47 virtio-pci-0000:00:05.0-part2 -> ../../vda2

See:
http://lists.linuxfoundation.org/pipermail/virtualization/2015-August/030328.html

Fixes systemd#2501
lnykryn pushed a commit to lnykryn/systemd that referenced this issue Mar 23, 2016
Enumeration of virtio buses is global and hence
non-deterministic. However, we are guaranteed there is never going to be
more than one virtio bus per parent PCI device. While populating
ID_PATH we simply skip virtio part of the syspath and we extend the path
using the sysname of the parent PCI device.

With this patch udev creates following by-path links for virtio-blk
device /dev/vda which contains two partitions.

ls -l /dev/disk/by-path/
total 0
lrwxrwxrwx 1 root root  9 Feb  9 10:47 virtio-pci-0000:00:05.0 -> ../../vda
lrwxrwxrwx 1 root root 10 Feb  9 10:47 virtio-pci-0000:00:05.0-part1 -> ../../vda1
lrwxrwxrwx 1 root root 10 Feb  9 10:47 virtio-pci-0000:00:05.0-part2 -> ../../vda2

See:
http://lists.linuxfoundation.org/pipermail/virtualization/2015-August/030328.html

Fixes systemd#2501

Cherry-picked from: f073b1b
Resolves: #952567
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants