Using the ATA "trim" command to discard sectors in disk images
The ATA command "trim", recently standardized by the T13 committee, has been designed to allow SSDs to do better wear-leveling. But there is an obvious fit for it in virtualizers such as Qemu: guests issuing trim commands would allow the host to deallocate block sectors in disk images.
In fact the trim command is already used by very recent Linux kernels: it is exported to the kernel via the block layer blkdev_issue_discard() call, and to userspace via the BLKDISCARD ioctl:
http://lwn.net/Articles/293658/
Swap allocation just started making use of it 2.6.29:
I just wanted to raise awareness of that command. I hope sometime in the future we will see qcow files able to decrease in size when files are deleted in guests :-)
-marc