diff mbox

[v7,01/10] qapi: Add BlockOperationType enum

Message ID 1386836626-6436-2-git-send-email-famz@redhat.com
State New
Headers show

Commit Message

Fam Zheng Dec. 12, 2013, 8:23 a.m. UTC
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 | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

Comments

Kevin Wolf Dec. 12, 2013, 12:21 p.m. UTC | #1
Am 12.12.2013 um 09:23 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>
> ---
>  qapi-schema.json | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 49 insertions(+)
> 
> diff --git a/qapi-schema.json b/qapi-schema.json
> index d6f8615..ef4d6af 100644
> --- a/qapi-schema.json
> +++ b/qapi-schema.json
> @@ -1440,6 +1440,55 @@
>    'data': ['commit', 'stream', 'mirror', 'backup'] }
>  
>  ##
> +# @BlockOperationType
> +# Type of a block operation. (since 1.8)

I don't think this description is accurate any more. You now have a list
of roles that a block device can take, or something like that. Not sure
what the best way to put it is. backup-source isn't an operation anyway,
nor is dataplane.

Also, should have an empty line after @BlockOperationType and 2.0
instead of 1.8.

> +# @backup-source: As a backup source. See the 'drive-backup' command.
> +#
> +# @backup-target: As a backup target. See the 'drive-backup' command.
> +#
> +# @change: See the 'change' command.
> +#
> +# @commit: See the 'block-commit' command.
> +#
> +# @dataplane: The virtio-blk dataplane feature.
> +#
> +# @drive-del: See the 'drive_del' HMP command.
> +#
> +# @eject: See the 'eject' command.
> +#
> +# @external-snapshot: See the 'blockdev-snapshot-sync' command.
> +#
> +# @internal-snapshot: See the 'blockdev-snapshot-internal-sync' command.
> +#
> +# @internal-snapshot-delete: See the 'blockdev-snapshot-delete-internal-sync' command.
> +#
> +# @mirror: See the 'drive-mirror' command.
> +#
> +# @resize: See the 'block-resize' command.
> +#
> +# @stream: See the 'block-stream' command.
> +#
> +# Since: 1.8

Here as well.

Kevin
Fam Zheng Dec. 12, 2013, 12:32 p.m. UTC | #2
On 2013年12月12日 20:21, Kevin Wolf wrote:
> Am 12.12.2013 um 09:23 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>
>> ---
>>   qapi-schema.json | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
>>   1 file changed, 49 insertions(+)
>>
>> diff --git a/qapi-schema.json b/qapi-schema.json
>> index d6f8615..ef4d6af 100644
>> --- a/qapi-schema.json
>> +++ b/qapi-schema.json
>> @@ -1440,6 +1440,55 @@
>>     'data': ['commit', 'stream', 'mirror', 'backup'] }
>>
>>   ##
>> +# @BlockOperationType
>> +# Type of a block operation. (since 1.8)
>
> I don't think this description is accurate any more. You now have a list
> of roles that a block device can take, or something like that. Not sure
> what the best way to put it is. backup-source isn't an operation anyway,
> nor is dataplane.

"Using this as backup source" or "start dataplane on that" still sounds 
an operation to me. It's just the 1:1 corresponding with QMP commands 
that is loosed, but not totally independent, as the long comments below 
show.

>
> Also, should have an empty line after @BlockOperationType and 2.0
> instead of 1.8.
>

OK, will fix. Thanks.

Fam
Markus Armbruster Dec. 12, 2013, 12:49 p.m. UTC | #3
Fam Zheng <famz@redhat.com> writes:

> This adds the enum of all the operations that can be taken on a block
> device.

All operations?  All blockable operations?  Something else?

> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>  qapi-schema.json | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 49 insertions(+)
>
> diff --git a/qapi-schema.json b/qapi-schema.json
> index d6f8615..ef4d6af 100644
> --- a/qapi-schema.json
> +++ b/qapi-schema.json
> @@ -1440,6 +1440,55 @@
>    'data': ['commit', 'stream', 'mirror', 'backup'] }
>  
>  ##
> +# @BlockOperationType
> +# Type of a block operation. (since 1.8)

(since 2.0)

> +#
> +# @backup-source: As a backup source. See the 'drive-backup' command.
> +#
> +# @backup-target: As a backup target. See the 'drive-backup' command.
> +#
> +# @change: See the 'change' command.
> +#
> +# @commit: See the 'block-commit' command.
> +#
> +# @dataplane: The virtio-blk dataplane feature.
> +#
> +# @drive-del: See the 'drive_del' HMP command.
> +#
> +# @eject: See the 'eject' command.
> +#
> +# @external-snapshot: See the 'blockdev-snapshot-sync' command.
> +#
> +# @internal-snapshot: See the 'blockdev-snapshot-internal-sync' command.
> +#
> +# @internal-snapshot-delete: See the 'blockdev-snapshot-delete-internal-sync' command.
> +#
> +# @mirror: See the 'drive-mirror' command.
> +#
> +# @resize: See the 'block-resize' command.
> +#
> +# @stream: See the 'block-stream' command.
> +#
> +# Since: 1.8

Likewise.

> +##
> +{ 'enum': 'BlockOpType',
> +  'data': [
> +    'backup-source',
> +    'backup-target',
> +    'change',
> +    'commit',
> +    'dataplane',
> +    'drive-del',
> +    'eject',
> +    'external-snapshot',
> +    'internal-snapshot',
> +    'internal-snapshot-delete',
> +    'mirror',
> +    'resize',
> +    'stream'
> +] }
> +
> +##
>  # @BlockJobInfo:
>  #
>  # Information about a long-running block device operation.
Fam Zheng Dec. 12, 2013, 12:53 p.m. UTC | #4
On 2013年12月12日 20:49, Markus Armbruster wrote:
> Fam Zheng <famz@redhat.com> writes:
>
>> This adds the enum of all the operations that can be taken on a block
>> device.
>
> All operations?  All blockable operations?  Something else?
>

All QMP operations those apply on device, plus all operations those 
"in_use" is protecting, at least. I will reconsider this enum or update 
the comment.

Fam
diff mbox

Patch

diff --git a/qapi-schema.json b/qapi-schema.json
index d6f8615..ef4d6af 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -1440,6 +1440,55 @@ 
   'data': ['commit', 'stream', 'mirror', 'backup'] }
 
 ##
+# @BlockOperationType
+# Type of a block operation. (since 1.8)
+#
+# @backup-source: As a backup source. See the 'drive-backup' command.
+#
+# @backup-target: As a backup target. See the 'drive-backup' command.
+#
+# @change: See the 'change' command.
+#
+# @commit: See the 'block-commit' command.
+#
+# @dataplane: The virtio-blk dataplane feature.
+#
+# @drive-del: See the 'drive_del' HMP command.
+#
+# @eject: See the 'eject' command.
+#
+# @external-snapshot: See the 'blockdev-snapshot-sync' command.
+#
+# @internal-snapshot: See the 'blockdev-snapshot-internal-sync' command.
+#
+# @internal-snapshot-delete: See the 'blockdev-snapshot-delete-internal-sync' command.
+#
+# @mirror: See the 'drive-mirror' command.
+#
+# @resize: See the 'block-resize' command.
+#
+# @stream: See the 'block-stream' command.
+#
+# Since: 1.8
+##
+{ 'enum': 'BlockOpType',
+  'data': [
+    'backup-source',
+    'backup-target',
+    'change',
+    'commit',
+    'dataplane',
+    'drive-del',
+    'eject',
+    'external-snapshot',
+    'internal-snapshot',
+    'internal-snapshot-delete',
+    'mirror',
+    'resize',
+    'stream'
+] }
+
+##
 # @BlockJobInfo:
 #
 # Information about a long-running block device operation.