Skip to contentSkip to conversation

Is the use of bdrv_getlength() in vmdk_check() kosher?

Qemu-devel Markus Armbruster 2 participants 2 messages Aug 4, 2017

lore
Share & tools
lore
#0 lore raw

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.

#1 lore raw
Quoted 7 lines · Markus Armbruster

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