summaryrefslogtreecommitdiff
path: root/rules
diff options
context:
space:
mode:
authorViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>2017-03-01 21:30:17 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-03-01 15:30:17 -0500
commitfb92fbb1b171ef94207a1ebc111ef0e414d49b4c (patch)
tree965b26d293599759ca975ae333e5741dffed0b8a /rules
parent2a75df743bcca334e17a8a513e6a66011b5047f3 (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 'rules')
-rw-r--r--rules/60-persistent-storage.rules4
1 files changed, 4 insertions, 0 deletions
diff --git a/rules/60-persistent-storage.rules b/rules/60-persistent-storage.rules
index 4a33ad813f..9817e9c64b 100644
--- a/rules/60-persistent-storage.rules
+++ b/rules/60-persistent-storage.rules
@@ -67,6 +67,10 @@ ENV{DEVTYPE}=="disk", DEVPATH!="*/virtual/*", IMPORT{builtin}="path_id"
ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}"
ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n"
+# legacy virtio-pci by-path links (deprecated)
+KERNEL=="vd*[!0-9]", ENV{ID_PATH}=="pci-*", SYMLINK+="disk/by-path/virtio-$env{ID_PATH}"
+KERNEL=="vd*[0-9]", ENV{ID_PATH}=="pci-*", SYMLINK+="disk/by-path/virtio-$env{ID_PATH}-part%n"
+
# probe filesystem metadata of optical drives which have a media inserted
KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="?*", \
IMPORT{builtin}="blkid --offset=$env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}"