aboutsummaryrefslogtreecommitdiff
path: root/qemu-options.hx
diff options
context:
space:
mode:
Diffstat (limited to 'qemu-options.hx')
-rw-r--r--qemu-options.hx1164
1 files changed, 833 insertions, 331 deletions
diff --git a/qemu-options.hx b/qemu-options.hx
index 8f603cc7e6..7fd1713fa8 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -1,3 +1,5 @@
+HXCOMM See docs/devel/docs.rst for the format of this file.
+HXCOMM
HXCOMM Use DEFHEADING() to define headings in both help text and rST.
HXCOMM Text between SRST and ERST is copied to the rST version and
HXCOMM discarded from C version.
@@ -26,7 +28,7 @@ DEF("machine", HAS_ARG, QEMU_OPTION_machine, \
"-machine [type=]name[,prop[=value][,...]]\n"
" selects emulated machine ('-machine help' for list)\n"
" property accel=accel1[:accel2[:...]] selects accelerator\n"
- " supported accelerators are kvm, xen, hax, hvf, nvmm, whpx or tcg (default: tcg)\n"
+ " supported accelerators are kvm, xen, hvf, nvmm, whpx or tcg (default: tcg)\n"
" vmport=on|off|auto controls emulation of vmport (default: auto)\n"
" dump-guest-core=on|off include guest memory in a core dump (default=on)\n"
" mem-merge=on|off controls memory merge support (default: on)\n"
@@ -36,7 +38,8 @@ DEF("machine", HAS_ARG, QEMU_OPTION_machine, \
" nvdimm=on|off controls NVDIMM support (default=off)\n"
" memory-encryption=@var{} memory encryption object to use (default=none)\n"
" hmat=on|off controls ACPI HMAT support (default=off)\n"
- " memory-backend='backend-id' specifies explicitly provided backend for main RAM (default=none)\n",
+ " memory-backend='backend-id' specifies explicitly provided backend for main RAM (default=none)\n"
+ " cxl-fmw.0.targets.0=firsttarget,cxl-fmw.0.targets.1=secondtarget,cxl-fmw.0.size=size[,cxl-fmw.0.interleave-granularity=granularity]\n",
QEMU_ARCH_ALL)
SRST
``-machine [type=]name[,prop=value[,...]]``
@@ -58,7 +61,7 @@ SRST
``accel=accels1[:accels2[:...]]``
This is used to enable an accelerator. Depending on the target
- architecture, kvm, xen, hax, hvf, nvmm, whpx or tcg can be available.
+ architecture, kvm, xen, hvf, nvmm, whpx or tcg can be available.
By default, tcg is used. If there is more than one accelerator
specified, the next one is used if the previous one fails to
initialize.
@@ -124,10 +127,48 @@ SRST
-object memory-backend-ram,id=pc.ram,size=512M,x-use-canonical-path-for-ramblock-id=off
-machine memory-backend=pc.ram
-m 512M
+
+ ``cxl-fmw.0.targets.0=firsttarget,cxl-fmw.0.targets.1=secondtarget,cxl-fmw.0.size=size[,cxl-fmw.0.interleave-granularity=granularity]``
+ Define a CXL Fixed Memory Window (CFMW).
+
+ Described in the CXL 2.0 ECN: CEDT CFMWS & QTG _DSM.
+
+ They are regions of Host Physical Addresses (HPA) on a system which
+ may be interleaved across one or more CXL host bridges. The system
+ software will assign particular devices into these windows and
+ configure the downstream Host-managed Device Memory (HDM) decoders
+ in root ports, switch ports and devices appropriately to meet the
+ interleave requirements before enabling the memory devices.
+
+ ``targets.X=target`` provides the mapping to CXL host bridges
+ which may be identified by the id provided in the -device entry.
+ Multiple entries are needed to specify all the targets when
+ the fixed memory window represents interleaved memory. X is the
+ target index from 0.
+
+ ``size=size`` sets the size of the CFMW. This must be a multiple of
+ 256MiB. The region will be aligned to 256MiB but the location is
+ platform and configuration dependent.
+
+ ``interleave-granularity=granularity`` sets the granularity of
+ interleave. Default 256KiB. Only 256KiB, 512KiB, 1024KiB, 2048KiB
+ 4096KiB, 8192KiB and 16384KiB granularities supported.
+
+ Example:
+
+ ::
+
+ -machine cxl-fmw.0.targets.0=cxl.0,cxl-fmw.0.targets.1=cxl.1,cxl-fmw.0.size=128G,cxl-fmw.0.interleave-granularity=512k
ERST
-HXCOMM Deprecated by -machine
-DEF("M", HAS_ARG, QEMU_OPTION_M, "", QEMU_ARCH_ALL)
+DEF("M", HAS_ARG, QEMU_OPTION_M,
+ " sgx-epc.0.memdev=memid,sgx-epc.0.node=numaid\n",
+ QEMU_ARCH_ALL)
+
+SRST
+``sgx-epc.0.memdev=@var{memid},sgx-epc.0.node=@var{numaid}``
+ Define an SGX EPC section.
+ERST
DEF("cpu", HAS_ARG, QEMU_OPTION_cpu,
"-cpu cpu select CPU ('-cpu help' for list)\n", QEMU_ARCH_ALL)
@@ -139,18 +180,22 @@ ERST
DEF("accel", HAS_ARG, QEMU_OPTION_accel,
"-accel [accel=]accelerator[,prop[=value][,...]]\n"
- " select accelerator (kvm, xen, hax, hvf, nvmm, whpx or tcg; use 'help' for a list)\n"
+ " select accelerator (kvm, xen, hvf, nvmm, whpx or tcg; use 'help' for a list)\n"
" igd-passthru=on|off (enable Xen integrated Intel graphics passthrough, default=off)\n"
" kernel-irqchip=on|off|split controls accelerated irqchip support (default=on)\n"
" kvm-shadow-mem=size of KVM shadow MMU in bytes\n"
+ " one-insn-per-tb=on|off (one guest instruction per TCG translation block)\n"
" split-wx=on|off (enable TCG split w^x mapping)\n"
" tb-size=n (TCG translation block cache size)\n"
" dirty-ring-size=n (KVM dirty ring GFN count, default 0)\n"
- " thread=single|multi (enable multi-threaded TCG)\n", QEMU_ARCH_ALL)
+ " eager-split-size=n (KVM Eager Page Split chunk size, default 0, disabled. ARM only)\n"
+ " notify-vmexit=run|internal-error|disable,notify-window=n (enable notify VM exit and set notify window, x86 only)\n"
+ " thread=single|multi (enable multi-threaded TCG)\n"
+ " device=path (KVM device path, default /dev/kvm)\n", QEMU_ARCH_ALL)
SRST
``-accel name[,prop=value[,...]]``
This is used to enable an accelerator. Depending on the target
- architecture, kvm, xen, hax, hvf, nvmm, whpx or tcg can be available. By
+ architecture, kvm, xen, hvf, nvmm, whpx or tcg can be available. By
default, tcg is used. If there is more than one accelerator
specified, the next one is used if the previous one fails to
initialize.
@@ -170,6 +215,12 @@ SRST
``kvm-shadow-mem=size``
Defines the size of the KVM shadow MMU.
+ ``one-insn-per-tb=on|off``
+ Makes the TCG accelerator put only one guest instruction into
+ each translation block. This slows down emulation a lot, but
+ can be useful in some situations, such as when trying to analyse
+ the logs produced by the ``-d`` option.
+
``split-wx=on|off``
Controls the use of split w^x mapping for the TCG code generation
buffer. Some operating systems require this to be enabled, and in
@@ -197,41 +248,137 @@ SRST
is disabled (dirty-ring-size=0). When enabled, KVM will instead
record dirty pages in a bitmap.
+ ``eager-split-size=n``
+ KVM implements dirty page logging at the PAGE_SIZE granularity and
+ enabling dirty-logging on a huge-page requires breaking it into
+ PAGE_SIZE pages in the first place. KVM on ARM does this splitting
+ lazily by default. There are performance benefits in doing huge-page
+ split eagerly, especially in situations where TLBI costs associated
+ with break-before-make sequences are considerable and also if guest
+ workloads are read intensive. The size here specifies how many pages
+ to break at a time and needs to be a valid block size which is
+ 1GB/2MB/4KB, 32MB/16KB and 512MB/64KB for 4KB/16KB/64KB PAGE_SIZE
+ respectively. Be wary of specifying a higher size as it will have an
+ impact on the memory. By default, this feature is disabled
+ (eager-split-size=0).
+
+ ``notify-vmexit=run|internal-error|disable,notify-window=n``
+ Enables or disables notify VM exit support on x86 host and specify
+ the corresponding notify window to trigger the VM exit if enabled.
+ ``run`` option enables the feature. It does nothing and continue
+ if the exit happens. ``internal-error`` option enables the feature.
+ It raises a internal error. ``disable`` option doesn't enable the feature.
+ This feature can mitigate the CPU stuck issue due to event windows don't
+ open up for a specified of time (i.e. notify-window).
+ Default: notify-vmexit=run,notify-window=0.
+
+ ``device=path``
+ Sets the path to the KVM device node. Defaults to ``/dev/kvm``. This
+ option can be used to pass the KVM device to use via a file descriptor
+ by setting the value to ``/dev/fdset/NN``.
+
ERST
DEF("smp", HAS_ARG, QEMU_OPTION_smp,
- "-smp [[cpus=]n][,maxcpus=cpus][,sockets=sockets][,dies=dies][,cores=cores][,threads=threads]\n"
- " set the number of CPUs to 'n' [default=1]\n"
+ "-smp [[cpus=]n][,maxcpus=maxcpus][,drawers=drawers][,books=books][,sockets=sockets]\n"
+ " [,dies=dies][,clusters=clusters][,cores=cores][,threads=threads]\n"
+ " set the number of initial CPUs to 'n' [default=1]\n"
" maxcpus= maximum number of total CPUs, including\n"
" offline CPUs for hotplug, etc\n"
- " sockets= number of discrete sockets in the system\n"
- " dies= number of CPU dies on one socket (for PC only)\n"
- " cores= number of CPU cores on one socket (for PC, it's on one die)\n"
- " threads= number of threads on one CPU core\n",
- QEMU_ARCH_ALL)
+ " drawers= number of drawers on the machine board\n"
+ " books= number of books in one drawer\n"
+ " sockets= number of sockets in one book\n"
+ " dies= number of dies in one socket\n"
+ " clusters= number of clusters in one die\n"
+ " cores= number of cores in one cluster\n"
+ " threads= number of threads in one core\n"
+ "Note: Different machines may have different subsets of the CPU topology\n"
+ " parameters supported, so the actual meaning of the supported parameters\n"
+ " will vary accordingly. For example, for a machine type that supports a\n"
+ " three-level CPU hierarchy of sockets/cores/threads, the parameters will\n"
+ " sequentially mean as below:\n"
+ " sockets means the number of sockets on the machine board\n"
+ " cores means the number of cores in one socket\n"
+ " threads means the number of threads in one core\n"
+ " For a particular machine type board, an expected CPU topology hierarchy\n"
+ " can be defined through the supported sub-option. Unsupported parameters\n"
+ " can also be provided in addition to the sub-option, but their values\n"
+ " must be set as 1 in the purpose of correct parsing.\n",
+ QEMU_ARCH_ALL)
SRST
-``-smp [[cpus=]n][,maxcpus=maxcpus][,sockets=sockets][,dies=dies][,cores=cores][,threads=threads]``
+``-smp [[cpus=]n][,maxcpus=maxcpus][,sockets=sockets][,dies=dies][,clusters=clusters][,cores=cores][,threads=threads]``
Simulate a SMP system with '\ ``n``\ ' CPUs initially present on
the machine type board. On boards supporting CPU hotplug, the optional
'\ ``maxcpus``\ ' parameter can be set to enable further CPUs to be
- added at runtime. If omitted the maximum number of CPUs will be
- set to match the initial CPU count. Both parameters are subject to
- an upper limit that is determined by the specific machine type chosen.
-
- To control reporting of CPU topology information, the number of sockets,
- dies per socket, cores per die, and threads per core can be specified.
- The sum `` sockets * cores * dies * threads `` must be equal to the
- maximum CPU count. CPU targets may only support a subset of the topology
- parameters. Where a CPU target does not support use of a particular
- topology parameter, its value should be assumed to be 1 for the purpose
- of computing the CPU maximum count.
+ added at runtime. When both parameters are omitted, the maximum number
+ of CPUs will be calculated from the provided topology members and the
+ initial CPU count will match the maximum number. When only one of them
+ is given then the omitted one will be set to its counterpart's value.
+ Both parameters may be specified, but the maximum number of CPUs must
+ be equal to or greater than the initial CPU count. Product of the
+ CPU topology hierarchy must be equal to the maximum number of CPUs.
+ Both parameters are subject to an upper limit that is determined by
+ the specific machine type chosen.
+
+ To control reporting of CPU topology information, values of the topology
+ parameters can be specified. Machines may only support a subset of the
+ parameters and different machines may have different subsets supported
+ which vary depending on capacity of the corresponding CPU targets. So
+ for a particular machine type board, an expected topology hierarchy can
+ be defined through the supported sub-option. Unsupported parameters can
+ also be provided in addition to the sub-option, but their values must be
+ set as 1 in the purpose of correct parsing.
Either the initial CPU count, or at least one of the topology parameters
- must be specified. Values for any omitted parameters will be computed
- from those which are given. Historically preference was given to the
- coarsest topology parameters when computing missing values (ie sockets
- preferred over cores, which were preferred over threads), however, this
- behaviour is considered liable to change.
+ must be specified. The specified parameters must be greater than zero,
+ explicit configuration like "cpus=0" is not allowed. Values for any
+ omitted parameters will be computed from those which are given.
+
+ For example, the following sub-option defines a CPU topology hierarchy
+ (2 sockets totally on the machine, 2 cores per socket, 2 threads per
+ core) for a machine that only supports sockets/cores/threads.
+ Some members of the option can be omitted but their values will be
+ automatically computed:
+
+ ::
+
+ -smp 8,sockets=2,cores=2,threads=2,maxcpus=8
+
+ The following sub-option defines a CPU topology hierarchy (2 sockets
+ totally on the machine, 2 dies per socket, 2 cores per die, 2 threads
+ per core) for PC machines which support sockets/dies/cores/threads.
+ Some members of the option can be omitted but their values will be
+ automatically computed:
+
+ ::
+
+ -smp 16,sockets=2,dies=2,cores=2,threads=2,maxcpus=16
+
+ The following sub-option defines a CPU topology hierarchy (2 sockets
+ totally on the machine, 2 clusters per socket, 2 cores per cluster,
+ 2 threads per core) for ARM virt machines which support sockets/clusters
+ /cores/threads. Some members of the option can be omitted but their values
+ will be automatically computed:
+
+ ::
+
+ -smp 16,sockets=2,clusters=2,cores=2,threads=2,maxcpus=16
+
+ Historically preference was given to the coarsest topology parameters
+ when computing missing values (ie sockets preferred over cores, which
+ were preferred over threads), however, this behaviour is considered
+ liable to change. Prior to 6.2 the preference was sockets over cores
+ over threads. Since 6.2 the preference is cores over sockets over threads.
+
+ For example, the following option defines a machine board with 2 sockets
+ of 1 core before 6.2 and 1 socket of 2 cores after 6.2:
+
+ ::
+
+ -smp 2
+
+ Note: The cluster topology will only be generated in ACPI and exposed
+ to guest if it's explicitly specified in -smp.
ERST
DEF("numa", HAS_ARG, QEMU_OPTION_numa,
@@ -251,7 +398,7 @@ SRST
\
``-numa cpu,node-id=node[,socket-id=x][,core-id=y][,thread-id=z]``
\
-``-numa hmat-lb,initiator=node,target=node,hierarchy=hierarchy,data-type=tpye[,latency=lat][,bandwidth=bw]``
+``-numa hmat-lb,initiator=node,target=node,hierarchy=hierarchy,data-type=type[,latency=lat][,bandwidth=bw]``
\
``-numa hmat-cache,node-id=node,size=size,level=level[,associativity=str][,policy=str][,line=size]``
Define a NUMA node and assign RAM and VCPUs to it. Set the NUMA
@@ -291,15 +438,22 @@ SRST
-numa node,nodeid=0 -numa node,nodeid=1 \
-numa cpu,node-id=0,socket-id=0 -numa cpu,node-id=1,socket-id=1
- Legacy '\ ``mem``\ ' assigns a given RAM amount to a node (not supported
- for 5.1 and newer machine types). '\ ``memdev``\ ' assigns RAM from
- a given memory backend device to a node. If '\ ``mem``\ ' and
- '\ ``memdev``\ ' are omitted in all nodes, RAM is split equally between them.
+ '\ ``memdev``\ ' option assigns RAM from a given memory backend
+ device to a node. It is recommended to use '\ ``memdev``\ ' option
+ over legacy '\ ``mem``\ ' option. This is because '\ ``memdev``\ '
+ option provides better performance and more control over the
+ backend's RAM (e.g. '\ ``prealloc``\ ' parameter of
+ '\ ``-memory-backend-ram``\ ' allows memory preallocation).
+ For compatibility reasons, legacy '\ ``mem``\ ' option is
+ supported in 5.0 and older machine types. Note that '\ ``mem``\ '
+ and '\ ``memdev``\ ' are mutually exclusive. If one node uses
+ '\ ``memdev``\ ', the rest nodes have to use '\ ``memdev``\ '
+ option, and vice versa.
- '\ ``mem``\ ' and '\ ``memdev``\ ' are mutually exclusive.
- Furthermore, if one node uses '\ ``memdev``\ ', all of them have to
- use it.
+ Users must specify memory for all NUMA nodes by '\ ``memdev``\ '
+ (or legacy '\ ``mem``\ ' if available). In QEMU 5.2, the support
+ for '\ ``-numa node``\ ' without memory specified was removed.
'\ ``initiator``\ ' is an additional option that points to an
initiator NUMA node that has best performance (the lowest latency or
@@ -387,7 +541,7 @@ SRST
-m 2G \
-object memory-backend-ram,size=1G,id=m0 \
-object memory-backend-ram,size=1G,id=m1 \
- -smp 2 \
+ -smp 2,sockets=2,maxcpus=2 \
-numa node,nodeid=0,memdev=m0 \
-numa node,nodeid=1,memdev=m1,initiator=0 \
-numa cpu,node-id=0,socket-id=0 \
@@ -524,7 +678,7 @@ DEF("m", HAS_ARG, QEMU_OPTION_m,
" size: initial amount of guest memory\n"
" slots: number of hotplug slots (default: none)\n"
" maxmem: maximum amount of guest memory (default: none)\n"
- "NOTE: Some architectures might enforce a specific granularity\n",
+ " Note: Some architectures might enforce a specific granularity\n",
QEMU_ARCH_ALL)
SRST
``-m [size=]megs[,slots=n,maxmem=size]``
@@ -584,19 +738,48 @@ SRST
ERST
-HXCOMM Deprecated by -audiodev
-DEF("audio-help", 0, QEMU_OPTION_audio_help,
- "-audio-help show -audiodev equivalent of the currently specified audio settings\n",
+DEF("audio", HAS_ARG, QEMU_OPTION_audio,
+ "-audio [driver=]driver[,prop[=value][,...]]\n"
+ " specifies default audio backend when `audiodev` is not\n"
+ " used to create a machine or sound device;"
+ " options are the same as for -audiodev\n"
+ "-audio [driver=]driver,model=value[,prop[=value][,...]]\n"
+ " specifies the audio backend and device to use;\n"
+ " apart from 'model', options are the same as for -audiodev.\n"
+ " use '-audio model=help' to show possible devices.\n",
QEMU_ARCH_ALL)
SRST
-``-audio-help``
- Will show the -audiodev equivalent of the currently specified
- (deprecated) environment variables.
+``-audio [driver=]driver[,model=value][,prop[=value][,...]]``
+ If the ``model`` option is specified, ``-audio`` is a shortcut
+ for configuring both the guest audio hardware and the host audio
+ backend in one go. The guest hardware model can be set with
+ ``model=modelname``. Use ``model=help`` to list the available
+ device types.
+
+ The following two example do exactly the same, to show how ``-audio``
+ can be used to shorten the command line length:
+
+ .. parsed-literal::
+
+ |qemu_system| -audiodev pa,id=pa -device sb16,audiodev=pa
+ |qemu_system| -audio pa,model=sb16
+
+ If the ``model`` option is not specified, ``-audio`` is used to
+ configure a default audio backend that will be used whenever the
+ ``audiodev`` property is not set on a device or machine. In
+ particular, ``-audio none`` ensures that no audio is produced even
+ for machines that have embedded sound hardware.
+
+ In both cases, the driver option is the same as with the corresponding
+ ``-audiodev`` option below. Use ``driver=help`` to list the available
+ drivers.
+
ERST
DEF("audiodev", HAS_ARG, QEMU_OPTION_audiodev,
"-audiodev [driver=]driver,id=id[,prop[=value][,...]]\n"
" specifies the audio backend to use\n"
+ " Use ``-audiodev help`` to list the available drivers\n"
" id= identifier of the backend\n"
" timer-period= timer period in microseconds\n"
" in|out.mixing-engine= use mixing engine to mix streams inside QEMU\n"
@@ -639,13 +822,25 @@ DEF("audiodev", HAS_ARG, QEMU_OPTION_audiodev,
" in|out.name= source/sink device name\n"
" in|out.latency= desired latency in microseconds\n"
#endif
+#ifdef CONFIG_AUDIO_PIPEWIRE
+ "-audiodev pipewire,id=id[,prop[=value][,...]]\n"
+ " in|out.name= source/sink device name\n"
+ " in|out.stream-name= name of pipewire stream\n"
+ " in|out.latency= desired latency in microseconds\n"
+#endif
#ifdef CONFIG_AUDIO_SDL
"-audiodev sdl,id=id[,prop[=value][,...]]\n"
" in|out.buffer-count= number of buffers\n"
#endif
+#ifdef CONFIG_AUDIO_SNDIO
+ "-audiodev sndio,id=id[,prop[=value][,...]]\n"
+#endif
#ifdef CONFIG_SPICE
"-audiodev spice,id=id[,prop[=value][,...]]\n"
#endif
+#ifdef CONFIG_DBUS_DISPLAY
+ "-audiodev dbus,id=id[,prop[=value][,...]]\n"
+#endif
"-audiodev wav,id=id[,prop[=value][,...]]\n"
" path= path of wav file to record\n",
QEMU_ARCH_ALL)
@@ -796,6 +991,21 @@ SRST
Desired latency in microseconds. The PulseAudio server will try
to honor this value but actual latencies may be lower or higher.
+``-audiodev pipewire,id=id[,prop[=value][,...]]``
+ Creates a backend using PipeWire. This backend is available on
+ most systems.
+
+ PipeWire specific options are:
+
+ ``in|out.latency=usecs``
+ Desired latency in microseconds.
+
+ ``in|out.name=sink``
+ Use the specified source/sink for recording/playback.
+
+ ``in|out.stream-name``
+ Specify the name of pipewire stream.
+
``-audiodev sdl,id=id[,prop[=value][,...]]``
Creates a backend using SDL. This backend is available on most
systems, but you should use your platform's native backend if
@@ -806,6 +1016,19 @@ SRST
``in|out.buffer-count=count``
Sets the count of the buffers.
+``-audiodev sndio,id=id[,prop[=value][,...]]``
+ Creates a backend using SNDIO. This backend is available on
+ OpenBSD and most other Unix-like systems.
+
+ Sndio specific options are:
+
+ ``in|out.dev=device``
+ Specify the sndio device to use for input and/or output. Default
+ is ``default``.
+
+ ``in|out.latency=usecs``
+ Sets the desired period length in microseconds.
+
``-audiodev spice,id=id[,prop[=value][,...]]``
Creates a backend that sends audio through SPICE. This backend
requires ``-spice`` and automatically selected in that case, so
@@ -822,33 +1045,6 @@ SRST
``qemu.wav``.
ERST
-DEF("soundhw", HAS_ARG, QEMU_OPTION_soundhw,
- "-soundhw c1,... enable audio support\n"
- " and only specified sound cards (comma separated list)\n"
- " use '-soundhw help' to get the list of supported cards\n"
- " use '-soundhw all' to enable all of them\n", QEMU_ARCH_ALL)
-SRST
-``-soundhw card1[,card2,...] or -soundhw all``
- Enable audio and selected sound hardware. Use 'help' to print all
- available sound hardware. For example:
-
- .. parsed-literal::
-
- |qemu_system_x86| -soundhw sb16,adlib disk.img
- |qemu_system_x86| -soundhw es1370 disk.img
- |qemu_system_x86| -soundhw ac97 disk.img
- |qemu_system_x86| -soundhw hda disk.img
- |qemu_system_x86| -soundhw all disk.img
- |qemu_system_x86| -soundhw help
-
- Note that Linux's i810\_audio OSS kernel (for AC97) module might
- require manually specifying clocking.
-
- ::
-
- modprobe i810_audio clocking=48000
-ERST
-
DEF("device", HAS_ARG, QEMU_OPTION_device,
"-device driver[,prop[=value][,...]]\n"
" add device (based on driver)\n"
@@ -916,7 +1112,7 @@ SRST
details on the external interface.
``-device isa-ipmi-kcs,bmc=id[,ioport=val][,irq=val]``
- Add a KCS IPMI interafce on the ISA bus. This also adds a
+ Add a KCS IPMI interface on the ISA bus. This also adds a
corresponding ACPI and SMBIOS entries, if appropriate.
``bmc=id``
@@ -936,7 +1132,7 @@ SRST
is 0xe4 and the default interrupt is 5.
``-device pci-ipmi-kcs,bmc=id``
- Add a KCS IPMI interafce on the PCI bus.
+ Add a KCS IPMI interface on the PCI bus.
``bmc=id``
The BMC to connect to, one of ipmi-bmc-sim or ipmi-bmc-extern above.
@@ -976,6 +1172,17 @@ SRST
Please also refer to the wiki page for general scenarios of VT-d
emulation in QEMU: https://wiki.qemu.org/Features/VT-d.
+``-device virtio-iommu-pci[,option=...]``
+ This is only supported by ``-machine q35`` (x86_64) and ``-machine virt`` (ARM).
+ It supports below options:
+
+ ``granule=val`` (possible values are 4k, 8k, 16k, 64k and host; default: host)
+ This decides the default granule to be be exposed by the
+ virtio-iommu. If host, the granule matches the host page size.
+
+ ``aw-bits=val`` (val between 32 and 64, default depends on machine)
+ This decides the address width of the IOVA address space.
+
ERST
DEF("name", HAS_ARG, QEMU_OPTION_name,
@@ -1005,6 +1212,31 @@ DEFHEADING()
DEFHEADING(Block device options:)
+SRST
+The QEMU block device handling options have a long history and
+have gone through several iterations as the feature set and complexity
+of the block layer have grown. Many online guides to QEMU often
+reference older and deprecated options, which can lead to confusion.
+
+The most explicit way to describe disks is to use a combination of
+``-device`` to specify the hardware device and ``-blockdev`` to
+describe the backend. The device defines what the guest sees and the
+backend describes how QEMU handles the data. It is the only guaranteed
+stable interface for describing block devices and as such is
+recommended for management tools and scripting.
+
+The ``-drive`` option combines the device and backend into a single
+command line option which is a more human friendly. There is however no
+interface stability guarantee although some older board models still
+need updating to work with the modern blockdev forms.
+
+Older options like ``-hda`` are essentially macros which expand into
+``-drive`` options for various drive interfaces. The original forms
+bake in a lot of assumptions from the days when QEMU was emulating a
+legacy PC, they are not recommended for modern configurations.
+
+ERST
+
DEF("fda", HAS_ARG, QEMU_OPTION_fda,
"-fda/-fdb file use 'file' as floppy disk 0/1 image\n", QEMU_ARCH_ALL)
DEF("fdb", HAS_ARG, QEMU_OPTION_fdb, "", QEMU_ARCH_ALL)
@@ -1017,10 +1249,10 @@ SRST
ERST
DEF("hda", HAS_ARG, QEMU_OPTION_hda,
- "-hda/-hdb file use 'file' as IDE hard disk 0/1 image\n", QEMU_ARCH_ALL)
+ "-hda/-hdb file use 'file' as hard disk 0/1 image\n", QEMU_ARCH_ALL)
DEF("hdb", HAS_ARG, QEMU_OPTION_hdb, "", QEMU_ARCH_ALL)
DEF("hdc", HAS_ARG, QEMU_OPTION_hdc,
- "-hdc/-hdd file use 'file' as IDE hard disk 2/3 image\n", QEMU_ARCH_ALL)
+ "-hdc/-hdd file use 'file' as hard disk 2/3 image\n", QEMU_ARCH_ALL)
DEF("hdd", HAS_ARG, QEMU_OPTION_hdd, "", QEMU_ARCH_ALL)
SRST
``-hda file``
@@ -1030,18 +1262,22 @@ SRST
``-hdc file``
\
``-hdd file``
- Use file as hard disk 0, 1, 2 or 3 image (see the :ref:`disk images`
- chapter in the System Emulation Users Guide).
+ Use file as hard disk 0, 1, 2 or 3 image on the default bus of the
+ emulated machine (this is for example the IDE bus on most x86 machines,
+ but it can also be SCSI, virtio or something else on other target
+ architectures). See also the :ref:`disk images` chapter in the System
+ Emulation Users Guide.
ERST
DEF("cdrom", HAS_ARG, QEMU_OPTION_cdrom,
- "-cdrom file use 'file' as IDE cdrom image (cdrom is ide1 master)\n",
+ "-cdrom file use 'file' as CD-ROM image\n",
QEMU_ARCH_ALL)
SRST
``-cdrom file``
- Use file as CD-ROM image (you cannot use ``-hdc`` and ``-cdrom`` at
- the same time). You can use the host CD-ROM by using ``/dev/cdrom``
- as filename.
+ Use file as CD-ROM image on the default bus of the emulated machine
+ (which is IDE1 master on x86, so you cannot use ``-hdc`` and ``-cdrom``
+ at the same time there). On systems that support it, you can use the
+ host CD-ROM by using ``/dev/cdrom`` as filename.
ERST
DEF("blockdev", HAS_ARG, QEMU_OPTION_blockdev,
@@ -1239,6 +1475,22 @@ SRST
issued on other occasions where a cluster gets freed
(on/off; default: off)
+ ``discard-no-unref``
+ When enabled, data clusters will remain preallocated when they are
+ no longer used, e.g. because they are discarded or converted to
+ zero clusters. As usual, whether the old data is discarded or kept
+ on the protocol level (i.e. in the image file) depends on the
+ setting of the pass-discard-request option. Keeping the clusters
+ preallocated prevents qcow2 fragmentation that would otherwise be
+ caused by freeing and re-allocating them later. Besides potential
+ performance degradation, such fragmentation can lead to increased
+ allocation of clusters past the end of the image file,
+ resulting in image files whose file length can grow much larger
+ than their guest disk size would suggest.
+ If image file length is of concern (e.g. when storing qcow2
+ images directly on block devices), you should consider enabling
+ this option.
+
``overlap-check``
Which overlap checks to perform for writes to the image
(none/constant/cached/all; default: cached). For details or
@@ -1307,7 +1559,7 @@ SRST
the bus number and the unit id.
``index=index``
- This option defines where is connected the drive by using an
+ This option defines where the drive is connected by using an
index in the list of available connectors of a given interface
type.
@@ -1461,7 +1713,7 @@ SRST
.. parsed-literal::
- |qemu_system_x86| -drive file=a -drive file=b"
+ |qemu_system_x86| -drive file=a -drive file=b
is interpreted like:
@@ -1485,13 +1737,6 @@ SRST
Use file as SecureDigital card image.
ERST
-DEF("pflash", HAS_ARG, QEMU_OPTION_pflash,
- "-pflash file use 'file' as a parallel flash image\n", QEMU_ARCH_ALL)
-SRST
-``-pflash file``
- Use file as a parallel flash image.
-ERST
-
DEF("snapshot", 0, QEMU_OPTION_snapshot,
"-snapshot write to temporary files instead of disk image files\n",
QEMU_ARCH_ALL)
@@ -1501,6 +1746,14 @@ SRST
the raw disk image you use is not written back. You can however
force the write back by pressing C-a s (see the :ref:`disk images`
chapter in the System Emulation Users Guide).
+
+ .. warning::
+ snapshot is incompatible with ``-blockdev`` (instead use qemu-img
+ to manually create snapshot images to attach to your blockdev).
+ If you have mixed ``-blockdev`` and ``-drive`` declarations you
+ can use the 'snapshot' property on your drive declarations
+ instead of this global option.
+
ERST
DEF("fsdev", HAS_ARG, QEMU_OPTION_fsdev,
@@ -1530,7 +1783,9 @@ SRST
Accesses to the filesystem are done by QEMU.
``proxy``
- Accesses to the filesystem are done by virtfs-proxy-helper(1).
+ Accesses to the filesystem are done by virtfs-proxy-helper(1). This
+ option is deprecated (since QEMU 8.1) and will be removed in a future
+ version of QEMU. Use ``local`` instead.
``synth``
Synthetic filesystem, only used by QTests.
@@ -1650,7 +1905,7 @@ SRST
directory on host is made directly accessible by guest as a pass-through
file system by using the 9P network protocol for communication between
host and guests, if desired even accessible, shared by several guests
- simultaniously.
+ simultaneously.
Note that ``-virtfs`` is actually just a convenience shortcut for its
generalized form ``-fsdev -device virtio-9p-pci``.
@@ -1662,6 +1917,8 @@ SRST
``proxy``
Accesses to the filesystem are done by virtfs-proxy-helper(1).
+ This option is deprecated (since QEMU 8.1) and will be removed in a
+ future version of QEMU. Use ``local`` instead.
``synth``
Synthetic filesystem, only used by QTests.
@@ -1754,8 +2011,8 @@ SRST
ERST
DEF("iscsi", HAS_ARG, QEMU_OPTION_iscsi,
- "-iscsi [user=user][,password=password]\n"
- " [,header-digest=CRC32C|CR32C-NONE|NONE-CRC32C|NONE\n"
+ "-iscsi [user=user][,password=password][,password-secret=secret-id]\n"
+ " [,header-digest=CRC32C|CR32C-NONE|NONE-CRC32C|NONE]\n"
" [,initiator-name=initiator-iqn][,id=target-iqn]\n"
" [,timeout=timeout]\n"
" iSCSI session parameters\n", QEMU_ARCH_ALL)
@@ -1833,12 +2090,13 @@ DEF("display", HAS_ARG, QEMU_OPTION_display,
"-display spice-app[,gl=on|off]\n"
#endif
#if defined(CONFIG_SDL)
- "-display sdl[,alt_grab=on|off][,ctrl_grab=on|off][,gl=on|core|es|off]\n"
- " [,grab-mod=<mod>][,show-cursor=on|off][,window-close=on|off]\n"
+ "-display sdl[,gl=on|core|es|off][,grab-mod=<mod>][,show-cursor=on|off]\n"
+ " [,window-close=on|off]\n"
#endif
#if defined(CONFIG_GTK)
"-display gtk[,full-screen=on|off][,gl=on|off][,grab-on-hover=on|off]\n"
- " [,show-cursor=on|off][,window-close=on|off]\n"
+ " [,show-tabs=on|off][,show-cursor=on|off][,window-close=on|off]\n"
+ " [,show-menubar=on|off][,zoom-to-fit=on|off]\n"
#endif
#if defined(CONFIG_VNC)
"-display vnc=<display>[,<optargs>]\n"
@@ -1846,9 +2104,18 @@ DEF("display", HAS_ARG, QEMU_OPTION_display,
#if defined(CONFIG_CURSES)
"-display curses[,charset=<encoding>]\n"
#endif
+#if defined(CONFIG_COCOA)
+ "-display cocoa[,full-grab=on|off][,swap-opt-cmd=on|off]\n"
+ " [,show-cursor=on|off][,left-command-key=on|off]\n"
+ " [,full-screen=on|off][,zoom-to-fit=on|off]\n"
+#endif
#if defined(CONFIG_OPENGL)
"-display egl-headless[,rendernode=<file>]\n"
#endif
+#if defined(CONFIG_DBUS_DISPLAY)
+ "-display dbus[,addr=<dbusaddr>]\n"
+ " [,gl=on|core|es|off][,rendernode=<file>]\n"
+#endif
"-display none\n"
" select display backend type\n"
" The default display is equivalent to\n "
@@ -1866,29 +2133,35 @@ DEF("display", HAS_ARG, QEMU_OPTION_display,
, QEMU_ARCH_ALL)
SRST
``-display type``
- Select type of display to use. This option is a replacement for the
- old style -sdl/-curses/... options. Use ``-display help`` to list
- the available display types. Valid values for type are
+ Select type of display to use. Use ``-display help`` to list the available
+ display types. Valid values for type are
``spice-app[,gl=on|off]``
Start QEMU as a Spice server and launch the default Spice client
application. The Spice server will redirect the serial consoles
and QEMU monitors. (Since 4.0)
+ ``dbus``
+ Export the display over D-Bus interfaces. (Since 7.0)
+
+ The connection is registered with the "org.qemu" name (and queued when
+ already owned).
+
+ ``addr=<dbusaddr>`` : D-Bus bus address to connect to.
+
+ ``p2p=yes|no`` : Use peer-to-peer connection, accepted via QMP ``add_client``.
+
+ ``gl=on|off|core|es`` : Use OpenGL for rendering (the D-Bus interface
+ will share framebuffers with DMABUF file descriptors).
+
``sdl``
Display video output via SDL (usually in a separate graphics
window; see the SDL documentation for other possibilities).
Valid parameters are:
``grab-mod=<mods>`` : Used to select the modifier keys for toggling
- the mouse grabbing in conjunction with the "g" key. `<mods>` can be
- either `lshift-lctrl-lalt` or `rctrl`.
-
- ``alt_grab=on|off`` : Use Control+Alt+Shift-g to toggle mouse grabbing.
- This parameter is deprecated - use ``grab-mod`` instead.
-
- ``ctrl_grab=on|off`` : Use Right-Control-g to toggle mouse grabbing.
- This parameter is deprecated - use ``grab-mod`` instead.
+ the mouse grabbing in conjunction with the "g" key. ``<mods>`` can be
+ either ``lshift-lctrl-lalt`` or ``rctrl``.
``gl=on|off|core|es`` : Use OpenGL for displaying
@@ -1907,10 +2180,19 @@ SRST
``grab-on-hover=on|off`` : Grab keyboard input on mouse hover
+ ``show-tabs=on|off`` : Display the tab bar for switching between the
+ various graphical interfaces (e.g. VGA and
+ virtual console character devices) by default.
+
``show-cursor=on|off`` : Force showing the mouse cursor
``window-close=on|off`` : Allow to quit qemu with window close button
+ ``show-menubar=on|off`` : Display the main window menubar, defaults to "on"
+
+ ``zoom-to-fit=on|off`` : Expand video output to the window size,
+ defaults to "off"
+
``curses[,charset=<encoding>]``
Display video output via curses. For graphics device models
which support a text mode, QEMU can display this output using a
@@ -1922,6 +2204,31 @@ SRST
``charset=CP850`` for IBM CP850 encoding. The default is
``CP437``.
+ ``cocoa``
+ Display video output in a Cocoa window. Mac only. This interface
+ provides drop-down menus and other UI elements to configure and
+ control the VM during runtime. Valid parameters are:
+
+ ``full-grab=on|off`` : Capture all key presses, including system combos.
+ This requires accessibility permissions, since it
+ performs a global grab on key events.
+ (default: off) See
+ https://support.apple.com/en-in/guide/mac-help/mh32356/mac
+
+ ``swap-opt-cmd=on|off`` : Swap the Option and Command keys so that their
+ key codes match their position on non-Mac
+ keyboards and you can use Meta/Super and Alt
+ where you expect them. (default: off)
+
+ ``show-cursor=on|off`` : Force showing the mouse cursor
+
+ ``left-command-key=on|off`` : Disable forwarding left command key to host
+
+ ``full-screen=on|off`` : Start in fullscreen mode
+
+ ``zoom-to-fit=on|off`` : Expand video output to the window size,
+ defaults to "off"
+
``egl-headless[,rendernode=<file>]``
Offload all OpenGL operations to a local DRI device. For any
graphical display, this display needs to be paired with either
@@ -1954,55 +2261,7 @@ SRST
Use C-a h for help on switching between the console and monitor.
ERST
-DEF("curses", 0, QEMU_OPTION_curses,
- "-curses shorthand for -display curses\n",
- QEMU_ARCH_ALL)
-SRST
-``-curses``
- Normally, if QEMU is compiled with graphical window support, it
- displays output such as guest graphics, guest console, and the QEMU
- monitor in a window. With this option, QEMU can display the VGA
- output when in text mode using a curses/ncurses interface. Nothing
- is displayed in graphical mode.
-ERST
-
-DEF("alt-grab", 0, QEMU_OPTION_alt_grab,
- "-alt-grab use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt)\n",
- QEMU_ARCH_ALL)
-SRST
-``-alt-grab``
- Use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt). Note that
- this also affects the special keys (for fullscreen, monitor-mode
- switching, etc). This option is deprecated - please use
- ``-display sdl,grab-mod=lshift-lctrl-lalt`` instead.
-ERST
-
-DEF("ctrl-grab", 0, QEMU_OPTION_ctrl_grab,
- "-ctrl-grab use Right-Ctrl to grab mouse (instead of Ctrl-Alt)\n",
- QEMU_ARCH_ALL)
-SRST
-``-ctrl-grab``
- Use Right-Ctrl to grab mouse (instead of Ctrl-Alt). Note that this
- also affects the special keys (for fullscreen, monitor-mode
- switching, etc). This option is deprecated - please use
- ``-display sdl,grab-mod=rctrl`` instead.
-ERST
-
-DEF("no-quit", 0, QEMU_OPTION_no_quit,
- "-no-quit disable SDL/GTK window close capability (deprecated)\n", QEMU_ARCH_ALL)
-SRST
-``-no-quit``
- Disable window close capability (SDL and GTK only). This option is
- deprecated, please use ``-display ...,window-close=off`` instead.
-ERST
-
-DEF("sdl", 0, QEMU_OPTION_sdl,
- "-sdl shorthand for -display sdl\n", QEMU_ARCH_ALL)
-SRST
-``-sdl``
- Enable SDL.
-ERST
-
+#ifdef CONFIG_SPICE
DEF("spice", HAS_ARG, QEMU_OPTION_spice,
"-spice [port=port][,tls-port=secured-port][,x509-dir=<dir>]\n"
" [,x509-key-file=<file>][,x509-key-password=<file>]\n"
@@ -2013,7 +2272,7 @@ DEF("spice", HAS_ARG, QEMU_OPTION_spice,
" [,tls-channel=[main|display|cursor|inputs|record|playback]]\n"
" [,plaintext-channel=[main|display|cursor|inputs|record|playback]]\n"
" [,sasl=on|off][,disable-ticketing=on|off]\n"
- " [,password=<string>][,password-secret=<secret-id>]\n"
+ " [,password-secret=<secret-id>]\n"
" [,image-compression=[auto_glz|auto_lz|quic|glz|lz|off]]\n"
" [,jpeg-wan-compression=[auto|never|always]]\n"
" [,zlib-glz-wan-compression=[auto|never|always]]\n"
@@ -2021,9 +2280,10 @@ DEF("spice", HAS_ARG, QEMU_OPTION_spice,
" [,disable-agent-file-xfer=on|off][,agent-mouse=[on|off]]\n"
" [,playback-compression=[on|off]][,seamless-migration=[on|off]]\n"
" [,gl=[on|off]][,rendernode=<file>]\n"
- " enable spice\n"
- " at least one of {port, tls-port} is mandatory\n",
+ " enable spice\n"
+ " at least one of {port, tls-port} is mandatory\n",
QEMU_ARCH_ALL)
+#endif
SRST
``-spice option[,option[,...]]``
Enable the spice remote desktop protocol. Valid options are
@@ -2038,13 +2298,6 @@ SRST
``ipv4=on|off``; \ ``ipv6=on|off``; \ ``unix=on|off``
Force using the specified IP version.
- ``password=<string>``
- Set the password you need to authenticate.
-
- This option is deprecated and insecure because it leaves the
- password visible in the process listing. Use ``password-secret``
- instead.
-
``password-secret=<secret-id>``
Set the ID of the ``secret`` object containing the password
you need to authenticate.
@@ -2209,8 +2462,10 @@ SRST
OBP.
ERST
+#ifdef CONFIG_VNC
DEF("vnc", HAS_ARG, QEMU_OPTION_vnc ,
"-vnc <display> shorthand for -display vnc=<display>\n", QEMU_ARCH_ALL)
+#endif
SRST
``-vnc display[,option[,option[,...]]]``
Normally, if QEMU is compiled with graphical window support, it
@@ -2224,7 +2479,7 @@ SRST
``to=L``
With this option, QEMU will try next available VNC displays,
- until the number L, if the origianlly defined "-vnc display" is
+ until the number L, if the originally defined "-vnc display" is
not available, e.g. port 5900+display is already used by another
application. By default, to=0.
@@ -2397,7 +2652,8 @@ SRST
``-win2k-hack``
Use it when installing Windows 2000 to avoid a disk full bug. After
Windows 2000 is installed, you no longer need this option (this
- option slows down the IDE transfers).
+ option slows down the IDE transfers). Synonym of ``-global
+ ide-device.win2k-install-hack=on``.
ERST
DEF("no-fd-bootchk", 0, QEMU_OPTION_no_fd_bootchk,
@@ -2406,23 +2662,7 @@ DEF("no-fd-bootchk", 0, QEMU_OPTION_no_fd_bootchk,
SRST
``-no-fd-bootchk``
Disable boot signature checking for floppy disks in BIOS. May be
- needed to boot from old floppy disks.
-ERST
-
-DEF("no-acpi", 0, QEMU_OPTION_no_acpi,
- "-no-acpi disable ACPI\n", QEMU_ARCH_I386 | QEMU_ARCH_ARM)
-SRST
-``-no-acpi``
- Disable ACPI (Advanced Configuration and Power Interface) support.
- Use it if your guest OS complains about ACPI problems (PC target
- machine only).
-ERST
-
-DEF("no-hpet", 0, QEMU_OPTION_no_hpet,
- "-no-hpet disable HPET\n", QEMU_ARCH_I386)
-SRST
-``-no-hpet``
- Disable HPET support.
+ needed to boot from old floppy disks. Synonym of ``-m fd-bootchk=off``.
ERST
DEF("acpitable", HAS_ARG, QEMU_OPTION_acpitable,
@@ -2458,7 +2698,10 @@ DEF("smbios", HAS_ARG, QEMU_OPTION_smbios,
" specify SMBIOS type 3 fields\n"
"-smbios type=4[,sock_pfx=str][,manufacturer=str][,version=str][,serial=str]\n"
" [,asset=str][,part=str][,max-speed=%d][,current-speed=%d]\n"
+ " [,processor-family=%d,processor-id=%d]\n"
" specify SMBIOS type 4 fields\n"
+ "-smbios type=8[,external_reference=str][,internal_reference=str][,connector_type=%d][,port_type=%d]\n"
+ " specify SMBIOS type 8 fields\n"
"-smbios type=11[,value=str][,path=filename]\n"
" specify SMBIOS type 11 fields\n"
"-smbios type=17[,loc_pfx=str][,bank=str][,manufacturer=str][,serial=str]\n"
@@ -2466,7 +2709,7 @@ DEF("smbios", HAS_ARG, QEMU_OPTION_smbios,
" specify SMBIOS type 17 fields\n"
"-smbios type=41[,designation=str][,kind=str][,instance=%d][,pcidev=str]\n"
" specify SMBIOS type 41 fields\n",
- QEMU_ARCH_I386 | QEMU_ARCH_ARM)
+ QEMU_ARCH_I386 | QEMU_ARCH_ARM | QEMU_ARCH_LOONGARCH | QEMU_ARCH_RISCV)
SRST
``-smbios file=binary``
Load SMBIOS entry from binary file.
@@ -2483,9 +2726,12 @@ SRST
``-smbios type=3[,manufacturer=str][,version=str][,serial=str][,asset=str][,sku=str]``
Specify SMBIOS type 3 fields
-``-smbios type=4[,sock_pfx=str][,manufacturer=str][,version=str][,serial=str][,asset=str][,part=str]``
+``-smbios type=4[,sock_pfx=str][,manufacturer=str][,version=str][,serial=str][,asset=str][,part=str][,processor-family=%d][,processor-id=%d]``
Specify SMBIOS type 4 fields
+``-smbios type=9[,slot_designation=str][,slot_type=%d][,slot_data_bus_width=%d][,current_usage=%d][,slot_length=%d][,slot_id=%d][,slot_characteristics1=%d][,slot_characteristics12=%d][,pci_device=str]``
+ Specify SMBIOS type 9 fields
+
``-smbios type=11[,value=str][,path=filename]``
Specify SMBIOS type 11 fields
@@ -2643,6 +2889,20 @@ DEF("netdev", HAS_ARG, QEMU_OPTION_netdev,
"-netdev socket,id=str[,fd=h][,udp=host:port][,localaddr=host:port]\n"
" configure a network backend to connect to another network\n"
" using an UDP tunnel\n"
+ "-netdev stream,id=str[,server=on|off],addr.type=inet,addr.host=host,addr.port=port[,to=maxport][,numeric=on|off][,keep-alive=on|off][,mptcp=on|off][,addr.ipv4=on|off][,addr.ipv6=on|off][,reconnect=seconds]\n"
+ "-netdev stream,id=str[,server=on|off],addr.type=unix,addr.path=path[,abstract=on|off][,tight=on|off][,reconnect=seconds]\n"
+ "-netdev stream,id=str[,server=on|off],addr.type=fd,addr.str=file-descriptor[,reconnect=seconds]\n"
+ " configure a network backend to connect to another network\n"
+ " using a socket connection in stream mode.\n"
+ "-netdev dgram,id=str,remote.type=inet,remote.host=maddr,remote.port=port[,local.type=inet,local.host=addr]\n"
+ "-netdev dgram,id=str,remote.type=inet,remote.host=maddr,remote.port=port[,local.type=fd,local.str=file-descriptor]\n"
+ " configure a network backend to connect to a multicast maddr and port\n"
+ " use ``local.host=addr`` to specify the host address to send packets from\n"
+ "-netdev dgram,id=str,local.type=inet,local.host=addr,local.port=port[,remote.type=inet,remote.host=addr,remote.port=port]\n"
+ "-netdev dgram,id=str,local.type=unix,local.path=path[,remote.type=unix,remote.path=path]\n"
+ "-netdev dgram,id=str,local.type=fd,local.str=file-descriptor\n"
+ " configure a network backend to connect to another network\n"
+ " using an UDP tunnel\n"
#ifdef CONFIG_VDE
"-netdev vde,id=str[,sock=socketpath][,port=n][,group=groupname][,mode=octalmode]\n"
" configure a network backend to connect to port 'n' of a vde switch\n"
@@ -2656,13 +2916,47 @@ DEF("netdev", HAS_ARG, QEMU_OPTION_netdev,
" VALE port (created on the fly) called 'name' ('nmname' is name of the \n"
" netmap device, defaults to '/dev/netmap')\n"
#endif
+#ifdef CONFIG_AF_XDP
+ "-netdev af-xdp,id=str,ifname=name[,mode=native|skb][,force-copy=on|off]\n"
+ " [,queues=n][,start-queue=m][,inhibit=on|off][,sock-fds=x:y:...:z]\n"
+ " attach to the existing network interface 'name' with AF_XDP socket\n"
+ " use 'mode=MODE' to specify an XDP program attach mode\n"
+ " use 'force-copy=on|off' to force XDP copy mode even if device supports zero-copy (default: off)\n"
+ " use 'inhibit=on|off' to inhibit loading of a default XDP program (default: off)\n"
+ " with inhibit=on,\n"
+ " use 'sock-fds' to provide file descriptors for already open AF_XDP sockets\n"
+ " added to a socket map in XDP program. One socket per queue.\n"
+ " use 'queues=n' to specify how many queues of a multiqueue interface should be used\n"
+ " use 'start-queue=m' to specify the first queue that should be used\n"
+#endif
#ifdef CONFIG_POSIX
"-netdev vhost-user,id=str,chardev=dev[,vhostforce=on|off]\n"
" configure a vhost-user network, backed by a chardev 'dev'\n"
#endif
#ifdef __linux__
- "-netdev vhost-vdpa,id=str,vhostdev=/path/to/dev\n"
+ "-netdev vhost-vdpa,id=str[,vhostdev=/path/to/dev][,vhostfd=h]\n"
" configure a vhost-vdpa network,Establish a vhost-vdpa netdev\n"
+ " use 'vhostdev=/path/to/dev' to open a vhost vdpa device\n"
+ " use 'vhostfd=h' to connect to an already opened vhost vdpa device\n"
+#endif
+#ifdef CONFIG_VMNET
+ "-netdev vmnet-host,id=str[,isolated=on|off][,net-uuid=uuid]\n"
+ " [,start-address=addr,end-address=addr,subnet-mask=mask]\n"
+ " configure a vmnet network backend in host mode with ID 'str',\n"
+ " isolate this interface from others with 'isolated',\n"
+ " configure the address range and choose a subnet mask,\n"
+ " specify network UUID 'uuid' to disable DHCP and interact with\n"
+ " vmnet-host interfaces within this isolated network\n"
+ "-netdev vmnet-shared,id=str[,isolated=on|off][,nat66-prefix=addr]\n"
+ " [,start-address=addr,end-address=addr,subnet-mask=mask]\n"
+ " configure a vmnet network backend in shared mode with ID 'str',\n"
+ " configure the address range and choose a subnet mask,\n"
+ " set IPv6 ULA prefix (of length 64) to use for internal network,\n"
+ " isolate this interface from others with 'isolated'\n"
+ "-netdev vmnet-bridged,id=str,ifname=name[,isolated=on|off]\n"
+ " configure a vmnet network backend in bridged mode with ID 'str',\n"
+ " use 'ifname=name' to select a physical network interface to be bridged,\n"
+ " isolate this interface from others with 'isolated'\n"
#endif
"-netdev hubport,id=str,hubid=n[,netdev=nd]\n"
" configure a hub port on the hub with ID 'n'\n", QEMU_ARCH_ALL)
@@ -2680,9 +2974,15 @@ DEF("nic", HAS_ARG, QEMU_OPTION_nic,
#ifdef CONFIG_NETMAP
"netmap|"
#endif
+#ifdef CONFIG_AF_XDP
+ "af-xdp|"
+#endif
#ifdef CONFIG_POSIX
"vhost-user|"
#endif
+#ifdef CONFIG_VMNET
+ "vmnet-host|vmnet-shared|vmnet-bridged|"
+#endif
"socket][,option][,...][mac=macaddr]\n"
" initialize an on-board / default host NIC (using MAC address\n"
" macaddr) and connect it to the given host network backend\n"
@@ -2705,11 +3005,17 @@ DEF("net", HAS_ARG, QEMU_OPTION_net,
#ifdef CONFIG_NETMAP
"netmap|"
#endif
+#ifdef CONFIG_AF_XDP
+ "af-xdp|"
+#endif
+#ifdef CONFIG_VMNET
+ "vmnet-host|vmnet-shared|vmnet-bridged|"
+#endif
"socket][,option][,option][,...]\n"
" old way to initialize a host network interface\n"
" (use the -netdev option if possible instead)\n", QEMU_ARCH_ALL)
SRST
-``-nic [tap|bridge|user|l2tpv3|vde|netmap|vhost-user|socket][,...][,mac=macaddr][,model=mn]``
+``-nic [tap|bridge|user|l2tpv3|vde|netmap|af-xdp|vhost-user|socket][,...][,mac=macaddr][,model=mn]``
This option is a shortcut for configuring both the on-board
(default) guest NIC hardware and the host network backend in one go.
The host backend options are the same as with the corresponding
@@ -2809,6 +3115,8 @@ SRST
server. The files in dir will be exposed as the root of a TFTP
server. The TFTP client on the guest must be configured in
binary mode (use the command ``bin`` of the Unix TFTP client).
+ The built-in TFTP server is read-only; it does not implement any
+ command for writing files. QEMU will not write to this directory.
``tftp-server-name=name``
In BOOTP reply, broadcast name as the "TFTP server name"
@@ -3123,6 +3431,55 @@ SRST
# launch QEMU instance
|qemu_system| linux.img -nic vde,sock=/tmp/myswitch
+``-netdev af-xdp,id=str,ifname=name[,mode=native|skb][,force-copy=on|off][,queues=n][,start-queue=m][,inhibit=on|off][,sock-fds=x:y:...:z]``
+ Configure AF_XDP backend to connect to a network interface 'name'
+ using AF_XDP socket. A specific program attach mode for a default
+ XDP program can be forced with 'mode', defaults to best-effort,
+ where the likely most performant mode will be in use. Number of queues
+ 'n' should generally match the number or queues in the interface,
+ defaults to 1. Traffic arriving on non-configured device queues will
+ not be delivered to the network backend.
+
+ .. parsed-literal::
+
+ # set number of queues to 4
+ ethtool -L eth0 combined 4
+ # launch QEMU instance
+ |qemu_system| linux.img -device virtio-net-pci,netdev=n1 \\
+ -netdev af-xdp,id=n1,ifname=eth0,queues=4
+
+ 'start-queue' option can be specified if a particular range of queues
+ [m, m + n] should be in use. For example, this is may be necessary in
+ order to use certain NICs in native mode. Kernel allows the driver to
+ create a separate set of XDP queues on top of regular ones, and only
+ these queues can be used for AF_XDP sockets. NICs that work this way
+ may also require an additional traffic redirection with ethtool to these
+ special queues.
+
+ .. parsed-literal::
+
+ # set number of queues to 1
+ ethtool -L eth0 combined 1
+ # redirect all the traffic to the second queue (id: 1)
+ # note: drivers may require non-empty key/mask pair.
+ ethtool -N eth0 flow-type ether \\
+ dst 00:00:00:00:00:00 m FF:FF:FF:FF:FF:FE action 1
+ ethtool -N eth0 flow-type ether \\
+ dst 00:00:00:00:00:01 m FF:FF:FF:FF:FF:FE action 1
+ # launch QEMU instance
+ |qemu_system| linux.img -device virtio-net-pci,netdev=n1 \\
+ -netdev af-xdp,id=n1,ifname=eth0,queues=1,start-queue=1
+
+ XDP program can also be loaded externally. In this case 'inhibit' option
+ should be set to 'on' and 'sock-fds' provided with file descriptors for
+ already open but not bound XDP sockets already added to a socket map for
+ corresponding queues. One socket per queue.
+
+ .. parsed-literal::
+
+ |qemu_system| linux.img -device virtio-net-pci,netdev=n1 \\
+ -netdev af-xdp,id=n1,ifname=eth0,queues=3,inhibit=on,sock-fds=15:16:17
+
``-netdev vhost-user,chardev=id[,vhostforce=on|off][,queues=n]``
Establish a vhost-user netdev, backed by a chardev id. The chardev
should be a unix domain socket backed one. The vhost-user uses a
@@ -3142,7 +3499,7 @@ SRST
-netdev type=vhost-user,id=net0,chardev=chr0 \
-device virtio-net-pci,netdev=net0
-``-netdev vhost-vdpa,vhostdev=/path/to/dev``
+``-netdev vhost-vdpa[,vhostdev=/path/to/dev][,vhostfd=h]``
Establish a vhost-vdpa netdev.
vDPA device is a device that uses a datapath which complies with
@@ -3188,7 +3545,7 @@ DEFHEADING(Character device options:)
DEF("chardev", HAS_ARG, QEMU_OPTION_chardev,
"-chardev help\n"
"-chardev null,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
- "-chardev socket,id=id[,host=host],port=port[,to=to][,ipv4=on|off][,ipv6=on|off][,nodelay=on|off][,reconnect=seconds]\n"
+ "-chardev socket,id=id[,host=host],port=port[,to=to][,ipv4=on|off][,ipv6=on|off][,nodelay=on|off]\n"
" [,server=on|off][,wait=on|off][,telnet=on|off][,websocket=on|off][,reconnect=seconds][,mux=on|off]\n"
" [,logfile=PATH][,logappend=on|off][,tls-creds=ID][,tls-authz=ID] (tcp)\n"
"-chardev socket,id=id,path=path[,server=on|off][,wait=on|off][,telnet=on|off][,websocket=on|off][,reconnect=seconds]\n"
@@ -3200,7 +3557,7 @@ DEF("chardev", HAS_ARG, QEMU_OPTION_chardev,
"-chardev vc,id=id[[,width=width][,height=height]][[,cols=cols][,rows=rows]]\n"
" [,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
"-chardev ringbuf,id=id[,size=size][,logfile=PATH][,logappend=on|off]\n"
- "-chardev file,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
+ "-chardev file,id=id,path=path[,input-path=input-file][,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
"-chardev pipe,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
#ifdef _WIN32
"-chardev console,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
@@ -3215,11 +3572,9 @@ DEF("chardev", HAS_ARG, QEMU_OPTION_chardev,
#if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \
|| defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
"-chardev serial,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
- "-chardev tty,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
#endif
#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__)
"-chardev parallel,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
- "-chardev parport,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
#endif
#if defined(CONFIG_SPICE)
"-chardev spicevmc,id=id,name=name[,debug=debug][,logfile=PATH][,logappend=on|off]\n"
@@ -3234,7 +3589,7 @@ The general form of a character device option is:
``-chardev backend,id=id[,mux=on|off][,options]``
Backend is one of: ``null``, ``socket``, ``udp``, ``msmouse``,
``vc``, ``ringbuf``, ``file``, ``pipe``, ``console``, ``serial``,
- ``pty``, ``stdio``, ``braille``, ``tty``, ``parallel``, ``parport``,
+ ``pty``, ``stdio``, ``braille``, ``parallel``,
``spicevmc``, ``spiceport``. The specific backend will determine the
applicable options.
@@ -3405,13 +3760,19 @@ The available backends are:
Create a ring buffer with fixed size ``size``. size must be a power
of two and defaults to ``64K``.
-``-chardev file,id=id,path=path``
+``-chardev file,id=id,path=path[,input-path=input-path]``
Log all traffic received from the guest to a file.
``path`` specifies the path of the file to be opened. This file will
be created if it does not already exist, and overwritten if it does.
``path`` is required.
+ If ``input-path`` is specified, this is the path of a second file
+ which will be used for input. If ``input-path`` is not specified,
+ no input will be available from the chardev.
+
+ Note that ``input-path`` is not supported on Windows hosts.
+
``-chardev pipe,id=id,path=path``
Create a two-way connection to the guest. The behaviour differs
slightly between Windows hosts and other hosts:
@@ -3458,15 +3819,8 @@ The available backends are:
Connect to a local BrlAPI server. ``braille`` does not take any
options.
-``-chardev tty,id=id,path=path``
- ``tty`` is only available on Linux, Sun, FreeBSD, NetBSD, OpenBSD
- and DragonFlyBSD hosts. It is an alias for ``serial``.
-
- ``path`` specifies the path to the tty. ``path`` is required.
-
``-chardev parallel,id=id,path=path``
\
-``-chardev parport,id=id,path=path``
``parallel`` is only available on Linux, FreeBSD and DragonFlyBSD
hosts.
@@ -3576,12 +3930,67 @@ DEFHEADING()
#endif
-DEFHEADING(Linux/Multiboot boot specific:)
+DEFHEADING(Boot Image or Kernel specific:)
SRST
-When using these options, you can use a given Linux or Multiboot kernel
-without installing it in the disk image. It can be useful for easier
-testing of various kernels.
+There are broadly 4 ways you can boot a system with QEMU.
+ - specify a firmware and let it control finding a kernel
+ - specify a firmware and pass a hint to the kernel to boot
+ - direct kernel image boot
+ - manually load files into the guest's address space
+
+The third method is useful for quickly testing kernels but as there is
+no firmware to pass configuration information to the kernel the
+hardware must either be probeable, the kernel built for the exact
+configuration or passed some configuration data (e.g. a DTB blob)
+which tells the kernel what drivers it needs. This exact details are
+often hardware specific.
+
+The final method is the most generic way of loading images into the
+guest address space and used mostly for ``bare metal`` type
+development where the reset vectors of the processor are taken into
+account.
+
+ERST
+
+SRST
+
+For x86 machines and some other architectures ``-bios`` will generally
+do the right thing with whatever it is given. For other machines the
+more strict ``-pflash`` option needs an image that is sized for the
+flash device for the given machine type.
+
+Please see the :ref:`system-targets-ref` section of the manual for
+more detailed documentation.
+
+ERST
+
+DEF("bios", HAS_ARG, QEMU_OPTION_bios, \
+ "-bios file set the filename for the BIOS\n", QEMU_ARCH_ALL)
+SRST
+``-bios file``
+ Set the filename for the BIOS.
+ERST
+
+DEF("pflash", HAS_ARG, QEMU_OPTION_pflash,
+ "-pflash file use 'file' as a parallel flash image\n", QEMU_ARCH_ALL)
+SRST
+``-pflash file``
+ Use file as a parallel flash image.
+ERST
+
+SRST
+
+The kernel options were designed to work with Linux kernels although
+other things (like hypervisors) can be packaged up as a kernel
+executable image. The exact format of a executable image is usually
+architecture specific.
+
+The way in which the kernel is started (what address it is loaded at,
+what if any information is passed to it via CPU registers, the state
+of the hardware when it is started, and so on) is also architecture
+specific. Typically it follows the specification laid down by the
+Linux kernel for how kernels for that architecture must be started.
ERST
@@ -3602,15 +4011,23 @@ ERST
DEF("initrd", HAS_ARG, QEMU_OPTION_initrd, \
"-initrd file use 'file' as initial ram disk\n", QEMU_ARCH_ALL)
-SRST
+SRST(initrd)
+
``-initrd file``
Use file as initial ram disk.
``-initrd "file1 arg=foo,file2"``
This syntax is only available with multiboot.
- Use file1 and file2 as modules and pass arg=foo as parameter to the
- first module.
+ Use file1 and file2 as modules and pass ``arg=foo`` as parameter to the
+ first module. Commas can be provided in module parameters by doubling
+ them on the command line to escape them:
+
+``-initrd "bzImage earlyprintk=xen,,keep root=/dev/xvda1,initrd.img"``
+ Multiboot only. Use bzImage as the first module with
+ "``earlyprintk=xen,keep root=/dev/xvda1``" as its command line,
+ and initrd.img as the second module.
+
ERST
DEF("dtb", HAS_ARG, QEMU_OPTION_dtb, \
@@ -3621,13 +4038,34 @@ SRST
kernel on boot.
ERST
+SRST
+
+Finally you can also manually load images directly into the address
+space of the guest. This is most useful for developers who already
+know the layout of their guest and take care to ensure something sane
+will happen when the reset vector executes.
+
+The generic loader can be invoked by using the loader device:
+
+``-device loader,addr=<addr>,data=<data>,data-len=<data-len>[,data-be=<data-be>][,cpu-num=<cpu-num>]``
+
+there is also the guest loader which operates in a similar way but
+tweaks the DTB so a hypervisor loaded via ``-kernel`` can find where
+the guest image is:
+
+``-device guest-loader,addr=<addr>[,kernel=<path>,[bootargs=<arguments>]][,initrd=<path>]``
+
+ERST
+
DEFHEADING()
DEFHEADING(Debug/Expert options:)
DEF("compat", HAS_ARG, QEMU_OPTION_compat,
"-compat [deprecated-input=accept|reject|crash][,deprecated-output=accept|hide]\n"
- " Policy for handling deprecated management interfaces\n",
+ " Policy for handling deprecated management interfaces\n"
+ "-compat [unstable-input=accept|reject|crash][,unstable-output=accept|hide]\n"
+ " Policy for handling unstable management interfaces\n",
QEMU_ARCH_ALL)
SRST
``-compat [deprecated-input=@var{input-policy}][,deprecated-output=@var{output-policy}]``
@@ -3645,6 +4083,22 @@ SRST
Suppress deprecated command results and events
Limitation: covers only syntactic aspects of QMP.
+
+``-compat [unstable-input=@var{input-policy}][,unstable-output=@var{output-policy}]``
+ Set policy for handling unstable management interfaces (experimental):
+
+ ``unstable-input=accept`` (default)
+ Accept unstable commands and arguments
+ ``unstable-input=reject``
+ Reject unstable commands and arguments
+ ``unstable-input=crash``
+ Crash on unstable commands and arguments
+ ``unstable-output=accept`` (default)
+ Emit unstable command results and events
+ ``unstable-output=hide``
+ Suppress unstable command results and events
+
+ Limitation: covers only syntactic aspects of QMP.
ERST
DEF("fw_cfg", HAS_ARG, QEMU_OPTION_fwcfg,
@@ -3656,9 +4110,13 @@ DEF("fw_cfg", HAS_ARG, QEMU_OPTION_fwcfg,
SRST
``-fw_cfg [name=]name,file=file``
Add named fw\_cfg entry with contents from file file.
+ If the filename contains comma, you must double it (for instance,
+ "file=my,,file" to use file "my,file").
``-fw_cfg [name=]name,string=str``
Add named fw\_cfg entry with contents from string str.
+ If the string contains comma, you must double it (for instance,
+ "string=my,,string" to use file "my,string").
The terminating NUL character of the contents of str will not be
included as part of the fw\_cfg item data. To insert contents with
@@ -3685,10 +4143,11 @@ SRST
default device is ``vc`` in graphical mode and ``stdio`` in non
graphical mode.
- This option can be used several times to simulate up to 4 serial
+ This option can be used several times to simulate multiple serial
ports.
- Use ``-serial none`` to disable all serial ports.
+ You can use ``-serial none`` to suppress the creation of default
+ serial devices.
Available character devices are:
@@ -3710,10 +4169,17 @@ SRST
[Linux only] Pseudo TTY (a new PTY is automatically allocated)
``none``
- No device is allocated.
+ No device is allocated. Note that for machine types which
+ emulate systems where a serial device is always present in
+ real hardware, this may be equivalent to the ``null`` option,
+ in that the serial device is still present but all output
+ is discarded. For boards where the number of serial ports is
+ truly variable, this suppresses the creation of the device.
``null``
- void device
+ A guest will see the UART or serial device as present in the
+ machine, but all output is discarded, and there is no input.
+ Conceptually equivalent to redirecting the output to ``/dev/null``.
``chardev:id``
Use a named character device defined with the ``-chardev``
@@ -3866,26 +4332,42 @@ DEF("qmp", HAS_ARG, QEMU_OPTION_qmp, \
QEMU_ARCH_ALL)
SRST
``-qmp dev``
- Like -monitor but opens in 'control' mode.
+ Like ``-monitor`` but opens in 'control' mode. For example, to make
+ QMP available on localhost port 4444::
+
+ -qmp tcp:localhost:4444,server=on,wait=off
+
+ Not all options are configurable via this syntax; for maximum
+ flexibility use the ``-mon`` option and an accompanying ``-chardev``.
+
ERST
DEF("qmp-pretty", HAS_ARG, QEMU_OPTION_qmp_pretty, \
"-qmp-pretty dev like -qmp but uses pretty JSON formatting\n",
QEMU_ARCH_ALL)
SRST
``-qmp-pretty dev``
- Like -qmp but uses pretty JSON formatting.
+ Like ``-qmp`` but uses pretty JSON formatting.
ERST
DEF("mon", HAS_ARG, QEMU_OPTION_mon, \
"-mon [chardev=]name[,mode=readline|control][,pretty[=on|off]]\n", QEMU_ARCH_ALL)
SRST
``-mon [chardev=]name[,mode=readline|control][,pretty[=on|off]]``
- Setup monitor on chardev name. ``mode=control`` configures
- a QMP monitor (a JSON RPC-style protocol) and it is not the
- same as HMP, the human monitor that has a "(qemu)" prompt.
- ``pretty`` is only valid when ``mode=control``,
+ Set up a monitor connected to the chardev ``name``.
+ QEMU supports two monitors: the Human Monitor Protocol
+ (HMP; for human interaction), and the QEMU Monitor Protocol
+ (QMP; a JSON RPC-style protocol).
+ The default is HMP; ``mode=control`` selects QMP instead.
+ ``pretty`` is only valid when ``mode=control``,
turning on JSON pretty printing to ease
human reading and debugging.
+
+ For example::
+
+ -chardev socket,id=mon1,host=localhost,port=4444,server=on,wait=off \
+ -mon chardev=mon1,mode=control,pretty=on
+
+ enables the QMP monitor on localhost port 4444 with pretty-printing.
ERST
DEF("debugcon", HAS_ARG, QEMU_OPTION_debugcon, \
@@ -3908,13 +4390,6 @@ SRST
from a script.
ERST
-DEF("singlestep", 0, QEMU_OPTION_singlestep, \
- "-singlestep always run in singlestep mode\n", QEMU_ARCH_ALL)
-SRST
-``-singlestep``
- Run the emulation in single step mode.
-ERST
-
DEF("preconfig", 0, QEMU_OPTION_preconfig, \
"--preconfig pause QEMU before machine is initialized (experimental)\n",
QEMU_ARCH_ALL)
@@ -4053,15 +4528,10 @@ SRST
To list all the data directories, use ``-L help``.
ERST
-DEF("bios", HAS_ARG, QEMU_OPTION_bios, \
- "-bios file set the filename for the BIOS\n", QEMU_ARCH_ALL)
-SRST
-``-bios file``
- Set the filename for the BIOS.
-ERST
-
DEF("enable-kvm", 0, QEMU_OPTION_enable_kvm, \
- "-enable-kvm enable KVM full virtualization support\n", QEMU_ARCH_ALL)
+ "-enable-kvm enable KVM full virtualization support\n",
+ QEMU_ARCH_ARM | QEMU_ARCH_I386 | QEMU_ARCH_MIPS | QEMU_ARCH_PPC |
+ QEMU_ARCH_RISCV | QEMU_ARCH_S390X)
SRST
``-enable-kvm``
Enable KVM full virtualization support. This option is only
@@ -4069,16 +4539,17 @@ SRST
ERST
DEF("xen-domid", HAS_ARG, QEMU_OPTION_xen_domid,
- "-xen-domid id specify xen guest domain id\n", QEMU_ARCH_ALL)
+ "-xen-domid id specify xen guest domain id\n",
+ QEMU_ARCH_ARM | QEMU_ARCH_I386)
DEF("xen-attach", 0, QEMU_OPTION_xen_attach,
"-xen-attach attach to existing xen domain\n"
" libxl will use this when starting QEMU\n",
- QEMU_ARCH_ALL)
+ QEMU_ARCH_ARM | QEMU_ARCH_I386)
DEF("xen-domid-restrict", 0, QEMU_OPTION_xen_domid_restrict,
"-xen-domid-restrict restrict set of available xen operations\n"
" to specified domain id. (Does not affect\n"
" xenpv machine type).\n",
- QEMU_ARCH_ALL)
+ QEMU_ARCH_ARM | QEMU_ARCH_I386)
SRST
``-xen-domid id``
Specify xen guest domain id (XEN only).
@@ -4110,7 +4581,7 @@ DEF("action", HAS_ARG, QEMU_OPTION_action,
" action when guest reboots [default=reset]\n"
"-action shutdown=poweroff|pause\n"
" action when guest shuts down [default=poweroff]\n"
- "-action panic=pause|shutdown|none\n"
+ "-action panic=pause|shutdown|exit-failure|none\n"
" action when guest panics [default=shutdown]\n"
"-action watchdog=reset|shutdown|poweroff|inject-nmi|pause|debug|none\n"
" action when watchdog fires [default=reset]\n",
@@ -4126,7 +4597,7 @@ SRST
``-action panic=none``
``-action reboot=shutdown,shutdown=pause``
- ``-watchdog i6300esb -action watchdog=pause``
+ ``-device i6300esb -action watchdog=pause``
ERST
@@ -4244,35 +4715,6 @@ SRST
specifies the snapshot name used to load the initial VM state.
ERST
-DEF("watchdog", HAS_ARG, QEMU_OPTION_watchdog, \
- "-watchdog model\n" \
- " enable virtual hardware watchdog [default=none]\n",
- QEMU_ARCH_ALL)
-SRST
-``-watchdog model``
- Create a virtual hardware watchdog device. Once enabled (by a guest
- action), the watchdog must be periodically polled by an agent inside
- the guest or else the guest will be restarted. Choose a model for
- which your guest has drivers.
-
- The model is the model of hardware watchdog to emulate. Use
- ``-watchdog help`` to list available hardware models. Only one
- watchdog can be enabled for a guest.
-
- The following models may be available:
-
- ``ib700``
- iBASE 700 is a very simple ISA watchdog with a single timer.
-
- ``i6300esb``
- Intel 6300ESB I/O controller hub is a much more featureful
- PCI-based dual-timer watchdog.
-
- ``diag288``
- A virtual watchdog for s390x backed by the diagnose 288
- hypercall (currently KVM only).
-ERST
-
DEF("watchdog-action", HAS_ARG, QEMU_OPTION_watchdog_action, \
"-watchdog-action reset|shutdown|poweroff|inject-nmi|pause|debug|none\n" \
" action when watchdog fires [default=reset]\n",
@@ -4294,7 +4736,7 @@ SRST
Examples:
- ``-watchdog i6300esb -watchdog-action pause``; \ ``-watchdog ib700``
+ ``-device i6300esb -watchdog-action pause``
ERST
@@ -4322,6 +4764,7 @@ DEF("incoming", HAS_ARG, QEMU_OPTION_incoming, \
" prepare for incoming migration, listen on\n" \
" specified protocol and socket address\n" \
"-incoming fd:fd\n" \
+ "-incoming file:filename[,offset=offset]\n" \
"-incoming exec:cmdline\n" \
" accept incoming migration on given file descriptor\n" \
" or from given external command\n" \
@@ -4338,7 +4781,11 @@ SRST
Prepare for incoming migration, listen on a given unix socket.
``-incoming fd:fd``
- Accept incoming migration from a given filedescriptor.
+ Accept incoming migration from a given file descriptor.
+
+``-incoming file:filename[,offset=offset]``
+ Accept incoming migration from a given file starting at offset.
+ offset allows the common size suffixes, or a 0x prefix, but not both.
``-incoming exec:cmdline``
Accept incoming migration as an output from specified external
@@ -4369,17 +4816,6 @@ SRST
ERST
#ifndef _WIN32
-DEF("chroot", HAS_ARG, QEMU_OPTION_chroot, \
- "-chroot dir chroot to dir just before starting the VM\n",
- QEMU_ARCH_ALL)
-#endif
-SRST
-``-chroot dir``
- Immediately before starting guest execution, chroot to the specified
- directory. Especially useful in combination with -runas.
-ERST
-
-#ifndef _WIN32
DEF("runas", HAS_ARG, QEMU_OPTION_runas, \
"-runas user change to user id user just before starting the VM\n" \
" user can be numeric uid:gid instead\n",
@@ -4416,37 +4852,28 @@ DEF("semihosting", 0, QEMU_OPTION_semihosting,
QEMU_ARCH_MIPS | QEMU_ARCH_NIOS2 | QEMU_ARCH_RISCV)
SRST
``-semihosting``
- Enable semihosting mode (ARM, M68K, Xtensa, MIPS, Nios II, RISC-V only).
+ Enable :ref:`Semihosting` mode (ARM, M68K, Xtensa, MIPS, Nios II, RISC-V only).
- Note that this allows guest direct access to the host filesystem, so
- should only be used with a trusted guest OS.
+ .. warning::
+ Note that this allows guest direct access to the host filesystem, so
+ should only be used with a trusted guest OS.
See the -semihosting-config option documentation for further
information about the facilities this enables.
ERST
DEF("semihosting-config", HAS_ARG, QEMU_OPTION_semihosting_config,
- "-semihosting-config [enable=on|off][,target=native|gdb|auto][,chardev=id][,arg=str[,...]]\n" \
+ "-semihosting-config [enable=on|off][,target=native|gdb|auto][,chardev=id][,userspace=on|off][,arg=str[,...]]\n" \
" semihosting configuration\n",
QEMU_ARCH_ARM | QEMU_ARCH_M68K | QEMU_ARCH_XTENSA |
QEMU_ARCH_MIPS | QEMU_ARCH_NIOS2 | QEMU_ARCH_RISCV)
SRST
-``-semihosting-config [enable=on|off][,target=native|gdb|auto][,chardev=id][,arg=str[,...]]``
- Enable and configure semihosting (ARM, M68K, Xtensa, MIPS, Nios II, RISC-V
+``-semihosting-config [enable=on|off][,target=native|gdb|auto][,chardev=id][,userspace=on|off][,arg=str[,...]]``
+ Enable and configure :ref:`Semihosting` (ARM, M68K, Xtensa, MIPS, Nios II, RISC-V
only).
- Note that this allows guest direct access to the host filesystem, so
- should only be used with a trusted guest OS.
-
- On Arm this implements the standard semihosting API, version 2.0.
-
- On M68K this implements the "ColdFire GDB" interface used by
- libgloss.
-
- Xtensa semihosting provides basic file IO calls, such as
- open/read/write/seek/select. Tensilica baremetal libc for ISS and
- linux platform "sim" use this interface.
-
- On RISC-V this implements the standard semihosting API, version 0.2.
+ .. warning::
+ Note that this allows guest direct access to the host filesystem, so
+ should only be used with a trusted guest OS.
``target=native|gdb|auto``
Defines where the semihosting calls will be addressed, to QEMU
@@ -4457,6 +4884,13 @@ SRST
Send the output to a chardev backend output for native or auto
output when not in gdb
+ ``userspace=on|off``
+ Allows code running in guest userspace to access the semihosting
+ interface. The default is that only privileged guest code can
+ make semihosting calls. Note that setting ``userspace=on`` should
+ only be used if all guest code is trusted (for example, in
+ bare-metal test case code).
+
``arg=str1,arg=str2,...``
Allows the user to pass input arguments, and can be used
multiple times to build up a list. The old-style
@@ -4507,18 +4941,14 @@ SRST
ERST
DEF("readconfig", HAS_ARG, QEMU_OPTION_readconfig,
- "-readconfig <file>\n", QEMU_ARCH_ALL)
+ "-readconfig <file>\n"
+ " read config file\n", QEMU_ARCH_ALL)
SRST
``-readconfig file``
Read device configuration from file. This approach is useful when
you want to spawn QEMU process with many command line options but
you don't want to exceed the command line character limit.
ERST
-DEF("writeconfig", HAS_ARG, QEMU_OPTION_writeconfig,
- "-writeconfig <file>\n"
- " read/write config file (deprecated)\n", QEMU_ARCH_ALL)
-SRST
-ERST
DEF("no-user-config", 0, QEMU_OPTION_nouserconfig,
"-no-user-config\n"
@@ -4558,15 +4988,33 @@ HXCOMM Internal use
DEF("qtest", HAS_ARG, QEMU_OPTION_qtest, "", QEMU_ARCH_ALL)
DEF("qtest-log", HAS_ARG, QEMU_OPTION_qtest_log, "", QEMU_ARCH_ALL)
-#ifdef __linux__
-DEF("enable-fips", 0, QEMU_OPTION_enablefips,
- "-enable-fips enable FIPS 140-2 compliance\n",
+#ifdef CONFIG_POSIX
+DEF("run-with", HAS_ARG, QEMU_OPTION_run_with,
+ "-run-with [async-teardown=on|off][,chroot=dir]\n"
+ " Set miscellaneous QEMU process lifecycle options:\n"
+ " async-teardown=on enables asynchronous teardown (Linux only)\n"
+ " chroot=dir chroot to dir just before starting the VM\n",
QEMU_ARCH_ALL)
-#endif
SRST
-``-enable-fips``
- Enable FIPS 140-2 compliance mode.
+``-run-with [async-teardown=on|off][,chroot=dir]``
+ Set QEMU process lifecycle options.
+
+ ``async-teardown=on`` enables asynchronous teardown. A new process called
+ "cleanup/<QEMU_PID>" will be created at startup sharing the address
+ space with the main QEMU process, using clone. It will wait for the
+ main QEMU process to terminate completely, and then exit. This allows
+ QEMU to terminate very quickly even if the guest was huge, leaving the
+ teardown of the address space to the cleanup process. Since the cleanup
+ process shares the same cgroups as the main QEMU process, accounting is
+ performed correctly. This only works if the cleanup process is not
+ forcefully killed with SIGKILL before the main QEMU process has
+ terminated completely.
+
+ ``chroot=dir`` can be used for doing a chroot to the specified directory
+ immediately before starting the guest execution. This is especially useful
+ in combination with -runas.
ERST
+#endif
DEF("msg", HAS_ARG, QEMU_OPTION_msg,
"-msg [timestamp[=on|off]][,guest-name=[on|off]]\n"
@@ -4609,6 +5057,26 @@ SRST
Enable synchronization profiling.
ERST
+#if defined(CONFIG_TCG) && defined(CONFIG_LINUX)
+DEF("perfmap", 0, QEMU_OPTION_perfmap,
+ "-perfmap generate a /tmp/perf-${pid}.map file for perf\n",
+ QEMU_ARCH_ALL)
+SRST
+``-perfmap``
+ Generate a map file for Linux perf tools that will allow basic profiling
+ information to be broken down into basic blocks.
+ERST
+
+DEF("jitdump", 0, QEMU_OPTION_jitdump,
+ "-jitdump generate a jit-${pid}.dump file for perf\n",
+ QEMU_ARCH_ALL)
+SRST
+``-jitdump``
+ Generate a dump file for Linux perf tools that maps basic blocks to symbol
+ names, line numbers and JITted code.
+ERST
+#endif
+
DEFHEADING()
DEFHEADING(Generic object creation:)
@@ -4626,7 +5094,7 @@ SRST
they are specified. Note that the 'id' property must be set. These
objects are placed in the '/objects' path.
- ``-object memory-backend-file,id=id,size=size,mem-path=dir,share=on|off,discard-data=on|off,merge=on|off,dump=on|off,prealloc=on|off,host-nodes=host-nodes,policy=default|preferred|bind|interleave,align=align,readonly=on|off``
+ ``-object memory-backend-file,id=id,size=size,mem-path=dir,share=on|off,discard-data=on|off,merge=on|off,dump=on|off,prealloc=on|off,host-nodes=host-nodes,policy=default|preferred|bind|interleave,align=align,offset=offset,readonly=on|off,rom=on|off|auto``
Creates a memory file backend object, which can be used to back
the guest RAM with huge pages.
@@ -4696,6 +5164,10 @@ SRST
such cases, users can specify the required alignment via this
option.
+ The ``offset`` option specifies the offset into the target file
+ that the region starts at. You can use this parameter to back
+ multiple regions with a single file.
+
The ``pmem`` option specifies whether the backing file specified
by ``mem-path`` is in host persistent memory that can be
accessed using the SNIA NVM programming model (e.g. Intel
@@ -4712,6 +5184,20 @@ SRST
The ``readonly`` option specifies whether the backing file is opened
read-only or read-write (default).
+ The ``rom`` option specifies whether to create Read Only Memory
+ (ROM) that cannot be modified by the VM. Any write attempts to such
+ ROM will be denied. Most use cases want proper RAM instead of ROM.
+ However, selected use cases, like R/O NVDIMMs, can benefit from
+ ROM. If set to ``on``, create ROM; if set to ``off``, create
+ writable RAM; if set to ``auto`` (default), the value of the
+ ``readonly`` option is used. This option is primarily helpful when
+ we want to have writable RAM in configurations that would
+ traditionally create ROM before the ``rom`` option was introduced:
+ VM templating, where we want to open a file readonly
+ (``readonly=on``) and mark the memory to be private for QEMU
+ (``share=off``). For this use case, we need writable RAM instead
+ of ROM, and want to also set ``rom=off``.
+
``-object memory-backend-ram,id=id,merge=on|off,dump=on|off,share=on|off,prealloc=on|off,size=size,host-nodes=host-nodes,policy=default|preferred|bind|interleave``
Creates a memory backend object, which can be used to back the
guest RAM. Memory backend objects offer more control than the
@@ -4744,6 +5230,18 @@ SRST
The ``share`` boolean option is on by default with memfd.
+ ``-object iommufd,id=id[,fd=fd]``
+ Creates an iommufd backend which allows control of DMA mapping
+ through the ``/dev/iommu`` device.
+
+ The ``id`` parameter is a unique ID which frontends (such as
+ vfio-pci of vdpa) will use to connect with the iommufd backend.
+
+ The ``fd`` parameter is an optional pre-opened file descriptor
+ resulting from ``/dev/iommu`` opening. Usually the iommufd is shared
+ across all subsystems, bringing the benefit of centralized
+ reference counting.
+
``-object rng-builtin,id=id``
Creates a random number generator backend which obtains entropy
from QEMU builtin functions. The ``id`` parameter is a unique ID
@@ -4989,7 +5487,7 @@ SRST
KVM COLO
primary:
- -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
+ -netdev tap,id=hn0,vhost=off
-device e1000,id=e0,netdev=hn0,mac=52:a4:00:12:78:66
-chardev socket,id=mirror0,host=3.3.3.3,port=9003,server=on,wait=off
-chardev socket,id=compare1,host=3.3.3.3,port=9004,server=on,wait=off
@@ -5004,7 +5502,7 @@ SRST
-object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0,iothread=iothread1
secondary:
- -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,down script=/etc/qemu-ifdown
+ -netdev tap,id=hn0,vhost=off
-device e1000,netdev=hn0,mac=52:a4:00:12:78:66
-chardev socket,id=red0,host=3.3.3.3,port=9003
-chardev socket,id=red1,host=3.3.3.3,port=9004
@@ -5015,7 +5513,7 @@ SRST
Xen COLO
primary:
- -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
+ -netdev tap,id=hn0,vhost=off
-device e1000,id=e0,netdev=hn0,mac=52:a4:00:12:78:66
-chardev socket,id=mirror0,host=3.3.3.3,port=9003,server=on,wait=off
-chardev socket,id=compare1,host=3.3.3.3,port=9004,server=on,wait=off
@@ -5028,10 +5526,10 @@ SRST
-object filter-redirector,netdev=hn0,id=redire0,queue=rx,indev=compare_out
-object filter-redirector,netdev=hn0,id=redire1,queue=rx,outdev=compare0
-object iothread,id=iothread1
- -object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0,notify_dev=nofity_way,iothread=iothread1
+ -object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0,notify_dev=notify_way,iothread=iothread1
secondary:
- -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,down script=/etc/qemu-ifdown
+ -netdev tap,id=hn0,vhost=off
-device e1000,netdev=hn0,mac=52:a4:00:12:78:66
-chardev socket,id=red0,host=3.3.3.3,port=9003
-chardev socket,id=red1,host=3.3.3.3,port=9004
@@ -5042,8 +5540,8 @@ SRST
read the colo-compare git log.
``-object cryptodev-backend-builtin,id=id[,queues=queues]``
- Creates a cryptodev backend which executes crypto opreation from
- the QEMU cipher APIS. The id parameter is a unique ID that will
+ Creates a cryptodev backend which executes crypto operations from
+ the QEMU cipher APIs. The id parameter is a unique ID that will
be used to reference this cryptodev backend from the
``virtio-crypto`` device. The queues parameter is optional,
which specify the queue number of cryptodev backend, the default
@@ -5157,7 +5655,7 @@ SRST
-object secret,id=sec0,keyid=secmaster0,format=base64,\\
data=$SECRET,iv=$(<iv.b64)
- ``-object sev-guest,id=id,cbitpos=cbitpos,reduced-phys-bits=val,[sev-device=string,policy=policy,handle=handle,dh-cert-file=file,session-file=file]``
+ ``-object sev-guest,id=id,cbitpos=cbitpos,reduced-phys-bits=val,[sev-device=string,policy=policy,handle=handle,dh-cert-file=file,session-file=file,kernel-hashes=on|off]``
Create a Secure Encrypted Virtualization (SEV) guest object,
which can be used to provide the guest memory encryption support
on AMD processors.
@@ -5172,7 +5670,7 @@ SRST
physical address space. The ``reduced-phys-bits`` is used to
provide the number of bits we loose in physical address space.
Similar to C-bit, the value is Host family dependent. On EPYC,
- the value should be 5.
+ a guest will lose a maximum of 1 bit, so the value should be 1.
The ``sev-device`` provides the device file to use for
communicating with the SEV firmware running inside AMD Secure
@@ -5197,13 +5695,17 @@ SRST
session with the guest owner to negotiate keys used for
attestation. The file must be encoded in base64.
+ The ``kernel-hashes`` adds the hashes of given kernel/initrd/
+ cmdline to a designated guest firmware page for measured Linux
+ boot with -kernel. The default is off. (Since 6.2)
+
e.g to launch a SEV guest
.. parsed-literal::
# |qemu_system_x86| \\
...... \\
- -object sev-guest,id=sev0,cbitpos=47,reduced-phys-bits=5 \\
+ -object sev-guest,id=sev0,cbitpos=47,reduced-phys-bits=1 \\
-machine ...,memory-encryption=sev0 \\
.....
@@ -5306,7 +5808,7 @@ SRST
file=/etc/qemu/vnc.allow
Finally the ``/etc/qemu/vnc.allow`` file would contain the list
- of x509 distingished names that are permitted access
+ of x509 distinguished names that are permitted access
::