]> xenbits.xensource.com Git - libvirt.git/commitdiff
storage_file: Add a new flag to mark backing files that are safe to probe
authorAdam Litke <agl@us.ibm.com>
Fri, 19 Nov 2010 16:18:17 +0000 (10:18 -0600)
committerEric Blake <eblake@redhat.com>
Fri, 19 Nov 2010 23:07:06 +0000 (16:07 -0700)
Signed-off-by: Adam Litke <agl@us.ibm.com>
src/conf/domain_conf.c
src/util/storage_file.c
src/util/storage_file.h

index 30c27db1f0ba30311287357df8e18be2853676e4..606ee50d9f5396122b2d07297fcad5ecbc2e6739 100644 (file)
@@ -8230,6 +8230,10 @@ int virDomainDiskDefForeachPath(virDomainDiskDefPtr disk,
         if (format == VIR_STORAGE_FILE_AUTO &&
             !allowProbing)
             format = VIR_STORAGE_FILE_RAW; /* Stops further recursion */
+
+        /* Allow probing for image formats that are safe */
+        if (format == VIR_STORAGE_FILE_AUTO_SAFE)
+            format = VIR_STORAGE_FILE_AUTO;
     } while (nextpath);
 
     ret = 0;
index c011544b290b04a5466fd6592335b44cb7c4478c..b82da0a73bc16e05d9f07277ee13c8edada916dc 100644 (file)
@@ -42,7 +42,7 @@
 
 VIR_ENUM_IMPL(virStorageFileFormat,
               VIR_STORAGE_FILE_LAST,
-              "raw", "dir", "bochs",
+              "raw", "probe", "dir", "bochs",
               "cloop", "cow", "dmg", "iso",
               "qcow", "qcow2", "qed", "vmdk", "vpc")
 
index 37d52b44eda79022d4533663a74bd6557e1cbc84..1b918301fb1539aac930b5bb5dae11994f2099f7 100644 (file)
@@ -30,6 +30,7 @@
 enum virStorageFileFormat {
     VIR_STORAGE_FILE_AUTO = -1,
     VIR_STORAGE_FILE_RAW = 0,
+    VIR_STORAGE_FILE_AUTO_SAFE,
     VIR_STORAGE_FILE_DIR,
     VIR_STORAGE_FILE_BOCHS,
     VIR_STORAGE_FILE_CLOOP,