[Libvirt-cim] [PATCH] [TEST] Fix VSMS 14_define_sys_disk.py to specify FV or PV disk for Xen guests

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Thu Nov 6 00:40:50 UTC 2008


# HG changeset patch
# User Kaitlin Rupert <karupert at us.ibm.com>
# Date 1225932047 28800
# Node ID 78c534011b848cade45897c0c35dac4ebc53fce1
# Parent  ddd395416461b33536e9475521548ba8e2c16d84
[TEST] Fix VSMS 14_define_sys_disk.py to specify FV or PV disk for Xen guests.

Without this fix, both FV and PV rasds are passed to the DefineSystem() call
which isn't valid on PV systems.

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

diff -r ddd395416461 -r 78c534011b84 suites/libvirt-cim/cimtest/VirtualSystemManagementService/14_define_sys_disk.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/14_define_sys_disk.py	Tue Nov 04 22:19:33 2008 -0800
+++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/14_define_sys_disk.py	Wed Nov 05 16:40:47 2008 -0800
@@ -48,18 +48,22 @@
 
     return path
 
-def get_vssd_rasd(ip, virt, addr):
+def get_vssd_rasd(ip, virt, addr, disk_type):
     vssd = get_vssd_mof(virt, test_dom)
 
     rasds = get_default_rasds(ip, virt)
 
-    for i in range(len(rasds)):
-        if 'DiskPool' in rasds[i]['PoolID']:
-            rasds[i]['Address'] = addr
-        rasds[i] = inst_to_mof(rasds[i])
+    rasd_list = []
+
+    for rasd in rasds:
+        if 'DiskPool' in rasd['PoolID']:
+            if disk_type != "" and rasd['Caption'] != disk_type:
+                continue
+            rasd['Address'] = addr
+        rasd_list.append(inst_to_mof(rasd))
 
     params = { 'vssd' : vssd,
-               'rasd' : rasds
+               'rasd' : rasd_list 
              }
 
     return params 
@@ -68,12 +72,19 @@
 def main():
     options = main.options
 
+    if options.virt == "Xen":
+        disk_cap = "PV disk"
+    elif options.virt == "XenFV":
+        disk_cap = "FV disk"
+    else:
+        disk_cap = "" 
+
     try:
         addr = make_long_disk_path(options.ip)
         if addr is None:
             raise Exception("Unable to create large disk image")
 
-        define_params = get_vssd_rasd(options.ip, options.virt, addr)
+        define_params = get_vssd_rasd(options.ip, options.virt, addr, disk_cap)
         if len(define_params) != 2:
             raise Exception("Unable to get VSSD and RASDs for %s" %  test_dom)
 




More information about the Libvirt-cim mailing list