[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 02/20] softmmu/vl.c: Check for the availability of the VGA device
|
From: |
Thomas Huth |
|
Subject: |
[PULL 02/20] softmmu/vl.c: Check for the availability of the VGA device before using it |
|
Date: |
Mon, 22 May 2023 13:49:56 +0200 |
In case the user disabled the default VGA device in the binary (e.g.
with the "--without-default-devices" configure switch), we should
not try to use it by default if QEMU is running with the default
devices, otherwise it aborts when trying to use it. Simply emit a
warning instead.
Message-Id: <20230512124033.502654-3-thuth@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
softmmu/vl.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 6c2427262b..43d3b972da 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -957,7 +957,18 @@ static const char *
get_default_vga_model(const MachineClass *machine_class)
{
if (machine_class->default_display) {
- return machine_class->default_display;
+ for (int t = 0; t < VGA_TYPE_MAX; t++) {
+ const VGAInterfaceInfo *ti = &vga_interfaces[t];
+
+ if (ti->opt_name && vga_interface_available(t) &&
+ g_str_equal(ti->opt_name, machine_class->default_display)) {
+ return machine_class->default_display;
+ }
+ }
+
+ warn_report_once("Default display '%s' is not available in this
binary",
+ machine_class->default_display);
+ return NULL;
} else if (vga_interface_available(VGA_CIRRUS)) {
return "cirrus";
} else if (vga_interface_available(VGA_STD)) {
--
2.31.1
- [PULL 09/20] hw/i386: Ignore the default parallel port if it has not been compiled into QEMU, (continued)
- [PULL 09/20] hw/i386: Ignore the default parallel port if it has not been compiled into QEMU, Thomas Huth, 2023/05/22
- [PULL 06/20] hw/s390x: Use MachineClass->default_nic in the s390x machine, Thomas Huth, 2023/05/22
- [PULL 17/20] tests/qemu-iotests/172: Run QEMU with -vga none and -nic none, Thomas Huth, 2023/05/22
- [PULL 16/20] tests/qtest/meson.build: Run the net filter tests only with default devices, Thomas Huth, 2023/05/22
- [PULL 20/20] memory: stricter checks prior to unsetting engaged_in_io, Thomas Huth, 2023/05/22
- [PULL 13/20] tests/qtest/cdrom-test: Fix the test to also work without optional devices, Thomas Huth, 2023/05/22
- [PULL 10/20] hw/sparc64/sun4u: Use MachineClass->default_nic and MachineClass->no_parallel, Thomas Huth, 2023/05/22
- [PULL 19/20] acpi/tests/avocado/bits: enable bios bits avocado tests on gitlab CI pipeline, Thomas Huth, 2023/05/22
- [PULL 18/20] .gitlab-ci.d/buildtest.yml: Run full "make check" with --without-default-devices, Thomas Huth, 2023/05/22
- [PULL 14/20] tests/qtest/virtio-ccw-test: Remove superfluous tests, Thomas Huth, 2023/05/22
- [PULL 02/20] softmmu/vl.c: Check for the availability of the VGA device before using it,
Thomas Huth <=
- [PULL 12/20] tests/qtest/usb-hcd-uhci-test: Skip test if UHCI controller is not available, Thomas Huth, 2023/05/22
- [PULL 15/20] tests/qtest: Check for the availability of virtio-ccw devices before using them, Thomas Huth, 2023/05/22
- Re: [PULL 00/20] Allow "make check" with "--without-default-devices", Richard Henderson, 2023/05/22