On 26/09/2018 21:57, Peter Maydell wrote: > On 26 September 2018 at 14:36, Paolo Bonzini <pbonz...@redhat.com> wrote: >> Here is a minimal example: >> >> # hw/scsi/Kconfig >> config SCSI >> >> config ESP >> select SCSI >> >> config ESP_PCI >> default y >> select ESP >> depends on PCI >> >> # hw/pci/Kconfig >> config PCI >> >> # hw/pci-host/Kconfig >> config PCI_GENERIC >> select PCI >> >> # hw/arm/Kconfig >> config ARM_VIRT >> select PCI_GENERIC >> default y >> >> # hw/sparc/Kconfig >> config SUN4M >> select ESP >> default y > > What is the syntactic thing in this example which distinguishes > "user can toggle this" (ESP_PCI, ARM_VIRT, SUN4M) from "user > can't toggle this, it's just an internal thing selected by > other nodes" (the rest) ? I'm assuming we'd have some sort > of UI thingy that presents the user only with the user-settable > options.
There's no UI, the configuration is still done with default-configs/; however the defaults are specified in the Kconfig files, so the default-configs/ files are basically empty (they are not yet empty in the branch I posted, but that's not by design; it's just one of the reasons why the code was never sent for inclusion upstream). At a very high level it's pretty simple, everything that is "select"ed is internal, so I suppose we could cook up a script that extracts the customizable variables and lists them in default-configs/ files. For example you could have default-configs/devices.mak: # This file is built from Kconfig files in hw/*. All symbols in this # file default to y, so you need not do anything to enable them # Assign "n" in order to disable a symbol. #CONFIG_ESP_PCI=y #CONFIG_VIRTIO_SCSI=y #... default-configs/sparc-softmmu.mak: # This file is built from hw/sparc/Kconfig. All symbols in this # file default to y, so you need not do anything to enable them # Assign "n" in order to disable a symbol. include devices.mak #CONFIG_SUN4M=y default-configs/arm-softmmu.mak: # This file is built from hw/sparc/Kconfig. All symbols in this # file default to y, so you need not do anything to enable them # Assign "n" in order to disable a symbol. include devices.mak #CONFIG_ARM_VIRT=y One complication could be if a "default y" symbol is "select"ed in some targets and not in others. I'm not sure if that actually happens, but again it would be easy to find such symbols and assess the impact. Paolo