]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsblk: support virtio block
authorzhenwei pi <pizhenwei@bytedance.com>
Fri, 3 Jun 2022 12:23:59 +0000 (20:23 +0800)
committerKarel Zak <kzak@redhat.com>
Mon, 6 Jun 2022 10:31:56 +0000 (12:31 +0200)
virtio blk is quite popular in the virtual machines, support 'TRAN'
column for a virtio block device.

Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
misc-utils/lsblk.c

index 047f744bed7cde2633bca4faf7d2b847198271de..dfa31797072abb5b18c69f862224be1ddcc302ab 100644 (file)
@@ -514,8 +514,10 @@ static char *get_transport(struct lsblk_device *dev)
                        trans = "ata";
                free(attr);
 
-       } else if (strncmp(dev->name, "nvme", 4) == 0)
+       } else if (strncmp(dev->name, "nvme", 4) == 0) {
                trans = "nvme";
+       } else if (strncmp(dev->name, "vd", 2) == 0)
+               trans = "virtio";
 
        return trans ? xstrdup(trans) : NULL;
 }