It’s easy to use:
$ virt-sparsify --in-place fedora.img Trimming /dev/sda1 ... Clearing Linux swap on /dev/sda2 ... Trimming /dev/sda3 ... Sparsify in-place operation completed with no errors.
… and much faster. However it does require very recent kernel and qemu support.
Thanks: Paolo Bonzini, Eric Sandeen & Kevin Wolf for implementing discard support and patiently helping out when we started to test and use it.