[Libvirt-cim] [PATCH] [TEST] Fixing vsms/08_modifyresource.py

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Thu Dec 10 22:58:13 UTC 2009


Deepti B. Kalakeri wrote:
> # HG changeset patch
> # User Deepti B. Kalakeri<deeptik at linux.vnet.ibm.com
> # Date 1260446374 28800
> # Node ID e95a3d156fc2284484f98f07c39fbfd65929a395
> # Parent  683a8a57d54506032a659bdb9178b7558827ffde
> [TEST] Fixing vsms/08_modifyresource.py
> 
> Tested with KVM and current sources on Fedora
> Signed-off-by: Deepti B. Kalakeri <deeptik at linux.vnet.ibm.com>
> 
> diff -r 683a8a57d545 -r e95a3d156fc2 suites/libvirt-cim/lib/XenKvmLib/vsms_util.py
> --- a/suites/libvirt-cim/lib/XenKvmLib/vsms_util.py	Sat Dec 05 02:22:09 2009 -0200
> +++ b/suites/libvirt-cim/lib/XenKvmLib/vsms_util.py	Thu Dec 10 03:59:34 2009 -0800
> @@ -120,9 +120,10 @@
>          cxml.dumpxml(server)
>          dom = cxml.xml_get_dom_name()
>          cpu = virsh_vcpuinfo(server, dom, virt)
> -        if cpu is None:
> +        if int(cpu) < int(ncpu)  or cpu is None:

This works, but it's more of a work around.  In this case, vcpuinfo 
returns an error. When we check the output for the VCPU string, we get 
zero occurrences, which is what virsh_vcpuinfo() returns.

A better check would be to see if the virsh call returns an error.  If 
it does, virsh_vcpuinfo() should return None.  Otherwise, it should 
return an integer.

>              logger.info("Unable to get vcpuinfo from virsh, using XML values")
>              cpu = cxml.xml_get_vcpu()
> +
>          if int(cpu) != int(ncpu):
>              logger.error("Got %d, exp %d.", int(cpu), int(ncpu))
>              raise Exception('Error changing rs for vcpu')
> 
> _______________________________________________
> Libvirt-cim mailing list
> Libvirt-cim at redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-cim


-- 
Kaitlin Rupert
IBM Linux Technology Center
kaitlin at linux.vnet.ibm.com




More information about the Libvirt-cim mailing list