From a9c49a6b023fd3706002fd8d549c58f0343932f8 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Wed, 26 Jan 2011 16:56:34 +0100 Subject: [PATCH] qemu-io: Fix discard command 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 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-io.c b/qemu-io.c index 5b24c5eec2..4470e49bc8 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) {