Make sure we're not trying to generate a graphics device on s390
which fails every testcase starting a domain.
For this purpose a new utility function has been provided to
query the hypervisor node's CPU model.
Signed-off-by: Viktor Mihajlovski <mihajlov(a)linux.vnet.ibm.com>
---
suites/libvirt-cim/lib/XenKvmLib/vxml.py | 5 +++--
suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py | 7 +++++++
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/suites/libvirt-cim/lib/XenKvmLib/vxml.py
b/suites/libvirt-cim/lib/XenKvmLib/vxml.py
index 82ab501..74c4f23 100644
--- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py
+++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py
@@ -41,7 +41,7 @@ from time import sleep
from VirtLib import utils, live
from XenKvmLib.xm_virt_util import get_bridge_from_network_xml, bootloader, \
- net_list
+ net_list, host_cpu_model
from XenKvmLib.test_doms import set_uuid, viruuid
from XenKvmLib import vsms
from XenKvmLib import const
@@ -650,7 +650,8 @@ class VirtCIM:
curr_cim_rev, changeset = get_provider_version(self.virt, ip)
if curr_cim_rev >= vsms_graphics_sup:
- if self.gasd is not None:
+ if self.gasd is not None and \
+ not str(host_cpu_model(ip, self.virt)).startswith('s390'):
res_settings.append(str(self.gasd))
if curr_cim_rev >= vsms_inputdev_sup:
diff --git a/suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py
b/suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py
index 7749fb7..33edd6a 100644
--- a/suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py
+++ b/suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py
@@ -417,3 +417,10 @@ def network_macs(ip, vs_name):
return ret
+def host_cpu_model(server, virt="KVM"):
+ cmd = "virsh -c %s nodeinfo 2>/dev/null | grep 'CPU model'" %
virt2uri(virt)
+ ret, out = utils.run_remote(server, cmd)
+ if ret != 0:
+ return None
+ left, right = out.split(':')
+ return right.strip()
--
1.7.9.5