qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Is blk_getlength() in find_image_format() and img_map() kosher?
@ 2017-08-04 13:55 Markus Armbruster
  2017-08-04 15:39 ` Eric Blake
  0 siblings, 1 reply; 2+ messages in thread
From: Markus Armbruster @ 2017-08-04 13:55 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-devel, qemu-block, Max Reitz

Have a look at find_image_format():

    if (blk_is_sg(file) || !blk_is_inserted(file) || blk_getlength(file) == 0) {
        *pdrv = &bdrv_raw;
        return ret;
    }

blk_getlength() can fail.  Shouldn't we error out then?

We pretty obviously should in img_map():

    length = blk_getlength(blk);
    while (curr.start + curr.length < length) {

Since I have to touch @length in the series I'm working on, I'll stick
in a fix.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-04 15:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-04 13:55 [Qemu-devel] Is blk_getlength() in find_image_format() and img_map() kosher? Markus Armbruster
2017-08-04 15:39 ` Eric Blake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).