mirror of
https://git.proxmox.com/git/qemu
synced 2025-08-14 04:54:36 +00:00
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>
This commit is contained in:
parent
b444736346
commit
a9c49a6b02
@ -1465,7 +1465,7 @@ discard_f(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
gettimeofday(&t1, NULL);
|
gettimeofday(&t1, NULL);
|
||||||
ret = bdrv_discard(bs, offset, count);
|
ret = bdrv_discard(bs, offset >> BDRV_SECTOR_BITS, count >> BDRV_SECTOR_BITS);
|
||||||
gettimeofday(&t2, NULL);
|
gettimeofday(&t2, NULL);
|
||||||
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user