On 20.03.2017 11:47, Stefan Hajnoczi wrote:
> On Mon, Mar 13, 2017 at 10:40:33PM +0100, Max Reitz wrote:
>> @@ -3429,8 +3442,16 @@ static int img_resize(int argc, char **argv)
>> goto out;
>> }
>>
>> +current_size = blk_getlength(blk);
>> +if (current_size < 0) {
>> +
On Mon, Mar 13, 2017 at 10:40:33PM +0100, Max Reitz wrote:
> @@ -3429,8 +3442,16 @@ static int img_resize(int argc, char **argv)
> goto out;
> }
>
> +current_size = blk_getlength(blk);
> +if (current_size < 0) {
> +error_report("Failed to inquire current image length
Add a --preallocation command line option to qemu-img resize which can
be used to set the PreallocMode parameter of blk_truncate().
Signed-off-by: Max Reitz
---
qemu-img.c| 33 ++---
qemu-img.texi | 7 ++-
2 files changed, 36 insertions(+), 4 deletions(-)
di