On Wed, Sep 23, 2026 at 1:01 PM Pierrick Bouvier <
[email protected]> wrote:
>
> this indeed allows QOM types to coexist in same binary.
> In such binary, how are we now supposed to differentiate two virt
> machines from -M <name>, given they both have same alias name?
>
> Regards,
> Pierrick
# Machine option demos
Intended design for combined `qemu-system`. Implement to match these
rows. Last `-M` / `-machine` / `-readconfig` wins. `qemu.conf` is
applied first.
`arch:name` binds `arch` and picks `name`. `arch:` binds `arch`.
`x86_64:` and `i386:` then run that target's default machine.
`aarch64:` and `riscv64:` have no default and exit with
`No machine specified, and there is no default`. A later bare
`name` keeps the last prefix. Help / `?` after `arch:` lists that
target; it does not leave the target at `none`.
Single-target rows are historic `qemu-system-<arch>` and stay as they
are.
## Bind and run
| Command | Shows |
|---------|-------|
| `qemu-system -M aarch64:virt` | Bind `aarch64`, run `virt`. |
| `qemu-system -M x86_64:q35` | Bind `x86_64`, run `q35`. |
| `qemu-system -M riscv64:virt` | Bind `riscv64`, run `virt`. |
| `qemu-system -M type=aarch64:virt` | Same as `-M aarch64:virt`. |
| `qemu-system -machine aarch64:virt` | Same as `-M`. |
| `qemu-system-aarch64 -M virt` | Historic. No `arch:` bind. |
| `qemu-system-x86_64` | Single-target default (`pc` / `q35`). |
## Default machine (`arch:`)
| Command | Shows |
|---------|-------|
| `qemu-system -M x86_64:` | Bind `x86_64`, run that target's default. |
| `qemu-system -M i386:` | Bind `i386`, run that target's default. |
| `qemu-system -M aarch64:` | Bind `aarch64`, then `No machine specified,
and there is no default`. |
| `qemu-system -M riscv64:` | Bind `riscv64`, then the same error. |
| `qemu-system -M none:` | Target `none`, empty `none` machine. |
## List
| Command | Shows |
|---------|-------|
| `qemu-system -M help` | Grouped list. `none:` first, then each target. |
| `qemu-system -M ?` | Same as `-M help`. |
| `qemu-system -M aarch64:help` | Flat list for `aarch64` only. |
| `qemu-system -M aarch64:?` | Same as `-M aarch64:help`. |
| `qemu-system -M riscv64:help` | Flat list for `riscv64` only. |
| `qemu-system -M none:help` | `none` and `empty machine`. No other target
group. |
| `qemu-system-aarch64 -M help` | Flat list for that target only. |
## Empty machine
| Command | Shows |
|---------|-------|
| `qemu-system` | Target `none`, empty `none` machine. |
| `qemu-system -M none` | Empty `none` machine. |
| `qemu-system -M none:none` | Same. |
| `qemu-system -M aarch64:none` | Target `aarch64`, empty `none` machine. |
| `qemu-system -M aarch64:virt -M none` | Empty `none` machine. Target
stays `aarch64`. |
## Properties
| Command | Shows |
|---------|-------|
| `qemu-system -M aarch64:virt,help` | Bind `aarch64`, dump `virt`
properties. |
| `qemu-system -M aarch64:,help` | `No machine specified, and there is no
default`. |
| `qemu-system -M virt,help` | `machine type "virt" needs an arch: prefix`.
|
| `qemu-system -M none,help` | Dump empty `none` machine properties. |
| `qemu-system-aarch64 -M virt,help` | Historic property dump for `virt`. |
## Last `-M` wins
| Command | Shows |
|---------|-------|
| `qemu-system -M aarch64:virt -M x86_64:q35` | Target `x86_64`, machine
`q35`. |
| `qemu-system -M aarch64:virt -M virt` | Last name is `virt`. Keep prefix
`aarch64`, run `virt`. |
| `qemu-system -M virt -M aarch64:virt` | Target `aarch64`, machine `virt`.
|
| `qemu-system -M aarch64: -M virt` | Bind `aarch64`, then bare `virt` runs
`virt`. |
| `qemu-system -M aarch64:virt -M riscv64:` | Bind `riscv64`, then `No
machine specified, and there is no default`. |
| `qemu-system -M aarch64:virt -M riscv64:virt` | Target `riscv64`, machine
`virt`. |
| `qemu-system -M help -M aarch64:virt` | Help is not last; run
`aarch64:virt`. |
| `qemu-system -M aarch64:virt -M help` | Keep prefix `aarch64`. List has
`virt`, not `q35`. |
## `-readconfig`
A `[machine] type = "..."` file is another machine option. The last
of `-M`, `-machine`, and `-readconfig` wins.
| Command | Shows |
|---------|-------|
| `-readconfig` with `type = "aarch64:virt"` | Bind `aarch64`, run `virt`. |
| that file, then `-M none` | Machine `none`. Target stays `aarch64`. |
| `-readconfig` with `type = "none:"` | Target `none`, empty `none`
machine. |
| `-M aarch64:virt`, then `-readconfig` `type = "riscv64:virt"` | Target
`riscv64`, machine `virt`. |
## Wrong target or machine
| Command | Shows |
|---------|-------|
| `qemu-system -M virt` | `machine type "virt" needs an arch: prefix` |
| `qemu-system -M riscv64` | Same. Bare `riscv64` is a machine name, not a
target. |
| `qemu-system -M aarch64` | Same. Bare `aarch64` is a machine name, not a
target. |
| `qemu-system -M aarch64:q35` | Target `aarch64`, then `unsupported
machine type: "aarch64:q35"` |
| `qemu-system -M arm:sbsa-ref` | Target `arm`, then unsupported
(`sbsa-ref` is `aarch64` only). |
| `qemu-system -M aarch64:no-such` | Target `aarch64`, then `unsupported
machine type: "aarch64:no-such"` |
| `qemu-system -M no-such:virt` | `target 'no-such' is not available` |
| `qemu-system -M AARCH64:virt` | `target 'AARCH64' is not available`
(names are lowercase). |
| `qemu-system -M none:virt` | `machine type "none:virt" is not available
for target none` |
## Odd strings
| Command | Shows |
|---------|-------|
| `qemu-system -M :virt` | Not a prefix. Same as bare `virt`: needs
`arch:`. |
| `qemu-system -M :` | Not a prefix. Unsupported machine `:` / needs
`arch:`. |
| `qemu-system -M aarch64:virt:extra` | First colon only. Name is
`virt:extra`. Unsupported machine. |
| `qemu-system-x86_64 -M aarch64:virt` | Prefix `aarch64` != `x86_64`. Not
available for this target. |
| `qemu-system-aarch64 -M aarch64:virt` | Prefix matches. Run `virt`. |
## Intended grouped `-M help` (no target)
| Group | Contents |
|-------|----------|
| `none:` | only `none` |
| `i386:` and `x86_64:` | pc / q35 / isapc / microvm / xen / nitro |
| `arm:` and `aarch64:` | `virt-*` and 32-bit ARM boards |
| `aarch64:` only | sbsa-ref, versal, zcu102, imx8, npcm845, raspi3/4,
ast2700 |
| `riscv32:` and `riscv64:` | RISC-V boards |
| `microblaze:` | petalogix and xlnx-zynqmp-pmu |
--
此致
礼
罗勇刚
Yours
sincerely,
Yonggang Luo