From fd93d46642a74a9d5fe7f9b6b93d7ed9d7dd5f26 Mon Sep 17 00:00:00 2001 From: Adam Litke Date: Fri, 19 Nov 2010 10:18:17 -0600 Subject: [PATCH] storage_file: Add a new flag to mark backing files that are safe to probe Signed-off-by: Adam Litke --- src/conf/domain_conf.c | 4 ++++ src/util/storage_file.c | 2 +- src/util/storage_file.h | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 30c27db1f0..606ee50d9f 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -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; diff --git a/src/util/storage_file.c b/src/util/storage_file.c index c011544b29..b82da0a73b 100644 --- a/src/util/storage_file.c +++ b/src/util/storage_file.c @@ -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") diff --git a/src/util/storage_file.h b/src/util/storage_file.h index 37d52b44ed..1b918301fb 100644 --- a/src/util/storage_file.h +++ b/src/util/storage_file.h @@ -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, -- GitLab