From patchwork Thu Jan 27 12:36:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 80666 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B562BB7103 for ; Thu, 27 Jan 2011 23:40:56 +1100 (EST) Received: from localhost ([127.0.0.1]:44650 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PiR9h-0004JF-Nh for incoming@patchwork.ozlabs.org; Thu, 27 Jan 2011 07:40:53 -0500 Received: from [140.186.70.92] (port=60904 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PiR3j-0001Yg-64 for qemu-devel@nongnu.org; Thu, 27 Jan 2011 07:34:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PiR3f-0000PP-Vo for qemu-devel@nongnu.org; Thu, 27 Jan 2011 07:34:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:21326) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PiR3f-0000Os-Nx for qemu-devel@nongnu.org; Thu, 27 Jan 2011 07:34:39 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p0RCYc8d009028 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 27 Jan 2011 07:34:39 -0500 Received: from dhcp-5-188.str.redhat.com (dhcp-5-175.str.redhat.com [10.32.5.175]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p0RCYbNU003924; Thu, 27 Jan 2011 07:34:37 -0500 From: Kevin Wolf To: qemu-devel@nongnu.org Date: Thu, 27 Jan 2011 13:36:12 +0100 Message-Id: <1296131772-9880-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: kwolf@redhat.com Subject: [Qemu-devel] [PATCH] qemu-io: Fix discard command X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@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) {