merge VIR_STORAGE_FILE_AUTO_SAFE/VIR_STORAGE_FILE_AUTO to VIR_STORAGE_FILE_AUTO
virStorageFileProbeFormatFromBuf will probe the backingStore format.
Fix the booting issue when setting backingStore format (QCOW image) to RAW image.
Signed-off-by: Yi Li <yili(a)winhong.com>
---
src/qemu/qemu_block.c | 2 --
src/util/virstoragefile.c | 4 +---
src/util/virstoragefile.h | 1 -
3 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index 66b1d11..0b99efc 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -1367,7 +1367,6 @@ qemuBlockStorageSourceGetBlockdevFormatProps(virStorageSourcePtr
src)
driver = virStorageFileFormatTypeToString(src->format);
break;
- case VIR_STORAGE_FILE_AUTO_SAFE:
case VIR_STORAGE_FILE_AUTO:
case VIR_STORAGE_FILE_NONE:
case VIR_STORAGE_FILE_COW:
@@ -2275,7 +2274,6 @@ qemuBlockStorageSourceCreateGetFormatProps(virStorageSourcePtr src,
case VIR_STORAGE_FILE_DIR:
return 0;
- case VIR_STORAGE_FILE_AUTO_SAFE:
case VIR_STORAGE_FILE_AUTO:
case VIR_STORAGE_FILE_NONE:
virReportError(VIR_ERR_INTERNAL_ERROR,
diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index 7288e18..2ebb2f1 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -692,7 +692,7 @@ qedGetBackingStore(char **res,
if (flags & QED_F_BACKING_FORMAT_NO_PROBE)
*format = VIR_STORAGE_FILE_RAW;
else
- *format = VIR_STORAGE_FILE_AUTO_SAFE;
+ *format = VIR_STORAGE_FILE_AUTO;
return BACKING_STORE_OK;
}
@@ -4916,8 +4916,6 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr src,
goto cleanup;
if (backingFormat == VIR_STORAGE_FILE_AUTO)
- backingStore->format = VIR_STORAGE_FILE_RAW;
- else if (backingFormat == VIR_STORAGE_FILE_AUTO_SAFE)
backingStore->format = VIR_STORAGE_FILE_AUTO;
else
backingStore->format = backingFormat;
diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h
index b65cd4c..c9deb6f 100644
--- a/src/util/virstoragefile.h
+++ b/src/util/virstoragefile.h
@@ -60,7 +60,6 @@ VIR_ENUM_DECL(virStorage);
typedef enum {
- VIR_STORAGE_FILE_AUTO_SAFE = -2,
VIR_STORAGE_FILE_AUTO = -1,
VIR_STORAGE_FILE_NONE = 0,
VIR_STORAGE_FILE_RAW,
--
2.7.5