7ffc87
From c197d163ccbd2997d400942e14442257dd9d2285 Mon Sep 17 00:00:00 2001
7ffc87
From: Peter Robinson <pbrobinson@gmail.com>
7ffc87
Date: Wed, 27 Feb 2019 11:08:25 +0000
7ffc87
Subject: [PATCH 05/13] Fix input devices for ARMv7 and aarch64
7ffc87
7ffc87
The Arm architectures don't work well with the legacy ps2 bits causing
7ffc87
issues with graphical output. Qemu also doesn't, due to a historical
7ffc87
oversight, automatically setup input so we need to do it here else
7ffc87
graphical out and hence screenshots don't work.
7ffc87
7ffc87
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
7ffc87
---
7ffc87
 oz/Guest.py | 10 +++++++++-
7ffc87
 1 file changed, 9 insertions(+), 1 deletion(-)
7ffc87
7ffc87
diff --git a/oz/Guest.py b/oz/Guest.py
7ffc87
index 4e74fe1..418b888 100644
7ffc87
--- a/oz/Guest.py
7ffc87
+++ b/oz/Guest.py
7ffc87
@@ -255,7 +255,10 @@ class Guest(object):
7ffc87
             self.clockoffset = "utc"
7ffc87
         self.mousetype = mousetype
7ffc87
         if self.mousetype is None:
7ffc87
-            self.mousetype = "ps2"
7ffc87
+            if self.tdl.arch in ["aarch64", "armv7l"]:
7ffc87
+                self.mousetype = "usb"
7ffc87
+            else:
7ffc87
+                self.mousetype = "ps2"
7ffc87
         if diskbus is None or diskbus == "ide":
7ffc87
             self.disk_bus = "ide"
7ffc87
             self.disk_dev = "hda"
7ffc87
@@ -512,6 +515,11 @@ class Guest(object):
7ffc87
         elif self.mousetype == "usb":
7ffc87
             mousedict['type'] = 'tablet'
7ffc87
         oz.ozutil.lxml_subelement(devices, "input", None, mousedict)
7ffc87
+        if self.tdl.arch in ["aarch64", "armv7l"] and self.libvirt_type == "kvm":
7ffc87
+            # Other arches add a keyboard by default, for historical reasons ARM doesn't
7ffc87
+            # so we add it here so graphical works and hence we can get debug screenshots RHBZ 1538637
7ffc87
+            oz.ozutil.lxml_subelement(devices, 'controller', None, {'type': 'usb', 'index': '0'})
7ffc87
+            oz.ozutil.lxml_subelement(devices, 'input', None, {'type': 'keyboard', 'bus': 'usb'})
7ffc87
         # serial console pseudo TTY
7ffc87
         console = oz.ozutil.lxml_subelement(devices, "serial", None, {'type': 'pty'})
7ffc87
         oz.ozutil.lxml_subelement(console, "target", None, {'port': '0'})
7ffc87
-- 
7ffc87
2.20.1
7ffc87