[Kimchi-devel] [PATCH 2/2] Guest storage: fix volume format overwrite

Aline Manera alinefm at linux.vnet.ibm.com
Wed Aug 27 18:11:57 UTC 2014


On 08/26/2014 06:50 AM, lvroyce at linux.vnet.ibm.com 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 | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/kimchi/model/vmstorages.py b/src/kimchi/model/vmstorages.py
> index f11bcec..3a656b2 100644
> --- a/src/kimchi/model/vmstorages.py
> +++ b/src/kimchi/model/vmstorages.py
> @@ -153,7 +153,8 @@ class VMStoragesModel(object):
>                   raise InvalidParameter("KCHVMSTOR0015E", {'error': e})
>               if vol_info['ref_cnt'] != 0:
>                   raise InvalidParameter("KCHVMSTOR0016E")
> -            params['format'] = vol_info['format']
> +            if vol_info['format'] in ["raw", "bochs", "qcow2", "qed"]:

 From libvirt I got the following types:

raw,bochs,qcow,qcow2,qed,vmdk

Shouldn't we use all those too?

> +                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