List mediated devices
With no options, information about the currently running mediated devices is provided. Specifying
'defined' lists the configuration of defined devices, regardless of their running state. This may be
further reduced by specifying specific 'uuid' or 'parent' devices to list. The 'dumpjson' option
provides output listing in machine readable JSON format. When a 'uuid' option is provided and the
result is a single device, the output contains only the JSON fields necessary to recreate a config
file for the device (minus attributes for listings of running devices). When the verbose option is
provided, the human readable listing will include attributes for the device(s).
Usage: lsmdev [OPTIONS]
Options:
-d, --defined
Show defined devices
--dumpjson
Output device list in json format
-v, --verbose
Print additional information about the devices
-u, --uuid <UUID>
List devices matching the specified UUID
-p, --parent <PARENT>
List devices associated with the specified Parent device
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
Options (11)
| Option | Description | Source |
|---|
-d, --defined | Show defined devices | help |
--dumpjson | Dump the configuration for a device in JSON format when filtered to as single device and used with the list command. | help + man |
-v, --verbose | Print additional information about the devices | help |
-u, --uuid UUID | List devices matching the specified UUID | help |
-p, --parent PARENT | List devices associated with the specified Parent device | help |
-h, --help | Print help (see a summary with '-h') | help |
-V, --version | Print version | help |
--addattr ATTRIBUTE | Add an attribute ATTRIBUTE. (in the manual page but not in --help) | man |
--delattr | Delete an attribute entry. (in the manual page but not in --help) | man |
--jsonfile FILE | Read the configuration for a device from a JSON file FILE. (in the manual page but not in --help) | man |
--value VALUE | Set an attribute to VALUE, in the format accepted by the attribute. (in the manual page but not in --help) | man |
Examples (12) from the manual page, untested
mdevctl list
List running mdev devices:mdevctl list -d
List defined mdev devices:mdevctl types
List mdev types supported on the host system:mdevctl modify --uuid 83c32df7-d52e-4ec1-9668-1f3c7e4df107 --manual
Modify a defined device from automatic start to manual:mdevctl stop -u 83c32df7-d52e-4ec1-9668-1f3c7e4df107
Stop a running mdev device:uuidgen
Start an mdev device that is not defined:mdevctl define --uuid 6eba5b41-176e-40db-b93e-7f18e04e0b93
Promote the new created mdev to a defined device:mdevctl list -d
## ADVANCED EXAMPLES (ATTRIBUTES AND JSON)mdevctl modify -u 783e6dbb-ea0e-411f-94e2-717eaad438bf --addattr=assign_adapter --value=5
Add some attributes:mdevctl list -d -u 783e6dbb-ea0e-411f-94e2-717eaad438bf --dumpjson
Dump the JSON configuration:mdevctl modify -u 783e6dbb-ea0e-411f-94e2-717eaad438bf --delattr --index=5
Remove some attributes:cat vfio_ap_device.json
Define an mdev device from a file:
Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.