aboutsummaryrefslogtreecommitdiff
path: root/block/qcow2-refcount.c
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2016-07-15 17:22:51 -0600
committerStefan Hajnoczi <stefanha@redhat.com>2016-07-20 14:11:55 +0100
commit0c51a893b643bc9393c685b47b9cea1e6831565f (patch)
tree9636a6178fd16b1efadc97009c5b600a5d589303 /block/qcow2-refcount.c
parent9f1963b3f72521f75a549f8afd61b19e7da63c6f (diff)
downloadqemu-0c51a893b643bc9393c685b47b9cea1e6831565f.zip
qemu-0c51a893b643bc9393c685b47b9cea1e6831565f.tar.gz
qemu-0c51a893b643bc9393c685b47b9cea1e6831565f.tar.bz2
block: Convert bdrv_discard() to byte-based
Another step towards byte-based interfaces everywhere. Replace the sector-based bdrv_discard() with a new byte-based bdrv_pdiscard(), which silently ignores any unaligned head or tail. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1468624988-423-3-git-send-email-eblake@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block/qcow2-refcount.c')
-rw-r--r--block/qcow2-refcount.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
index 49b6ce6..cbfb3fe 100644
--- a/block/qcow2-refcount.c
+++ b/block/qcow2-refcount.c
@@ -615,9 +615,7 @@ void qcow2_process_discards(BlockDriverState *bs, int ret)
/* Discard is optional, ignore the return value */
if (ret >= 0) {
- bdrv_discard(bs->file->bs,
- d->offset >> BDRV_SECTOR_BITS,
- d->bytes >> BDRV_SECTOR_BITS);
+ bdrv_pdiscard(bs->file->bs, d->offset, d->bytes);
}
g_free(d);