Il 13/09/2013 12:46, Peter Lieven ha scritto: >>> >>> - flags = BDRV_O_RDWR; >>> + flags = BDRV_O_RDWR | BDRV_O_UNMAP; >> I think this should be a new command-line flag. > In an earlier version there where no objections. I think it would > make the usage of qemu-img convert more complicated. For > most targets has_zero_init is 1 anyway.
If Kevin is okay with having BDRV_O_UNMAP as the default that's fine. However there should be an option to disable it. Perhaps it could be "-S 0" with something like this added: diff --git a/qemu-img.c b/qemu-img.c index 3e5e388..f42c90c 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -769,6 +769,10 @@ int ret; int num_checked, num_used; + if (!min) { + return 1; + } + if (n < min) { min = n; } Paolo