virt-manager/virtinst-graphics-add-check-for-qemu-modules-in-spice-graphic.patch
Charles Arnold 52d4ba61c3 Accepting request 844150 from home:bfrogers:branches:Virtualization
- boo#1178141 - Accomodate qemu modularization with respect to
  spice and spice related optional modules. If full spice support
  is not detected due to missing qemu modules (v5.1 qemu and newer),
  use vnc as the default install-time graphics type used

OBS-URL: https://build.opensuse.org/request/show/844150
OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=518
2020-10-26 18:51:31 +00:00

58 lines
2.4 KiB
Diff

From 2919f40ac931dce5dedf326f84e83e8c04e1fabe Mon Sep 17 00:00:00 2001
From: Bruce Rogers <brogers@suse.com>
Date: Sat, 24 Oct 2020 08:10:29 -0600
Subject: [PATCH] graphics: add check for qemu modules in spice graphics
detection
For SLE and openSUSE qemu, starting with v5.1, spice and spice related
qemu modules have been split away from the main system emulator and
are packaged as Recommends, meaning that they may not be present.
Up to now virt-manager has assumed spice is available for x86 qemu, but
that is no longer the case. Unfortunately the standard libvirt feature
detection can't yet help us out here, so we leapfrog libvirt by doing
our own detection of whether the qemu modules needed to support the
default guest install using spice, usb redirection, and qxl video are
present.
Signed-off-by: Bruce Rogers <brogers@suse.com>
---
virtinst/devices/graphics.py | 9 +++++++++
virtinst/support.py | 1 +
2 files changed, 10 insertions(+)
diff --git a/virtinst/devices/graphics.py b/virtinst/devices/graphics.py
index a514b455..f5083e68 100644
--- a/virtinst/devices/graphics.py
+++ b/virtinst/devices/graphics.py
@@ -135,6 +135,15 @@ class DeviceGraphics(Device):
# Spice has issues on some host arches, like ppc, so allow it
if self.conn.caps.host.cpu.arch not in ["i686", "x86_64"]:
return False
+ if self.conn.support.conn_spice_modular():
+ if self.conn.caps.host.cpu.arch in ["x86_64"]:
+ if not (os.path.exists("/usr/lib64/qemu/hw-usb-redirect.so") and
+ os.path.exists("/usr/lib64/qemu/hw-display-qxl.so")):
+ return False
+ else:
+ if not (os.path.exists("/usr/lib/qemu/hw-usb-redirect.so") and
+ os.path.exists("/usr/lib/qemu/hw-display-qxl.so")):
+ return False
return True
def _listen_need_port(self):
diff --git a/virtinst/support.py b/virtinst/support.py
index de73629e..29dad32b 100644
--- a/virtinst/support.py
+++ b/virtinst/support.py
@@ -281,6 +281,7 @@ class SupportCache:
conn_disk_driver_name_qemu = _make(
hv_version={"qemu": 0, "xen": "4.2.0"},
hv_libvirt_version={"qemu": 0, "xen": "1.1.0"})
+ conn_spice_modular = _make(hv_version={"qemu": "5.1.0", "test": 0})
# Domain checks
domain_xml_inactive = _make(function="virDomain.XMLDesc", run_args=(),
--
2.29.0