[libvirt] [PATCH] qemu-monitor-command: hide the low level protocol

Daniel P. Berrange berrange at redhat.com
Thu Jan 6 11:12:00 UTC 2011


On Thu, Jan 06, 2011 at 04:35:03PM +0800, Lai Jiangshan wrote:
> 
> When qmp protocol is available, the libvirt will use this protocol
> to communicates with qemu. And when we use "virsh  qemu-monitor-command",
> we need:
> 	virsh qemu-monitor-command dom '{ "execute": "eject", \
> 		"arguments": { "device": "ide1-cd0" } }'
> 
> But virsh is typical a human command line interface, it is not comfortable
> that a human user has to construct such commands. This patch makes
> human user can use
> 	virsh qemu-monitor-command dom 'eject ide1-cd0'
> in any time(qmp protocol is available or not).
> 
> The result string is also converted to the same as non-qmp-protocol version.
> The user do not need to concern about the low level protocol now.

What if the user *wants* to use QMP? There will be commands available
in QMP that are different to those in HMP, so there will definitely
be a need to send true QMP commands here.

In addition this patch changes semantics for *all* users of the API
(virDomainQemuMonitorCommand) not solely virsh, preventing any apps
from using QMP.

If we want todo automatic HMP passthrough, then it must be optional
with the default being off. It could perhaps be done with a flag
to virDomainQemuMonitorCommand

Regards,
Daniel




More information about the libvir-list mailing list