From 5a2a474ee8e7f3c3fc62abaa41943da13dfc2f76 Mon Sep 17 00:00:00 2001 From: Adam Litke Date: Fri, 19 Nov 2010 10:18:15 -0600 Subject: [PATCH] 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 --- src/util/storage_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/storage_file.c b/src/util/storage_file.c index f1a445a56d..b17187695b 100644 --- a/src/util/storage_file.c +++ b/src/util/storage_file.c @@ -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; -- 2.47.2