From patchwork Fri Apr 11 12:39:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 338502 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 6BDA2140085 for ; Fri, 11 Apr 2014 22:44:53 +1000 (EST) Received: from localhost ([::1]:57451 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYap9-00026X-JP for incoming@patchwork.ozlabs.org; Fri, 11 Apr 2014 08:44:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34119) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYajy-0003kY-7W for qemu-devel@nongnu.org; Fri, 11 Apr 2014 08:39:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WYajr-00012G-FN for qemu-devel@nongnu.org; Fri, 11 Apr 2014 08:39:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:11634) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYajr-000127-83 for qemu-devel@nongnu.org; Fri, 11 Apr 2014 08:39:23 -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 s3BCdLr7012118 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 11 Apr 2014 08:39:21 -0400 Received: from noname.redhat.com (ovpn-116-60.ams2.redhat.com [10.36.116.60]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s3BCdDBJ029753; Fri, 11 Apr 2014 08:39:20 -0400 From: Kevin Wolf To: qemu-devel@nongnu.org Date: Fri, 11 Apr 2014 14:39:12 +0200 Message-Id: <1397219952-26807-5-git-send-email-kwolf@redhat.com> In-Reply-To: <1397219952-26807-1-git-send-email-kwolf@redhat.com> References: <1397219952-26807-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, peter.maydell@linaro.org Subject: [Qemu-devel] [PULL 4/4] block-commit: speed is an optional parameter X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: 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. Cc: qemu-stable@nongnu.org Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Fam Zheng Signed-off-by: Kevin Wolf --- blockdev.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/blockdev.c b/blockdev.c index c3422a1..5dd01ea 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1876,6 +1876,10 @@ 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();