qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Eric Blake <eblake@redhat.com>
Cc: kwolf@redhat.com, stefanha@linux.vnet.ibm.com, jcody@redhat.com,
	qemu-devel@nongnu.org, lcapitulino@redhat.com,
	fsimonce@redhat.com, Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 0/6] Mirrored writes using blockdev-transaction
Date: Fri, 02 Mar 2012 07:05:15 -0600	[thread overview]
Message-ID: <4F50C58B.4020606@codemonkey.ws> (raw)
In-Reply-To: <4F4FEBCB.7020509@codemonkey.ws>

On 03/01/2012 03:36 PM, Anthony Liguori wrote:
> 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.

BTW, in the short term, this can be addressed with careful documentation.  Just 
make it clear that in the absence of introspection, the only two supported 
operations are what's currently here.

And realize that to add new commands in the future, we need introspection first.

Regards,

Anthony Liguori

>
> Regards,
>
> Anthony Liguori
>
>>
>
>

  reply	other threads:[~2012-03-02 13:05 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-01 11:21 [Qemu-devel] [PATCH v2 0/6] Mirrored writes using blockdev-transaction Paolo Bonzini
2012-03-01 11:21 ` [Qemu-devel] [PATCH v2 1/6] fix format name for backing file Paolo Bonzini
2012-03-01 11:21 ` [Qemu-devel] [PATCH v2 2/6] qapi: complete implementation of unions Paolo Bonzini
2012-03-01 13:52   ` Kevin Wolf
2012-03-01 15:56     ` Luiz Capitulino
2012-03-01 11:21 ` [Qemu-devel] [PATCH v2 3/6] rename blockdev-group-snapshot-sync Paolo Bonzini
2012-03-01 11:21 ` [Qemu-devel] [PATCH v2 4/6] add reuse field Paolo Bonzini
2012-03-01 11:21 ` [Qemu-devel] [PATCH v2 5/6] Add blkmirror block driver Paolo Bonzini
2012-03-01 11:21 ` [Qemu-devel] [PATCH v2 6/6] add mirroring to blockdev-transaction Paolo Bonzini
2012-03-01 16:02 ` [Qemu-devel] [PATCH v2 0/6] Mirrored writes using blockdev-transaction Luiz Capitulino
2012-03-01 16:18   ` Kevin Wolf
2012-03-01 16:43     ` Luiz Capitulino
2012-03-01 21:10 ` Anthony Liguori
2012-03-01 21:30   ` Eric Blake
2012-03-01 21:36     ` Anthony Liguori
2012-03-02 13:05       ` Anthony Liguori [this message]
2012-03-05  8:53   ` Kevin Wolf
2012-03-05  9:28     ` Paolo Bonzini
2012-03-05 12:13       ` Kevin Wolf
2012-03-05 13:05         ` Paolo Bonzini
2012-03-05 14:47     ` Anthony Liguori
2012-03-05 14:54       ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F50C58B.4020606@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=eblake@redhat.com \
    --cc=fsimonce@redhat.com \
    --cc=jcody@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).