aboutsummaryrefslogtreecommitdiff
path: root/block/qcow2.h
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2011-01-26 16:56:48 +0100
committerKevin Wolf <kwolf@redhat.com>2011-01-31 10:03:00 +0100
commit5ea929e3d13622e5d06ca8795819f1590644cda2 (patch)
tree1aba3562b30cf62ac6a8fdc5f313f4a90e816c88 /block/qcow2.h
parenta9c49a6b023fd3706002fd8d549c58f0343932f8 (diff)
downloadqemu-5ea929e3d13622e5d06ca8795819f1590644cda2.zip
qemu-5ea929e3d13622e5d06ca8795819f1590644cda2.tar.gz
qemu-5ea929e3d13622e5d06ca8795819f1590644cda2.tar.bz2
qcow2: Add bdrv_discard support
This adds a bdrv_discard function to qcow2 that frees the discarded clusters. It does not yet pass the discard on to the underlying file system driver, but the space can be reused by future writes to the image. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Diffstat (limited to 'block/qcow2.h')
-rw-r--r--block/qcow2.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/block/qcow2.h b/block/qcow2.h
index 6d80120..a019831 100644
--- a/block/qcow2.h
+++ b/block/qcow2.h
@@ -209,6 +209,8 @@ uint64_t qcow2_alloc_compressed_cluster_offset(BlockDriverState *bs,
int compressed_size);
int qcow2_alloc_cluster_link_l2(BlockDriverState *bs, QCowL2Meta *m);
+int qcow2_discard_clusters(BlockDriverState *bs, uint64_t offset,
+ int nb_sectors);
/* qcow2-snapshot.c functions */
int qcow2_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info);