# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1230554983 28800
# Node ID 7ff2982fa8c146251ba93d030da5024dae5ffa6d
# Parent 5849e413cc6e3d3330d11fbda9e9b954af774ac0
[TEST]Fixing get_hv_version() of xm_virt_util.py lib.
The command virsh -c qemu:///system version does not work on F10.
Hence this workaround for F10.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 5849e413cc6e -r 7ff2982fa8c1 suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py
--- a/suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py Tue Dec 23 13:51:22 2008 -0800
+++ b/suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py Mon Dec 29 04:49:43 2008 -0800
@@ -231,7 +231,18 @@
return None
def get_hv_ver(server, virt="Xen"):
- cmd = "virsh -c %s version | grep ^Running | cut -d ' ' -f 3,4"
%virt2uri(virt)
+ cmd = "virsh -c %s version" %virt2uri(virt)
+ ret, out = utils.run_remote(server, cmd)
+ if ret == 0:
+ cmd = "virsh -c %s version | grep ^Running | cut -d ' ' -f 3,4"
\
+ %virt2uri(virt)
+
+ # This is a workaround work for F10.
+ # The version option does not seem to work on F10.
+ if ret != 0 and virt == 'KVM':
+ cmd = "qemu-kvm --help | grep -i version | tr -s [:space:] |" \
+ " cut -d ' ' -f 1,5"
+
ret, out = utils.run_remote(server, cmd)
if ret == 0:
return out