Received: from eggs.gnu.org ([2001:4830:134:3::10]:43563) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wmg1r-0003b8-CZ for qemu-devel@nongnu.org; Tue, 20 May 2014 05:08:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wmg1k-00086E-HS for qemu-devel@nongnu.org; Tue, 20 May 2014 05:08:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58696) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wmg1k-00085w-Al for qemu-devel@nongnu.org; Tue, 20 May 2014 05:08:04 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s4K9839o008654 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 20 May 2014 05:08:03 -0400 From: Fam Zheng Date: Tue, 20 May 2014 17:08:01 +0800 Message-Id: <1400576881-6954-8-git-send-email-famz@redhat.com> In-Reply-To: <1400576881-6954-1-git-send-email-famz@redhat.com> References: <1400576881-6954-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [RFC PATCH v2 7/7] qmp: Convert block-commit speed to arg property dict List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi Moving the default value logic from qmp handler to generated code. Signed-off-by: Fam Zheng --- 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