[Kimchi-devel] [PATCH v3 1/5] fix: Use correct path when setting 'ref_cnt' to a new volume

Aline Manera alinefm at linux.vnet.ibm.com
Fri May 15 15:18:52 UTC 2015


Reviewed-by: Aline Manera <alinefm at linux.vnet.ibm.com>

On 12/05/2015 11:58, Crístian Deives wrote:
> When a storage volume is created with the parameter 'capacity', the
> parameter 'ref_cnt' is set on the storage pool path instead of the
> storage volume path. 'ref_cnt's are only related to storage volumes, not
> pools.
>
> Use the storage volume path instead of the storage pool path when
> setting 'ref_cnt' on a new volume.
>
> Signed-off-by: Crístian Deives <cristiandeives at gmail.com>
> ---
>   src/kimchi/model/storagevolumes.py | 8 +++++---
>   1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/src/kimchi/model/storagevolumes.py b/src/kimchi/model/storagevolumes.py
> index f02efca..cf4611d 100644
> --- a/src/kimchi/model/storagevolumes.py
> +++ b/src/kimchi/model/storagevolumes.py
> @@ -182,12 +182,14 @@ class StorageVolumesModel(object):
>                                     {'name': name, 'pool': pool,
>                                      'err': e.get_error_message()})
>   
> -        path = StoragePoolModel(
> -            conn=self.conn, objstore=self.objstore).lookup(pool_name)['path']
> +        vol_info = StorageVolumeModel(conn=self.conn,
> +                                      objstore=self.objstore).lookup(pool_name,
> +                                                                     name)
>   
>           try:
>               with self.objstore as session:
> -                session.store('storagevolume', path, {'ref_cnt': 0})
> +                session.store('storagevolume', vol_info['path'],
> +                              {'ref_cnt': 0})
>           except Exception as e:
>               # If the storage volume was created flawlessly, then lets hide this
>               # error to avoid more error in the VM creation process




More information about the Kimchi-devel mailing list