[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 01/10] vl.c: Do not add isa-parallel if it's not present
From: |
Fabiano Rosas |
Subject: |
Re: [PATCH 01/10] vl.c: Do not add isa-parallel if it's not present |
Date: |
Mon, 06 Feb 2023 14:05:54 -0300 |
Philippe Mathieu-Daudé <philmd@linaro.org> writes:
> On 6/2/23 15:08, Fabiano Rosas wrote:
>> Currently the isa-parallel driver is always added by default
>> regardless of the presence of the actual code in the build, which can
>> lead to a crash:
>>
>> qemu-system-i386: unknown type 'isa-parallel'
>> Aborted (core dumped)
>>
>> Check for the presence of the QOM class and do not include
>> isa-parallel by default if it's not found.
>>
>> Signed-off-by: Fabiano Rosas <farosas@suse.de>
>> ---
>> softmmu/vl.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/softmmu/vl.c b/softmmu/vl.c
>> index 9177d95d4e..614e6cf66e 100644
>> --- a/softmmu/vl.c
>> +++ b/softmmu/vl.c
>> @@ -1269,7 +1269,8 @@ static void qemu_disable_default_devices(void)
>> if (!has_defaults || machine_class->no_serial) {
>> default_serial = 0;
>> }
>> - if (!has_defaults || machine_class->no_parallel) {
>> + if (!has_defaults || machine_class->no_parallel ||
>> + !object_class_by_name("isa-parallel")) {
>> default_parallel = 0;
>> }
>> if (!has_defaults || machine_class->no_floppy) {
>
> How is isa-parallel different, why not the other defaults?
I doesn't need to be different, I did it like this because I expected to
solve the others in the same way. Peter also flagged the inconsistency,
I'll add a Kconfig dependence like the others.
As to why the other defaults don't have this issue:
serial - for x86, already selected by CONFIG_PC;
not used on arm;
parallel - for x86, should be selected by CONFIG_PC, I'll fix that on v2;
not used on arm;
monitor - built in with char.c;
floppy - built in with blockdev.c;
sdcard - built in with blockdev.c;
cdrom - uses mc->block_default_type, so the CONFIG corresponding to that
device should be selected.
net - verification is only done later during machine init, so the
machine will need to provide a fallback;
vga - uses mc->default_display, so the CONFIG corresponding to that device
should be selected.
These last three are addressed in other patches in this series (VGA_PCI,
VIRTIO_*).
- [PATCH 00/10] Kconfig vs. default devices, Fabiano Rosas, 2023/02/06
- [PATCH 01/10] vl.c: Do not add isa-parallel if it's not present, Fabiano Rosas, 2023/02/06
- [PATCH 02/10] hw/i386: Select E1000E for q35, Fabiano Rosas, 2023/02/06
- [PATCH 03/10] hw/i386: Select VGA_PCI in Kconfig, Fabiano Rosas, 2023/02/06
- [PATCH 04/10] hw/i386: Select E1000_PCI for i440fx, Fabiano Rosas, 2023/02/06
- [PATCH 05/10] hw/arm: Select VIRTIO_NET for virt machine, Fabiano Rosas, 2023/02/06
- [PATCH 06/10] hw/arm: Select VIRTIO_BLK for virt machine, Fabiano Rosas, 2023/02/06