From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=37242 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pil4k-0003KR-DL for qemu-devel@nongnu.org; Fri, 28 Jan 2011 04:57:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pil4i-0005WC-73 for qemu-devel@nongnu.org; Fri, 28 Jan 2011 04:57:06 -0500 Received: from mail-ww0-f41.google.com ([74.125.82.41]:54059) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pil4i-0005Vy-0e for qemu-devel@nongnu.org; Fri, 28 Jan 2011 04:57:04 -0500 Received: by wwi18 with SMTP id 18so789227wwi.4 for ; Fri, 28 Jan 2011 01:57:03 -0800 (PST) Date: Fri, 28 Jan 2011 09:56:45 +0000 From: Stefan Hajnoczi Subject: Re: [Qemu-devel] [PATCH] qemu-io: Fix discard command Message-ID: <20110128095645.GA3082@stefanha-thinkpad.localdomain> References: <1296131772-9880-1-git-send-email-kwolf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1296131772-9880-1-git-send-email-kwolf@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org On Thu, Jan 27, 2011 at 01:36:12PM +0100, Kevin Wolf wrote: > qemu-io passed bytes where it's supposed to pass sectors, so discard requests > were off. > > Signed-off-by: Kevin Wolf > --- > 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); Oops, thanks for the fix. Reviewed-by: Stefan Hajnoczi