[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH v2 7/7] qmp: Convert block-commit speed to arg p
From: |
Fam Zheng |
Subject: |
[Qemu-devel] [RFC PATCH v2 7/7] qmp: Convert block-commit speed to arg property dict |
Date: |
Tue, 20 May 2014 17:08:01 +0800 |
Moving the default value logic from qmp handler to generated code.
Signed-off-by: Fam Zheng <address@hidden>
---
blockdev.c | 6 +-----
qapi-schema.json | 2 +-
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/blockdev.c b/blockdev.c
index 7810e9f..de06218 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -1869,7 +1869,7 @@ void qmp_block_stream(const char *device, bool has_base,
void qmp_block_commit(const char *device,
bool has_base, const char *base, const char *top,
- bool has_speed, int64_t speed,
+ int64_t speed,
Error **errp)
{
BlockDriverState *bs;
@@ -1880,10 +1880,6 @@ void qmp_block_commit(const char *device,
*/
BlockdevOnError on_error = BLOCKDEV_ON_ERROR_REPORT;
- if (!has_speed) {
- speed = 0;
- }
-
/* drain all i/o before commits */
bdrv_drain_all();
diff --git a/qapi-schema.json b/qapi-schema.json
index 36cb964..06e373c 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -2129,7 +2129,7 @@
##
{ 'command': 'block-commit',
'data': { 'device': 'str', '*base': 'str', 'top': 'str',
- '*speed': 'int' } }
+ '@speed': { 'type': 'int', 'optional': true, 'default': 0 } } }
##
# @drive-backup
--
1.9.2
- [Qemu-devel] [RFC PATCH v2 0/7] qapi: Specify default value for optional argument in schema json, Fam Zheng, 2014/05/20
- [Qemu-devel] [RFC PATCH v2 1/7] qapi: Allow decimal values, Fam Zheng, 2014/05/20
- [Qemu-devel] [RFC PATCH v2 2/7] qapi: Allow true, false and null in schema json, Fam Zheng, 2014/05/20
- [Qemu-devel] [RFC PATCH v2 4/7] qapi: Add c_val(t, val) for int, Fam Zheng, 2014/05/20
- [Qemu-devel] [RFC PATCH v2 5/7] qapi: Add @arg property dictionary syntax, Fam Zheng, 2014/05/20
- [Qemu-devel] [RFC PATCH v2 6/7] qapi: Initialize argument value in generated code if has 'default', Fam Zheng, 2014/05/20
- [Qemu-devel] [RFC PATCH v2 3/7] tests: Add decimal test cases for qapi-schema, Fam Zheng, 2014/05/20
- [Qemu-devel] [RFC PATCH v2 7/7] qmp: Convert block-commit speed to arg property dict,
Fam Zheng <=
- Re: [Qemu-devel] [RFC PATCH v2 0/7] qapi: Specify default value for optional argument in schema json, Fam Zheng, 2014/05/20
- Re: [Qemu-devel] [RFC PATCH v2 0/7] qapi: Specify default value for optional argument in schema json, Eric Blake, 2014/05/20
- Re: [Qemu-devel] [RFC PATCH v2 0/7] qapi: Specify default value for optional argument in schema json, Fam Zheng, 2014/05/20
- Re: [Qemu-devel] [RFC PATCH v2 0/7] qapi: Specify default value for optional argument in schema json, Markus Armbruster, 2014/05/21
- Re: [Qemu-devel] [RFC PATCH v2 0/7] qapi: Specify default value for optional argument in schema json, Fam Zheng, 2014/05/21
- Re: [Qemu-devel] [RFC PATCH v2 0/7] qapi: Specify default value for optional argument in schema json, Markus Armbruster, 2014/05/21
- Re: [Qemu-devel] [RFC PATCH v2 0/7] qapi: Specify default value for optional argument in schema json, Kevin Wolf, 2014/05/21
- Re: [Qemu-devel] [RFC PATCH v2 0/7] qapi: Specify default value for optional argument in schema json, Fam Zheng, 2014/05/21
- Re: [Qemu-devel] [RFC PATCH v2 0/7] qapi: Specify default value for optional argument in schema json, Kevin Wolf, 2014/05/21
- Re: [Qemu-devel] [RFC PATCH v2 0/7] qapi: Specify default value for optional argument in schema json, Eric Blake, 2014/05/21