https://linux-kvm.org/api.php?action=feedcontributions&user=Miguel&feedformat=atom
KVM - User contributions [en]
2024-03-28T14:23:26Z
User contributions
MediaWiki 1.39.5
https://linux-kvm.org/index.php?title=Lists,_IRC&diff=3512
Lists, IRC
2011-03-07T14:53:46Z
<p>Miguel: Removed Spam</p>
<hr />
<div>=Lists, IRC=<br />
<br />
== Mailing Lists ==<br />
<br />
{|<br />
|-<br />
! list<br />
! topics<br />
! subscribe<br />
! archives<br />
|-<br />
| kvm@vger.kernel.org<br />
| general and x86<br />
| [mailto:majordomo@vger.kernel.org?body=subscribe%20kvm subscribe]<br />
| [http://news.gmane.org/gmane.comp.emulators.kvm.devel Gmane], [http://www.spinics.net/lists/kvm spinics], [http://marc.info/?l=kvm MARC]<br />
|-<br />
| kvm-commits@vger.kernel.org <br />
| kernel commit logs <br />
| [mailto:majordomo@vger.kernel.org?body=subscribe%20kvm-commits subscribe] <br />
| [http://news.gmane.org/gmane.comp.emulators.kvm.scm Gmane] <br />
|-<br />
| kvm-ia64@vger.kernel.org <br />
| ia64 <br />
| [mailto:majordomo@vger.kernel.org?body=subscribe%20kvm-ia64 subscribe] <br />
| [http://www.spinics.net/lists/kvm-ia64/ spinics]<br />
|-<br />
| kvm-ppc@vger.kernel.org <br />
| PowerPC <br />
| [mailto:majordomo@vger.kernel.org?body=subscribe%20kvm-ppc subscribe] <br />
| [http://marc.info/?l=kvm-ppc-devel MARC] <br />
|}<br />
<br />
While the lists are used mainly for development, user queries are welcome. No need to subscribe for a one-off question, just send an email. You may also want to check the various qemu resources on the web, as kvm shares the qemu user interface and networking.<br />
<br />
Please observe the usual mailing list etiquette: don't top-post, and trim excess quotations from the mail you are replying to.<br />
<br />
Don't post to individual kvm developers directly.<br />
<br />
== IRC ==<br />
<br />
Join us on '''#kvm''' at [http://freenode.net Freenode]. Don't report serious bugs on IRC; they're liable to get lost. Use the list or the [[Bugs|bug tracker]].<br />
<br />
== Blogs and related sites ==<br />
Haydn Solomon's [http://www.linux-kvm.com linux-kvm] site, featuring forums and a blog<br />
<br />
Avi Kivity's [http://avikivity.blogspot.com blog] <br />
<br />
Anthony Liguori's [http://blog.codemonkey.ws blog] <br />
<br />
[http://virt.kernelnewbies.org/ Linux virtualization] wiki<br />
<br />
== Forums ==<br />
<br />
[http://forums.meulie.net/viewforum.php?f=43 KVM forum]</div>
Miguel
https://linux-kvm.org/index.php?title=MonitorProtocol&diff=3040
MonitorProtocol
2010-07-01T16:56:17Z
<p>Miguel: </p>
<hr />
<div>= QEMU Monitor Protocol =<br />
<br />
The QEMU Monitor Protocol (QMP) is a [http://www.json.org/ JSON]-based protocol which allows applications to communicate with QEMU's Monitor.<br />
<br />
QMP's main features are:<br />
<br />
* Lightweight, text-based, easy to parse data format<br />
* Asynchronous messages support (ie. events)<br />
* Capabilities Negotiation<br />
* Stable API (starting with QEMU version 0.13)<br />
<br />
The [http://git.savannah.gnu.org/cgit/qemu.git/tree/QMP/README README] file has a simple introduction and the [http://git.savannah.gnu.org/cgit/qemu.git/tree/QMP/qmp-spec.txt full specification] is recommended for application writers.<br />
<br />
== General Status ==<br />
<br />
A '''preview''' version of QMP is available in QEMU version 0.12. This means that QMP is still under development and there '''will''' be incompatible changes between QEMU 0.12 and QEMU 0.13.<br />
<br />
For more information about converted handlers, please check [[#Conversion Status]].<br />
<br />
== Examples ==<br />
<br />
In the following examples, 'C' stands for 'Client' and 'S' stands for 'Server'.<br />
<br />
=== Server Greeting ===<br />
<br />
S: { "QMP": { "version": { "qemu": "0.12.50", "package": "" }, "capabilities": [] } }<br />
<br />
=== Query version ===<br />
<br />
C: { "execute": "query-version" }<br />
S: { "return": { "qemu": "0.12.50", "package": ""} }<br />
<br />
=== Eject a device ===<br />
<br />
C: { "execute": "eject", "arguments": { "device": "ide1-cd0" } }<br />
S: {"return": {}}<br />
<br />
== Development ==<br />
<br />
Main developers are [mailto:lcapitulino@redhat.com Luiz Capitulino] and [mailto:armbru@redhat.com Markus Armbruster], but all QMP-related discussions happen on the [http://lists.nongnu.org/mailman/listinfo/qemu-devel qemu-devel] mailing list.<br />
<br />
Next features, hot fixes and other patches are stored in the QMP unstable repository:<br />
<br />
http://repo.or.cz/w/qemu/qmp-unstable.git<br />
<br />
'''NOTE''': all branches in this repository are constantly ''rebased'' (master inclusive).<br />
<br />
== TODO ==<br />
<br />
=== High Priority ===<br />
<br />
* do_device_add()/do_device_del() conversions (markus)<br />
* do_netdev_add()/do_netdev_del() conversions (markus)<br />
* do_blockdev_add()/do_blockdev_del() conversions (markus)<br />
* Events Grouping (luiz)<br />
* Make qmp-shell work again (luiz)<br />
<br />
* Self-description & High-level protocol documentation<br />
* High-level internal documentation<br />
* Better QObjects and QMP debug support<br />
<br />
=== Normal Priority ===<br />
<br />
* Convert all remaining commands to the QObject API<br />
* Improve internal API, currently it's too [http://lists.gnu.org/archive/html/qemu-devel/2009-12/msg02537.html low-level]<br />
* Array-based Monitor's command table<br />
* Libqmp<br />
<br />
== Testing ==<br />
<br />
Unfortunately, there is no automated tool to test QMP correctness yet. Probably, the right thing to do is to integrate with [http://www.linux-kvm.org/page/KVM-Autotest kvm-autotest] but we still have to think how this should be done.<br />
<br />
Meanwhile, QMP testing is a low-level procedure which requires knowledge about the protocol and its implementation, so the first thing to do is to read the [http://git.savannah.gnu.org/cgit/qemu.git/tree/QMP/README README] and [http://git.savannah.gnu.org/cgit/qemu.git/tree/QMP/qmp-spec.txt spec] files.<br />
<br />
This section describes three ways of testing QMP:<br />
<br />
* By hand (difficult, only worth it if you're chasing a specific bug)<br />
* qmp-shell script (automates part of the job)<br />
* Libvirt integration (assumes familiarity with libvirt)<br />
<br />
=== By hand ===<br />
<br />
1. Start QMP on a TCP socket, so that telnet can be used<br />
<br />
# qemu [...] -qmp tcp:localhost:4444,server<br />
<br />
2. Now, run telnet<br />
<br />
$ telnet localhost 4444<br />
<br />
3. You should see the following prompt<br />
<br />
{"QMP": {"version": {"qemu": "0.12.50", "package": ""}, "capabilities": []}}<br />
<br />
4. Now you can issue commands. For example, to get a list of QMP supported commands, run ''query-commands''<br />
<br />
{ "execute": "query-commands" }<br />
<br />
'''NOTE (1):''' all "info" commands are available under QMP as "query-", for example "info vnc" is "query-vnc".<br />
<br />
'''NOTE (2):''' QMP doesn't have user documentation yet, this means that, to find out which arguments a command accepts or what's its output, you will have to either check the [http://git.savannah.gnu.org/cgit/qemu.git/tree/qemu-monitor.hx qemu-monitor.hx] file and/or the function which implements the command.<br />
<br />
=== qmp-shell script ===<br />
<br />
This script is available under the [http://git.savannah.gnu.org/cgit/qemu.git/tree/QMP QMP] directory in QEMU's source-tree. It automates a bit the testing work, as it can construct commands.<br />
<br />
1. Start QMP on a unix socket, like:<br />
<br />
# qemu [...] -qmp unix:./qmp-sock,server<br />
<br />
2. Run the script<br />
<br />
# qmp-shell ./qmp-sock<br />
<br />
3. You should get the following prompt<br />
<br />
(QEMU)<br />
<br />
4. Now you can run commands. For example, let's change the VNC password:<br />
<br />
(QEMU) change device=vnc target=password arg='1234'<br />
<br />
'''NOTE''': To find out what arguments a command accepts, you have to either check the [http://git.savannah.gnu.org/cgit/qemu.git/tree/qemu-monitor.hx qemu-monitor.hx] file and/or the function which implements the command.<br />
<br />
=== Libvirt ===<br />
<br />
Libvirt already has QMP support, but it's currently disable. This test procedure explains how to enable it and put libvirt to run on top of QMP.<br />
<br />
1. Install [http://lloyd.github.com/yajl yajl-devel] (If you're running Fedora 12 or above just do 'yum install yajl-devel')<br />
<br />
2. From a fresh checkout of [http://libvirt.org/git/?p=libvirt.git;a=summary libvirt master branch] run the following:<br />
<br />
./autogen.sh --system --enable-compile-warnings=error<br />
<br />
'''NOTE (1):''' The '--system' flag is a shortcut for compiling with the --prefix and other directories matching a system RPM build.<br />
<br />
'''NOTE (2):''' Make sure the final summary of autogen.sh tells you that it found the yajl library<br />
<br />
3. To enable QMP support, edit '''src/qemu/qemu_conf.c''' and find:<br />
<br />
#if 0<br />
if (version >= 13000)<br />
flags |= QEMUD_CMD_FLAG_MONITOR_JSON;<br />
#endif<br />
<br />
Change to '#if 1', and change the version to 12000 so it detects your GIT build of QEMU<br />
<br />
4. Run 'make' to build. There is no need to 'make install' anything<br />
especially since that would overwrite your RPM based install<br />
<br />
5. As root simply stop the current daemon & start the one you built<br />
<br />
/etc/init.d/libvirtd stop<br />
$HOME/your/git/checkout/of/libvirt/daemon/libvirtd<br />
<br />
6. As root you can use the newly built virsh too<br />
<br />
cd $HOME/your/git/checkout/of/libvirt/src<br />
./virsh <BLAH><br />
<br />
== Conversion Status ==<br />
<br />
'''UPDATED''': 2009-12-16<br />
<br />
{| border="1"<br />
|<br />
|Command<br />
|Info<br />
|-<br />
|Handlers<br />
|62<br />
|36<br />
|-<br />
|Converted<br />
|19<br />
|15<br />
|-<br />
|Percentage<br />
|30%<br />
|41%<br />
|-<br />
|}<br />
<br />
The following tables have a per-function status. There is one table for ''command'' handlers and another one for ''info'' handlers.<br />
<br />
Status can be:<br />
<br />
* merged: already merged upstream<br />
* partial: merged, but error handling is incomplete<br />
<br />
'''NOTE:''' Handlers used by [http://libvirt.org Libvirt] are marked with <span style="background-color:yellow">yellow</span>. Handlers it is expected to use are marked <span style="background-color:khaki">khaki</span><br />
<br />
==== Command handlers ====<br />
<br />
{| border="1"<br />
|'''Handler name'''<br />
|'''Status'''<br />
|'''Version'''<br />
|'''Comments'''<br />
|-<br />
|do_acl_add()<br />
|<br />
|<br />
|<br />
|-<br />
|do_acl_policy()<br />
|<br />
|<br />
|<br />
|-<br />
|do_acl_remove()<br />
|<br />
|<br />
|<br />
|-<br />
|do_acl_reset()<br />
|<br />
|<br />
|<br />
|-<br />
|do_acl_show()<br />
|<br />
|<br />
|<br />
|- style="background-color:yellow;"<br />
|do_balloon()<br />
|merged<br />
|0.12<br />
|<br />
|-<br />
|do_block_set_passwd()<br />
|merged<br />
|0.12<br />
|<br />
|-<br />
|do_boot_set()<br />
|<br />
|<br />
|<br />
|- style="background-color:yellow;"<br />
|do_change()<br />
|merged<br />
|0.12<br />
|<br />
|- style="background-color:yellow;"<br />
|do_closefd()<br />
|merged<br />
|0.12<br />
|<br />
|- style="background-color:yellow;"<br />
|do_commit()<br />
|<br />
|<br />
|<br />
|- style="background-color:yellow;"<br />
|do_cont()<br />
|merged<br />
|0.12<br />
|<br />
|- style="background-color:yellow;"<br />
|do_cpu_set()<br />
|merged<br />
|0.12.50<br />
|<br />
|- style="background-color:yellow;"<br />
|do_cpu_set_nr()<br />
|<br />
|<br />
|qemu-kvm only<br />
|- style="background-color:yellow;"<br />
|do_delvm()<br />
|<br />
|<br />
|<br />
|- style="background-color:yellow;"<br />
|do_device_add()<br />
|merged<br />
|0.12.50<br />
|<br />
|- style="background-color:yellow;"<br />
|do_device_del()<br />
|merged<br />
|0.12.50<br />
|<br />
|- style="background-color:yellow;"<br />
|do_eject()<br />
|merged<br />
|0.12<br />
|<br />
|-<br />
|do_gdbserver()<br />
|<br />
|<br />
|<br />
|- style="background-color:yellow;"<br />
|do_getfd()<br />
|merged<br />
|0.12<br />
|<br />
|-<br />
|do_help_cmd()<br />
|<br />
|<br />
|<br />
|-<br />
|do_info()<br />
|merged<br />
|0.12<br />
|as 'query-' commands<br />
|-<br />
|do_inject_mce()<br />
|<br />
|<br />
|<br />
|-<br />
|do_inject_nmi()<br />
|<br />
|<br />
|<br />
|-<br />
|do_ioport_read()<br />
|<br />
|<br />
|<br />
|-<br />
|do_ioport_write()<br />
|<br />
|<br />
|<br />
|- style="background-color:yellow;"<br />
|do_loadvm()<br />
|<br />
|<br />
|<br />
|-<br />
|do_log()<br />
|<br />
|<br />
|<br />
|-<br />
|do_logfile()<br />
|<br />
|<br />
|<br />
|-<br />
|do_memory_dump()<br />
|<br />
|<br />
|<br />
|- style="background-color:yellow;"<br />
|do_memory_save()<br />
|merged<br />
|0.12.50<br />
|<br />
|- style="background-color:yellow;"<br />
|do_migrate()<br />
|partial<br />
|0.12<br />
|<br />
|- style="background-color:yellow;"<br />
|do_migrate_cancel()<br />
|merged<br />
|0.12<br />
|<br />
|- style="background-color:yellow;"<br />
|do_migrate_set_downtime()<br />
|merged<br />
|0.12.50<br />
|<br />
|- style="background-color:yellow;"<br />
|do_migrate_set_speed()<br />
|merged<br />
|0.12.50<br />
|<br />
|- style="background-color:khaki;"<br />
|do_mouse_button()<br />
|<br />
|<br />
|<br />
|- style="background-color:khaki;"<br />
|do_mouse_move()<br />
|<br />
|<br />
|<br />
|- style="background-color:khaki;"<br />
|do_mouse_set()<br />
|<br />
|<br />
|<br />
|-<br />
|do_netdev_add()<br />
|merged<br />
|0.12.50<br />
|<br />
|-<br />
|do_netdev_del()<br />
|merged<br />
|0.12.50<br />
|<br />
|- style="background-color:yellow;"<br />
|do_pci_device_hot_remove()<br />
|partial<br />
|0.12<br />
|legacy, use device_del instead<br />
|-<br />
|do_physical_memory_dump()<br />
|<br />
|<br />
|<br />
|- style="background-color:yellow;"<br />
|do_physical_memory_save()<br />
|merged<br />
|0.12.50<br />
|<br />
|-<br />
|do_print()<br />
|<br />
|<br />
|<br />
|-<br />
|do_quit()<br />
|merged<br />
|0.12<br />
|<br />
|- style="background-color:yellow;"<br />
|do_savevm()<br />
|<br />
|<br />
|<br />
|- style="background-color:khaki;"<br />
|do_screen_dump()<br />
|merged<br />
|0.12.50<br />
|<br />
|- style="background-color:khaki;"<br />
|do_sendkey()<br />
|<br />
|<br />
|<br />
|- style="background-color:khaki;"<br />
|do_set_link()<br />
|merged<br />
|0.12.50<br />
|<br />
|-<br />
|do_singlestep()<br />
|<br />
|<br />
|<br />
|- style="background-color:yellow;"<br />
|do_stop()<br />
|merged<br />
|0.12<br />
|<br />
|-<br />
|do_stop_capture()<br />
|<br />
|<br />
|<br />
|-<br />
|do_sum()<br />
|<br />
|<br />
|<br />
|- style="background-color:yellow;"<br />
|do_system_powerdown()<br />
|merged<br />
|0.12<br />
|<br />
|-<br />
|do_system_reset()<br />
|merged<br />
|0.12<br />
|<br />
|- style="background-color:yellow;"<br />
|do_usb_add()<br />
|<br />
|<br />
|legacy, use device_add instead<br />
|- style="background-color:yellow;"<br />
|do_usb_del()<br />
|<br />
|<br />
|legacy, use device_del instead<br />
|-<br />
|do_watchdog_action()<br />
|<br />
|<br />
|<br />
|-<br />
|do_wav_capture()<br />
|<br />
|<br />
|<br />
|- style="background-color:yellow;"<br />
|drive_hot_add()<br />
|<br />
|<br />
|legacy, use blockdev_add, device_add instead<br />
|- style="background-color:yellow;"<br />
|net_host_device_add()<br />
|<br />
|<br />
|consider do_netdev_add() instead<br />
|- style="background-color:yellow;"<br />
|net_host_device_remove()<br />
|<br />
|<br />
|consider do_netdev_del() instead<br />
|-<br />
|net_slirp_hostfwd_add()<br />
|<br />
|<br />
|<br />
|-<br />
|net_slirp_hostfwd_remove()<br />
|<br />
|<br />
|<br />
|- style="background-color:yellow;"<br />
|pci_device_hot_add()<br />
|partial<br />
|0.12<br />
|legacy, use device_add, blockdev_add instead<br />
|-<br />
|do_blockdev_add()<br />
|<br />
|<br />
|to be created<br />
|-<br />
|do_blockdev_del()<br />
|<br />
|<br />
|to be created<br />
|-<br />
|do_chardev_add()<br />
|<br />
|<br />
|to be created<br />
|-<br />
|do_chardev_del()<br />
|<br />
|<br />
|to be created<br />
|-<br />
|}<br />
<br />
==== Info handlers ====<br />
<br />
{| border="1"<br />
|'''Handler name'''<br />
|'''Status'''<br />
|'''Version'''<br />
|'''Comments'''<br />
|-<br />
|bdrv_info()<br />
|merged<br />
|0.12<br />
|<br />
|- style="background-color:yellow;"<br />
|bdrv_info_stats()<br />
|merged<br />
|0.12<br />
|<br />
|- style="background-color:yellow;"<br />
|do_info_balloon()<br />
|merged<br />
|0.12<br />
|<br />
|-<br />
|do_info_capture()<br />
|<br />
|<br />
|<br />
|-<br />
|do_info_commands()<br />
|merged<br />
|0.12<br />
|<br />
|-<br />
|do_info_cpu_stats()<br />
|<br />
|<br />
|<br />
|- style="background-color:yellow;"<br />
|do_info_cpus()<br />
|merged<br />
|0.12<br />
|<br />
|-<br />
|do_info_history()<br />
|<br />
|<br />
|<br />
|-<br />
|do_info_hpet()<br />
|merged<br />
|0.12<br />
|<br />
|-<br />
|do_info_jit()<br />
|<br />
|<br />
|<br />
|- style="background-color:khaki;"<br />
|do_info_kvm()<br />
|merged<br />
|0.12<br />
|<br />
|-<br />
|do_info_mice()<br />
|merged<br />
|0.12<br />
|<br />
|- style="background-color:yellow;"<br />
|do_info_migrate()<br />
|merged<br />
|0.12<br />
|<br />
|-<br />
|do_info_name()<br />
|merged<br />
|0.12<br />
|<br />
|-<br />
|do_info_network()<br />
|<br />
|<br />
|legacy, use do_info_netdev()<br />
|- style="background-color:khaki;"<br />
|do_info_netdev()<br />
|<br />
|<br />
|[http://wiki.qemu.org/Google_Summer_of_Code_2010/QMP Being worked on in SoC]<br />
|-<br />
|do_info_numa()<br />
|<br />
|<br />
|<br />
|-<br />
|do_info_profile()<br />
|<br />
|<br />
|<br />
|- style="background-color:khaki;" <br />
|do_info_qdm()<br />
|<br />
|<br />
|<br />
|-<br />
|do_info_qtree()<br />
|<br />
|<br />
|<br />
|-<br />
|do_info_registers()<br />
|<br />
|<br />
|<br />
|-<br />
|do_info_roms()<br />
|<br />
|<br />
|<br />
|- style="background-color:khaki;"<br />
|do_info_snapshots()<br />
|<br />
|<br />
|lacks parent info, libvirt wants it<br />
|- style="background-color:khaki;"<br />
|do_info_status()<br />
|merged<br />
|0.12<br />
|<br />
|-<br />
|do_info_usernet()<br />
|<br />
|<br />
|<br />
|-<br />
|do_info_uuid()<br />
|merged<br />
|0.12<br />
|<br />
|-<br />
|do_info_version()<br />
|merged<br />
|0.12<br />
|<br />
|-<br />
|do_info_vnc()<br />
|merged<br />
|0.12<br />
|<br />
|-<br />
|do_pci_info()<br />
|merged<br />
|0.12.50<br />
|libvirt uses this, but only with pre-0.12.x QEMU<br />
|-<br />
|irq_info()<br />
|<br />
|<br />
|<br />
|-<br />
|mem_info()<br />
|<br />
|<br />
|<br />
|-<br />
|pcmcia_info()<br />
|<br />
|<br />
|<br />
|-<br />
|pic_info()<br />
|<br />
|<br />
|<br />
|- style="background-color:yellow;"<br />
|qemu_chr_info()<br />
|merged<br />
|0.12<br />
|<br />
|-<br />
|tlb_info()<br />
|<br />
|<br />
|<br />
|-<br />
|usb_host_info()<br />
|<br />
|<br />
|<br />
|-<br />
|usb_info()<br />
|<br />
|<br />
|<br />
|-<br />
|}<br />
<br />
== History ==<br />
<br />
This was the fourth proposal for a Monitor protocol, past discussions can be found in the following links:<br />
<br />
* http://www.mail-archive.com/qemu-devel@nongnu.org/msg14593.html<br />
* http://lists.gnu.org/archive/html/qemu-devel/2009-01/msg00655.html<br />
* http://lists.gnu.org/archive/html/qemu-devel/2009-06/msg01584.html</div>
Miguel
https://linux-kvm.org/index.php?title=MonitorProtocol&diff=2968
MonitorProtocol
2010-04-29T19:10:49Z
<p>Miguel: </p>
<hr />
<div>= QEMU Monitor Protocol =<br />
<br />
The QEMU Monitor Protocol (QMP) is a [http://www.json.org/ JSON]-based protocol which allows applications to communicate with QEMU's Monitor.<br />
<br />
QMP's main features are:<br />
<br />
* Lightweight, text-based, easy to parse data format<br />
* Asynchronous messages support (ie. events)<br />
* Capabilities Negotiation<br />
* Stable API (starting with QEMU version 0.13)<br />
<br />
The [http://git.savannah.gnu.org/cgit/qemu.git/tree/QMP/README README] file has a simple introduction and the [http://git.savannah.gnu.org/cgit/qemu.git/tree/QMP/qmp-spec.txt full specification] is recommended for application writers.<br />
<br />
== General Status ==<br />
<br />
A '''preview''' version of QMP is available in QEMU version 0.12. This means that QMP is still under development and there '''will''' be incompatible changes between QEMU 0.12 and QEMU 0.13.<br />
<br />
For more information about converted handlers, please check [[#Conversion Status]].<br />
<br />
== Examples ==<br />
<br />
In the following examples, 'C' stands for 'Client' and 'S' stands for 'Server'.<br />
<br />
=== Server Greeting ===<br />
<br />
S: { "QMP": { "version": { "qemu": "0.12.50", "package": "" }, "capabilities": [] } }<br />
<br />
=== Query version ===<br />
<br />
C: { "execute": "query-version" }<br />
S: { "return": { "qemu": "0.12.50", "package": ""} }<br />
<br />
=== Eject a device ===<br />
<br />
C: { "execute": "eject", "arguments": { "device": "ide1-cd0" } }<br />
S: {"return": {}}<br />
<br />
== Development ==<br />
<br />
Main developers are [mailto:lcapitulino@redhat.com Luiz Capitulino] and [mailto:armbru@redhat.com Markus Armbruster], but all QMP-related discussions happen on the [http://lists.nongnu.org/mailman/listinfo/qemu-devel qemu-devel] mailing list.<br />
<br />
Next features, hot fixes and other patches are stored in the QMP unstable repository:<br />
<br />
http://repo.or.cz/w/qemu/qmp-unstable.git<br />
<br />
'''NOTE''': all branches in this repository are constantly ''rebased'' (master inclusive).<br />
<br />
== TODO ==<br />
<br />
=== High Priority ===<br />
<br />
* do_device_add()/do_device_del() conversions (markus)<br />
* do_netdev_add()/do_netdev_del() conversions (markus)<br />
* do_blockdev_add()/do_blockdev_del() conversions (markus)<br />
* Events Grouping (luiz)<br />
* Make qmp-shell work again (luiz)<br />
<br />
* Self-description & High-level protocol documentation<br />
* High-level internal documentation<br />
* Better QObjects and QMP debug support<br />
<br />
=== Normal Priority ===<br />
<br />
* Convert all remaining commands to the QObject API<br />
* Improve internal API, currently it's too [http://lists.gnu.org/archive/html/qemu-devel/2009-12/msg02537.html low-level]<br />
* Array-based Monitor's command table<br />
* Libqmp<br />
<br />
== Testing ==<br />
<br />
Unfortunately, there is no automated tool to test QMP correctness yet. Probably, the right thing to do is to integrate with [http://www.linux-kvm.org/page/KVM-Autotest kvm-autotest] but we still have to think how this should be done.<br />
<br />
Meanwhile, QMP testing is a low-level procedure which requires knowledge about the protocol and its implementation, so the first thing to do is to read the [http://git.savannah.gnu.org/cgit/qemu.git/tree/QMP/README README] and [http://git.savannah.gnu.org/cgit/qemu.git/tree/QMP/qmp-spec.txt spec] files.<br />
<br />
This section describes three ways of testing QMP:<br />
<br />
* By hand (difficult, only worth it if you're chasing a specific bug)<br />
* qmp-shell script (automates part of the job)<br />
* Libvirt integration (assumes familiarity with libvirt)<br />
<br />
=== By hand ===<br />
<br />
1. Start QMP on a TCP socket, so that telnet can be used<br />
<br />
# qemu [...] -qmp tcp:localhost:4444,server<br />
<br />
2. Now, run telnet<br />
<br />
$ telnet localhost 4444<br />
<br />
3. You should see the following prompt<br />
<br />
{"QMP": {"version": {"qemu": "0.12.50", "package": ""}, "capabilities": []}}<br />
<br />
4. Now you can issue commands. For example, to get a list of QMP supported commands, run ''query-commands''<br />
<br />
{ "execute": "query-commands" }<br />
<br />
'''NOTE (1):''' all "info" commands are available under QMP as "query-", for example "info vnc" is "query-vnc".<br />
<br />
'''NOTE (2):''' QMP doesn't have user documentation yet, this means that, to find out which arguments a command accepts or what's its output, you will have to either check the [http://git.savannah.gnu.org/cgit/qemu.git/tree/qemu-monitor.hx qemu-monitor.hx] file and/or the function which implements the command.<br />
<br />
=== qmp-shell script ===<br />
<br />
This script is available under the [http://git.savannah.gnu.org/cgit/qemu.git/tree/QMP QMP] directory in QEMU's source-tree. It automates a bit the testing work, as it can construct commands.<br />
<br />
1. Start QMP on a unix socket, like:<br />
<br />
# qemu [...] -qmp unix:./qmp-sock,server<br />
<br />
2. Run the script<br />
<br />
# qmp-shell ./qmp-sock<br />
<br />
3. You should get the following prompt<br />
<br />
(QEMU)<br />
<br />
4. Now you can run commands. For example, let's change the VNC password:<br />
<br />
(QEMU) change device=vnc target=password arg='1234'<br />
<br />
'''NOTE''': To find out what arguments a command accepts, you have to either check the [http://git.savannah.gnu.org/cgit/qemu.git/tree/qemu-monitor.hx qemu-monitor.hx] file and/or the function which implements the command.<br />
<br />
=== Libvirt ===<br />
<br />
Libvirt already has QMP support, but it's currently disable. This test procedure explains how to enable it and put libvirt to run on top of QMP.<br />
<br />
1. Install [http://lloyd.github.com/yajl yajl-devel] (If you're running Fedora 12 or above just do 'yum install yajl-devel')<br />
<br />
2. From a fresh checkout of [http://libvirt.org/git/?p=libvirt.git;a=summary libvirt master branch] run the following:<br />
<br />
./autogen.sh --system --enable-compile-warnings=error<br />
<br />
'''NOTE (1):''' The '--system' flag is a shortcut for compiling with the --prefix and other directories matching a system RPM build.<br />
<br />
'''NOTE (2):''' Make sure the final summary of autogen.sh tells you that it found the yajl library<br />
<br />
3. To enable QMP support, edit '''src/qemu/qemu_conf.c''' and find:<br />
<br />
#if 0<br />
if (version >= 13000)<br />
flags |= QEMUD_CMD_FLAG_MONITOR_JSON;<br />
#endif<br />
<br />
Change to '#if 1', and change the version to 12000 so it detects your GIT build of QEMU<br />
<br />
4. Run 'make' to build. There is no need to 'make install' anything<br />
especially since that would overwrite your RPM based install<br />
<br />
5. As root simply stop the current daemon & start the one you built<br />
<br />
/etc/init.d/libvirtd stop<br />
$HOME/your/git/checkout/of/libvirt/daemon/libvirtd<br />
<br />
6. As root you can use the newly built virsh too<br />
<br />
cd $HOME/your/git/checkout/of/libvirt/src<br />
./virsh <BLAH><br />
<br />
== Conversion Status ==<br />
<br />
'''UPDATED''': 2009-12-16<br />
<br />
{| border="1"<br />
|<br />
|Command<br />
|Info<br />
|-<br />
|Handlers<br />
|62<br />
|36<br />
|-<br />
|Converted<br />
|19<br />
|15<br />
|-<br />
|Percentage<br />
|30%<br />
|41%<br />
|-<br />
|}<br />
<br />
The following tables have a per-function status. There is one table for ''command'' handlers and another one for ''info'' handlers.<br />
<br />
Status can be:<br />
<br />
* merged: already merged upstream<br />
* partial: merged, but error handling is incomplete<br />
<br />
'''NOTE:''' Handlers used by [http://libvirt.org Libvirt] are marked with yellow.<br />
<br />
==== Command handlers ====<br />
<br />
{| border="1"<br />
|'''Handler name'''<br />
|'''Status'''<br />
|'''Version'''<br />
|'''Comments'''<br />
|-<br />
|do_acl_add()<br />
|<br />
|<br />
|<br />
|-<br />
|do_acl_policy()<br />
|<br />
|<br />
|<br />
|-<br />
|do_acl_remove()<br />
|<br />
|<br />
|<br />
|-<br />
|do_acl_reset()<br />
|<br />
|<br />
|<br />
|-<br />
|do_acl_show()<br />
|<br />
|<br />
|<br />
|- style="background-color:yellow;"<br />
|do_balloon()<br />
|merged<br />
|0.12<br />
|<br />
|-<br />
|do_block_set_passwd()<br />
|merged<br />
|0.12<br />
|<br />
|-<br />
|do_boot_set()<br />
|<br />
|<br />
|<br />
|- style="background-color:yellow;"<br />
|do_change()<br />
|merged<br />
|0.12<br />
|<br />
|- style="background-color:yellow;"<br />
|do_closefd()<br />
|merged<br />
|0.12<br />
|<br />
|-<br />
|do_commit()<br />
|<br />
|<br />
|<br />
|- style="background-color:yellow;"<br />
|do_cont()<br />
|merged<br />
|0.12<br />
|<br />
|- style="background-color:yellow;"<br />
|do_cpu_set()<br />
|merged<br />
|0.12.50<br />
|<br />
|-<br />
|do_delvm()<br />
|<br />
|<br />
|<br />
|- style="background-color:yellow;"<br />
|do_device_add()<br />
|merged<br />
|0.12.50<br />
|<br />
|- style="background-color:yellow;"<br />
|do_device_del()<br />
|<br />
|<br />
|<br />
|- style="background-color:yellow;"<br />
|do_eject()<br />
|merged<br />
|0.12<br />
|<br />
|-<br />
|do_gdbserver()<br />
|<br />
|<br />
|<br />
|- style="background-color:yellow;"<br />
|do_getfd()<br />
|merged<br />
|0.12<br />
|<br />
|-<br />
|do_help_cmd()<br />
|<br />
|<br />
|<br />
|-<br />
|do_info()<br />
|merged<br />
|0.12<br />
|as 'query-' commands<br />
|-<br />
|do_inject_mce()<br />
|<br />
|<br />
|<br />
|-<br />
|do_inject_nmi()<br />
|<br />
|<br />
|<br />
|-<br />
|do_ioport_read()<br />
|<br />
|<br />
|<br />
|-<br />
|do_ioport_write()<br />
|<br />
|<br />
|<br />
|-<br />
|do_loadvm()<br />
|<br />
|<br />
|<br />
|-<br />
|do_log()<br />
|<br />
|<br />
|<br />
|-<br />
|do_logfile()<br />
|<br />
|<br />
|<br />
|-<br />
|do_memory_dump()<br />
|<br />
|<br />
|<br />
|- style="background-color:yellow;"<br />
|do_memory_save()<br />
|merged<br />
|0.12.50<br />
|<br />
|- style="background-color:yellow;"<br />
|do_migrate()<br />
|partial<br />
|0.12<br />
|<br />
|- style="background-color:yellow;"<br />
|do_migrate_cancel()<br />
|merged<br />
|0.12<br />
|<br />
|- style="background-color:yellow;"<br />
|do_migrate_set_downtime()<br />
|merged<br />
|0.12.50<br />
|<br />
|- style="background-color:yellow;"<br />
|do_migrate_set_speed()<br />
|merged<br />
|0.12.50<br />
|<br />
|-<br />
|do_mouse_button()<br />
|<br />
|<br />
|<br />
|-<br />
|do_mouse_move()<br />
|<br />
|<br />
|<br />
|-<br />
|do_mouse_set()<br />
|<br />
|<br />
|<br />
|- style="background-color:yellow;"<br />
|do_pci_device_hot_remove()<br />
|partial<br />
|0.12<br />
|legacy, use device_del instead<br />
|-<br />
|do_physical_memory_dump()<br />
|<br />
|<br />
|<br />
|- style="background-color:yellow;"<br />
|do_physical_memory_save()<br />
|merged<br />
|0.12.50<br />
|<br />
|-<br />
|do_print()<br />
|<br />
|<br />
|<br />
|-<br />
|do_quit()<br />
|merged<br />
|0.12<br />
|<br />
|-<br />
|do_savevm()<br />
|<br />
|<br />
|<br />
|-<br />
|do_screen_dump()<br />
|<br />
|<br />
|<br />
|-<br />
|do_sendkey()<br />
|<br />
|<br />
|<br />
|- style="background-color:yellow;"<br />
|do_set_link()<br />
|<br />
|<br />
|<br />
|-<br />
|do_singlestep()<br />
|<br />
|<br />
|<br />
|- style="background-color:yellow;"<br />
|do_stop()<br />
|merged<br />
|0.12<br />
|<br />
|-<br />
|do_stop_capture()<br />
|<br />
|<br />
|<br />
|-<br />
|do_sum()<br />
|<br />
|<br />
|<br />
|- style="background-color:yellow;"<br />
|do_system_powerdown()<br />
|merged<br />
|0.12<br />
|<br />
|-<br />
|do_system_reset()<br />
|merged<br />
|0.12<br />
|<br />
|- style="background-color:yellow;"<br />
|do_usb_add()<br />
|<br />
|<br />
|legacy, use device_add instead<br />
|- style="background-color:yellow;"<br />
|do_usb_del()<br />
|<br />
|<br />
|legacy, use device_del instead<br />
|-<br />
|do_watchdog_action()<br />
|<br />
|<br />
|<br />
|-<br />
|do_wav_capture()<br />
|<br />
|<br />
|<br />
|- style="background-color:yellow;"<br />
|drive_hot_add()<br />
|<br />
|<br />
|<br />
|- style="background-color:yellow;"<br />
|net_host_device_add()<br />
|<br />
|<br />
|consider do_netdev_add() instead<br />
|- style="background-color:yellow;"<br />
|net_host_device_remove()<br />
|<br />
|<br />
|consider do_netdev_del() instead<br />
|-<br />
|net_slirp_hostfwd_add()<br />
|<br />
|<br />
|<br />
|-<br />
|net_slirp_hostfwd_remove()<br />
|<br />
|<br />
|<br />
|- style="background-color:yellow;"<br />
|pci_device_hot_add()<br />
|partial<br />
|0.12<br />
|legacy, use device_add instead<br />
|-<br />
|do_chardev_add()<br />
|<br />
|<br />
|to be created<br />
|-<br />
|do_chardev_del()<br />
|<br />
|<br />
|to be created<br />
|-<br />
|do_blockdev_add()<br />
|<br />
|<br />
|to be created<br />
|-<br />
|do_blockdev_del()<br />
|<br />
|<br />
|to be created<br />
|-<br />
|do_netdev_add()<br />
|<br />
|<br />
|to be created<br />
|-<br />
|do_netdev_del()<br />
|<br />
|<br />
|to be created<br />
|-<br />
|}<br />
<br />
==== Info handlers ====<br />
<br />
{| border="1"<br />
|'''Handler name'''<br />
|'''Status'''<br />
|'''Version'''<br />
|'''Comments'''<br />
|- style="background-color:yellow;"<br />
|bdrv_info()<br />
|merged<br />
|0.12<br />
|<br />
|- style="background-color:yellow;"<br />
|bdrv_info_stats()<br />
|merged<br />
|0.12<br />
|<br />
|- style="background-color:yellow;"<br />
|do_info_balloon()<br />
|merged<br />
|0.12<br />
|<br />
|-<br />
|do_info_capture()<br />
|<br />
|<br />
|<br />
|- style="background-color:yellow;"<br />
|do_info_cpus()<br />
|merged<br />
|0.12<br />
|<br />
|-<br />
|do_info_cpu_stats()<br />
|<br />
|<br />
|<br />
|-<br />
|do_info_history()<br />
|<br />
|<br />
|<br />
|-<br />
|do_info_hpet()<br />
|merged<br />
|0.12<br />
|<br />
|-<br />
|do_info_jit()<br />
|<br />
|<br />
|<br />
|-<br />
|do_info_kvm()<br />
|merged<br />
|0.12<br />
|<br />
|-<br />
|do_info_mice()<br />
|merged<br />
|0.12<br />
|<br />
|- style="background-color:yellow;"<br />
|do_info_migrate()<br />
|merged<br />
|0.12<br />
|<br />
|-<br />
|do_info_name()<br />
|merged<br />
|0.12<br />
|<br />
|-<br />
|do_info_network()<br />
| [http://wiki.qemu.org/Google_Summer_of_Code_2010/QMP Being worked on in SoC]<br />
|<br />
|<br />
|-<br />
|do_info_numa()<br />
|<br />
|<br />
|<br />
|-<br />
|do_info_profile()<br />
|<br />
|<br />
|<br />
|-<br />
|do_info_qdm()<br />
|<br />
|<br />
|<br />
|-<br />
|do_info_qtree()<br />
|<br />
|<br />
|<br />
|-<br />
|do_info_registers()<br />
|<br />
|<br />
|<br />
|-<br />
|do_info_roms()<br />
|<br />
|<br />
|<br />
|-<br />
|do_info_snapshots()<br />
|<br />
|<br />
|<br />
|-<br />
|do_info_status()<br />
|merged<br />
|0.12<br />
|<br />
|-<br />
|do_info_usernet()<br />
|<br />
|<br />
|<br />
|-<br />
|do_info_uuid()<br />
|merged<br />
|0.12<br />
|<br />
|-<br />
|do_info_version()<br />
|merged<br />
|0.12<br />
|<br />
|-<br />
|do_info_vnc()<br />
|merged<br />
|0.12<br />
|<br />
|-<br />
|irq_info()<br />
|<br />
|<br />
|<br />
|-<br />
|mem_info()<br />
|<br />
|<br />
|<br />
|- style="background-color:yellow;"<br />
|pci_info()<br />
|<br />
|<br />
|<br />
|-<br />
|pcmcia_info()<br />
|<br />
|<br />
|<br />
|-<br />
|pic_info()<br />
|<br />
|<br />
|<br />
|-<br />
|qemu_chr_info()<br />
|merged<br />
|0.12<br />
|<br />
|-<br />
|tlb_info()<br />
|<br />
|<br />
|<br />
|-<br />
|usb_host_info()<br />
|<br />
|<br />
|<br />
|- style="background-color:yellow;"<br />
|usb_info()<br />
|<br />
|<br />
|<br />
|-<br />
|}<br />
<br />
== History ==<br />
<br />
This was the fourth proposal for a Monitor protocol, past discussions can be found in the following links:<br />
<br />
* http://www.mail-archive.com/qemu-devel@nongnu.org/msg14593.html<br />
* http://lists.gnu.org/archive/html/qemu-devel/2009-01/msg00655.html<br />
* http://lists.gnu.org/archive/html/qemu-devel/2009-06/msg01584.html</div>
Miguel