From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
When vol_info reports unsupported type, such as an iscsi volume with type
'unknown',
use 'raw' without overwriting it, this applied to type 'unknown',
'iso'
and so on.
Signed-off-by: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
---
src/kimchi/model/vmstorages.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/kimchi/model/vmstorages.py b/src/kimchi/model/vmstorages.py
index 537edbb..40856d3 100644
--- a/src/kimchi/model/vmstorages.py
+++ b/src/kimchi/model/vmstorages.py
@@ -152,7 +152,10 @@ class VMStoragesModel(object):
raise InvalidParameter("KCHVMSTOR0015E", {'error': e})
if vol_info['ref_cnt'] != 0:
raise InvalidParameter("KCHVMSTOR0016E")
- params['format'] = vol_info['format']
+
+ supported_format = ["raw", "bochs", "qcow",
"qcow2", "qed", "vmdk"]
+ if vol_info['format'] in supported_format:
+ params['format'] = vol_info['format']
params['path'] = vol_info['path']
params['src_type'] = _check_path(params['path'])
if (params['bus'] not in HOTPLUG_TYPE
--
1.9.3