Is the use of bdrv_getlength() in vmdk_check() kosher?
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.
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