Allow vmstorage creation passing disk bus
Signed-off-by: Ramon Medeiros <ramonn(a)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