From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42689) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXEil-0004Nz-8V for qemu-devel@nongnu.org; Mon, 07 Apr 2014 14:56:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WXEie-0003Bc-Ro for qemu-devel@nongnu.org; Mon, 07 Apr 2014 14:56:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37919) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXEie-0003BW-K2 for qemu-devel@nongnu.org; Mon, 07 Apr 2014 14:56:32 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s37IuVnc031571 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 7 Apr 2014 14:56:32 -0400 Message-ID: <5342F4DC.6010003@redhat.com> Date: Mon, 07 Apr 2014 20:56:28 +0200 From: Max Reitz MIME-Version: 1.0 References: <1396891800-8627-1-git-send-email-mreitz@redhat.com> <1396891800-8627-3-git-send-email-mreitz@redhat.com> <5342F48F.8020805@redhat.com> In-Reply-To: <5342F48F.8020805@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 2/4] block-commit: speed is an optional parameter List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi On 07.04.2014 20:55, Eric Blake wrote: > On 04/07/2014 11:29 AM, Max Reitz wrote: >> 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 | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/blockdev.c b/blockdev.c >> index 0be4601..337c11f 100644 >> --- a/blockdev.c >> +++ b/blockdev.c >> @@ -1876,6 +1876,7 @@ void qmp_block_commit(const char *device, >> */ >> BlockdevOnError on_error =3D BLOCKDEV_ON_ERROR_REPORT; >> =20 >> + speed =3D speed ? speed : 0; > Oops, branching based on the contents of an undefined variable. You > meant has_speed in the second of the three uses. Right =E2=80=93 this way, it makes little sense but as a test for compile= r=20 optimizations. ;-) Max