All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabiano Rosas <farosas@suse.de>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org, Thomas Huth <thuth@redhat.com>
Subject: Re: [PATCH 00/10] Kconfig vs. default devices
Date: Mon, 06 Feb 2023 11:56:17 -0300	[thread overview]
Message-ID: <87ttzyc06m.fsf@suse.de> (raw)
In-Reply-To: <CAFEAcA9VkFU_bh=aBAOoXCUCeSm1xuR+H+uerd468=vVuDrJEg@mail.gmail.com>

Peter Maydell <peter.maydell@linaro.org> writes:

> On Mon, 6 Feb 2023 at 14:14, Fabiano Rosas <farosas@suse.de> wrote:
>>
>> We currently have a situation where disabling a Kconfig might result
>> in a runtime error when QEMU selects the corresponding device as a
>> default value for an option. But first a disambiguation:
>>
>> Kconfig default::
>>   a device "Foo" for which there's "config FOO default y" or "config X
>>   imply FOO" in Kconfig.
>>
>> QEMU hardcoded default::
>>   a fallback; a device "Foo" that is chosen in case no corresponding
>>   option is given in the command line.
>>
>> The issue I'm trying to solve is that there is no link between the two
>> "defaults" above, which means that when the user at build time
>> de-selects a Kconfig default, either via configs/devices/*/*.mak or
>> --without-default-devices, the subsequent invocation at runtime might
>> continue to try to create the missing device due to QEMU defaults.
>>
>> Even a experienced user that tweaks the build via .mak files is not
>> required to know about what QEMU developers chose to use as fallbacks
>> in the code. Moreover, the person/entity that builds the code might
>> not be the same that runs it, which makes it even more confusing.
>>
>> We do have -nodefaults in the command line, but that doesn't include
>> all types of fallbacks that might be set in the code. It also does not
>> cover individual CONFIGs and their respective use as a fallback in the
>> code.
>>
>> So my proposal here is actually simple: Let's make sure every fallback
>> device creation *without* a validation check gets a hard dependency in
>> Kconfig. A validation check being something like:
>>
>> if (has_defaults && object_get_class("foo") {
>>    create_foo();
>> }
>
> So we could do one of several things to resolve any particular
> one of these:
>  (1) make the Kconfig force the device to be compiled in
>  (2) make QEMU silently fall back to "don't provide device"
>      rather than "provide this default device" if the
>      device isn't compiled in
>  (3) make QEMU emit an error message saying that the
>      command line implies that the machine should have
>      (default) device X but X support wasn't compiled in
>
> I don't strongly care which approach we take, but shouldn't
> we be consistent about what we do? AFAICT your patch 1
> here takes approach (2) but the others take approach (1).

Good point. The one from patch 1 (isa-parallel) is a bit different since
it is used in the -nodefaults logic, but I could probably use the (1)
approach with it as well, let me give it a try.


      reply	other threads:[~2023-02-06 14:56 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-06 14:07 [PATCH 00/10] Kconfig vs. default devices Fabiano Rosas
2023-02-06 14:08 ` [PATCH 01/10] vl.c: Do not add isa-parallel if it's not present Fabiano Rosas
2023-02-06 15:02   ` Philippe Mathieu-Daudé
2023-02-06 17:05     ` Fabiano Rosas
2023-02-06 14:08 ` [PATCH 02/10] hw/i386: Select E1000E for q35 Fabiano Rosas
2023-02-07 15:28   ` Thomas Huth
2023-02-06 14:08 ` [PATCH 03/10] hw/i386: Select VGA_PCI in Kconfig Fabiano Rosas
2023-02-07 15:47   ` Thomas Huth
2023-02-07 17:41     ` Fabiano Rosas
2023-02-06 14:08 ` [PATCH 04/10] hw/i386: Select E1000_PCI for i440fx Fabiano Rosas
2023-02-07 18:16   ` Thomas Huth
2023-02-06 14:08 ` [PATCH 05/10] hw/arm: Select VIRTIO_NET for virt machine Fabiano Rosas
2023-02-07 18:19   ` Thomas Huth
2023-02-06 14:08 ` [PATCH 06/10] hw/arm: Select VIRTIO_BLK " Fabiano Rosas
2023-02-07 18:26   ` Thomas Huth
2023-02-07 19:24     ` Fabiano Rosas
2023-02-06 14:08 ` [PATCH 07/10] hw/arm: Select XLNX_USB_SUBSYS for xlnx-zcu102 machine Fabiano Rosas
2023-02-06 14:21   ` Peter Maydell
2023-02-06 14:08 ` [PATCH 08/10] hw/arm: Select GICV3_TCG for sbsa-ref machine Fabiano Rosas
2023-02-06 14:21   ` Peter Maydell
2023-02-06 14:08 ` [PATCH 09/10] hw/arm: Select e1000e " Fabiano Rosas
2023-02-06 14:08 ` [PATCH 10/10] hw/arm: Select VGA_PCI " Fabiano Rosas
2023-02-06 14:22   ` Peter Maydell
2023-02-06 14:19 ` [PATCH 00/10] Kconfig vs. default devices Peter Maydell
2023-02-06 14:56   ` Fabiano Rosas [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ttzyc06m.fsf@suse.de \
    --to=farosas@suse.de \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.