[Libvirt-cim] [PATCH] [TEST] .2# Add kernel params in VSSD construction in vsms

lizg at cn.ibm.com lizg at cn.ibm.com
Fri Mar 28 13:47:36 UTC 2008


# HG changeset patch
# User Zhengang Li <lizg at cn.ibm.com>
# Date 1206712013 -28800
# Node ID c67d4960d4073c641beeb1fe5180862001c247ae
# Parent  877558f5cbe913300335b7069d8e21a6257638a4
[TEST] .2# Add kernel params in VSSD construction in vsms

Provider has added Kernel/Bootloader properties for para-virt. This is
the change to utilize those properties.

The non-default argument follows default argment error fixed in this
version.

Signed-off-by: Zhengang Li <lizg at cn.ibm.com>

diff -r 877558f5cbe9 -r c67d4960d407 suites/libvirt-cim/lib/XenKvmLib/vsms.py
--- a/suites/libvirt-cim/lib/XenKvmLib/vsms.py	Fri Mar 28 17:23:54 2008 +0800
+++ b/suites/libvirt-cim/lib/XenKvmLib/vsms.py	Fri Mar 28 21:46:53 2008 +0800
@@ -25,6 +25,7 @@ import pywbem
 import pywbem
 from CimTest.CimExt import CIMMethodClass, CIMClassMOF
 from CimTest import Globals
+from VirtLib import live
 from XenKvmLib import vxml
 from XenKvmLib.classes import get_typed_class, get_class_type, virt_types
 
@@ -33,6 +34,10 @@ RASD_TYPE_NET_ETHER = 10
 RASD_TYPE_NET_ETHER = 10
 RASD_TYPE_NET_OTHER = 11
 RASD_TYPE_DISK = 17
+
+VSSD_RECOVERY_NONE     = 2
+VSSD_RECOVERY_RESTART  = 3
+VSSD_RECOVERY_PRESERVE = 123
 
 def eval_cls(basename):
     def func(f):
@@ -81,17 +86,25 @@ def enumerate_instances(server, virt='Xe
 
 # classes to define VSSD parameters
 class CIM_VirtualSystemSettingData(CIMClassMOF):
-    def __init__(self, name='test_domain', set_vs_id = True):
+    def __init__(self, name, virt):
         type = get_class_type(self.__class__.__name__)
         self.InstanceID = '%s:%s' % (type, name)
         self.Caption = self.Description = 'Virtual System'
-        self.ElementName = name
+        self.VirtualSystemIdentifier = self.ElementName = name
         self.VirtualSystemType = type
         self.CreationClassName = self.__class__.__name__
-        self.isFullVirt = (type == 'KVM')
+        self.AutomaticShutdownAction = VSSD_RECOVERY_NONE
+        self.AutomaticRecoveryAction = VSSD_RECOVERY_NONE
+
+        self.isFullVirt = (type == 'KVM' or virt == 'XenFV')
+        if self.isFullVirt:
+            self.BootDevice = 'hd'
+        else:
+            self.Bootloader = live.bootloader(Globals.CIM_IP, 0)
+            self.BootloaderArgs = ''
+            self.Kernel = vxml.XenXML.kernel_path
+            self.Ramdisk = vxml.XenXML.init_path
  
-        if set_vs_id == True:
-            self.VirtualSystemIdentifier = name
 
 class Xen_VirtualSystemSettingData(CIM_VirtualSystemSettingData):
     pass
@@ -193,7 +206,7 @@ def default_vssd_rasd_str(dom_name='test
                           mem_mb=512,
                           virt='Xen'):
     class_vssd = get_vssd_class(virt)
-    vssd = class_vssd(name=dom_name)
+    vssd = class_vssd(name=dom_name, virt=virt)
 
     class_dasd = get_dasd_class(virt)
     if virt == 'KVM':




More information about the Libvirt-cim mailing list