}
}
+ /* ignore non-virtio devices */
+ if (lsblk->virtio) {
+ char *transport = get_transport(dev);
+
+ if (!transport || strcmp(transport, "virtio")) {
+ DBG(DEV, ul_debugobj(dev, "non-virtio device -- ignore"));
+ return -1;
+ }
+ }
+
DBG(DEV, ul_debugobj(dev, "%s: context successfully initialized", dev->name));
return 0;
}
fputs(_(" -P, --pairs use key=\"value\" output format\n"), out);
fputs(_(" -S, --scsi output info about SCSI devices\n"), out);
fputs(_(" -N, --nvme output info about NVMe devices\n"), out);
+ fputs(_(" -v, --virtio output info about virtio devices\n"), out);
fputs(_(" -T, --tree[=<column>] use tree format output\n"), out);
fputs(_(" -a, --all print all devices\n"), out);
fputs(_(" -b, --bytes print SIZE in bytes rather than in human readable format\n"), out);
{ "pairs", no_argument, NULL, 'P' },
{ "scsi", no_argument, NULL, 'S' },
{ "nvme", no_argument, NULL, 'N' },
+ { "virtio", no_argument, NULL, 'v' },
{ "sort", required_argument, NULL, 'x' },
{ "sysroot", required_argument, NULL, OPT_SYSROOT },
{ "shell", no_argument, NULL, 'y' },
lsblk_init_debug();
while((c = getopt_long(argc, argv,
- "AabdDzE:e:fhJlNnMmo:OpPiI:rstVST::w:x:y",
+ "AabdDzE:e:fhJlNnMmo:OpPiI:rstVvST::w:x:y",
longopts, NULL)) != -1) {
err_exclusive_options(c, longopts, excl, excl_st);
add_uniq_column(COL_TRANSPORT);
add_uniq_column(COL_RQ_SIZE);
break;
+ case 'v':
+ lsblk->nodeps = 1;
+ lsblk->virtio = 1;
+ add_uniq_column(COL_NAME);
+ add_uniq_column(COL_TYPE);
+ add_uniq_column(COL_TRANSPORT);
+ add_uniq_column(COL_SIZE);
+ add_uniq_column(COL_RQ_SIZE);
+ break;
case 'T':
force_tree = 1;
if (optarg) {