Make `virsh nodedev-list` print more information about the devices
Goal
To be able to determine which device to detach/reattach/reset.
Background
I'm using virt-manager on a laptop, and have added the built-in webcam as a device for a Window's VM. Frequently the webcam seems to be lost so I've been looking for ways to control whether it should be attached to the host or guest. In that search I found the virsh nodedev-*
commands, but it is difficult to determine which device to invoke commands on.
When adding the webcam, it is listed as:
002:002 Integrated Camera
Whereas the XML for the VM contains:
<hostdev mode="subsystem" type="usb" managed="yes">
<source>
<vendor id="0x04f2"/>
<product id="0xb6d8"/>
</source>
<address type="usb" bus="0" port="5"/>
</hostdev>
And the output from virsh nodedev-list --tree
-- which lists the devices in a format virsh commands will understand -- contains things like:
+- pci_0000_00_02_2
| |
| +- pci_0000_02_00_0
| | |
| | +- net_enp2s0f0_00_2b_67_cd_ff_fe
| |
| +- pci_0000_02_00_1
| +- pci_0000_02_00_2
| +- pci_0000_02_00_3
| +- pci_0000_02_00_4
| |
| +- usb_usb1
| |
| +- usb_1_0_1_0
It is difficult to tell which which device listed by virsh nodedev-list
corresponds to the webcam. In fact my attempts to make guesses based on the "0" and "5" from the <address>
element in the XML seem to be wrong, as do my guesses based on the "002:002" displayed when I added the device using virt-manager.
Request
Could virsh nodedev-list
be given a --verbose
flag (or something like that) to have it also list the device names and vendor and product IDs? Currently I'm left wondering if the virsh commands aren't working for me because I'm getting the device ID wrong, or because of something else.