Re: [Qemu-devel] [PATCH 2/3] qemu-io: Respect early image end for map

2014-10-11 Thread Benoît Canet
The Saturday 16 Aug 2014 à 20:54:17 (+0200), Max Reitz wrote : > bdrv_is_allocated() may report zero clusters which most probably means > the image (file) is shorter than expected. Respect this case in order to > avoid an infinite loop. > > Signed-off-by: Max Reitz > --- > qemu-io-cmds.c | 5 +++

Re: [Qemu-devel] [PATCH 2/3] qemu-io: Respect early image end for map

2014-10-11 Thread Benoît Canet
The Saturday 11 Oct 2014 à 11:53:40 (+0200), Max Reitz wrote : > Am 10.10.2014 um 14:03 schrieb Benoît Canet: > >>+} else if (!num) { > >>+error_report("Unexpected end of image"); > >>+return 0; > >I think this test can miss some case of Unexpected end of image. > >

Re: [Qemu-devel] [PATCH 2/3] qemu-io: Respect early image end for map

2014-10-11 Thread Max Reitz
Am 10.10.2014 um 14:03 schrieb Benoît Canet: +} else if (!num) { +error_report("Unexpected end of image"); +return 0; I think this test can miss some case of Unexpected end of image. For example supose that in map_is_allocated the first bdrv_is_allocated actually

Re: [Qemu-devel] [PATCH 2/3] qemu-io: Respect early image end for map

2014-10-10 Thread Benoît Canet
> +} else if (!num) { > +error_report("Unexpected end of image"); > +return 0; I think this test can miss some case of Unexpected end of image. For example supose that in map_is_allocated the first bdrv_is_allocated actually succeed then *pnum = num. Then the botto

Re: [Qemu-devel] [PATCH 2/3] qemu-io: Respect early image end for map

2014-10-08 Thread Eric Blake
On 08/16/2014 12:54 PM, Max Reitz wrote: > bdrv_is_allocated() may report zero clusters which most probably means > the image (file) is shorter than expected. Respect this case in order to > avoid an infinite loop. > > Signed-off-by: Max Reitz > --- > qemu-io-cmds.c | 5 - > 1 file changed,

[Qemu-devel] [PATCH 2/3] qemu-io: Respect early image end for map

2014-08-16 Thread Max Reitz
bdrv_is_allocated() may report zero clusters which most probably means the image (file) is shorter than expected. Respect this case in order to avoid an infinite loop. Signed-off-by: Max Reitz --- qemu-io-cmds.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qemu-io-cmds