+1.
We have some clean-up to do so it's not an urgent matter, but it we need
to improve the code documentation so that future developers can make
sense of vsi -> exp_base_num = 4. I don't have access to VSI HW so I'm
not sure I can validate that assumption. Otherwise, the code change look
fine.
On 01/14/2011 10:51 AM, Sharad Mishra wrote:
# HG changeset patch
# User Sharad Mishra<snmishra(a)us.ibm.com>
# Date 1295017601 28800
# Node ID a226c6d2bccad847da03d29746b8f2c821957517
# Parent bb3fbbcdfd16998662bc8187dcdac95f959473d0
[TEST] Updated test case for VSI.
libvirt-cim netpool template was changed to support VSI
and this test has been updated to reflect the new template
count.
Signed-off-by: Sharad Mishra<snmishra(a)us.ibm.com>
diff -r bb3fbbcdfd16 -r a226c6d2bcca suites/libvirt-cim/lib/XenKvmLib/rasd.py
--- a/suites/libvirt-cim/lib/XenKvmLib/rasd.py Fri Jan 14 06:56:10 2011 -0800
+++ b/suites/libvirt-cim/lib/XenKvmLib/rasd.py Fri Jan 14 07:06:41 2011 -0800
@@ -395,11 +395,14 @@
def get_exp_net_rasd_len(virt, rev, id):
net_rasd_template_changes = 861
net_rasd_direct_nettype_changes = 1029
+ net_rasd_vsi_nettype_changes = 1043
# NetRASD record for Direct NetType 1 for each min, max, incr, default
exp_direct = 4
exp_base_num = 4
+ dev_types = 2
+ net_types = 3
if id == "NetworkPool/0":
pool_types = 3
@@ -408,14 +411,13 @@
return (exp_base_num * pool_types) + (exp_base_num * forward_modes)
if rev>= net_rasd_template_changes:
- dev_types = 2
- net_types = 3
exp_base_num = exp_base_num * dev_types * net_types
- if rev>= net_rasd_direct_nettype_changes:
- exp_base_num += exp_direct
+ if rev>= net_rasd_direct_nettype_changes:
+ exp_base_num += exp_direct
- return exp_base_num
+ if rev>= net_rasd_vsi_nettype_changes:
+ exp_base_num = 4 * (dev_types * net_types + exp_direct)
return exp_base_num
_______________________________________________
Libvirt-cim mailing list
Libvirt-cim(a)redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-cim