qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
To: Eric Blake <eblake@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>, Fam Zheng <famz@redhat.com>,
	qemu-devel@nongnu.org, Luiz Capitulino <lcapitulino@redhat.com>,
	imain@redhat.com, Stefan Hajnoczi <stefanha@redhat.com>,
	pbonzini@redhat.com, dietmar@proxmox.com
Subject: Re: [Qemu-devel] [PATCH v2 2/3] block: add block-backup QMP command
Date: Tue, 14 May 2013 10:18:51 +0800	[thread overview]
Message-ID: <51919F0B.4060409@linux.vnet.ibm.com> (raw)
In-Reply-To: <5190FDBC.8090607@redhat.com>

于 2013-5-13 22:50, Eric Blake 写道:
> On 05/13/2013 08:27 AM, Kevin Wolf wrote:
>> I think long term we'll need a dynamic schema anyway. As we go forward
>> with modularisation and putting things into shared libraries, we'll have
>> modules that add support for commands, enum values, etc.
>
> In other words, qapi-schema.json should have a way to declare a
> dynamic-enum, where introspection on that enum will see what is made
> available at runtime, rather than manually listing the enum contents
> directly in the .json file.
>
>>
>> Providing the full list of theoretically available elements (i.e. what
>> would be there, if everything was compiled and all modules were loaded)
>> would probably implement the spec for the introspection interfaces by the
>> letter, but just give useless information. Callers want to know what's
>> really there.
>>
>> If we're going to have a query-* command for everything, then we don't
>> need introspection at all. I would however prefer having the uniform
>> schema introspection and building the schema at runtime instead of many
>> separate query-* commands.
>
> Indeed, having introspection of a dynamic enum results in fewer commands
> overall, by making a reusable command have more power.  And maybe it's
> possible to have introspection do both - with an optional boolean
> parameter that distinguishes between full vs. runtime querying of any
> enum type.
>
   "string <-> enum mapping" issue happens when I try coding libqblock,
what I found is that, since lower level implement code still depends
string, so there will be another translating back to string inside
later. For format string, it is probably OK since two functions will be
enough, but when more enum is wanted, things become complex.
    So I feel it is right to try use enum in the API now, but maybe a
plan to reorganize block layer will be also needed, which may be
a bit complex needing serous plan.


-- 
Best Regards

Wenchao Xia

  reply	other threads:[~2013-05-14  2:19 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-29  7:42 [Qemu-devel] [PATCH v2 0/3] block: block-backup live backup command Stefan Hajnoczi
2013-04-29  7:42 ` [Qemu-devel] [PATCH v2 1/3] block: add basic backup support to block driver Stefan Hajnoczi
2013-05-08 12:39   ` Kevin Wolf
2013-05-08 15:43     ` Paolo Bonzini
2013-05-14  8:51     ` Stefan Hajnoczi
2013-05-14 13:24     ` Stefan Hajnoczi
2013-05-14 13:43       ` Kevin Wolf
2013-05-14 15:12         ` Stefan Hajnoczi
2013-05-30  3:37   ` Fam Zheng
2013-05-30 12:27     ` Stefan Hajnoczi
2013-04-29  7:42 ` [Qemu-devel] [PATCH v2 2/3] block: add block-backup QMP command Stefan Hajnoczi
2013-05-08 12:49   ` Kevin Wolf
2013-05-11  3:34     ` Eric Blake
2013-05-11  8:02       ` Paolo Bonzini
2013-05-13  8:23       ` Kevin Wolf
2013-05-14  8:44     ` Stefan Hajnoczi
2013-05-11  4:02   ` Eric Blake
2013-05-13  8:28     ` Kevin Wolf
2013-05-13 12:56       ` Eric Blake
2013-05-13 13:09         ` Kevin Wolf
2013-05-13 13:18           ` Luiz Capitulino
2013-05-13 14:14             ` Eric Blake
2013-05-13 14:27               ` Kevin Wolf
2013-05-13 14:50                 ` Eric Blake
2013-05-14  2:18                   ` Wenchao Xia [this message]
2013-05-14  8:48     ` Stefan Hajnoczi
2013-04-29  7:42 ` [Qemu-devel] [PATCH v2 3/3] qemu-iotests: add 054 block-backup test case Stefan Hajnoczi

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=51919F0B.4060409@linux.vnet.ibm.com \
    --to=xiawenc@linux.vnet.ibm.com \
    --cc=dietmar@proxmox.com \
    --cc=eblake@redhat.com \
    --cc=famz@redhat.com \
    --cc=imain@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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).