d76c62
From 627b980c628dd06fb9995e83130fbaa858d4087f Mon Sep 17 00:00:00 2001
d76c62
Message-Id: <627b980c628dd06fb9995e83130fbaa858d4087f@dist-git>
d76c62
From: Peter Krempa <pkrempa@redhat.com>
d76c62
Date: Fri, 28 Feb 2020 10:24:42 +0100
d76c62
Subject: [PATCH] qemu: domain: Convert detected 'iso' image format into 'raw'
d76c62
MIME-Version: 1.0
d76c62
Content-Type: text/plain; charset=UTF-8
d76c62
Content-Transfer-Encoding: 8bit
d76c62
d76c62
While our code can detect ISO as a separate format, qemu does not use it
d76c62
as such and just passes it through as raw. Add conversion for detected
d76c62
parts of the backing chain so that the validation code does not reject
d76c62
it right away.
d76c62
d76c62
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
d76c62
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
d76c62
(cherry picked from commit 3c6e6f55a5ded357c39b92629cd523e51f6ca8f9)
d76c62
d76c62
https://bugzilla.redhat.com/show_bug.cgi?id=1798148
d76c62
Message-Id: <2c6cfa942acf0d7fe56046122b23780ee5c0d777.1582881363.git.pkrempa@redhat.com>
d76c62
Reviewed-by: Ján Tomko <jtomko@redhat.com>
d76c62
---
d76c62
 src/qemu/qemu_domain.c | 4 ++++
d76c62
 1 file changed, 4 insertions(+)
d76c62
d76c62
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
d76c62
index f037f0812e..ed35260712 100644
d76c62
--- a/src/qemu/qemu_domain.c
d76c62
+++ b/src/qemu/qemu_domain.c
d76c62
@@ -11598,6 +11598,10 @@ qemuDomainDetermineDiskChain(virQEMUDriverPtr driver,
d76c62
         return -1;
d76c62
 
d76c62
     for (n = src->backingStore; virStorageSourceIsBacking(n); n = n->backingStore) {
d76c62
+        /* convert detected ISO format to 'raw' as qemu would not understand it */
d76c62
+        if (n->format == VIR_STORAGE_FILE_ISO)
d76c62
+            n->format = VIR_STORAGE_FILE_RAW;
d76c62
+
d76c62
         if (qemuDomainValidateStorageSource(n, priv->qemuCaps) < 0)
d76c62
             return -1;
d76c62
 
d76c62
-- 
d76c62
2.25.1
d76c62