[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 04/18] softmmu/vl.c: Disable default NIC if it has not been compi
|
From: |
Thomas Huth |
|
Subject: |
[PATCH 04/18] softmmu/vl.c: Disable default NIC if it has not been compiled into the binary |
|
Date: |
Fri, 12 May 2023 14:40:19 +0200 |
Don't try to instantiate a default NIC if it is not available (since
this will cause QEMU to abort). Emit a warning instead.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
softmmu/vl.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 43d3b972da..b0b96f67fa 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -1294,6 +1294,13 @@ static void qemu_disable_default_devices(void)
default_monitor = 0;
default_net = 0;
default_vga = 0;
+ } else {
+ if (default_net && machine_class->default_nic &&
+ !module_object_class_by_name(machine_class->default_nic)) {
+ warn_report("Default NIC '%s' is not available in this binary",
+ machine_class->default_nic);
+ default_net = 0;
+ }
}
}
--
2.31.1
- [PATCH 00/18] Allow qtests with --without-default-devices (part 1), Thomas Huth, 2023/05/12
- [PATCH 02/18] softmmu/vl.c: Check for the availability of the VGA device before using it, Thomas Huth, 2023/05/12
- [PATCH 01/18] hw/i386/Kconfig: ISAPC works fine without VGA_ISA, Thomas Huth, 2023/05/12
- [PATCH 05/18] hw/ppc: Use MachineClass->default_nic in the ppc machines, Thomas Huth, 2023/05/12
- [PATCH 04/18] softmmu/vl.c: Disable default NIC if it has not been compiled into the binary,
Thomas Huth <=
- [PATCH 07/18] hw/sh4: Use MachineClass->default_nic in the sh4 r2d machine, Thomas Huth, 2023/05/12
- [PATCH 03/18] hw: Move the default NIC machine class setting from the x86 to the generic one, Thomas Huth, 2023/05/12
- [PATCH 08/18] hw/char/parallel: Move TYPE_ISA_PARALLEL to the header file, Thomas Huth, 2023/05/12
- [PATCH 06/18] hw/s390x: Use MachineClass->default_nic in the s390x machine, Thomas Huth, 2023/05/12
- [PATCH 09/18] hw/i386: Ignore the default parallel port if it has not been compiled into QEMU, Thomas Huth, 2023/05/12
- [PATCH 10/18] hw/sparc64/sun4u: Use MachineClass->default_nic and MachineClass->no_parallel, Thomas Huth, 2023/05/12
- [PATCH 11/18] tests/qtest/readconfig-test: Check for the availability of USB controllers, Thomas Huth, 2023/05/12
- [PATCH 12/18] tests/qtest/usb-hcd-uhci-test: Skip test if UHCI controller is not available, Thomas Huth, 2023/05/12
- [PATCH 15/18] tests/qtest: Check for the availability of virtio-ccw devices before using them, Thomas Huth, 2023/05/12
- [PATCH 13/18] tests/qtest/cdrom-test: Fix the test to also work without optional devices, Thomas Huth, 2023/05/12