[Kimchi-devel] [PATCH] [Kimchi] Bug fix #1066: Do not stora guest storage volume information on objectstore

Lucio Correia luciojhc at linux.vnet.ibm.com
Fri Dec 9 18:39:55 UTC 2016


Reviewed-By: Lucio Correia <luciojhc at linux.vnet.ibm.com>

On 09/12/2016 15:26, Aline Manera wrote:
> Since commit 2e111ef4 the storage volume used by each guest is not
> stored on objectstore. So we can safely remove any update about that
> information from code.
>
> Signed-off-by: Aline Manera <alinefm at linux.vnet.ibm.com>
> ---
>  model/vms.py | 16 ----------------
>  1 file changed, 16 deletions(-)
>
> diff --git a/model/vms.py b/model/vms.py
> index d703c89..7dfec30 100644
> --- a/model/vms.py
> +++ b/model/vms.py
> @@ -481,11 +481,6 @@ class VMModel(object):
>          all_paths = xpath_get_text(xml, XPATH_DOMAIN_DISK)
>
>          vir_conn = self.conn.get()
> -
> -        def _delete_disk_from_objstore(path):
> -            with self.objstore as session:
> -                session.delete('storagevolume', path)
> -
>          domain_name = xpath_get_text(xml, XPATH_DOMAIN_NAME)[0]
>
>          for i, path in enumerate(all_paths):
> @@ -556,13 +551,6 @@ class VMModel(object):
>              xml = xml_item_update(xml, XPATH_DOMAIN_DISK_BY_FILE % path,
>                                    new_vol['path'], 'file')
>
> -            # set the new disk's used_by
> -            with self.objstore as session:
> -                session.store('storagevolume', new_vol['path'],
> -                              {'used_by': [domain_name]},
> -                              get_kimchi_version())
> -            rollback.prependDefer(_delete_disk_from_objstore, new_vol['path'])
> -
>              # remove the new volume should an error occur later
>              rollback.prependDefer(self.storagevolume.delete, new_pool_name,
>                                    new_vol_name)
> @@ -1476,10 +1464,6 @@ class VMModel(object):
>                  pool_type = xpath_get_text(xml, "/pool/@type")[0]
>                  if pool_type not in READONLY_POOL_TYPE:
>                      vol.delete(0)
> -                    # Update objstore to remove the volume
> -                    with self.objstore as session:
> -                        session.delete('storagevolume', path,
> -                                       ignore_missing=True)
>              except libvirt.libvirtError as e:
>                  wok_log.error('Unable to get storage volume by path: %s' %
>                                e.message)
>


-- 
Lucio Correia
Software Engineer
IBM LTC Brazil




More information about the Kimchi-devel mailing list