qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Is the use of bdrv_getlength() in vmdk_check() kosher?
@ 2017-08-04 13:28 Markus Armbruster
  2017-08-04 13:55 ` Fam Zheng
  0 siblings, 1 reply; 2+ messages in thread
From: Markus Armbruster @ 2017-08-04 13:28 UTC (permalink / raw)
  To: Fam Zheng; +Cc: qemu-devel, qemu-block, Kevin Wolf

Have a look at vmdk_check():

        if (ret == VMDK_OK &&
            cluster_offset >= bdrv_getlength(extent->file->bs))

bdrv_getlength() can fail.  Does it do the right thing then?  For what
it's worth, the comparison of its value is unsigned.

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

* Re: [Qemu-devel] Is the use of bdrv_getlength() in vmdk_check() kosher?
  2017-08-04 13:28 [Qemu-devel] Is the use of bdrv_getlength() in vmdk_check() kosher? Markus Armbruster
@ 2017-08-04 13:55 ` Fam Zheng
  0 siblings, 0 replies; 2+ messages in thread
From: Fam Zheng @ 2017-08-04 13:55 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel, qemu-block, Kevin Wolf

On Fri, 08/04 15:28, Markus Armbruster wrote:
> Have a look at vmdk_check():
> 
>         if (ret == VMDK_OK &&
>             cluster_offset >= bdrv_getlength(extent->file->bs))
> 
> bdrv_getlength() can fail.  Does it do the right thing then?  For what
> it's worth, the comparison of its value is unsigned.

Sure, error handling should be done with bdrv_getlength() return value. I'll
send a patch.

Fam

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

end of thread, other threads:[~2017-08-04 14:00 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:28 [Qemu-devel] Is the use of bdrv_getlength() in vmdk_check() kosher? Markus Armbruster
2017-08-04 13:55 ` Fam Zheng

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).