[Top][All Lists]

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

Re: [Qemu-devel] [PATCH v2 2/3] block: add block-backup QMP command

From: Wenchao Xia
Subject: Re: [Qemu-devel] [PATCH v2 2/3] block: add block-backup QMP command
Date: Tue, 14 May 2013 10:18:51 +0800
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130328 Thunderbird/17.0.5

于 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 via email to

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