[Kimchi-devel] [PATCH] Allow creating VM storages with ref_cnt > 0

Crístian Deives cristiandeives at gmail.com
Mon Apr 20 15:14:04 UTC 2015


As discussed in an e-mail thread
(http://lists.ovirt.org/pipermail/kimchi-devel/2015-March/010154.html),
we should stop blocking the user from creating VM storages when the
storage has already been added to some VM. The UI may display a warning
when that cases happens so the user should decide what to do.

Remove check on ref_cnt when creating a VM storage.

Signed-off-by: Crístian Deives <cristiandeives at gmail.com>
---
 src/kimchi/i18n.py             | 1 -
 src/kimchi/model/vmstorages.py | 2 --
 2 files changed, 3 deletions(-)

diff --git a/src/kimchi/i18n.py b/src/kimchi/i18n.py
index 18e84bc..6b4726c 100644
--- a/src/kimchi/i18n.py
+++ b/src/kimchi/i18n.py
@@ -285,7 +285,6 @@ messages = {
     "KCHVMSTOR0013E": _("Specify path to update virtual machine disk"),
     "KCHVMSTOR0014E": _("Controller type %(type)s limitation of %(limit)s devices reached"),
     "KCHVMSTOR0015E": _("Cannot retrieve disk path information for given pool/volume: %(error)s"),
-    "KCHVMSTOR0016E": _("Volume already in use by other virtual machine."),
     "KCHVMSTOR0017E": _("Only one of path or pool/volume can be specified to add a new virtual machine disk"),
     "KCHVMSTOR0018E": _("Volume chosen with format %(format)s does not fit in the storage type %(type)s"),
 
diff --git a/src/kimchi/model/vmstorages.py b/src/kimchi/model/vmstorages.py
index 37aca64..0375772 100644
--- a/src/kimchi/model/vmstorages.py
+++ b/src/kimchi/model/vmstorages.py
@@ -111,8 +111,6 @@ class VMStoragesModel(object):
                 raise InvalidParameter("KCHVMSTOR0012E")
             except Exception as e:
                 raise InvalidParameter("KCHVMSTOR0015E", {'error': e})
-            if vol_info['ref_cnt'] != 0:
-                raise InvalidParameter("KCHVMSTOR0016E")
 
             valid_format = {
                 "disk": ["raw", "bochs", "qcow", "qcow2", "qed", "vmdk"],
-- 
2.1.0




More information about the Kimchi-devel mailing list