[Kimchi-devel] [PATCH] Fix: retrieve right bus type in vmstorage update

lvroyce at linux.vnet.ibm.com lvroyce at linux.vnet.ibm.com
Fri Sep 26 08:40:34 UTC 2014


From: Royce Lv <lvroyce at 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 at 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']
-- 
1.8.3.2




More information about the Kimchi-devel mailing list