[Kimchi-devel] [PATCH][Kimchi 5/6] Add function to retrieve bootorder on vm lookup

Ramon Medeiros ramonn at linux.vnet.ibm.com
Thu Jun 9 20:44:41 UTC 2016


Signed-off-by: Ramon Medeiros <ramonn at linux.vnet.ibm.com>
---
 model/vms.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/model/vms.py b/model/vms.py
index f4c7b16..c24df91 100644
--- a/model/vms.py
+++ b/model/vms.py
@@ -95,6 +95,7 @@ XPATH_DOMAIN_MEMORY_UNIT = '/domain/memory/@unit'
 XPATH_DOMAIN_UUID = '/domain/uuid'
 XPATH_DOMAIN_DEV_CPU_ID = '/domain/devices/spapr-cpu-socket/@id'
 
+XPATH_BOOT = 'os/boot/@dev'
 XPATH_CPU = './cpu'
 XPATH_NAME = './name'
 XPATH_NUMA_CELL = './cpu/numa/cell'
@@ -1241,6 +1242,9 @@ class VMModel(object):
         else:
             maxmemory = memory
 
+        # get boot order
+        boot = xpath_get_text(xml, XPATH_BOOT)
+
         return {'name': name,
                 'state': state,
                 'stats': res,
@@ -1258,7 +1262,8 @@ class VMModel(object):
                 'users': users,
                 'groups': groups,
                 'access': 'full',
-                'persistent': True if dom.isPersistent() else False
+                'persistent': True if dom.isPersistent() else False,
+                'bootorder': boot
                 }
 
     def _vm_get_disk_paths(self, dom):
-- 
2.5.5




More information about the Kimchi-devel mailing list