Reviewed-By: Christy Perez <christy(a)linux.vnet.ibm.com>
On 09/26/2014 03:40 AM, lvroyce(a)linux.vnet.ibm.com wrote:
From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
When disk source does not present in xml(i.e. cdrom ejected),
bus type probe will be ignored because of former exception.
Retrive right bus type before source probe to fix this.
Signed-off-by: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
---
src/kimchi/vmdisks.py | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/kimchi/vmdisks.py b/src/kimchi/vmdisks.py
index 6012ada..b61c883 100644
--- a/src/kimchi/vmdisks.py
+++ b/src/kimchi/vmdisks.py
@@ -43,7 +43,7 @@ def get_vm_disk(dom, dev_name):
"KCHVMSTOR0007E",
{'dev_name': dev_name, 'vm_name': dom.name()})
path = ""
- dev_bus = 'ide'
+ dev_bus = disk.target.attrib['bus']
try:
source = disk.source
if source is not None:
@@ -55,8 +55,6 @@ def get_vm_disk(dom, dev_name):
host.attrib['port'] + source.attrib['name'])
else:
path = source.attrib[DEV_TYPE_SRC_ATTR_MAP[src_type]]
- # Retrieve storage bus type
- dev_bus = disk.target.attrib['bus']
except:
pass
dev_type = disk.attrib['device']