[Kimchi-devel] [PATCH] [Kimchi 1/4] Read io and cache option from disks

Ramon Medeiros posted 4 patches 7 years, 3 months ago
There is a newer version of this series
[Kimchi-devel] [PATCH] [Kimchi 1/4] Read io and cache option from disks
Posted by Ramon Medeiros 7 years, 3 months ago
Signed-off-by: Ramon Medeiros <ramonn@linux.vnet.ibm.com>
---
 xmlutils/disk.py | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/xmlutils/disk.py b/xmlutils/disk.py
index 02d6811..8edb991 100644
--- a/xmlutils/disk.py
+++ b/xmlutils/disk.py
@@ -147,12 +147,21 @@ def get_vm_disk_info(dom, dev_name):
     except:
         path = ""
 
-    return {'dev': dev_name,
+    base = {'dev': dev_name,
             'path': path,
             'type': disk.attrib['device'],
             'format': disk.driver.attrib['type'],
             'bus': disk.target.attrib['bus']}
 
+    # optional parameters
+    if disk.driver.attrib.get('io') != None:
+        base.update({'io': disk.driver.attrib['io']})
+
+    if disk.driver.attrib.get('cache') != None:
+        base.update({'cache': disk.driver.attrib['cache']})
+
+    return base
+
 
 def get_vm_disks(dom):
     xml = dom.XMLDesc(0)
-- 
2.9.3

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