# HG changeset patch
# User Zhengang Li <lizg(a)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(a)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':
Show replies by date
ZL> + self.Kernel = vxml.XenXML.kernel_path
ZL> + self.Ramdisk = vxml.XenXML.init_path
I assume that this will not cause a problem if the test domain does
not have a kernel/initrd set?
--
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: danms(a)us.ibm.com
Dan Smith wrote:
ZL> + self.Kernel = vxml.XenXML.kernel_path
ZL> + self.Ramdisk = vxml.XenXML.init_path
I assume that this will not cause a problem if the test domain does
not have a kernel/initrd set?
It falls in the para-virt part. So KVM and XenFV
won't get this set.
We'll revisit LxC later when that's ready.
------------------------------------------------------------------------
_______________________________________________
Libvirt-cim mailing list
Libvirt-cim(a)redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-cim
--
- Zhengang
ZL> It falls in the para-virt part. So KVM and XenFV won't get this
ZL> set. We'll revisit LxC later when that's ready.
Right, but what about a paravirt test domain that uses a bootloader
and does not have a specific kernel/ramdisk?
--
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: danms(a)us.ibm.com
Dan Smith wrote:
ZL> It falls in the para-virt part. So KVM and XenFV won't get
this
ZL> set. We'll revisit LxC later when that's ready.
Right, but what about a paravirt test domain that uses a bootloader
and does not have a specific kernel/ramdisk?
I'm not aware of this. Can you
give me an example?
------------------------------------------------------------------------
_______________________________________________
Libvirt-cim mailing list
Libvirt-cim(a)redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-cim
--
- Zhengang
ZL> I'm not aware of this. Can you give me an example?
I went digging to try to figure out the answer to my question, and I
think I've got it. I'll apply.
--
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: danms(a)us.ibm.com