Received: from eggs.gnu.org ([2001:4830:134:3::10]:36172) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLSwK-00078w-Lv for qemu-devel@nongnu.org; Tue, 19 Jan 2016 04:51:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLSwJ-0002wH-Ri for qemu-devel@nongnu.org; Tue, 19 Jan 2016 04:51:04 -0500 From: Markus Armbruster References: <1452823763-4235-1-git-send-email-famz@redhat.com> Date: Tue, 19 Jan 2016 10:50:54 +0100 In-Reply-To: <1452823763-4235-1-git-send-email-famz@redhat.com> (Fam Zheng's message of "Fri, 15 Jan 2016 10:09:21 +0800") Message-ID: <87a8o1hp8h.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v4 0/2] block: Reject negative values for throttling options List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: Kevin Wolf , berto@igalia.com, qemu-devel@nongnu.org, qemu-block@nongnu.org, mreitz@redhat.com Fam Zheng writes: > v4: Add Max's rev-by in both patches, while fixing the "maxs" typo. > > v3: Address comments: > - Add test for large value; [Berto] > - Fix typos "negative" & "caught"; [Eric, Berto] > - Use "LL" suffix to the upper limit constant. [Berto] > > v2: Check the value range and report an appropriate error. [Berto] > > Now the negative values are silently converted to a huge positive number > because we are doing implicit casting from uint64_t to double. Fix it and add a > test case (this was once fixed in 7d81c1413c9 but regressed when the block > device option parsing code was changed). I think PATCH 1's commit message could explain the problem in a bit more detail, and it should mention the changed valid range. Other than that, I had two questions: why cast THROTTLE_VALUE_MAX for printing (in scope for the series), and why parse the settings as integers even though they're really floating-point (probably not in scope).