[Libvirt-cim] [PATCH 07/10] XenKvmLib: Add controller pool

John Ferlan jferlan at redhat.com
Fri Apr 4 16:12:56 UTC 2014


Add support to have a controller pool for the controller RASD

Signed-off-by: John Ferlan <jferlan at redhat.com>
---
 suites/libvirt-cim/lib/XenKvmLib/pool.py | 6 ++++++
 suites/libvirt-cim/lib/XenKvmLib/rasd.py | 2 ++
 suites/libvirt-cim/lib/XenKvmLib/vxml.py | 3 ++-
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/suites/libvirt-cim/lib/XenKvmLib/pool.py b/suites/libvirt-cim/lib/XenKvmLib/pool.py
index ddbe532..59555ae 100644
--- a/suites/libvirt-cim/lib/XenKvmLib/pool.py
+++ b/suites/libvirt-cim/lib/XenKvmLib/pool.py
@@ -44,6 +44,7 @@ cim_mname  = "CreateChildResourcePool"
 input_graphics_pool_rev = 757
 libvirt_cim_child_pool_rev = 837
 libvirt_rasd_spool_del_changes = 971
+libvirt_controller_rev = 1312
 
 DIR_POOL = 1L
 FS_POOL = 2L
@@ -69,6 +70,8 @@ def pool_cn_to_rasd_cn(pool_cn, virt):
         return get_typed_class(virt, "GraphicsResourceAllocationSettingData")
     elif pool_cn.find('InputPool') >= 0:
         return get_typed_class(virt, "InputResourceAllocationSettingData")
+    elif pool_cn.find('ControllerPool') >= 0:
+        return get_typed_class(virt, "ControllerResourceAllocationSettingData")
     else:
         return None
 
@@ -80,6 +83,9 @@ def enum_pools(virt, ip):
         pool_list.append('GraphicsPool')
         pool_list.append('InputPool')
 
+    if curr_cim_rev >= libvirt_controller_rev and virt == 'KVM':
+        pool_list.append('ControllerPool')
+
     pool_insts = {}
 
     try:
diff --git a/suites/libvirt-cim/lib/XenKvmLib/rasd.py b/suites/libvirt-cim/lib/XenKvmLib/rasd.py
index 21dd7e4..e7ef4e9 100644
--- a/suites/libvirt-cim/lib/XenKvmLib/rasd.py
+++ b/suites/libvirt-cim/lib/XenKvmLib/rasd.py
@@ -321,6 +321,8 @@ def rasd_cn_to_pool_cn(rasd_cn, virt):
         return get_typed_class(virt, "GraphicsPool")
     elif rasd_cn.find('InputResourceAllocationSettingData') >= 0:
         return get_typed_class(virt, "InputPool")
+    elif rasd_cn.find('ControllerResourceAllocationSettingData') >= 0:
+        return get_typed_class(virt, "ControllerPool")
     else:
         return None 
 
diff --git a/suites/libvirt-cim/lib/XenKvmLib/vxml.py b/suites/libvirt-cim/lib/XenKvmLib/vxml.py
index ad80aae..3bea13c 100644
--- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py
+++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py
@@ -669,7 +669,8 @@ class VirtCIM:
             if self.iasd is not None:
                 res_settings.append(str(self.iasd))
 
-        if curr_cim_rev > vsms_controller_sup and self.ctlasd is not None:
+        if curr_cim_rev > vsms_controller_sup and self.ctlasd is not None and \
+           self.virt == 'KVM':
             res_settings.append(str(self.ctlasd))
 
         if ref_conf is None:
-- 
1.8.5.3




More information about the Libvirt-cim mailing list