One Hat Cyber Team
Your IP :
216.73.216.115
Server IP :
194.44.31.54
Server :
Linux zen.imath.kiev.ua 4.18.0-553.77.1.el8_10.x86_64 #1 SMP Fri Oct 3 14:30:23 UTC 2025 x86_64
Server Software :
Apache/2.4.37 (Rocky Linux) OpenSSL/1.1.1k
PHP Version :
5.6.40
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
doc
/
qemu-kvm
/
devel
/
View File Name :
kconfig.html
<!DOCTYPE html> <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>QEMU and Kconfig — QEMU qemu-kvm-6.2.0-53.module+el8.10.0+2055+8eb7870b.4 documentation</title> <link rel="shortcut icon" href="../_static/qemu_32x32.png"/> <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="Testing in QEMU" href="testing.html" /> <link rel="prev" title="QEMU Coding Style" href="style.html" /> <script src="../_static/js/modernizr.min.js"></script> </head> <body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search"> <a href="../index.html" class="icon icon-home"> QEMU <img src="../_static/qemu_128x128.png" class="logo" alt="Logo"/> </a> <div class="version"> 6.2.0 </div> <div role="search"> <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> </div> </div> <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> <p class="caption"><span class="caption-text">Contents:</span></p> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="../about/index.html">About QEMU</a></li> <li class="toctree-l1"><a class="reference internal" href="../system/index.html">System Emulation</a></li> <li class="toctree-l1"><a class="reference internal" href="../user/index.html">User Mode Emulation</a></li> <li class="toctree-l1"><a class="reference internal" href="../tools/index.html">Tools</a></li> <li class="toctree-l1"><a class="reference internal" href="../interop/index.html">System Emulation Management and Interoperability</a></li> <li class="toctree-l1"><a class="reference internal" href="../specs/index.html">System Emulation Guest Hardware Specifications</a></li> <li class="toctree-l1 current"><a class="reference internal" href="index.html">Developer Information</a><ul class="current"> <li class="toctree-l2"><a class="reference internal" href="code-of-conduct.html">Code of Conduct</a></li> <li class="toctree-l2"><a class="reference internal" href="conflict-resolution.html">Conflict Resolution Policy</a></li> <li class="toctree-l2"><a class="reference internal" href="build-system.html">The QEMU build system architecture</a></li> <li class="toctree-l2"><a class="reference internal" href="style.html">QEMU Coding Style</a></li> <li class="toctree-l2 current"><a class="current reference internal" href="#">QEMU and Kconfig</a><ul> <li class="toctree-l3"><a class="reference internal" href="#the-kconfig-language">The Kconfig language</a></li> <li class="toctree-l3"><a class="reference internal" href="#guidelines-for-writing-kconfig-files">Guidelines for writing Kconfig files</a></li> <li class="toctree-l3"><a class="reference internal" href="#writing-and-modifying-default-configurations">Writing and modifying default configurations</a></li> <li class="toctree-l3"><a class="reference internal" href="#kconfig-host"><code class="docutils literal notranslate"><span class="pre">Kconfig.host</span></code></a></li> </ul> </li> <li class="toctree-l2"><a class="reference internal" href="testing.html">Testing in QEMU</a></li> <li class="toctree-l2"><a class="reference internal" href="fuzzing.html">Fuzzing</a></li> <li class="toctree-l2"><a class="reference internal" href="control-flow-integrity.html">Control-Flow Integrity (CFI)</a></li> <li class="toctree-l2"><a class="reference internal" href="loads-stores.html">Load and Store APIs</a></li> <li class="toctree-l2"><a class="reference internal" href="memory.html">The memory API</a></li> <li class="toctree-l2"><a class="reference internal" href="migration.html">Migration</a></li> <li class="toctree-l2"><a class="reference internal" href="atomics.html">Atomic operations in QEMU</a></li> <li class="toctree-l2"><a class="reference internal" href="stable-process.html">QEMU and the stable process</a></li> <li class="toctree-l2"><a class="reference internal" href="ci.html">CI</a></li> <li class="toctree-l2"><a class="reference internal" href="qtest.html">QTest Device Emulation Testing Framework</a></li> <li class="toctree-l2"><a class="reference internal" href="decodetree.html">Decodetree Specification</a></li> <li class="toctree-l2"><a class="reference internal" href="secure-coding-practices.html">Secure Coding Practices</a></li> <li class="toctree-l2"><a class="reference internal" href="tcg.html">Translator Internals</a></li> <li class="toctree-l2"><a class="reference internal" href="tcg-icount.html">TCG Instruction Counting</a></li> <li class="toctree-l2"><a class="reference internal" href="tracing.html">Tracing</a></li> <li class="toctree-l2"><a class="reference internal" href="multi-thread-tcg.html">Multi-threaded TCG</a></li> <li class="toctree-l2"><a class="reference internal" href="tcg-plugins.html">QEMU TCG Plugins</a></li> <li class="toctree-l2"><a class="reference internal" href="bitops.html">Bitwise operations</a></li> <li class="toctree-l2"><a class="reference internal" href="ui.html">QEMU UI subsystem</a></li> <li class="toctree-l2"><a class="reference internal" href="reset.html">Reset in QEMU: the Resettable interface</a></li> <li class="toctree-l2"><a class="reference internal" href="s390-dasd-ipl.html">Booting from real channel-attached devices on s390x</a></li> <li class="toctree-l2"><a class="reference internal" href="clocks.html">Modelling a clock tree in QEMU</a></li> <li class="toctree-l2"><a class="reference internal" href="qom.html">The QEMU Object Model (QOM)</a></li> <li class="toctree-l2"><a class="reference internal" href="modules.html">QEMU modules</a></li> <li class="toctree-l2"><a class="reference internal" href="block-coroutine-wrapper.html">block-coroutine-wrapper</a></li> <li class="toctree-l2"><a class="reference internal" href="multi-process.html">Multi-process QEMU</a></li> <li class="toctree-l2"><a class="reference internal" href="ebpf_rss.html">eBPF RSS virtio-net support</a></li> <li class="toctree-l2"><a class="reference internal" href="vfio-migration.html">VFIO device Migration</a></li> <li class="toctree-l2"><a class="reference internal" href="qapi-code-gen.html">How to use the QAPI code generator</a></li> <li class="toctree-l2"><a class="reference internal" href="writing-monitor-commands.html">How to write monitor commands</a></li> <li class="toctree-l2"><a class="reference internal" href="trivial-patches.html">Trivial Patches</a></li> <li class="toctree-l2"><a class="reference internal" href="submitting-a-patch.html">Submitting a Patch</a></li> <li class="toctree-l2"><a class="reference internal" href="submitting-a-pull-request.html">Submitting a Pull Request</a></li> </ul> </li> </ul> </div> </div> </nav> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> <nav class="wy-nav-top" aria-label="top navigation"> <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="../index.html">QEMU</a> </nav> <div class="wy-nav-content"> <div class="rst-content"> <div role="navigation" aria-label="breadcrumbs navigation"> <ul class="wy-breadcrumbs"> <li><a href="../index.html">Docs</a> »</li> <li><a href="index.html">Developer Information</a> »</li> <li>QEMU and Kconfig</li> <li class="wy-breadcrumbs-aside"> <a href="https://gitlab.com/qemu-project/qemu/blob/master/docs/devel/kconfig.rst" class="fa fa-gitlab"> Edit on GitLab</a> </li> </ul> <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> <div class="section" id="qemu-and-kconfig"> <span id="kconfig"></span><h1>QEMU and Kconfig<a class="headerlink" href="#qemu-and-kconfig" title="Permalink to this headline">¶</a></h1> <p>QEMU is a very versatile emulator; it can be built for a variety of targets, where each target can emulate various boards and at the same time different targets can share large amounts of code. For example, a POWER and an x86 board can run the same code to emulate a PCI network card, even though the boards use different PCI host bridges, and they can run the same code to emulate a SCSI disk while using different SCSI adapters. Arm, s390 and x86 boards can all present a virtio-blk disk to their guests, but with three different virtio guest interfaces.</p> <p>Each QEMU target enables a subset of the boards, devices and buses that are included in QEMU’s source code. As a result, each QEMU executable only links a small subset of the files that form QEMU’s source code; anything that is not needed to support a particular target is culled.</p> <p>QEMU uses a simple domain-specific language to describe the dependencies between components. This is useful for two reasons:</p> <ul class="simple"> <li>new targets and boards can be added without knowing in detail the architecture of the hardware emulation subsystems. Boards only have to list the components they need, and the compiled executable will include all the required dependencies and all the devices that the user can add to that board;</li> <li>users can easily build reduced versions of QEMU that support only a subset of boards or devices. For example, by default most targets will include all emulated PCI devices that QEMU supports, but the build process is configurable and it is easy to drop unnecessary (or otherwise unwanted) code to make a leaner binary.</li> </ul> <p>This domain-specific language is based on the Kconfig language that originated in the Linux kernel, though it was heavily simplified and the handling of dependencies is stricter in QEMU.</p> <p>Unlike Linux, there is no user interface to edit the configuration, which is instead specified in per-target files under the <code class="docutils literal notranslate"><span class="pre">default-configs/</span></code> directory of the QEMU source tree. This is because, unlike Linux, configuration and dependencies can be treated as a black box when building QEMU; the default configuration that QEMU ships with should be okay in almost all cases.</p> <div class="section" id="the-kconfig-language"> <h2>The Kconfig language<a class="headerlink" href="#the-kconfig-language" title="Permalink to this headline">¶</a></h2> <p>Kconfig defines configurable components in files named <code class="docutils literal notranslate"><span class="pre">hw/*/Kconfig</span></code>. Note that configurable components are _not_ visible in C code as preprocessor symbols; they are only visible in the Makefile. Each configurable component defines a Makefile variable whose name starts with <code class="docutils literal notranslate"><span class="pre">CONFIG_</span></code>.</p> <p>All elements have boolean (true/false) type; truth is written as <code class="docutils literal notranslate"><span class="pre">y</span></code>, while falsehood is written <code class="docutils literal notranslate"><span class="pre">n</span></code>. They are defined in a Kconfig stanza like the following:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">config</span> <span class="n">ARM_VIRT</span> <span class="nb">bool</span> <span class="n">imply</span> <span class="n">PCI_DEVICES</span> <span class="n">imply</span> <span class="n">VFIO_AMD_XGBE</span> <span class="n">imply</span> <span class="n">VFIO_XGMAC</span> <span class="n">select</span> <span class="n">A15MPCORE</span> <span class="n">select</span> <span class="n">ACPI</span> <span class="n">select</span> <span class="n">ARM_SMMUV3</span> </pre></div> </div> <p>The <code class="docutils literal notranslate"><span class="pre">config</span></code> keyword introduces a new configuration element. In the example above, Makefiles will have access to a variable named <code class="docutils literal notranslate"><span class="pre">CONFIG_ARM_VIRT</span></code>, with value <code class="docutils literal notranslate"><span class="pre">y</span></code> or <code class="docutils literal notranslate"><span class="pre">n</span></code> (respectively for boolean true and false).</p> <p>Boolean expressions can be used within the language, whenever <code class="docutils literal notranslate"><span class="pre"><expr></span></code> is written in the remainder of this section. The <code class="docutils literal notranslate"><span class="pre">&&</span></code>, <code class="docutils literal notranslate"><span class="pre">||</span></code> and <code class="docutils literal notranslate"><span class="pre">!</span></code> operators respectively denote conjunction (AND), disjunction (OR) and negation (NOT).</p> <p>The <code class="docutils literal notranslate"><span class="pre">bool</span></code> data type declaration is optional, but it is suggested to include it for clarity and future-proofing. After <code class="docutils literal notranslate"><span class="pre">bool</span></code> the following directives can be included:</p> <p><strong>dependencies</strong>: <code class="docutils literal notranslate"><span class="pre">depends</span> <span class="pre">on</span> <span class="pre"><expr></span></code></p> <blockquote> <div>This defines a dependency for this configurable element. Dependencies evaluate an expression and force the value of the variable to false if the expression is false.</div></blockquote> <p><strong>reverse dependencies</strong>: <code class="docutils literal notranslate"><span class="pre">select</span> <span class="pre"><symbol></span> <span class="pre">[if</span> <span class="pre"><expr>]</span></code></p> <blockquote> <div><p>While <code class="docutils literal notranslate"><span class="pre">depends</span> <span class="pre">on</span></code> can force a symbol to false, reverse dependencies can be used to force another symbol to true. In the following example, <code class="docutils literal notranslate"><span class="pre">CONFIG_BAZ</span></code> will be true whenever <code class="docutils literal notranslate"><span class="pre">CONFIG_FOO</span></code> is true:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">config</span> <span class="n">FOO</span> <span class="n">select</span> <span class="n">BAZ</span> </pre></div> </div> <p>The optional expression will prevent <code class="docutils literal notranslate"><span class="pre">select</span></code> from having any effect unless it is true.</p> <p>Note that unlike Linux’s Kconfig implementation, QEMU will detect contradictions between <code class="docutils literal notranslate"><span class="pre">depends</span> <span class="pre">on</span></code> and <code class="docutils literal notranslate"><span class="pre">select</span></code> statements and prevent you from building such a configuration.</p> </div></blockquote> <p><strong>default value</strong>: <code class="docutils literal notranslate"><span class="pre">default</span> <span class="pre"><value></span> <span class="pre">[if</span> <span class="pre"><expr>]</span></code></p> <blockquote> <div><p>Default values are assigned to the config symbol if no other value was set by the user via <code class="docutils literal notranslate"><span class="pre">default-configs/*.mak</span></code> files, and only if <code class="docutils literal notranslate"><span class="pre">select</span></code> or <code class="docutils literal notranslate"><span class="pre">depends</span> <span class="pre">on</span></code> directives do not force the value to true or false respectively. <code class="docutils literal notranslate"><span class="pre"><value></span></code> can be <code class="docutils literal notranslate"><span class="pre">y</span></code> or <code class="docutils literal notranslate"><span class="pre">n</span></code>; it cannot be an arbitrary Boolean expression. However, a condition for applying the default value can be added with <code class="docutils literal notranslate"><span class="pre">if</span></code>.</p> <p>A configuration element can have any number of default values (usually, if more than one default is present, they will have different conditions). If multiple default values satisfy their condition, only the first defined one is active.</p> </div></blockquote> <p><strong>reverse default</strong> (weak reverse dependency): <code class="docutils literal notranslate"><span class="pre">imply</span> <span class="pre"><symbol></span> <span class="pre">[if</span> <span class="pre"><expr>]</span></code></p> <blockquote> <div><p>This is similar to <code class="docutils literal notranslate"><span class="pre">select</span></code> as it applies a lower limit of <code class="docutils literal notranslate"><span class="pre">y</span></code> to another symbol. However, the lower limit is only a default and the “implied” symbol’s value may still be set to <code class="docutils literal notranslate"><span class="pre">n</span></code> from a <code class="docutils literal notranslate"><span class="pre">default-configs/*.mak</span></code> files. The following two examples are equivalent:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">config</span> <span class="n">FOO</span> <span class="nb">bool</span> <span class="n">imply</span> <span class="n">BAZ</span> <span class="n">config</span> <span class="n">BAZ</span> <span class="nb">bool</span> <span class="n">default</span> <span class="n">y</span> <span class="k">if</span> <span class="n">FOO</span> </pre></div> </div> <p>The next section explains where to use <code class="docutils literal notranslate"><span class="pre">imply</span></code> or <code class="docutils literal notranslate"><span class="pre">default</span> <span class="pre">y</span></code>.</p> </div></blockquote> </div> <div class="section" id="guidelines-for-writing-kconfig-files"> <h2>Guidelines for writing Kconfig files<a class="headerlink" href="#guidelines-for-writing-kconfig-files" title="Permalink to this headline">¶</a></h2> <p>Configurable elements in QEMU fall under five broad groups. Each group declares its dependencies in different ways:</p> <p><strong>subsystems</strong>, of which <strong>buses</strong> are a special case</p> <blockquote> <div><p>Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">config</span> <span class="n">SCSI</span> <span class="nb">bool</span> </pre></div> </div> <p>Subsystems always default to false (they have no <code class="docutils literal notranslate"><span class="pre">default</span></code> directive) and are never visible in <code class="docutils literal notranslate"><span class="pre">default-configs/*.mak</span></code> files. It’s up to other symbols to <code class="docutils literal notranslate"><span class="pre">select</span></code> whatever subsystems they require.</p> <p>They sometimes have <code class="docutils literal notranslate"><span class="pre">select</span></code> directives to bring in other required subsystems or buses. For example, <code class="docutils literal notranslate"><span class="pre">AUX</span></code> (the DisplayPort auxiliary channel “bus”) selects <code class="docutils literal notranslate"><span class="pre">I2C</span></code> because it can act as an I2C master too.</p> </div></blockquote> <p><strong>devices</strong></p> <blockquote> <div><p>Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">config</span> <span class="n">MEGASAS_SCSI_PCI</span> <span class="nb">bool</span> <span class="n">default</span> <span class="n">y</span> <span class="k">if</span> <span class="n">PCI_DEVICES</span> <span class="n">depends</span> <span class="n">on</span> <span class="n">PCI</span> <span class="n">select</span> <span class="n">SCSI</span> </pre></div> </div> <p>Devices are the most complex of the five. They can have a variety of directives that cooperate so that a default configuration includes all the devices that can be accessed from QEMU.</p> <p>Devices <em>depend on</em> the bus that they lie on, for example a PCI device would specify <code class="docutils literal notranslate"><span class="pre">depends</span> <span class="pre">on</span> <span class="pre">PCI</span></code>. An MMIO device will likely have no <code class="docutils literal notranslate"><span class="pre">depends</span> <span class="pre">on</span></code> directive. Devices also <em>select</em> the buses that the device provides, for example a SCSI adapter would specify <code class="docutils literal notranslate"><span class="pre">select</span> <span class="pre">SCSI</span></code>. Finally, devices are usually <code class="docutils literal notranslate"><span class="pre">default</span> <span class="pre">y</span></code> if and only if they have at least one <code class="docutils literal notranslate"><span class="pre">depends</span> <span class="pre">on</span></code>; the default could be conditional on a device group.</p> <p>Devices also select any optional subsystem that they use; for example a video card might specify <code class="docutils literal notranslate"><span class="pre">select</span> <span class="pre">EDID</span></code> if it needs to build EDID information and publish it to the guest.</p> </div></blockquote> <p><strong>device groups</strong></p> <blockquote> <div><p>Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">config</span> <span class="n">PCI_DEVICES</span> <span class="nb">bool</span> </pre></div> </div> <p>Device groups provide a convenient mechanism to enable/disable many devices in one go. This is useful when a set of devices is likely to be enabled/disabled by several targets. Device groups usually need no directive and are not used in the Makefile either; they only appear as conditions for <code class="docutils literal notranslate"><span class="pre">default</span> <span class="pre">y</span></code> directives.</p> <p>QEMU currently has two device groups, <code class="docutils literal notranslate"><span class="pre">PCI_DEVICES</span></code> and <code class="docutils literal notranslate"><span class="pre">TEST_DEVICES</span></code>. PCI devices usually have a <code class="docutils literal notranslate"><span class="pre">default</span> <span class="pre">y</span> <span class="pre">if</span> <span class="pre">PCI_DEVICES</span></code> directive rather than just <code class="docutils literal notranslate"><span class="pre">default</span> <span class="pre">y</span></code>. This lets some boards (notably s390) easily support a subset of PCI devices, for example only VFIO (passthrough) and virtio-pci devices. <code class="docutils literal notranslate"><span class="pre">TEST_DEVICES</span></code> instead is used for devices that are rarely used on production virtual machines, but provide useful hooks to test QEMU or KVM.</p> </div></blockquote> <p><strong>boards</strong></p> <blockquote> <div><p>Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">config</span> <span class="n">SUN4M</span> <span class="nb">bool</span> <span class="n">imply</span> <span class="n">TCX</span> <span class="n">imply</span> <span class="n">CG3</span> <span class="n">select</span> <span class="n">CS4231</span> <span class="n">select</span> <span class="n">ECCMEMCTL</span> <span class="n">select</span> <span class="n">EMPTY_SLOT</span> <span class="n">select</span> <span class="n">ESCC</span> <span class="n">select</span> <span class="n">ESP</span> <span class="n">select</span> <span class="n">FDC</span> <span class="n">select</span> <span class="n">SLAVIO</span> <span class="n">select</span> <span class="n">LANCE</span> <span class="n">select</span> <span class="n">M48T59</span> <span class="n">select</span> <span class="n">STP2000</span> </pre></div> </div> <p>Boards specify their constituent devices using <code class="docutils literal notranslate"><span class="pre">imply</span></code> and <code class="docutils literal notranslate"><span class="pre">select</span></code> directives. A device should be listed under <code class="docutils literal notranslate"><span class="pre">select</span></code> if the board cannot be started at all without it. It should be listed under <code class="docutils literal notranslate"><span class="pre">imply</span></code> if (depending on the QEMU command line) the board may or may not be started without it. Boards also default to false; they are enabled by the <code class="docutils literal notranslate"><span class="pre">default-configs/*.mak</span></code> for the target they apply to.</p> </div></blockquote> <p><strong>internal elements</strong></p> <blockquote> <div><p>Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">config</span> <span class="n">ECCMEMCTL</span> <span class="nb">bool</span> <span class="n">select</span> <span class="n">ECC</span> </pre></div> </div> <p>Internal elements group code that is useful in several boards or devices. They are usually enabled with <code class="docutils literal notranslate"><span class="pre">select</span></code> and in turn select other elements; they are never visible in <code class="docutils literal notranslate"><span class="pre">default-configs/*.mak</span></code> files, and often not even in the Makefile.</p> </div></blockquote> </div> <div class="section" id="writing-and-modifying-default-configurations"> <h2>Writing and modifying default configurations<a class="headerlink" href="#writing-and-modifying-default-configurations" title="Permalink to this headline">¶</a></h2> <p>In addition to the Kconfig files under hw/, each target also includes a file called <code class="docutils literal notranslate"><span class="pre">default-configs/TARGETNAME-softmmu.mak</span></code>. These files initialize some Kconfig variables to non-default values and provide the starting point to turn on devices and subsystems.</p> <p>A file in <code class="docutils literal notranslate"><span class="pre">default-configs/</span></code> looks like the following example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># Default configuration for alpha-softmmu</span> <span class="c1"># Uncomment the following lines to disable these optional devices:</span> <span class="c1">#</span> <span class="c1">#CONFIG_PCI_DEVICES=n</span> <span class="c1">#CONFIG_TEST_DEVICES=n</span> <span class="c1"># Boards:</span> <span class="c1">#</span> <span class="n">CONFIG_DP264</span><span class="o">=</span><span class="n">y</span> </pre></div> </div> <p>The first part, consisting of commented-out <code class="docutils literal notranslate"><span class="pre">=n</span></code> assignments, tells the user which devices or device groups are implied by the boards. The second part, consisting of <code class="docutils literal notranslate"><span class="pre">=y</span></code> assignments, tells the user which boards are supported by the target. The user will typically modify the default configuration by uncommenting lines in the first group, or commenting out lines in the second group.</p> <p>It is also possible to run QEMU’s configure script with the <code class="docutils literal notranslate"><span class="pre">--without-default-devices</span></code> option. When this is done, everything defaults to <code class="docutils literal notranslate"><span class="pre">n</span></code> unless it is <code class="docutils literal notranslate"><span class="pre">select``ed</span> <span class="pre">or</span> <span class="pre">explicitly</span> <span class="pre">switched</span> <span class="pre">on</span> <span class="pre">in</span> <span class="pre">the</span> <span class="pre">``.mak</span></code> files. In other words, <code class="docutils literal notranslate"><span class="pre">default</span></code> and <code class="docutils literal notranslate"><span class="pre">imply</span></code> directives are disabled. When QEMU is built with this option, the user will probably want to change some lines in the first group, for example like this:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">CONFIG_PCI_DEVICES</span><span class="o">=</span><span class="n">y</span> <span class="c1">#CONFIG_TEST_DEVICES=n</span> </pre></div> </div> <p>and/or pick a subset of the devices in those device groups. Right now there is no single place that lists all the optional devices for <code class="docutils literal notranslate"><span class="pre">CONFIG_PCI_DEVICES</span></code> and <code class="docutils literal notranslate"><span class="pre">CONFIG_TEST_DEVICES</span></code>. In the future, we expect that <code class="docutils literal notranslate"><span class="pre">.mak</span></code> files will be automatically generated, so that they will include all these symbols and some help text on what they do.</p> </div> <div class="section" id="kconfig-host"> <h2><code class="docutils literal notranslate"><span class="pre">Kconfig.host</span></code><a class="headerlink" href="#kconfig-host" title="Permalink to this headline">¶</a></h2> <p>In some special cases, a configurable element depends on host features that are detected by QEMU’s configure or <code class="docutils literal notranslate"><span class="pre">meson.build</span></code> scripts; for example some devices depend on the availability of KVM or on the presence of a library on the host.</p> <p>These symbols should be listed in <code class="docutils literal notranslate"><span class="pre">Kconfig.host</span></code> like this:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">config</span> <span class="n">TPM</span> <span class="nb">bool</span> </pre></div> </div> <p>and also listed as follows in the top-level meson.build’s host_kconfig variable:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span>host_kconfig = \ ('CONFIG_TPM' in config_host ? ['CONFIG_TPM=y'] : []) + \ ('CONFIG_SPICE' in config_host ? ['CONFIG_SPICE=y'] : []) + \ (have_ivshmem ? ['CONFIG_IVSHMEM=y'] : []) + \ ... </pre></div> </div> </div> </div> </div> </div> <footer> <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> <a href="testing.html" class="btn btn-neutral float-right" title="Testing in QEMU" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> <a href="style.html" class="btn btn-neutral" title="QEMU Coding Style" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> </div> <hr/> <div role="contentinfo"> <p> © Copyright 2021, The QEMU Project Developers. </p> </div> Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. <!-- Empty para to force a blank line after "Built with Sphinx ..." --> <p></p> <p>This documentation is for QEMU version 6.2.0.</p> <p><a href="../about/license.html">QEMU and this manual are released under the GNU General Public License, version 2.</a></p> </footer> </div> </div> </section> </div> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT:'../', VERSION:'qemu-kvm-6.2.0-53.module+el8.10.0+2055+8eb7870b.4', LANGUAGE:'None', COLLAPSE_INDEX:false, FILE_SUFFIX:'.html', HAS_SOURCE: false, SOURCELINK_SUFFIX: '.txt' }; </script> <script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script> <script type="text/javascript" src="../_static/js/theme.js"></script> <script type="text/javascript"> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); </script> </body> </html>