Re: [Qemu-devel] Is blk_getlength() in find_image_format() and img_map() kosher?

2017-08-04 Thread Eric Blake
On 08/04/2017 08:55 AM, Markus Armbruster wrote: > Have a look at find_image_format(): > > if (blk_is_sg(file) || !blk_is_inserted(file) || blk_getlength(file) == > 0) { > *pdrv = _raw; > return ret; > } > > blk_getlength() can fail. Shouldn't we error out then? > > We

[Qemu-devel] Is blk_getlength() in find_image_format() and img_map() kosher?

2017-08-04 Thread Markus Armbruster
Have a look at find_image_format(): if (blk_is_sg(file) || !blk_is_inserted(file) || blk_getlength(file) == 0) { *pdrv = _raw; return ret; } blk_getlength() can fail. Shouldn't we error out then? We pretty obviously should in img_map(): length = blk_getlength(blk);