qemu/modules-quick-fix-a-fundamental-error-in.patch

89 lines
2.8 KiB
Diff
Raw Normal View History

From: "Jose R. Ziviani" <jziviani@suse.de>
Date: Thu, 16 Sep 2021 00:52:34 -0300
Subject: modules: quick-fix a fundamental error in modules
Git-commit: 00000000000000000000000000000000000000000
References: bsc#1190573
modinfo.c is generated regarding the arch being built. However, if we
build multiple arch targets at once, modinfo.c will list modules that
might not be supported by all these targets. When trying to run these
targets, errors[1] will appear.
This patch is a bandaid specific to s390x. It will be removed as soon
as a better approach is fixed upstream.
[1]
$ qemu-system-s390x -nodefaults -display none -accel qtest -M none -device help
Failed to open module: /home/jose/qemu/build/hw-display-virtio-vga.so: undefined symbol: vmstate_vga_common
Signed-off-by: Jose R. Ziviani <jziviani@suse.de>
---
include/qemu/module.h | 1 +
util/module.c | 33 +++++++++++++++++++++++++++++++++
2 files changed, 34 insertions(+)
diff --git a/include/qemu/module.h b/include/qemu/module.h
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 11:07:39 +01:00
index 5fcc323b2a79d5adfdf27fa19bf7..ed051a6c0e7df56015e25936e641 100644
--- a/include/qemu/module.h
+++ b/include/qemu/module.h
@@ -73,6 +73,7 @@ bool module_load_one(const char *prefix, const char *lib_name, bool mayfail);
void module_load_qom_one(const char *type);
void module_load_qom_all(void);
void module_allow_arch(const char *arch);
+bool s390x_blocklist(const char *name);
/**
* DOC: module info annotation macros
diff --git a/util/module.c b/util/module.c
index 6bb4ad915a1c86f1601a4913a29c..8370d4c6209eda4319342b202f6b 100644
--- a/util/module.c
+++ b/util/module.c
@@ -119,6 +119,35 @@ static const QemuModinfo module_info_stub[] = { {
static const QemuModinfo *module_info = module_info_stub;
static const char *module_arch;
+bool s390x_blocklist(const char *name)
+{
+ const char *blocklist[] = {
+ "hw-display-qxl",
+ "hw-display-virtio-vga",
+ "hw-display-virtio-vga-gl",
+ "hw-usb-host",
+ "hw-usb-redirect",
+ "hw-usb-smartcard"
+ };
+
+ const size_t len = sizeof(blocklist) / sizeof(blocklist[0]);
+
+ if (strcmp(module_arch, "x86_64") == 0 ||
+ strcmp(module_arch, "i386") == 0 ||
+ strcmp(module_arch, "arm") == 0 ||
+ strcmp(module_arch, "aarch64") == 0) {
+ return false;
+ }
+
+ for (size_t i = 0; i < len; i++) {
+ if (strcmp(blocklist[i], name) == 0) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
void module_init_info(const QemuModinfo *info)
{
module_info = info;
@@ -131,6 +160,10 @@ void module_allow_arch(const char *arch)
static bool module_check_arch(const QemuModinfo *modinfo)
{
+ if (modinfo->name && s390x_blocklist(modinfo->name)) {
+ return false;
+ }
+
if (modinfo->arch) {
if (!module_arch) {
/* no arch set -> ignore all */