SHA256
1
0
forked from pool/qemu
qemu/seabios-switch-to-python3-as-needed.patch
Dario Faggioli e8c9119cb5 Accepting request 941047 from home:dfaggioli:devel:Virtualization
- Add an audio-oss sub-package
- Add some new (mostly documentation) files in the package
- Remove option --audio-drv-list because audio is detected by
  meson automatically in latest version. 
- Remove options --disable-jemalloc and --disable-tcmalloc
  which are changed in v6.2.0. 
- Update to v 6.2.0. For full release notese, see:
  * https://wiki.qemu.org/ChangeLog/6.2.
  Be sure to also check the following pages:
  * https://qemu-project.gitlab.io/qemu/about/removed-features.html
  * https://qemu-project.gitlab.io/qemu/about/deprecated.html
  Some notable changes:
  * virtio-mem: guest memory dumps are now fully supported, along
    with pre-copy/post-copy migration and background guest snapshots
  * QMP: support for nw DEVICE_UNPLUG_GUEST_ERROR to detect
    guest-reported hotplug failures
  * TCG: improvements to TCG plugin argument syntax, and multi-core
    support for cache plugin
  * 68k: improved support for Apple’s NuBus, including ability to
    load declaration ROMs, and slot IRQ support
  * ARM: macOS hosts with Apple Silicon CPUs now support ‘hvf’
    accelerator for AArch64 guests
  * ARM: emulation support for Fujitsu A64FX processor model
  * ARM: emulation support for kudo-mbc machine type
  * ARM: M-profile MVE extension is now supported for Cortex-M55
  * ARM: ‘virt’ machine now supports an emulated ITS (Interrupt
    Translation Service) and supports more than 123 CPUs in
    emulation mode
  * ARM: xlnx-zcu102 and xlnx-versal-virt machines now support
    BBRAM and eFUSE devices
  * PowerPC: improved POWER10 support for the ‘powernv’ machine type
  * PowerPC: initial support for POWER10 DD2.0 CPU model
  * PowerPC: support for FORM2 PAPR NUMA descriptions for ‘pseries’ machine type
  * RISC-V: support for Zb[abcs] instruction set extensions
  * RISC-V: support for vhost-user and numa mem options across all boards
  * RISC-V: SiFive PWM support
  * x86: support for new Snowridge-v4 CPU model
  * x86: guest support for Intel SGX
  * x86: AMD SEV guests now support measurement of kernel binary when doing
    direct kernel boot (not using a bootloader)
* Patches dropped:
  9pfs-fix-crash-in-v9fs_walk.patch
  block-introduce-max_hw_iov-for-use-in-sc.patch
  hmp-Unbreak-change-vnc.patch
  hw-acpi-ich9-Add-compat-prop-to-keep-HPC.patch
  hw-i386-acpi-build-Deny-control-on-PCIe-.patch
  i386-cpu-Remove-AVX_VNNI-feature-from-Co.patch
  net-vmxnet3-validate-configuration-value.patch
  pcie-rename-native-hotplug-to-x-native-h.patch
  plugins-do-not-limit-exported-symbols-if.patch
  plugins-execlog-removed-unintended-s-at-.patch
  qemu-nbd-Change-default-cache-mode-to-wr.patch
  qemu-sockets-fix-unix-socket-path-copy-a.patch
  target-arm-Don-t-skip-M-profile-reset-en.patch
  target-i386-add-missing-bits-to-CR4_RESE.patch
  tcg-arm-Fix-tcg_out_vec_op-function-sign.patch
  uas-add-stream-number-sanity-checks.patch
  vhost-vsock-fix-migration-issue-when-seq.patch
  virtio-balloon-don-t-start-free-page-hin.patch
  virtio-mem-pci-Fix-memory-leak-when-crea.patch
  virtio-net-fix-use-after-unmap-free-for-.patch

OBS-URL: https://build.opensuse.org/request/show/941047
OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=681
2021-12-17 10:07:39 +00:00

150 lines
6.5 KiB
Diff

From: Bruce Rogers <brogers@suse.com>
Date: Thu, 27 Jun 2019 10:15:24 -0600
Subject: seabios: switch to python3 as needed
Switch to python3 the places where "python2" is explicitly referenced.
(Ignore the uses of #!/usr/bin/env python, since that usage does the
right thing in our build environment).
Include changes proposed by the python3 2to3 tool.
Signed-off-by: Bruce Rogers <brogers@suse.com>
---
Makefile | 2 +-
scripts/acpi_extract.py | 4 ++--
scripts/acpi_extract_preprocess.py | 2 +-
scripts/layoutrom.py | 28 ++++++++++++++--------------
scripts/vgafixup.py | 2 +-
5 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/roms/seabios/Makefile b/roms/seabios/Makefile
index 418a0e3649443ee89e8fdad436f5..408983026669e531dcb84230dd23 100644
--- a/roms/seabios/Makefile
+++ b/roms/seabios/Makefile
@@ -22,7 +22,7 @@ LD=$(CROSS_PREFIX)ld
OBJCOPY=$(CROSS_PREFIX)objcopy
OBJDUMP=$(CROSS_PREFIX)objdump
STRIP=$(CROSS_PREFIX)strip
-PYTHON=python2
+PYTHON=python3
CPP=cpp
IASL:=iasl
LD32BIT_FLAG:=-melf_i386
diff --git a/roms/seabios/scripts/acpi_extract.py b/roms/seabios/scripts/acpi_extract.py
index 86c6226c0f9aae4e4687cf216369..7ac054e626780253fcec78414b17 100755
--- a/roms/seabios/scripts/acpi_extract.py
+++ b/roms/seabios/scripts/acpi_extract.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python2
+#!/usr/bin/python3
# Copyright (C) 2011 Red Hat, Inc., Michael S. Tsirkin <mst@redhat.com>
#
# This file may be distributed under the terms of the GNU GPLv3 license.
@@ -348,7 +348,7 @@ def main():
# Pretty print output
outstrs = ["/* DO NOT EDIT! This is an autogenerated file."
" See scripts/acpi_extract.py. */"]
- for array in output.keys():
+ for array in list(output.keys()):
otype = get_value_type(max(output[array]))
outstrs.append("static unsigned %s %s[] = {" % (otype, array))
odata = []
diff --git a/roms/seabios/scripts/acpi_extract_preprocess.py b/roms/seabios/scripts/acpi_extract_preprocess.py
index b8e92a525730442815a0dce78f45..6963847a8b5d3e4bf9340a67afe2 100755
--- a/roms/seabios/scripts/acpi_extract_preprocess.py
+++ b/roms/seabios/scripts/acpi_extract_preprocess.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python2
+#!/usr/bin/python3
# Copyright (C) 2011 Red Hat, Inc., Michael S. Tsirkin <mst@redhat.com>
#
# This file may be distributed under the terms of the GNU GPLv3 license.
diff --git a/roms/seabios/scripts/layoutrom.py b/roms/seabios/scripts/layoutrom.py
index abebf0211fa9627cec31cce76b8d..34b3e68f556af124346755e87c58 100755
--- a/roms/seabios/scripts/layoutrom.py
+++ b/roms/seabios/scripts/layoutrom.py
@@ -81,8 +81,8 @@ def fitSections(sections, fillsections):
section.finalsegloc = addr
fixedsections.append((addr, section))
if section.align != 1:
- print("Error: Fixed section %s has non-zero alignment (%d)" % (
- section.name, section.align))
+ print(("Error: Fixed section %s has non-zero alignment (%d)" % (
+ section.name, section.align)))
sys.exit(1)
fixedsections.sort(key=operator.itemgetter(0))
firstfixed = fixedsections[0][0]
@@ -142,10 +142,10 @@ def fitSections(sections, fillsections):
# Report stats
total = BUILD_BIOS_SIZE-firstfixed
slack = total - totalused
- print ("Fixed space: 0x%x-0x%x total: %d slack: %d"
+ print(("Fixed space: 0x%x-0x%x total: %d slack: %d"
" Percent slack: %.1f%%" % (
firstfixed, BUILD_BIOS_SIZE, total, slack,
- (float(slack) / total) * 100.0))
+ (float(slack) / total) * 100.0)))
return firstfixed + BUILD_BIOS_ADDR
@@ -288,12 +288,12 @@ def doLayout(sections, config, genreloc):
size32flat = sec32fseg_start - sec32flat_start
size32init = sec32flat_start - sec32init_start
sizelow = li.sec32low_end - li.sec32low_start
- print("16bit size: %d" % size16)
- print("32bit segmented size: %d" % size32seg)
- print("32bit flat size: %d" % (size32flat + size32textfseg))
- print("32bit flat init size: %d" % size32init)
- print("Lowmem size: %d" % sizelow)
- print("f-segment var size: %d" % size32fseg)
+ print(("16bit size: %d" % size16))
+ print(("32bit segmented size: %d" % size32seg))
+ print(("32bit flat size: %d" % (size32flat + size32textfseg)))
+ print(("32bit flat init size: %d" % size32init))
+ print(("Lowmem size: %d" % sizelow))
+ print(("f-segment var size: %d" % size32fseg))
return li
@@ -312,7 +312,7 @@ def outXRefs(sections, useseg=0, exportsyms=[], forcedelta=0):
and (symbol.section.fileid != section.fileid
or symbol.name != reloc.symbolname)):
xrefs[reloc.symbolname] = symbol
- for symbolname, symbol in xrefs.items():
+ for symbolname, symbol in list(xrefs.items()):
loc = symbol.section.finalloc
if useseg:
loc = symbol.section.finalsegloc
@@ -482,8 +482,8 @@ def checkRuntime(reloc, rsection, data, chain):
if section is None or '.init.' in section.name:
return 0
if '.data.varinit.' in section.name:
- print("ERROR: %s is VARVERIFY32INIT but used from %s" % (
- section.name, chain))
+ print(("ERROR: %s is VARVERIFY32INIT but used from %s" % (
+ section.name, chain)))
sys.exit(1)
return 1
@@ -695,7 +695,7 @@ def main():
li = doLayout(sections, config, genreloc)
# Exported symbols
- li.varlowsyms = [symbol for symbol in symbols['32flat'].values()
+ li.varlowsyms = [symbol for symbol in list(symbols['32flat'].values())
if (symbol.section is not None
and symbol.section.finalloc is not None
and '.data.varlow.' in symbol.section.name
diff --git a/roms/seabios/scripts/vgafixup.py b/roms/seabios/scripts/vgafixup.py
index 2053cd5d78e5935658e1fecec074..dc662480f909e27958fa906d73b1 100644
--- a/roms/seabios/scripts/vgafixup.py
+++ b/roms/seabios/scripts/vgafixup.py
@@ -29,7 +29,7 @@ re_leal = re.compile(
def handle_leal(sline):
m = re_leal.match(sline[5:])
if m is None or m.group('index') == '%esp':
- print("Unable to fixup leal instruction: %s" % (sline,))
+ print(("Unable to fixup leal instruction: %s" % (sline,)))
sys.exit(-1)
offset, base, index, scale, dest = m.group(
'offset', 'base', 'index', 'scale', 'dest')