]> git.proxmox.com Git - mirror_qemu.git/commit - monitor.c
QMP: Allow 'query-' commands
authorLuiz Capitulino <lcapitulino@redhat.com>
Fri, 27 Nov 2009 00:59:02 +0000 (22:59 -0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Thu, 3 Dec 2009 15:41:23 +0000 (09:41 -0600)
commit5e23f480df7a451dab6f82c4f13520b089daaf0e
tree8d085b2d28fee0b5643110f46aa7bb302c4d1153
parent5fa737a4792c0aef9cf0588242336eefb0cb8ca8
QMP: Allow 'query-' commands

The 'info' command makes sense for the user protocol, but for QMP
it doesn't, as its return data is not well defined. That is, it
can return anything.

To fix this Avi proposes having 'query-' commands when in protocol
mode. For example, 'info balloon' would become 'query-balloon'.

The right way of supporting this would probably be to move all
info handlers to qemu-monitor.hx, add a flags field to mon_cmd_t
to identify them and then modify do_info() to do its search based
on that flag.

Unfortunately, this would require a big change in the Monitor.

To make things simpler for now, this commit takes a different
approach: a check for commands starting with "query-" is added to
toplevel QMP code, if it's true we setup things so that do_info()
is called with the appropriate arguments.

This is a hack, but is a temporary one and guarantees that query-
commands will work from the first day.

Also note that 'info' is not allowed in protocol mode.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
monitor.c