]> xenbits.xensource.com Git - libvirt.git/commitdiff
Allow probing of image formats without version information
authorAdam Litke <agl@us.ibm.com>
Fri, 19 Nov 2010 16:18:15 +0000 (10:18 -0600)
committerEric Blake <eblake@redhat.com>
Fri, 19 Nov 2010 22:55:02 +0000 (15:55 -0700)
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>
src/util/storage_file.c

index f1a445a56d75fc3f87fc32defe3e3bfd7694f434..b17187695b03656cd316750d8ce2d4bf9d22f099 100644 (file)
@@ -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;