======== Codebase ======== This section presents the various parts of QEMU and how the codebase is organized. Beyond giving succint descriptions, the goal is to offer links to various parts of the documentation/codebase. Subsystems ---------- An exhaustive list of subsystems and associated files can be found in the `MAINTAINERS `_ file. Some of the main QEMU subsystems are: - `Accelerators` - Block devices and `disk images` support - `CI` and `Tests` - `Devices` & Board models - `Documentation ` - `GDB support` - `Migration` - `Monitor` - :ref:`QOM (QEMU Object Model)` - `System mode` - :ref:`TCG (Tiny Code Generator)` - `User mode` (`Linux` & `BSD`) - User Interfaces More documentation on QEMU subsystems can be found on :ref:`internal-subsystem` page. The Grand tour -------------- We present briefly here what every folder in the top directory of the codebase contains. Hop on! The folder name links here will take you to that folder in our gitlab repository. Other links will take you to more detailed documentation for that subsystem, where we have it. Unfortunately not every subsystem has documentation yet, so sometimes the source code is all you have. * `accel `_: Infrastructure and architecture agnostic code related to the various `accelerators ` supported by QEMU (TCG, KVM, hvf, whpx, xen, nvmm). Contains interfaces for operations that will be implemented per `target `_. * `audio `_: Audio (host) support. * `authz `_: `QEMU Authorization framework`. * `backends `_: Various backends that are used to access resources on the host (e.g. for random number generation, memory backing or cryptographic functions). * `block `_: Block devices and `image formats` implementation. * `bsd-user `_: `BSD User mode`. * build: Where the code built goes by default. You can tell the QEMU build system to put the built code anywhere else you like. * `chardev `_: Various backends used by char devices. * `common-user `_: User-mode assembly code for dealing with signals occuring during syscalls. * `configs `_: Makefiles defining configurations to build QEMU. * `contrib `_: Community contributed devices/plugins/tools. * `crypto `_: Cryptographic algorithms used in QEMU. * `disas `_: Disassembly functions used by QEMU target code. * `docs `_: QEMU Documentation. * `dump `_: Code to dump memory of a running VM. * `ebpf `_: eBPF program support in QEMU. `virtio-net RSS` uses it. * `fpu `_: Floating-point software emulation. * `fsdev `_: `VirtFS `_ support. * `gdbstub `_: `GDB ` support. * `gdb-xml `_: Set of XML files describing architectures and used by `gdbstub `. * `host `_: Various architecture specific header files (crypto, atomic, memory operations). * `linux-headers `_: A subset of headers imported from Linux kernel and used for implementing KVM support and user-mode. * `linux-user `_: `User mode ` implementation. Contains one folder per target architecture. * `.gitlab-ci.d `_: `CI ` yaml and scripts. * `include `_: All headers associated to different subsystems in QEMU. The hierachy used mirrors source code organization and naming. * `hw `_: `Devices ` and boards emulation. Devices are categorized by type/protocol/architecture and located in associated subfolder. * `io `_: QEMU `I/O channels `_. * `libdecnumber `_: Import of gcc library, used to implement decimal number arithmetic. * `migration `__: `Migration framework `. * `monitor `_: `Monitor ` implementation (HMP & QMP). * `nbd `_: QEMU `NBD (Network Block Device) ` server. * `net `_: Network (host) support. * `pc-bios `_: Contains pre-built firmware binaries and boot images, ready to use in QEMU without compilation. * `plugins `_: :ref:`TCG plugins ` core implementation. Plugins can be found in `tests `__ and `contrib `__ folders. * `po `_: Translation files. * `python `_: Python part of our build/test system. * `qapi `_: `QAPI ` implementation. * `qobject `_: QEMU Object implementation. * `qga `_: QEMU `Guest agent ` implementation. * `qom `_: QEMU :ref:`Object model ` implementation, with monitor associated commands. * `replay `_: QEMU :ref:`Record/replay ` implementation. * `roms `_: Contains source code for various firmware and ROMs, which can be compiled if custom or updated versions are needed. * `rust `_: Rust integration in QEMU. It contains the new interfaces defined and associated devices using it. * `scripts `_: Collection of scripts used in build and test systems, and various tools for QEMU codebase and execution traces. * `scsi `_: Code related to SCSI support, used by SCSI devices. * `semihosting `_: QEMU `Semihosting ` implementation. * `stats `_: `Monitor ` stats commands implementation. * `storage-daemon `_: QEMU `Storage daemon ` implementation. * `stubs `_: Various stubs (empty functions) used to compile QEMU with specific configurations. * `subprojects `_: QEMU submodules used by QEMU build system. * `system `_: QEMU `system mode ` implementation (cpu, mmu, boot support). * `target `_: Contains code for all target architectures supported (one subfolder per arch). For every architecture, you can find accelerator specific implementations. * `tcg `_: :ref:`TCG ` related code. Contains one subfolder per host supported architecture. * `tests `_: QEMU `test ` suite - `avocado `_: Functional tests booting full VM using `Avocado framework `. Those tests will be transformed and moved into `tests/functional `_ in the future. - `data `_: Data for various tests. - `decode `_: Testsuite for :ref:`decodetree ` implementation. - `docker `_: Code and scripts to create `containers ` used in `CI `. - `fp `_: QEMU testsuite for soft float implementation. - `functional `_: `Functional tests ` (full VM boot). - `lcitool `_: Generate dockerfiles for CI containers. - `migration `_: Test scripts and data for `Migration framework `. - `multiboot `_: Test multiboot functionality for x86_64/i386. - `qapi-schema `_: Test scripts and data for `QAPI `. - `qemu-iotests `_: `Disk image and block tests `. - `qtest `_: `Device emulation testing `. - `tcg `__: `TCG related tests `. Contains code per architecture (subfolder) and multiarch tests as well. - `tsan `_: `Suppressions ` for thread sanitizer. - `uefi-test-tools `_: Test tool for UEFI support. - `unit `_: QEMU `Unit tests `. * `trace `_: :ref:`Tracing framework `. Used to print information associated to various events during execution. * `ui `_: QEMU User interfaces. * `util `_: Utility code used by other parts of QEMU.