]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
qemu-io: Fix discard command
authorKevin Wolf <kwolf@redhat.com>
Wed, 26 Jan 2011 15:56:34 +0000 (16:56 +0100)
committerKevin Wolf <kwolf@redhat.com>
Mon, 31 Jan 2011 09:03:00 +0000 (10:03 +0100)
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>
qemu-io.c

index 5b24c5eec217c671c9da103c92195880b714c7a7..4470e49bc88481ebd304df558b716b2893752d82 100644 (file)
--- 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) {