From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38142) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXVUT-0001no-08 for qemu-devel@nongnu.org; Tue, 08 Apr 2014 08:51:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WXVUK-0004dB-Rd for qemu-devel@nongnu.org; Tue, 08 Apr 2014 08:51:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:64557) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXVUK-0004cU-Jg for qemu-devel@nongnu.org; Tue, 08 Apr 2014 08:50:52 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s38CopXq024067 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 8 Apr 2014 08:50:51 -0400 From: Max Reitz Date: Tue, 8 Apr 2014 14:50:38 +0200 Message-Id: <1396961442-24046-3-git-send-email-mreitz@redhat.com> In-Reply-To: <1396961442-24046-1-git-send-email-mreitz@redhat.com> References: <1396961442-24046-1-git-send-email-mreitz@redhat.com> Subject: [Qemu-devel] [PATCH v2 2/6] block-commit: speed is an optional parameter List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi , Max Reitz As speed is an optional parameter for the QMP block-commit command, it should be set to 0 if not given (as it is undefined if has_speed is false), that is, the speed should not be limited. Signed-off-by: Max Reitz --- blockdev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/blockdev.c b/blockdev.c index b988cc5..9d7bd04 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1876,6 +1876,9 @@ void qmp_block_commit(const char *device, */ BlockdevOnError on_error = BLOCKDEV_ON_ERROR_REPORT; + if (!has_speed) { + speed = 0; + } if (!has_granularity) { granularity = 0; } -- 1.9.1