* [Qemu-devel] [PATCH] qemu-io: Fix discard command
@ 2011-01-27 12:36 Kevin Wolf
2011-01-28 9:56 ` Stefan Hajnoczi
0 siblings, 1 reply; 2+ messages in thread
From: Kevin Wolf @ 2011-01-27 12:36 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf
qemu-io passed bytes where it's supposed to pass sectors, so discard requests
were off.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] qemu-io: Fix discard command
2011-01-27 12:36 [Qemu-devel] [PATCH] qemu-io: Fix discard command Kevin Wolf
@ 2011-01-28 9:56 ` Stefan Hajnoczi
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Hajnoczi @ 2011-01-28 9:56 UTC (permalink / raw)
To: Kevin Wolf; +Cc: qemu-devel
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 <kwolf@redhat.com>
> ---
> 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 <stefanha@linux.vnet.ibm.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-01-28 9:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-27 12:36 [Qemu-devel] [PATCH] qemu-io: Fix discard command Kevin Wolf
2011-01-28 9:56 ` Stefan Hajnoczi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.