
# HG changeset patch # User Deepti B. Kalakeri <deeptik@linux.vnet.ibm.com> # Date 1251275502 25200 # Node ID bd5411ebb634f6cf0945aa4e2f6896eb4221c03f # Parent 3c09a49a30f4bc1e6544736612508d3f99308083 [TEST] Adding vol_list to xm_virt_util.py. Tested with KVM on F11 with current sources. Signed-off-by: Deepti B. Kalakeri <deeptik@linux.vnet.ibm.com> diff -r 3c09a49a30f4 -r bd5411ebb634 suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py --- a/suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py Mon Aug 24 13:28:13 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py Wed Aug 26 01:31:42 2009 -0700 @@ -237,6 +237,17 @@ return names +def vol_list(server, virt="KVM", pool_name=None): + """ Function to list the volumes part of a pool""" + + cmd = " virsh -c %s vol-list %s | sed -e '1,2 d' -e '$ d'" \ + % (virt2uri(virt), pool_name) + ret, out = utils.run_remote(server, cmd) + if ret != 0: + return None + + return out + def virsh_vcpuinfo(server, dom, virt="Xen"): cmd = "virsh -c %s vcpuinfo %s | grep VCPU | wc -l" % (virt2uri(virt), dom)