I have created a VM with the below command in qemu with KVM enabled.
qemu-kvm -m 1024 -enable-kvm -hda /var/lib/libvirt/images/fedora.img
I would like to know the exact devices that are emulated for this VM, including storage and network (I can see a network interface enabled inside VM using ifconfig).
info qtree
This awesome QEMU monitor command shows a nice tree view of how all the QEMU devices are placed.
You can get a QEMU monitor prompt either via:
-nographic
?
is either 1, 2, 3, etc. in a graphic QEMU window-monitor telnet::45454,server,nowait
and then connect to it withtelnet 45454
Then for example, I can see my network device as:
and my storage device as:
and other PCI devices as:
Tested in QEMU v2.12.
If you have access to the guest, why not use something like 'lspci'. If you're trying to get this from the host, you'd need to figure out what defaults qemu is using. This is going to vary based on what version you're using.
I'd suggest you use libvirt instead of manually launching qemu. This would give you better APIs to the guests, and actually give you this information in a sane fashion (you could simply use
virsh dumpxml
to dump a configuration of the guest, including all attached hardware devices).