summaryrefslogtreecommitdiff
path: root/qemu-io.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2011-01-26 16:56:34 +0100
committerKevin Wolf <kwolf@redhat.com>2011-01-31 10:03:00 +0100
commitef90015a361d33ec364aecf3727ece662cf07563 (patch)
treeefcc70b73937578fe9ad793631024229a2f0f5f6 /qemu-io.c
parent4304c369da25c36977d8a07c6c920ce6a80e5adc (diff)
downloadqemu-ef90015a361d33ec364aecf3727ece662cf07563.tar.gz
qemu-ef90015a361d33ec364aecf3727ece662cf07563.tar.bz2
qemu-ef90015a361d33ec364aecf3727ece662cf07563.zip
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 <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Diffstat (limited to 'qemu-io.c')
-rw-r--r--qemu-io.c2
1 files changed, 1 insertions, 1 deletions
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) {