Re: [Qemu-devel] [PATCH for-2.10 04/16] qemu-img: Expose PreallocMode for resizing

2017-03-20 Thread Max Reitz
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) { >> +

Re: [Qemu-devel] [PATCH for-2.10 04/16] qemu-img: Expose PreallocMode for resizing

2017-03-20 Thread Stefan Hajnoczi
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

[Qemu-devel] [PATCH for-2.10 04/16] qemu-img: Expose PreallocMode for resizing

2017-03-13 Thread Max Reitz
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