mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-13 00:46:03 -06:00
Allow probing of image formats without version information
Disk image formats that wish to opt-out of version validation are supposed to set versionOffset to -1 in their fileTypeInfo entry. By unconditionally returning False for these formats, virStorageFileMatchesVersion() incorrectly reports a version mismatch when the test was actually skipped. The correct behavior is to return True so these formats can be successfully probed using the magic bytes alone. Signed-off-by: Adam Litke <agl@us.ibm.com>
This commit is contained in:
parent
d2af8ffcd8
commit
5a2a474ee8
@ -479,7 +479,7 @@ virStorageFileMatchesVersion(int format,
|
||||
|
||||
/* Validate version number info */
|
||||
if (fileTypeInfo[format].versionOffset == -1)
|
||||
return false;
|
||||
return true;
|
||||
|
||||
if ((fileTypeInfo[format].versionOffset + 4) > buflen)
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user