[Libvirt-cim] [PATCH 3 of 3] [TEST] #2 Fix cim_define() for LXC

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Wed Oct 29 23:17:41 UTC 2008


# HG changeset patch
# User Kaitlin Rupert <karupert at us.ibm.com>
# Date 1225321849 25200
# Node ID 3fe31c4399cc4b4df264013f612926361fd9b20d
# Parent  3648a3f070f319d031110c8dba89ab5a47e90363
[TEST] #2 Fix cim_define() for LXC

For LXC guests, don't supply a value for vcpu when creating a ProcRASD.
The VirtualQuantity attribute isn't valid for containers guests.

Signed-off-by: Kaitlin Rupert <karupert at us.ibm.com>

diff -r 3648a3f070f3 -r 3fe31c4399cc suites/libvirt-cim/lib/XenKvmLib/vsms.py
--- a/suites/libvirt-cim/lib/XenKvmLib/vsms.py	Fri Oct 10 13:03:57 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/vsms.py	Wed Oct 29 16:10:49 2008 -0700
@@ -174,7 +174,7 @@
     pass
 
 class CIM_ProcResourceAllocationSettingData(CIMClassMOF):
-    def __init__(self, vcpu, name, weight=None, limit=None):
+    def __init__(self, name, vcpu=None, weight=None, limit=None):
         self.ResourceType = RASD_TYPE_PROC
         
         if vcpu != None:
diff -r 3648a3f070f3 -r 3fe31c4399cc suites/libvirt-cim/lib/XenKvmLib/vxml.py
--- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py	Fri Oct 10 13:03:57 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py	Wed Oct 29 16:10:49 2008 -0700
@@ -472,7 +472,10 @@
                                               mac=net_mac,
                                               name=dom_name,
                                               virt_net=net_name)
-        self.pasd = vsms.get_pasd_class(virt)(vcpu=vcpus, name=dom_name)
+        if virt == 'LXC':
+            self.pasd = vsms.get_pasd_class(virt)(name=dom_name)
+        else:
+            self.pasd = vsms.get_pasd_class(virt)(vcpu=vcpus, name=dom_name)
         self.masd = vsms.get_masd_class(virt)(megabytes=mem, 
                                               mallocunits=mem_allocunits,
                                               name=dom_name)




More information about the Libvirt-cim mailing list