Red Hat Bugzilla – Bug 723713
virsh does not have a command to list devices attached to a virtual machine
Last modified: 2014-08-11 20:16:29 EDT
Description of problem:
There is no command to list devices attached to a virtual machine. Only commands exist to show information or state of devices attached to virtual machines. For both commands it is necessary to know the device name attached.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Install libvirt-bin
2. Create a virtual machine
3. search for a command listing devices attached
no such command available
having such a command available
something like "virsh list-devices <domain>" or
"virsh domlistblk <domain>" would be helpful
Well those can be extracted from the XML provided by virsh dumpxml <domain>
by looking in the "devices" section.
One of the problem of a standalone list as you suggest is that it would
like all the associated metadata like:
- is that a read only device use
- is that used as a block device or a character one
I don't disagree that one or 2 convenience function could be provided for virsh
(not in the API) though ...
This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component.
Yeah, this is not a bug. XML might not be the best interface, but there are well known tools that allow parsing it.
It actually does have one - look at the original submission - he apparently is trying to see block devices, however the command has a typo: it's not "virsh domlistblk <domain>" - the correct command is "virsh domblklist <domain>". I hope this comment helps him as the message is pretty old.