[libvirt] [PATCH 3/4] storage_file: Add a new flag to mark backing files that are safe to probe

Adam Litke agl at us.ibm.com
Mon Nov 22 16:23:51 UTC 2010


Signed-off-by: Adam Litke <agl at us.ibm.com>
Acked-by: Eric Blake <eblake at redhat.com>
---
 src/conf/domain_conf.c  |    4 ++++
 src/util/storage_file.h |    1 +
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 2d11785..a08c846 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -7825,6 +7825,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;
diff --git a/src/util/storage_file.h b/src/util/storage_file.h
index c4d4650..1eef4c5 100644
--- a/src/util/storage_file.h
+++ b/src/util/storage_file.h
@@ -28,6 +28,7 @@
 # include <stdbool.h>
 
 enum virStorageFileFormat {
+    VIR_STORAGE_FILE_AUTO_SAFE = -2,
     VIR_STORAGE_FILE_AUTO = -1,
     VIR_STORAGE_FILE_RAW = 0,
     VIR_STORAGE_FILE_DIR,
-- 
1.7.3.2.164.g6f10c




More information about the libvir-list mailing list