Message ID | 1385097894-1380-2-git-send-email-famz@redhat.com |
---|---|
State | New |
Headers | show |
On 11/21/2013 10:24 PM, Fam Zheng wrote: > This adds the enum of all the operations that can be taken on a block > device. > > Signed-off-by: Fam Zheng <famz@redhat.com> > --- > qapi-schema.json | 25 +++++++++++++++++++++++++ > 1 file changed, 25 insertions(+) > > ## > +# @BlockOperationType > +# Type of a block operation. > +# > +# Since: 1.8 It might be worth adding a bit more docs, as in one line per enum value with a cross-reference to the command(s) that can trigger that operation. Something like: @backup: See the 'drive-backup' command. @change: See the 'change' command. This is especially true if we later add new block ops later than 1.8, so such additions can have the useful '(since 1.9)' notation.
Am 22.11.2013 um 06:24 hat Fam Zheng geschrieben: > This adds the enum of all the operations that can be taken on a block > device. > > Signed-off-by: Fam Zheng <famz@redhat.com> Okay, so now I've read the whole series and I still couldn't solve this mystery: Why is this a QAPI type and not some internal enum? Kevin
On 2013年11月25日 19:26, Kevin Wolf wrote: > Am 22.11.2013 um 06:24 hat Fam Zheng geschrieben: >> This adds the enum of all the operations that can be taken on a block >> device. >> >> Signed-off-by: Fam Zheng <famz@redhat.com> > > Okay, so now I've read the whole series and I still couldn't solve this > mystery: Why is this a QAPI type and not some internal enum? > The logic is becoming complicated, I think even more rules will come with Quorum and BlockBackend, etc. By then we probably will have to add an interface to query the blockers, so user knows what operation is possible and what is not, without trial and error. Eric, any ideas? Fam
diff --git a/qapi-schema.json b/qapi-schema.json index 83fa485..4656e8c 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -1440,6 +1440,31 @@ 'data': ['commit', 'stream', 'mirror', 'backup'] } ## +# @BlockOperationType +# Type of a block operation. +# +# Since: 1.8 +## +{ 'enum': 'BlockOpType', + 'data': [ + 'backup', + 'change', + 'commit', + 'dataplane', + 'drive-del', + 'eject', + 'external-snapshot', + 'internal-snapshot', + 'internal-snapshot-delete', + 'mirror', + 'nbd-server-add', + 'passwd', + 'resize', + 'set-io-throttle', + 'stream' +] } + +## # @BlockJobInfo: # # Information about a long-running block device operation.
This adds the enum of all the operations that can be taken on a block device. Signed-off-by: Fam Zheng <famz@redhat.com> --- qapi-schema.json | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+)