[Kimchi-devel] [PATCH] [Kimchi 3/4] Bug fix #1091: Allow to set disk performance options per guest and template

Ramon Medeiros posted 4 patches 7 years, 3 months ago
There is a newer version of this series
[Kimchi-devel] [PATCH] [Kimchi 3/4] Bug fix #1091: Allow to set disk performance options per guest and template
Posted by Ramon Medeiros 7 years, 3 months ago
Allow vmstorage creation passing disk bus

Signed-off-by: Ramon Medeiros <ramonn@linux.vnet.ibm.com>
---
 docs/API.md         | 1 +
 model/vmstorages.py | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/docs/API.md b/docs/API.md
index 6f00600..3657db3 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -243,6 +243,7 @@ Represents a snapshot of the Virtual Machine's primary monitor.
     * dir_path: s390x specific attribute to attach direct storage without libvirt
     * format: s390x specific attribute specify the format of direct storage
     * size: s390x specific attribute to specify the size of direct storage
+    * bus: Bus type of disk.
 
 ### Sub-resource: storage
 **URI:** /plugins/kimchi/vms/*:name*/storages/*:dev*
diff --git a/model/vmstorages.py b/model/vmstorages.py
index 007e88c..bf55300 100644
--- a/model/vmstorages.py
+++ b/model/vmstorages.py
@@ -91,7 +91,9 @@ class VMStoragesModel(object):
                 raise InvalidParameter("KCHVMSTOR0019E")
 
         dom = VMModel.get_vm(vm_name, self.conn)
-        params['bus'] = _get_device_bus(params['type'], dom)
+
+        if params.get('bus') is None:
+            params['bus'] = _get_device_bus(params['type'], dom)
 
         if is_s390x() and params['type'] == 'disk' and 'dir_path' in params:
             if 'format' not in params:
-- 
2.9.3

_______________________________________________
Kimchi-devel mailing list
Kimchi-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/kimchi-devel