
From: Royce Lv <lvroyce@linux.vnet.ibm.com> Since we pick the best bus type according to distro/version/arch when creating template instead of giving users choice, this logic can be applied to add vm disk logic. So delete 'bus' param from api and let kimchi decide the best bus type to use. Signed-off-by: Royce Lv <lvroyce@linux.vnet.ibm.com> --- src/kimchi/API.json | 6 ------ src/kimchi/model/vmstorages.py | 3 +-- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/kimchi/API.json b/src/kimchi/API.json index 4b432a2..640ed10 100644 --- a/src/kimchi/API.json +++ b/src/kimchi/API.json @@ -500,12 +500,6 @@ "type": "string", "pattern": "^((/)|(http)[s]?:|[t]?(ftp)[s]?:)+.*$", "error": "KCHVMSTOR0003E" - }, - "bus": { - "description": "Target bus type of attached device", - "type": "string", - "pattern": "^scsi|ide|virtio$", - "error": "KCHVMSTOR0005E" } } }, diff --git a/src/kimchi/model/vmstorages.py b/src/kimchi/model/vmstorages.py index cd985fa..c15744b 100644 --- a/src/kimchi/model/vmstorages.py +++ b/src/kimchi/model/vmstorages.py @@ -171,8 +171,7 @@ class VMStoragesModel(object): params['format'] = vol_info['format'] params['path'] = vol_info['path'] params['src_type'] = _check_path(params['path']) - params.setdefault( - 'bus', _get_device_bus(params['type'], dom)) + params['bus'] = _get_device_bus(params['type'], dom) if (params['bus'] not in HOTPLUG_TYPE and DOM_STATE_MAP[dom.info()[0]] != 'shutoff'): raise InvalidOperation('KCHVMSTOR0011E') -- 1.8.3.2