[Kimchi-devel] [PATCH] Guest storage: fix volume format overwrite
Daniel H Barboza
danielhb at linux.vnet.ibm.com
Mon Sep 1 19:57:14 UTC 2014
Reviewed-by: Daniel Barboza <danielhb at linux.vnet.ibm.com>
On 09/01/2014 03:16 PM, Aline Manera wrote:
> From: Royce Lv <lvroyce at 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 at 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
More information about the Kimchi-devel
mailing list