oz/fixes-and-enhancements.patch

367 lines
14 KiB
Diff

From 777a40e5dbd3a690cb8aaaa6458a8c5f2c4994ca Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Wed, 23 Jan 2019 03:00:08 +0000
Subject: [PATCH 01/11] Clarify bugzilla instance for bug references
Substitute BZ -> RHBZ to clarify BZ locations.
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
oz/Guest.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/oz/Guest.py b/oz/Guest.py
index 4f66c2f..034749d 100644
--- a/oz/Guest.py
+++ b/oz/Guest.py
@@ -465,7 +465,7 @@ class Guest(object):
oz.ozutil.lxml_subelement(features, "pae")
# CPU
if self.tdl.arch in ["aarch64", "armv7l"] and self.libvirt_type == "kvm":
- # Possibly related to BZ 1171501 - need host passthrough for aarch64 and arm with kvm
+ # Possibly related to RHBZ 1171501 - need host passthrough for aarch64 and arm with kvm
cpu = oz.ozutil.lxml_subelement(domain, "cpu", None, {'mode': 'custom', 'match': 'exact'})
oz.ozutil.lxml_subelement(cpu, "model", "host", {'fallback': 'allow'})
# os
@@ -597,7 +597,7 @@ class Guest(object):
capacity = size
if backing_filename:
- # FIXME: Revisit as BZ 958510 evolves
+ # FIXME: Revisit as RHBZ 958510 evolves
# At the moment libvirt forces us to specify a size rather than
# assuming we want to inherit the size of our backing file.
# It may be possible to avoid this inspection step if libvirt
--
2.20.1
From 9ddffbbbb177e342ab1c806939ce857e87c71232 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Wed, 23 Jan 2019 03:05:22 +0000
Subject: [PATCH 02/11] Add the latest location for EDK2 OVMF firmware location
The Tianocore EDK2 OVMF firmware can now often be found in the
/usr/share/edk2/ovmf location so add this as an extra option.
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
oz/ozutil.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/oz/ozutil.py b/oz/ozutil.py
index 273a028..989c9d4 100644
--- a/oz/ozutil.py
+++ b/oz/ozutil.py
@@ -1050,6 +1050,8 @@ def find_uefi_firmware(arch):
elif arch in ['x86_64']:
uefi_list = [UEFI('/usr/share/OVMF/OVMF_CODE.fd',
'/usr/share/OVMF/OVMF_VARS.fd'),
+ UEFI('/usr/share/edk2/ovmf/OVMF_CODE.fd',
+ '/usr/share/edk2/ovmf/OVMF_VARS.fd'),
UEFI('/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd',
'/usr/share/edk2.git/ovmf-x64/OVMF_VARS-pure-efi.fd')]
elif arch in ['aarch64']:
--
2.20.1
From faf1ac20ae6b6fb8ab4b9f511086a731e4175fc3 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Wed, 23 Jan 2019 03:12:50 +0000
Subject: [PATCH 03/11] Add check for TianoCore EDK2 firmware for ARMv7
There's now TianoCore EDK2 firmwares for ARMv7 so add a check to
see if they're available in preparation of building UEFI enabled
ARMv7 images.
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
oz/ozutil.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/oz/ozutil.py b/oz/ozutil.py
index 989c9d4..d6a4a28 100644
--- a/oz/ozutil.py
+++ b/oz/ozutil.py
@@ -1061,6 +1061,9 @@ def find_uefi_firmware(arch):
'/usr/share/edk2/aarch64/vars-template-pflash.raw'),
UEFI('/usr/share/edk2.git/aarch64/QEMU_EFI-pflash.raw',
'/usr/share/edk2.git/aarch64/vars-template-pflash.raw')]
+ elif arch in ['armv7l']:
+ uefi_list = [UEFI('/usr/share/edk2/arm/QEMU_EFI-pflash.raw',
+ '/usr/share/edk2/arm/vars-template-pflash.raw')]
else:
raise Exception("Invalid arch for UEFI firmware")
--
2.20.1
From 2ade14274caa2b99fbc8038d2b860c1175d009ca Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Wed, 23 Jan 2019 03:16:41 +0000
Subject: [PATCH 04/11] Check for UEFI EDK2 firmware on x86_64 and ARMv7 too
Add checks for EDK2 firmware on x86_64 and ARMv7 along side aarch64
as all those architectures support UEFI now and if the firmware is
available we should priortise UEFI over traditional methods.
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
oz/Guest.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/oz/Guest.py b/oz/Guest.py
index 034749d..8d9e319 100644
--- a/oz/Guest.py
+++ b/oz/Guest.py
@@ -484,7 +484,7 @@ class Guest(object):
if self.tdl.arch == "armv7l":
cmdline += " console=ttyAMA0"
oz.ozutil.lxml_subelement(osNode, "cmdline", cmdline)
- if self.tdl.arch == "aarch64":
+ if self.tdl.arch in ["x86_64", "aarch64", "armv7l"]:
loader, nvram = oz.ozutil.find_uefi_firmware(self.tdl.arch)
oz.ozutil.lxml_subelement(osNode, "loader", loader, {'readonly': 'yes', 'type': 'pflash'})
oz.ozutil.lxml_subelement(osNode, "nvram", None, {'template': nvram})
--
2.20.1
From a8727eb82aff624cb7e41e17aefbbc8dde8d4fe3 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Wed, 27 Feb 2019 10:42:25 +0000
Subject: [PATCH 05/11] drop ARMv7 special handling for console port
It's unnecessary and breaks grpahical output. Qemu generates a DT with all
the appropriate bits in it to setup the console.
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
oz/Guest.py | 2 --
1 file changed, 2 deletions(-)
diff --git a/oz/Guest.py b/oz/Guest.py
index 8d9e319..1c8c97c 100644
--- a/oz/Guest.py
+++ b/oz/Guest.py
@@ -481,8 +481,6 @@ class Guest(object):
if initrd:
oz.ozutil.lxml_subelement(osNode, "initrd", initrd)
if cmdline:
- if self.tdl.arch == "armv7l":
- cmdline += " console=ttyAMA0"
oz.ozutil.lxml_subelement(osNode, "cmdline", cmdline)
if self.tdl.arch in ["x86_64", "aarch64", "armv7l"]:
loader, nvram = oz.ozutil.find_uefi_firmware(self.tdl.arch)
--
2.20.1
From bc355031e72d546bd7af7f04a9702eaa030aeae9 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Wed, 27 Feb 2019 10:54:43 +0000
Subject: [PATCH 06/11] Add appropriate arch checks for architecture specific
features
In a lot of cases qemu just ignores incorrect cmd line options when run
against a different architecture but sometimes it causes issues so lets
add the appropriate checks to ensure no issues.
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
oz/Guest.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/oz/Guest.py b/oz/Guest.py
index 1c8c97c..e21098a 100644
--- a/oz/Guest.py
+++ b/oz/Guest.py
@@ -460,9 +460,11 @@ class Guest(object):
oz.ozutil.lxml_subelement(domain, "vcpu", str(self.install_cpus))
# features
features = oz.ozutil.lxml_subelement(domain, "features")
- oz.ozutil.lxml_subelement(features, "acpi")
- oz.ozutil.lxml_subelement(features, "apic")
- oz.ozutil.lxml_subelement(features, "pae")
+ if self.tdl.arch in ["aarch64", "x86_64"]:
+ oz.ozutil.lxml_subelement(features, "acpi")
+ if self.tdl.arch in ["x86_64"]:
+ oz.ozutil.lxml_subelement(features, "apic")
+ oz.ozutil.lxml_subelement(features, "pae")
# CPU
if self.tdl.arch in ["aarch64", "armv7l"] and self.libvirt_type == "kvm":
# Possibly related to RHBZ 1171501 - need host passthrough for aarch64 and arm with kvm
--
2.20.1
From d0ee021efc2cb638af2fec280298f80ca1122a74 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Wed, 27 Feb 2019 10:56:36 +0000
Subject: [PATCH 07/11] ARMv7 only supports GICv2 so we need to explicitly
define it
Add the GIC version to the cpu features list to ensure we get the right GIC
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
oz/Guest.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/oz/Guest.py b/oz/Guest.py
index e21098a..3db1c9e 100644
--- a/oz/Guest.py
+++ b/oz/Guest.py
@@ -465,6 +465,8 @@ class Guest(object):
if self.tdl.arch in ["x86_64"]:
oz.ozutil.lxml_subelement(features, "apic")
oz.ozutil.lxml_subelement(features, "pae")
+ if self.tdl.arch in ["armv7l"]:
+ oz.ozutil.lxml_subelement(features, "gic", attributes={'version': '2'})
# CPU
if self.tdl.arch in ["aarch64", "armv7l"] and self.libvirt_type == "kvm":
# Possibly related to RHBZ 1171501 - need host passthrough for aarch64 and arm with kvm
--
2.20.1
From 32c17a97c90e5714008e1aca487e145f366d1d67 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Wed, 27 Feb 2019 11:08:25 +0000
Subject: [PATCH 08/11] 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 3db1c9e..e423ed6 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
From 48b5e57e36d39645190a756b93e1c3806c929261 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Wed, 23 Jan 2019 03:19:21 +0000
Subject: [PATCH 09/11] Setup graphical console on all architectures except
s390x
The graphical console is now supported on all architectures except
s390x so set it up to enable screenshot fucntionality across all
supported architectures.
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
oz/Guest.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/oz/Guest.py b/oz/Guest.py
index e423ed6..ad35fb5 100644
--- a/oz/Guest.py
+++ b/oz/Guest.py
@@ -500,8 +500,8 @@ class Guest(object):
# devices
devices = oz.ozutil.lxml_subelement(domain, "devices")
# graphics
- if self.tdl.arch not in ["aarch64", "armv7l", "s390x"]:
- # qemu for arm/aarch64/s390x does not support a graphical console - amazingly
+ if not self.tdl.arch in ["s390x"]:
+ # qemu for s390x does not support a graphical console
oz.ozutil.lxml_subelement(devices, "graphics", None, {'port': '-1', 'type': 'vnc'})
# network
interface = oz.ozutil.lxml_subelement(devices, "interface", None, {'type': 'bridge'})
--
2.20.1
From ce0dde7a39d3ed3482bb81fc8c534ad98bc7ed50 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Wed, 27 Feb 2019 12:30:07 +0000
Subject: [PATCH 10/11] Default to using 2Gb on all architectures
The original 1Gb should be enough but RAM is cheap and sometimes things
like the initrd unexpectently bloat so 2Gb gives us room to move.
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
oz/Guest.py | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/oz/Guest.py b/oz/Guest.py
index ad35fb5..1e49527 100644
--- a/oz/Guest.py
+++ b/oz/Guest.py
@@ -178,13 +178,8 @@ class Guest(object):
1)
# the memory in the configuration file is specified in megabytes, but
# libvirt expects kilobytes, so multiply by 1024
- if self.tdl.arch in ["ppc64", "ppc64le"]:
- # ppc64 needs at least 2Gb RAM
- self.install_memory = int(oz.ozutil.config_get_key(config, 'libvirt',
+ self.install_memory = int(oz.ozutil.config_get_key(config, 'libvirt',
'memory', 2048)) * 1024
- else:
- self.install_memory = int(oz.ozutil.config_get_key(config, 'libvirt',
- 'memory', 1024)) * 1024
self.image_type = oz.ozutil.config_get_key(config, 'libvirt',
'image_type', 'raw')
--
2.20.1
From 0681aaf5a6b3309a242fbf5a09450e52cff01310 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Wed, 27 Feb 2019 16:07:38 +0000
Subject: [PATCH 11/11] Use better host-passthrough settings for qemu
The host-passthrough setting as set doesn't work for ARMv7 and the option
used for both aarch64 and ARMv7 by libvirt/virt-install.
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
oz/Guest.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/oz/Guest.py b/oz/Guest.py
index 1e49527..7e8f57c 100644
--- a/oz/Guest.py
+++ b/oz/Guest.py
@@ -468,8 +468,7 @@ class Guest(object):
# CPU
if self.tdl.arch in ["aarch64", "armv7l"] and self.libvirt_type == "kvm":
# Possibly related to RHBZ 1171501 - need host passthrough for aarch64 and arm with kvm
- cpu = oz.ozutil.lxml_subelement(domain, "cpu", None, {'mode': 'custom', 'match': 'exact'})
- oz.ozutil.lxml_subelement(cpu, "model", "host", {'fallback': 'allow'})
+ cpu = oz.ozutil.lxml_subelement(domain, "cpu", None, {'mode': 'host-passthrough', 'check': 'none'})
# os
osNode = oz.ozutil.lxml_subelement(domain, "os")
mods = None
--
2.20.1