About QEMU Monitor Protocol

Source: Internet
Author: User
Tags json

About QEMU Monitor Protocol

Reference:
Http://wiki.qemu.org/QMP
http://humblec.com/qmp-qemu-monitor-protocol-and-different-ways-of-accessing-it/

Related documents:
Qmp-commands.hx
Qmp-events.txt
Qmp-spec.txt
Qapi-schema.json
Writing-qmp-commands.txt
Hmp-commands.hx

First, Introduction
QEMU Monitor Protocol, abbreviated as QMP, is a protocol in JSON format. QMP is an important part of the QEMU-KVM virtual machine. If you use Libvirt to start a virtual machine, Libvirt uses QMP to send commands to QEMU, and QEMU returns by QMP events (QMP event), so QMP is an important channel for interaction between Libvirt and QEMU.
According to the introduction in Http://wiki.qemu.org/QMP, The commands we use now are still in QMP-COMMANDS.HX and HMP-COMMANDS.HX, and future hopes are placed in the Qapi-schema.json file, just like the Qga (Qemu guest agent) implementation.

Second, use
The second URL in the reference has a qmp approach, which is a simple introduction to the virtual machines from Libvirt.
Use the command:
# Virsh Qemu-monitor-command--help
You can find all the QMP commands and a brief introduction to the commands.
Use the command:
# virsh Qemu-monitor-command Domain--HMP Help
You can find all the commands for HMP (Human Monitor Protocol) and a brief introduction to the commands.
The difference between QMP and HMP is that the QMP command uses the JSON format, HMP uses the command directly, and the commands between the two are slightly different. Relatively speaking, HMP is simpler than QMP in format.
Examples of HMP and QMP:
# Virsh Qemu-monitor-command--HMP 3 Info block
# Virsh Qemu-monitor-command 3 ' {"Execute": "Query-block"} '

Three, the principle
The qmp essence is a local UNIX socket. QEMU is the server side and Libvirt is the client side. This is explained in detail in the following QMP principles.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.