Blob Blame Raw
From c197d163ccbd2997d400942e14442257dd9d2285 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Wed, 27 Feb 2019 11:08:25 +0000
Subject: [PATCH 05/13] Fix input devices for ARMv7 and aarch64

The Arm architectures don't work well with the legacy ps2 bits causing
issues with graphical output. Qemu also doesn't, due to a historical
oversight, automatically setup input so we need to do it here else
graphical out and hence screenshots don't work.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
 oz/Guest.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/oz/Guest.py b/oz/Guest.py
index 4e74fe1..418b888 100644
--- a/oz/Guest.py
+++ b/oz/Guest.py
@@ -255,7 +255,10 @@ class Guest(object):
             self.clockoffset = "utc"
         self.mousetype = mousetype
         if self.mousetype is None:
-            self.mousetype = "ps2"
+            if self.tdl.arch in ["aarch64", "armv7l"]:
+                self.mousetype = "usb"
+            else:
+                self.mousetype = "ps2"
         if diskbus is None or diskbus == "ide":
             self.disk_bus = "ide"
             self.disk_dev = "hda"
@@ -512,6 +515,11 @@ class Guest(object):
         elif self.mousetype == "usb":
             mousedict['type'] = 'tablet'
         oz.ozutil.lxml_subelement(devices, "input", None, mousedict)
+        if self.tdl.arch in ["aarch64", "armv7l"] and self.libvirt_type == "kvm":
+            # Other arches add a keyboard by default, for historical reasons ARM doesn't
+            # so we add it here so graphical works and hence we can get debug screenshots RHBZ 1538637
+            oz.ozutil.lxml_subelement(devices, 'controller', None, {'type': 'usb', 'index': '0'})
+            oz.ozutil.lxml_subelement(devices, 'input', None, {'type': 'keyboard', 'bus': 'usb'})
         # serial console pseudo TTY
         console = oz.ozutil.lxml_subelement(devices, "serial", None, {'type': 'pty'})
         oz.ozutil.lxml_subelement(console, "target", None, {'port': '0'})
-- 
2.20.1