From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39522) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIVFt-0003ae-Bm for qemu-devel@nongnu.org; Mon, 11 Jan 2016 00:43:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aIVFs-0002Er-73 for qemu-devel@nongnu.org; Mon, 11 Jan 2016 00:43:01 -0500 From: Fam Zheng Date: Mon, 11 Jan 2016 13:42:37 +0800 Message-Id: <1452490959-10387-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH 0/2] block: Reject negative values for throttling options List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Markus Armbruster , qemu-block@nongnu.org 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). Fam Zheng (2): blockdev: Error out on negative throttling option values iotests: Test that negative throttle values are rejected blockdev.c | 26 +++++++++++++------------- tests/qemu-iotests/051 | 11 +++++++++++ tests/qemu-iotests/051.out | 21 +++++++++++++++++++++ tests/qemu-iotests/051.pc.out | 21 +++++++++++++++++++++ 4 files changed, 66 insertions(+), 13 deletions(-) -- 2.4.3