[Libvirt-cim] [PATCH] [TEST] Updating rasd.py to include floppy changes and direct net type changes

Sharad Mishra snmishra at us.ibm.com
Wed Mar 24 18:21:33 UTC 2010


+1

Sharad Mishra
Open Virtualization
Linux Technology Center
IBM


                                                                           
             "Deepti B.                                                    
             Kalakeri"                                                     
             <deeptik at linux.vn                                          To 
             et.ibm.com>               libvirt-cim at redhat.com              
             Sent by:                                                   cc 
             libvirt-cim-bounc                                             
             es at redhat.com                                         Subject 
                                       [Libvirt-cim] [PATCH] [TEST]        
                                       Updating rasd.py to include floppy  
             03/15/2010 06:16          changes and direct	net type    
             AM                        changes                             
                                                                           
                                                                           
             Please respond to                                             
                 List for                                                  
              discussion and                                               
              development of                                               
              libvirt CIM                                               
             <libvirt-cim at redh                                             
                  at.com>                                                  
                                                                           
                                                                           




# HG changeset patch
# User Deepti B. Kalakeri<deeptik at linux.vnet.ibm.com>
# Date 1268658975 14400
# Node ID 888ca94fdbc69076a8ab2f7dd805d314b3dbb27d
# Parent  a576cb1c855a8f507d7ec38c49467bfb018b46b7
[TEST] Updating rasd.py to include floppy changes and direct net type
changes.

This test fixes the SettingsDefineCapabilities/01_forward.py  and
HostSystem -t 03_hs_to_settdefcap.py.

The test has been verified with KVM and Xen on current Libvirt-CIM Sources.
Signed-off-by: Deepti B. Kalakeri <deeptik at linux.vnet.ibm.com>

diff -r a576cb1c855a -r 888ca94fdbc6
suites/libvirt-cim/lib/XenKvmLib/rasd.py
--- a/suites/libvirt-cim/lib/XenKvmLib/rasd.py		 Tue Feb 02 12:30:20
2010 -0800
+++ b/suites/libvirt-cim/lib/XenKvmLib/rasd.py		 Mon Mar 15 09:16:15
2010 -0400
@@ -324,6 +324,8 @@
     libvirt_rasd_template_changes = 707
     libvirt_rasd_new_changes = 805
     libvirt_rasd_dpool_changes = 839
+    libvirt_rasd_floppy_changes = 1023
+    libvirt_rasd_stvol_unit_changes = 1025

     libvirt_ver = virsh_version(ip, virt)

@@ -334,6 +336,13 @@
     # StoragePoolRASD record 1 for each of Min, Max, Default, and Incr
     exp_storagevol_rasd = 4
     exp_len = exp_base_num
+
+    # StoragePoolRASD record with AllocationUnits=G 1 for each \
+    # of Min, Max, Default,  Incr
+    exp_storagevol_unit_changes = 4
+
+    # Floppy record 1 for each of Min, Max, Default, and Incr
+    exp_floppy = 4

     if id == "DiskPool/0":
         pool_types = 7
@@ -350,7 +359,11 @@

         elif rev >= libvirt_rasd_dpool_changes and libvirt_ver >= '0.4.1':
             volumes = enum_volumes(virt, ip)
-            exp_len = ((volumes * exp_base_num) + exp_cdrom) * xen_multi
+            if rev >= libvirt_rasd_floppy_changes:
+                exp_len = ((volumes * exp_base_num) + \
+                           exp_cdrom + exp_floppy) * xen_multi
+            else:
+                exp_len = ((volumes * exp_base_num) + exp_cdrom) *
xen_multi

         else:
             exp_len = (exp_base_num + exp_cdrom) * xen_multi
@@ -363,16 +376,28 @@
         elif rev >= libvirt_rasd_dpool_changes:
             id = parse_instance_id(id)
             volumes = enum_volumes(virt, ip, id[1])
-            exp_len = (volumes * exp_base_num) + exp_cdrom

-    if rev >= libvirt_rasd_storagepool_changes and libvirt_ver >= '0.4.1'
\
-       and virt != 'LXC':
-        exp_len += exp_storagevol_rasd
+            if rev >= libvirt_rasd_floppy_changes:
+                exp_len = (volumes * exp_base_num) + exp_cdrom +
exp_floppy
+            else:
+                exp_len = (volumes * exp_base_num) + exp_cdrom
+
+
+    if virt != 'LXC' and libvirt_ver >= '0.4.1':
+        if rev >= libvirt_rasd_storagepool_changes:
+            exp_len += exp_storagevol_rasd
+
+        if rev >= libvirt_rasd_stvol_unit_changes:
+            exp_len +=  exp_storagevol_unit_changes

     return exp_len

 def get_exp_net_rasd_len(virt, rev, id):
     net_rasd_template_changes = 861
+    net_rasd_direct_nettype_changes = 1029
+
+    # NetRASD record for Direct NetType 1 for each min, max, incr, default
+    exp_direct = 4

     exp_base_num = 4

@@ -385,8 +410,12 @@
     if rev >= net_rasd_template_changes:
         dev_types = 2
         net_types = 3
+        exp_base_num = exp_base_num * dev_types * net_types

-        return exp_base_num * dev_types * net_types
+		 if rev >= net_rasd_direct_nettype_changes:
+            exp_base_num += exp_direct
+
+        return exp_base_num

     return exp_base_num


_______________________________________________
Libvirt-cim mailing list
Libvirt-cim at redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-cim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-cim/attachments/20100324/4acd4da6/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvirt-cim/attachments/20100324/4acd4da6/attachment.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic14601.gif
Type: image/gif
Size: 1255 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvirt-cim/attachments/20100324/4acd4da6/attachment-0001.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ecblank.gif
Type: image/gif
Size: 45 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvirt-cim/attachments/20100324/4acd4da6/attachment-0002.gif>


More information about the Libvirt-cim mailing list