diff options
author | Karel Zak | 2016-06-02 14:41:08 +0200 |
---|---|---|
committer | Karel Zak | 2016-06-02 14:41:08 +0200 |
commit | 3d305170f0240feb804fa5075141751b5650e9c9 (patch) | |
tree | e0538b30872afedea0373cf329d162d02ebd50ee /misc-utils/lsblk.c | |
parent | lib/sysfs: be more smart for non-scsi devices (diff) | |
download | kernel-qcow2-util-linux-3d305170f0240feb804fa5075141751b5650e9c9.tar.gz kernel-qcow2-util-linux-3d305170f0240feb804fa5075141751b5650e9c9.tar.xz kernel-qcow2-util-linux-3d305170f0240feb804fa5075141751b5650e9c9.zip |
lsblk: improve support for nvme
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'misc-utils/lsblk.c')
-rw-r--r-- | misc-utils/lsblk.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/misc-utils/lsblk.c b/misc-utils/lsblk.c index 752783af1..8e6e6c5ac 100644 --- a/misc-utils/lsblk.c +++ b/misc-utils/lsblk.c @@ -758,7 +758,9 @@ static char *get_transport(struct blkdev_cxt *cxt) else if (strstr(attr, "ata")) trans = "ata"; free(attr); - } + + } else if (strncmp(cxt->name, "nvme", 4) == 0) + trans = "nvme"; return trans ? xstrdup(trans) : NULL; } @@ -1001,6 +1003,8 @@ static void set_scols_data(struct blkdev_cxt *cxt, int col, int id, struct libsc get_udev_properties(cxt); if (cxt->serial) str = xstrdup(cxt->serial); + else + str = sysfs_strdup(&cxt->sysfs, "device/serial"); } break; case COL_REV: |