diff options
author | Sven Wiltink | 2019-02-08 10:53:21 +0100 |
---|---|---|
committer | Karel Zak | 2019-02-11 10:37:27 +0100 |
commit | c2f6513c106f5522555a8c129f4e6579b9642c65 (patch) | |
tree | 390d3c5058717831c9ad5adf2b3cf5a4f535ab3b /misc-utils/lsblk-properties.c | |
parent | hardlink: cleanup error messages, use xalloc.h (diff) | |
download | kernel-qcow2-util-linux-c2f6513c106f5522555a8c129f4e6579b9642c65.tar.gz kernel-qcow2-util-linux-c2f6513c106f5522555a8c129f4e6579b9642c65.tar.xz kernel-qcow2-util-linux-c2f6513c106f5522555a8c129f4e6579b9642c65.zip |
lsblk: use ID_SCSI_SERIAL when available
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'misc-utils/lsblk-properties.c')
-rw-r--r-- | misc-utils/lsblk-properties.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/misc-utils/lsblk-properties.c b/misc-utils/lsblk-properties.c index 30168dd48..530332fec 100644 --- a/misc-utils/lsblk-properties.c +++ b/misc-utils/lsblk-properties.c @@ -96,8 +96,12 @@ static struct lsblk_devprop *get_properties_by_udev(struct lsblk_device *ld) if (data) prop->wwn = xstrdup(data); - if ((data = udev_device_get_property_value(dev, "ID_SERIAL_SHORT"))) + data = udev_device_get_property_value(dev, "ID_SCSI_SERIAL"); + if(!data) + data = udev_device_get_property_value(dev, "ID_SERIAL_SHORT"); + if (data) prop->serial = xstrdup(data); + if ((data = udev_device_get_property_value(dev, "ID_MODEL"))) prop->model = xstrdup(data); |