qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 0/6] Mirrored writes using blockdev-transacti


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v2 0/6] Mirrored writes using blockdev-transaction
Date: Thu, 01 Mar 2012 14:30:13 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120216 Thunderbird/10.0.1

On 03/01/2012 02:10 PM, Anthony Liguori wrote:
>> 2) Execute the following QMP command
>>
>> { "execute": "qmp_capabilities" }
>> { "execute": "blockdev-transaction", "arguments":
>>    {'actions': [
>>      { 'type': 'snapshot', 'data' :
>>        { 'device': 'ide0-hd0', 'snapshot-file':
>> '/home/pbonzini/base.qcow2' } },
>>      { 'type': 'mirror', 'data' :
>>        { 'device': 'ide0-hd0', 'target': '/home/pbonzini/mirror.qcow2'
>> } } ] } }
>> { "execute": "cont" }
> 
> We don't have schema introspection today.  How would one determine when
> new transaction types are available?
> 
> I think we need some sort of introspection method too in order for
> clients to figure out when the command is extended.
> 

I agree that introspection is necessary.  Up till now, libvirt could get
by with query-commands (either a command exists or it doesn't).  But now
we have the case where blockdev-transaction might exist, but doesn't
support the particular union action such as 'mirror' that libvirt wants
to use.

Could this be something we wire up to the query-commands command?

Something like:

{ 'type': 'CommandInfo', 'data': {'name': 'str', '*syntax': 'str'} }
{ 'command': 'query-commands,
  'data': { '*syntax': 'bool', '*names': ['str'] },
  'returns': ['CommandInfo'] }

where the normal {"execute":"qemu-commands"} just returns the list of
command names, but {"execute":"qemu-commands", "arguments": { "syntax":
"true", "names" : [ "blockdev-transaction" ] } } then returns:

{"return":[{"name":"blockdev-transaction", "syntax":"{ 'command' ...
}"}], "id":"..."}

that is, return back the qapi-schema.json description of the command.
Actually, I'd guess you'd also want to be able to query 'type' listings,
not just 'command's, so maybe this deserves a new monitor command rather
than shoe-horning it onto an existing one.

-- 
Eric Blake   address@hidden    +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]