From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=42949 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PjvfZ-0002cq-FR for qemu-devel@nongnu.org; Mon, 31 Jan 2011 10:28:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PjvfV-0003RL-GR for qemu-devel@nongnu.org; Mon, 31 Jan 2011 10:27:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:2583) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PjvfV-0003RC-6Q for qemu-devel@nongnu.org; Mon, 31 Jan 2011 10:27:53 -0500 From: Kevin Wolf Date: Mon, 31 Jan 2011 16:29:01 +0100 Message-Id: <1296487756-12553-14-git-send-email-kwolf@redhat.com> In-Reply-To: <1296487756-12553-1-git-send-email-kwolf@redhat.com> References: <1296487756-12553-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 13/28] qemu-io: Fix discard command List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org qemu-io passed bytes where it's supposed to pass sectors, so discard requests were off. Signed-off-by: Kevin Wolf Reviewed-by: Stefan Hajnoczi --- qemu-io.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/qemu-io.c b/qemu-io.c index 5b24c5e..4470e49 100644 --- a/qemu-io.c +++ b/qemu-io.c @@ -1465,7 +1465,7 @@ discard_f(int argc, char **argv) } gettimeofday(&t1, NULL); - ret = bdrv_discard(bs, offset, count); + ret = bdrv_discard(bs, offset >> BDRV_SECTOR_BITS, count >> BDRV_SECTOR_BITS); gettimeofday(&t2, NULL); if (ret < 0) { -- 1.7.2.3