Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
lsblk: Fall back to ID_SERIAL
In some cases ID_SERIAL_SHORT isn't provided by libudev, but ID_SERIAL is. An example of this are virtio devices. See the output of udevadm info: P: /devices/pci0000:00/0000:00:06.0/virtio2/block/vdb N: vdb S: disk/by-id/virtio-08491434ee711d3420e9 S: disk/by-path/pci-0000:00:06.0 S: disk/by-path/virtio-pci-0000:00:06.0 E: DEVLINKS=/dev/disk/by-id/virtio-08491434ee711d3420e9 /dev/disk/by-path/pci-0000:00:06.0 /dev/disk/by-path/virtio-pci-0000:00:06.0 E: DEVNAME=/dev/vdb E: DEVPATH=/devices/pci0000:00/0000:00:06.0/virtio2/block/vdb E: DEVTYPE=disk E: ID_PATH=pci-0000:00:06.0 E: ID_PATH_TAG=pci-0000_00_06_0 E: ID_SERIAL=08491434ee711d3420e9 E: MAJOR=252 E: MINOR=16 E: SUBSYSTEM=block E: TAGS=:systemd: E: USEC_INITIALIZED=1403804 [kzak@redhat.com: - add ID_SERIAL also to get_properties_by_file()] Signed-off-by: Karel Zak <kzak@redhat.com>
- Loading branch information