qcow2: Add bdrv_discard support
authorKevin Wolf <kwolf@redhat.com>
Wed, 26 Jan 2011 15:56:48 +0000 (16:56 +0100)
committerKevin Wolf <kwolf@redhat.com>
Mon, 31 Jan 2011 09:03:00 +0000 (10:03 +0100)
commitf9a8b60cb7215ff21b6dbd4ab51d57112c3ac573
tree1aba3562b30cf62ac6a8fdc5f313f4a90e816c88
parentef90015a361d33ec364aecf3727ece662cf07563
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>
block/qcow2-cluster.c
block/qcow2.c
block/qcow2.h