[Kimchi-devel] [PATCH] vmtemplate: allow allocation = 0 for type 'raw'
Christy Perez
christy at linux.vnet.ibm.com
Tue Nov 25 17:43:52 UTC 2014
Reviewed-By: Christy Perez <christy at linux.vnet.ibm.com>
On 11/25/2014 06:15 AM, Daniel Henrique Barboza wrote:
> Kimchi was allocating the entire disk when the disk image type wasn't
> 'qcow2'. Adding 'raw' to this exception list because raw images can
> be created as sparse (= size in bytes when creating the disk is
> less than its total capacity) too.
>
> Signed-off-by: Daniel Henrique Barboza <danielhb at linux.vnet.ibm.com>
> ---
> src/kimchi/vmtemplate.py | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/kimchi/vmtemplate.py b/src/kimchi/vmtemplate.py
> index 5dbbdd4..6c449f2 100644
> --- a/src/kimchi/vmtemplate.py
> +++ b/src/kimchi/vmtemplate.py
> @@ -197,7 +197,8 @@ class VMTemplate(object):
> 'capacity': d['size'],
> 'format': fmt,
> 'path': '%s/%s' % (storage_path, volume)}
> - info['allocation'] = 0 if fmt == 'qcow2' else info['capacity']
> + info['allocation'] = 0 if fmt in ['qcow2', 'raw'] \
> + else info['capacity']
>
> if 'base' in d:
> info['base'] = dict()
>
More information about the Kimchi-devel
mailing list