qemu-img: add support for skipping zeroes in input during convert
authorPeter Lieven <pl@kamp.de>
Wed, 27 Nov 2013 10:07:01 +0000 (11:07 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Thu, 5 Dec 2013 10:45:24 +0000 (11:45 +0100)
commit13c28af87a5541a9b09a59502b876a1725fb502d
tree120236eed4d8d6d7bd2333db2a28ca64055a0184
parent4323fdcf9451deaaf48468afa91b8bcaeac00cff
qemu-img: add support for skipping zeroes in input during convert

we currently do not check if a sector is allocated during convert.
This means if a sector is unallocated that we allocate a bounce
buffer of zeroes, find out its zero later and do not write it
in the best case. In the worst case this can lead to reading
blocks from a raw device (like iSCSI) altough we could easily
know via get_block_status that they are zero and simply skip them.

This patch also fixes the progress output not being at 100% after
a successful conversion.

Signed-off-by: Peter Lieven <pl@kamp.de>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
qemu-img.c