::
- nodedev-list [--cap capability] [--tree] [--inactive | --all]
+ nodedev-list [--cap capability] [--tree] [--inactive | --all] [--persistent | --transient]
List all of the devices available on the node that are known by libvirt.
*cap* is used to filter the list by capability types, the types must be
'scsi', 'storage', 'fc_host', 'vports', 'scsi_generic', 'drm', 'mdev',
'mdev_types', 'ccw', 'css', 'ap_card', 'ap_queue', 'ap_matrix'. By default,
only active devices are listed. *--inactive* is used to list only inactive
-devices, and *-all* is used to list both active and inactive devices.
+devices, and *--all* is used to list both active and inactive devices.
+*--persistent* is used to list only persistent devices, and *--transient* is
+used to list only transient devices. Not providing *--persistent* or
+*--transient* will list all devices unless filtered otherwise. *--transient*
+is mutually exclusive with *--persistent* and *--inactive*.
If *--tree* is used, the output is formatted in a tree representing parents of
each node. *--tree* is mutually exclusive with all other options.
.type = VSH_OT_BOOL,
.help = N_("list inactive & active devices")
},
+ {.name = "persistent",
+ .type = VSH_OT_BOOL,
+ .help = N_("list persistent devices")
+ },
+ {.name = "transient",
+ .type = VSH_OT_BOOL,
+ .help = N_("list transient devices")
+ },
{.name = NULL}
};
int cap_type = -1;
bool inactive = vshCommandOptBool(cmd, "inactive");
bool all = vshCommandOptBool(cmd, "all");
+ bool persistent = vshCommandOptBool(cmd, "persistent");
+ bool transient = vshCommandOptBool(cmd, "transient");
ignore_value(vshCommandOptStringQuiet(ctl, cmd, "cap", &cap_str));
return false;
}
- if (tree && (cap_str || inactive)) {
- vshError(ctl, "%s", _("Option --tree is incompatible with --cap and --inactive"));
+ if (transient && (persistent || inactive)) {
+ vshError(ctl, "%s", _("Option --transient is incompatible with --persistent and --inactive"));
+ return false;
+ }
+
+ if (tree && (cap_str || inactive || persistent || transient)) {
+ vshError(ctl, "%s", _("Option --tree is incompatible with --cap, --inactive, --persistent and --transient"));
return false;
}
if (!inactive)
flags |= VIR_CONNECT_LIST_NODE_DEVICES_ACTIVE;
+ if (persistent)
+ flags |= VIR_CONNECT_LIST_NODE_DEVICES_PERSISTENT;
+ if (transient)
+ flags |= VIR_CONNECT_LIST_NODE_DEVICES_TRANSIENT;
+
if (!(list = virshNodeDeviceListCollect(ctl, caps, ncaps, flags))) {
ret = false;
goto cleanup;