On 2 Sep 2013, at 16:28, Stefan Hajnoczi wrote: > If bdrv_getlength() failed and bdrv_get_geometry() produced a 0 result, > then this error message will be confusing to users. > > It would be better to use bdrv_getlength() directly: > > int64_t length = bdrv_getlength(out_bs); > if (length < 0) { > error_report("unable to get output image length: %s\n", strerror(-length)); > ret = -1; > goto out; > } else if (length < total_sectors) { > error_report("output file is smaller than input file"); > ret = -1; > goto out; > }
Fixed in v7 (just sent) subject to fixing the deliberate mistake in the above :-) Other two fixed too. -- Alex Bligh