+1 from me.

Best,
Regards

Daisy (Ô˹úÁ«)
VSM Team, China Systems & Technology Labs (CSTL)
E-mail: yunguol@cn.ibm.com
TEL: (86)-21-60922403
Building 10, 399 Ke Yuan Rd, Pudong Shanghai, 201203



Kaitlin Rupert <kaitlin@linux.vnet.ibm.com>
Sent by: libvirt-cim-bounces@redhat.com

2008-11-06 08:40
Please respond to
List for discussion and development of libvirt CIM        <libvirt-cim@redhat.com>

To
libvirt-cim@redhat.com
cc
Subject
[Libvirt-cim] [PATCH] [TEST] Fix VSMS 14_define_sys_disk.py to        specify FV or PV disk for Xen guests





# HG changeset patch
# User Kaitlin Rupert <karupert@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@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)


_______________________________________________
Libvirt-cim mailing list
Libvirt-cim@redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-cim