qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 16/16] Make qemu-io commands available in the mo


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 16/16] Make qemu-io commands available in the monitor
Date: Wed, 29 May 2013 06:05:12 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6

On 05/29/2013 02:13 AM, Kevin Wolf wrote:
> Am 28.05.2013 um 18:07 hat Eric Blake geschrieben:
>> On 05/28/2013 09:27 AM, Kevin Wolf wrote:
>>> The QMP version is flagged with a __org.qemu.debug- prefix in order to
>>> reinforce the statement that qemu-io is for testing and debugging only,
>>> with no API guarantees.
>>
>> Correct use of naming conventions.
>>
>> Hmm, I wonder if the recent addition of an 'abort' action to
>> 'transaction' should be renamed __org.qemu.debug-abort, to make it
>> obvious that it is another case of a QMP command useful mainly for
>> testing, and not real-life use.
> 
> Makes sense to me.
> 
> But first I'd like to get Luiz's ack for this, because I think I'm the
> first one to use an __org.qemu prefix, and I'm the first one trying to
> introduce a QMP command without API stability.

qom-get/qom-set is somewhat of an unstable API (not that the parameters
of the call will change, but that the underlying qom model is not locked
down, and therefore you cannot blindly rely on a qom command that worked
in one version to continue working in future versions).  [Hmm, do we
have a good way to introspect the qom model?]

But yes, this is indeed a different class of unstable interface, and
worth agreeing that we have best practice in mind before committing to it.

>>> +{ 'command': '__org.qemu.debug-qemu-io-command',
>>> +  'data': {'device': 'str', 'command': 'str'} }
>>
>> I would have asked that 'command' be an enum, except that we promise no
>> API stability so there's no need to lock us into an enum that could be
>> introspected :)  This command looks fine as-is.
> 
> Wouldn't even work because the command includes parameters and things.
> This is really what you would type on the qemu-io command line. So a
> typical example might look like:
> 
> { "execute": "__org.qemu.debug-qemu-io-command", "arguments":
>     { "device": "ide0-hd0", "command": "write -P 0x12 4M 512k" } }
> 
> There's nothing structured about it, but for testing and debugging this
> should be good enough.

I would suggest that you consider using 'command':['str'], so that at
least you have structure that allows you to pass separate arguments (and
thus pass an argument with spaces in the future, should the need arise):

{ "execute": "__org.qemu.debug-qemu-io-command", "arguments":
    { "device": "ide0-hd0",
      "command": [ "write", "-P", "0x12", "4M", "512k" ] } }

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]