libvirt – QEMU Monitor Protocol (QMP)

Because libvirt self is using the qemu monitor to mange the guests, it is not available for the user. Since version 0.8.6 [1] its possbile to send a command throught libvirt to the monitor.

virsh qemu-monitor-command <domain> <command>

The problem is that you must use the QMP format to send a command like

$ virsh qemu-monitor-command <domain> \
    '{"execute":"human-monitor-command","arguments":{"command-line":"info kvm"}}'

The solution: Human Monitor Protocol / --hmp

With this nifty switch [2] its possible to use qemu monitor commands without the QMP format like

$ virsh qemu-monitor-command --hmp <domain> 'info kvm'
kvm support: enabled

Leave a Reply

Your email address will not be published. Required fields are marked *