
# HG changeset patch # User Deepti B. Kalakeri <deeptik@linux.vnet.ibm.com> # Date 1250847104 25200 # Node ID 4b9d9b5b54d1781fe35f24008aeb0fd14a5b10ac # Parent c338efef06278a9a40a90f07a34750ec50c49939 [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 c338efef0627 -r 4b9d9b5b54d1 suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py --- a/suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py Wed Aug 19 09:03:40 2009 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py Fri Aug 21 02:31:44 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)