[Libvirt-cim] [PATCH 2 of 2] [TEST] Modify vsms.py and vxml.py to include vnc_passwd filed for GRASD

Deepti B. Kalakeri deeptik at linux.vnet.ibm.com
Mon Jul 20 09:15:08 UTC 2009


# HG changeset patch
# User Deepti B.Kalakeri <deeptik at linux.vnet.ibm.com>
# Date 1248081035 25200
# Node ID 7a453b4c7749159ee7e740dc7b8e0e6c69790ad0
# Parent  d8ce1c1e439da8f1f26bc65e1c192ba5d590445b
[TEST] Modify vsms.py and vxml.py to include vnc_passwd filed for GRASD.

Tested with KVM and current sources on F10 and SLES.

Signed-off-by: Deepti B. Kalakeri <deeptik at linux.vnet.ibm.com>

diff -r d8ce1c1e439d -r 7a453b4c7749 suites/libvirt-cim/lib/XenKvmLib/vsms.py
--- a/suites/libvirt-cim/lib/XenKvmLib/vsms.py	Mon Jul 20 02:09:38 2009 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/vsms.py	Mon Jul 20 02:10:35 2009 -0700
@@ -243,7 +243,7 @@
 
 class CIM_GraphicsResourceAllocationSettingData(CIMClassMOF):
     def __init__(self, name, res_sub_type="vnc", ip="127.0.0.1", 
-                 lport='-1', keymap="en-us"):
+                 lport='-1', keymap="en-us", vnc_passwd=None):
         self.InstanceID = '%s/graphics' %name
         self.ResourceType = RASD_TYPE_GRAPHICS
 
@@ -255,6 +255,9 @@
 
         if keymap != None:
            self.KeyMap = keymap
+        
+        if vnc_passwd != None:
+           self.Password = vnc_passwd
   
 
 class Xen_GraphicsResourceAllocationSettingData(CIM_GraphicsResourceAllocationSettingData):
diff -r d8ce1c1e439d -r 7a453b4c7749 suites/libvirt-cim/lib/XenKvmLib/vxml.py
--- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py	Mon Jul 20 02:09:38 2009 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py	Mon Jul 20 02:10:35 2009 -0700
@@ -558,7 +558,7 @@
     def __init__(self, virt, dom_name, disk_dev, disk_source,
                  net_type, net_name, net_mac, vcpus, mem,
                  mem_allocunits, emu_type, grstype, ip,
-                 port_num, kmap, irstype, btype):
+                 port_num, kmap, irstype, btype, vnc_passwd):
         self.virt = virt
         self.domain_name = dom_name
         self.err_rc = None
@@ -581,7 +581,8 @@
                                               name=dom_name)
         self.gasd = vsms.get_gasd_class(virt)(name=dom_name, 
                                               res_sub_type=grstype, ip=ip,
-                                              lport=port_num, keymap=kmap)
+                                              lport=port_num, keymap=kmap, 
+                                              vnc_passwd=vnc_passwd)
         self.iasd = vsms.get_iasd_class(virt)(name=dom_name, 
                                               res_sub_type=irstype, 
                                               bus_type=btype)
@@ -796,7 +797,7 @@
                        net_name=const.default_network_name,
                        emu_type=None, grstype="vnc", address="127.0.0.1",
                        port_num='-1', keymap="en-us", irstype="mouse", 
-                       btype="xen"): 
+                       btype="xen", vnc_passwd=None): 
         if not (os.path.exists(const.Xen_kernel_path) \
                 and os.path.exists(const.Xen_init_path)):
             logger.error('ERROR: Either the kernel image '
@@ -809,7 +810,7 @@
         VirtCIM.__init__(self, 'Xen', test_dom, disk, disk_file_path, 
                          ntype, net_name, mac, vcpus, mem, mem_allocunits, 
                          emu_type, grstype, address, port_num, keymap, irstype,
-                         btype)
+                         btype, vnc_passwd)
 
     def _os(self, os_kernel, os_initrd):
         os = self.get_node('/domain/os')
@@ -861,7 +862,7 @@
                        net_name=const.default_network_name,
                        emu_type=None, grstype="vnc", address="127.0.0.1",
                        port_num='-1', keymap="en-us", irstype="mouse", 
-                       btype="ps2"):
+                       btype="ps2", vnc_passwd=None):
         if not os.path.exists(disk_file_path):
             logger.error('Error: Disk image does not exist')
             sys.exit(1)
@@ -869,7 +870,7 @@
         VirtCIM.__init__(self, 'KVM', test_dom, disk, disk_file_path,
                          ntype, net_name, mac, vcpus, mem, 
                          mem_allocunits, emu_type, grstype, address, 
-                         port_num, keymap, irstype, btype)
+                         port_num, keymap, irstype, btype, vnc_passwd)
         self._os()
         self._devices(const.KVM_default_emulator, ntype,
                       disk_file_path, disk, mac, net_name)
@@ -916,7 +917,7 @@
                        net_name=const.default_network_name,
                        emu_type=None, grstype="vnc", 
                        address="127.0.0.1", port_num='-1', keymap="en-us",
-                       irstype="mouse", btype="ps2"):
+                       irstype="mouse", btype="ps2", vnc_passwd=None):
         if not os.path.exists(disk_file_path):
             logger.error('Error: Disk image does not exist')
             sys.exit(1)
@@ -924,7 +925,7 @@
         VirtCIM.__init__(self, 'XenFV', test_dom, disk, disk_file_path,
                          ntype, net_name, mac, vcpus, mem, mem_allocunits, 
                          emu_type, grstype, address, port_num, keymap, 
-                         irstype, btype)
+                         irstype, btype, vnc_passwd)
         self._features()
         self._os(const.XenFV_default_loader)
         self._devices(const.XenFV_default_emulator,
@@ -973,12 +974,12 @@
                        net_name=const.default_network_name,
                        tty=const.LXC_default_tty, grstype="vnc",
                        address="127.0.0.1", port_num='-1', keymap="en-us",
-                       irstype="mouse", btype="usb"):
+                       irstype="mouse", btype="usb", vnc_passwd=None):
         VirtXML.__init__(self, 'lxc', test_dom, set_uuid(), mem, vcpus)
         VirtCIM.__init__(self, 'LXC', test_dom, const.LXC_default_mp,
                          const.LXC_default_source, ntype, net_name, mac, vcpus,
                          mem, const.default_mallocunits, None, grstype, 
-                         address, port_num, keymap, irstype, btype)
+                         address, port_num, keymap, irstype, btype, vnc_passwd)
         self._os(const.LXC_init_path)
         self._devices(mac, ntype, net_name, const.LXC_default_tty)
         self.create_lxc_file(CIM_IP, const.LXC_init_path)




More information about the Libvirt-cim mailing list