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: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH v2 0/6] Mirrored writes using blockdev-transaction
Date: Thu, 01 Mar 2012 15:36:11 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110922 Lightning/1.0b2 Thunderbird/3.1.15

On 03/01/2012 03:30 PM, Eric Blake wrote:
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.

Yes, this is what I would like to do, but it's a requires a bit of work to implement. You'd have to either install qapi-schema.json and read it at run time or serialize it to a C data structure that can then be used to initialize a QObject.

Nothing Earth shattering, just a fair amount of bit moving.

Regards,

Anthony Liguori






reply via email to

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