xref: /openbmc/qemu/qemu-options.hx (revision 350785d41d8bb0b799dd16ea04a7232dc8d6093a)
1HXCOMM See docs/devel/docs.rst for the format of this file.
2HXCOMM
3HXCOMM Use DEFHEADING() to define headings in both help text and rST.
4HXCOMM Text between SRST and ERST is copied to the rST version and
5HXCOMM discarded from C version.
6HXCOMM DEF(option, HAS_ARG/0, opt_enum, opt_help, arch_mask) is used to
7HXCOMM construct option structures, enums and help message for specified
8HXCOMM architectures.
9HXCOMM HXCOMM can be used for comments, discarded from both rST and C.
10
11DEFHEADING(Standard options:)
12
13DEF("help", 0, QEMU_OPTION_h,
14    "-h or -help     display this help and exit\n", QEMU_ARCH_ALL)
15SRST
16``-h``
17    Display help and exit
18ERST
19
20DEF("version", 0, QEMU_OPTION_version,
21    "-version        display version information and exit\n", QEMU_ARCH_ALL)
22SRST
23``-version``
24    Display version information and exit
25ERST
26
27DEF("machine", HAS_ARG, QEMU_OPTION_machine, \
28    "-machine [type=]name[,prop[=value][,...]]\n"
29    "                selects emulated machine ('-machine help' for list)\n"
30    "                property accel=accel1[:accel2[:...]] selects accelerator\n"
31    "                supported accelerators are kvm, xen, hvf, nvmm, whpx or tcg (default: tcg)\n"
32    "                vmport=on|off|auto controls emulation of vmport (default: auto)\n"
33    "                dump-guest-core=on|off include guest memory in a core dump (default=on)\n"
34    "                mem-merge=on|off controls memory merge support (default: on)\n"
35    "                aes-key-wrap=on|off controls support for AES key wrapping (default=on)\n"
36    "                dea-key-wrap=on|off controls support for DEA key wrapping (default=on)\n"
37    "                suppress-vmdesc=on|off disables self-describing migration (default=off)\n"
38    "                nvdimm=on|off controls NVDIMM support (default=off)\n"
39    "                memory-encryption=@var{} memory encryption object to use (default=none)\n"
40    "                hmat=on|off controls ACPI HMAT support (default=off)\n"
41#ifdef CONFIG_POSIX
42    "                aux-ram-share=on|off allocate auxiliary guest RAM as shared (default: off)\n"
43#endif
44    "                memory-backend='backend-id' specifies explicitly provided backend for main RAM (default=none)\n"
45    "                cxl-fmw.0.targets.0=firsttarget,cxl-fmw.0.targets.1=secondtarget,cxl-fmw.0.size=size[,cxl-fmw.0.interleave-granularity=granularity]\n"
46    "                smp-cache.0.cache=cachename,smp-cache.0.topology=topologylevel\n",
47    QEMU_ARCH_ALL)
48SRST
49``-machine [type=]name[,prop=value[,...]]``
50    Select the emulated machine by name. Use ``-machine help`` to list
51    available machines.
52
53    For architectures which aim to support live migration compatibility
54    across releases, each release will introduce a new versioned machine
55    type. For example, the 2.8.0 release introduced machine types
56    "pc-i440fx-2.8" and "pc-q35-2.8" for the x86\_64/i686 architectures.
57
58    To allow live migration of guests from QEMU version 2.8.0, to QEMU
59    version 2.9.0, the 2.9.0 version must support the "pc-i440fx-2.8"
60    and "pc-q35-2.8" machines too. To allow users live migrating VMs to
61    skip multiple intermediate releases when upgrading, new releases of
62    QEMU will support machine types from many previous versions.
63
64    Supported machine properties are:
65
66    ``accel=accels1[:accels2[:...]]``
67        This is used to enable an accelerator. Depending on the target
68        architecture, kvm, xen, hvf, nvmm, whpx or tcg can be available.
69        By default, tcg is used. If there is more than one accelerator
70        specified, the next one is used if the previous one fails to
71        initialize.
72
73    ``vmport=on|off|auto``
74        Enables emulation of VMWare IO port, for vmmouse etc. auto says
75        to select the value based on accel and i8042. For accel=xen or
76        i8042=off the default is off otherwise the default is on.
77
78    ``dump-guest-core=on|off``
79        Include guest memory in a core dump. The default is on.
80
81    ``mem-merge=on|off``
82        Enables or disables memory merge support. This feature, when
83        supported by the host, de-duplicates identical memory pages
84        among VMs instances (enabled by default).
85
86    ``aes-key-wrap=on|off``
87        Enables or disables AES key wrapping support on s390-ccw hosts.
88        This feature controls whether AES wrapping keys will be created
89        to allow execution of AES cryptographic functions. The default
90        is on.
91
92    ``dea-key-wrap=on|off``
93        Enables or disables DEA key wrapping support on s390-ccw hosts.
94        This feature controls whether DEA wrapping keys will be created
95        to allow execution of DEA cryptographic functions. The default
96        is on.
97
98    ``nvdimm=on|off``
99        Enables or disables NVDIMM support. The default is off.
100
101    ``memory-encryption=``
102        Memory encryption object to use. The default is none.
103
104    ``hmat=on|off``
105        Enables or disables ACPI Heterogeneous Memory Attribute Table
106        (HMAT) support. The default is off.
107
108    ``aux-ram-share=on|off``
109        Allocate auxiliary guest RAM as an anonymous file that is
110        shareable with an external process.  This option applies to
111        memory allocated as a side effect of creating various devices.
112        It does not apply to memory-backend-objects, whether explicitly
113        specified on the command line, or implicitly created by the -m
114        command line option.  The default is off.
115
116        To use the cpr-transfer migration mode, you must set aux-ram-share=on.
117
118    ``memory-backend='id'``
119        An alternative to legacy ``-mem-path`` and ``mem-prealloc`` options.
120        Allows to use a memory backend as main RAM.
121
122        For example:
123        ::
124
125            -object memory-backend-file,id=pc.ram,size=512M,mem-path=/hugetlbfs,prealloc=on,share=on
126            -machine memory-backend=pc.ram
127            -m 512M
128
129        Migration compatibility note:
130
131        * as backend id one shall use value of 'default-ram-id', advertised by
132          machine type (available via ``query-machines`` QMP command), if migration
133          to/from old QEMU (<5.0) is expected.
134        * for machine types 4.0 and older, user shall
135          use ``x-use-canonical-path-for-ramblock-id=off`` backend option
136          if migration to/from old QEMU (<5.0) is expected.
137
138        For example:
139        ::
140
141            -object memory-backend-ram,id=pc.ram,size=512M,x-use-canonical-path-for-ramblock-id=off
142            -machine memory-backend=pc.ram
143            -m 512M
144
145    ``cxl-fmw.0.targets.0=firsttarget,cxl-fmw.0.targets.1=secondtarget,cxl-fmw.0.size=size[,cxl-fmw.0.interleave-granularity=granularity]``
146        Define a CXL Fixed Memory Window (CFMW).
147
148        Described in the CXL 2.0 ECN: CEDT CFMWS & QTG _DSM.
149
150        They are regions of Host Physical Addresses (HPA) on a system which
151        may be interleaved across one or more CXL host bridges.  The system
152        software will assign particular devices into these windows and
153        configure the downstream Host-managed Device Memory (HDM) decoders
154        in root ports, switch ports and devices appropriately to meet the
155        interleave requirements before enabling the memory devices.
156
157        ``targets.X=target`` provides the mapping to CXL host bridges
158        which may be identified by the id provided in the -device entry.
159        Multiple entries are needed to specify all the targets when
160        the fixed memory window represents interleaved memory. X is the
161        target index from 0.
162
163        ``size=size`` sets the size of the CFMW. This must be a multiple of
164        256MiB. The region will be aligned to 256MiB but the location is
165        platform and configuration dependent.
166
167        ``interleave-granularity=granularity`` sets the granularity of
168        interleave. Default 256 (bytes). Only 256, 512, 1k, 2k,
169        4k, 8k and 16k granularities supported.
170
171        Example:
172
173        ::
174
175            -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=512
176
177    ``smp-cache.0.cache=cachename,smp-cache.0.topology=topologylevel``
178        Define cache properties for SMP system.
179
180        ``cache=cachename`` specifies the cache that the properties will be
181        applied on. This field is the combination of cache level and cache
182        type. It supports ``l1d`` (L1 data cache), ``l1i`` (L1 instruction
183        cache), ``l2`` (L2 unified cache) and ``l3`` (L3 unified cache).
184
185        ``topology=topologylevel`` sets the cache topology level. It accepts
186        CPU topology levels including ``core``, ``module``, ``cluster``, ``die``,
187        ``socket``, ``book``, ``drawer`` and a special value ``default``. If
188        ``default`` is set, then the cache topology will follow the architecture's
189        default cache topology model. If another topology level is set, the cache
190        will be shared at corresponding CPU topology level. For example,
191        ``topology=core`` makes the cache shared by all threads within a core.
192        The omitting cache will default to using the ``default`` level.
193
194        The default cache topology model for an i386 PC machine is as follows:
195        ``l1d``, ``l1i``, and ``l2`` caches are per ``core``, while the ``l3``
196        cache is per ``die``.
197
198        Example:
199
200        ::
201
202            -machine smp-cache.0.cache=l1d,smp-cache.0.topology=core,smp-cache.1.cache=l1i,smp-cache.1.topology=core
203ERST
204
205DEF("M", HAS_ARG, QEMU_OPTION_M,
206    "                sgx-epc.0.memdev=memid,sgx-epc.0.node=numaid\n",
207    QEMU_ARCH_ALL)
208
209SRST
210``sgx-epc.0.memdev=@var{memid},sgx-epc.0.node=@var{numaid}``
211    Define an SGX EPC section.
212ERST
213
214DEF("cpu", HAS_ARG, QEMU_OPTION_cpu,
215    "-cpu cpu        select CPU ('-cpu help' for list)\n", QEMU_ARCH_ALL)
216SRST
217``-cpu model``
218    Select CPU model (``-cpu help`` for list and additional feature
219    selection)
220ERST
221
222DEF("accel", HAS_ARG, QEMU_OPTION_accel,
223    "-accel [accel=]accelerator[,prop[=value][,...]]\n"
224    "                select accelerator (kvm, xen, hvf, nvmm, whpx or tcg; use 'help' for a list)\n"
225    "                igd-passthru=on|off (enable Xen integrated Intel graphics passthrough, default=off)\n"
226    "                kernel-irqchip=on|off|split controls accelerated irqchip support (default=on)\n"
227    "                kvm-shadow-mem=size of KVM shadow MMU in bytes\n"
228    "                one-insn-per-tb=on|off (one guest instruction per TCG translation block)\n"
229    "                split-wx=on|off (enable TCG split w^x mapping)\n"
230    "                tb-size=n (TCG translation block cache size)\n"
231    "                dirty-ring-size=n (KVM dirty ring GFN count, default 0)\n"
232    "                eager-split-size=n (KVM Eager Page Split chunk size, default 0, disabled. ARM only)\n"
233    "                notify-vmexit=run|internal-error|disable,notify-window=n (enable notify VM exit and set notify window, x86 only)\n"
234    "                thread=single|multi (enable multi-threaded TCG)\n"
235    "                device=path (KVM device path, default /dev/kvm)\n", QEMU_ARCH_ALL)
236SRST
237``-accel name[,prop=value[,...]]``
238    This is used to enable an accelerator. Depending on the target
239    architecture, kvm, xen, hvf, nvmm, whpx or tcg can be available. By
240    default, tcg is used. If there is more than one accelerator
241    specified, the next one is used if the previous one fails to
242    initialize.
243
244    ``igd-passthru=on|off``
245        When Xen is in use, this option controls whether Intel
246        integrated graphics devices can be passed through to the guest
247        (default=off)
248
249    ``kernel-irqchip=on|off|split``
250        Controls KVM in-kernel irqchip support. The default is full
251        acceleration of the interrupt controllers. On x86, split irqchip
252        reduces the kernel attack surface, at a performance cost for
253        non-MSI interrupts. Disabling the in-kernel irqchip completely
254        is not recommended except for debugging purposes.
255
256    ``kvm-shadow-mem=size``
257        Defines the size of the KVM shadow MMU.
258
259    ``one-insn-per-tb=on|off``
260        Makes the TCG accelerator put only one guest instruction into
261        each translation block. This slows down emulation a lot, but
262        can be useful in some situations, such as when trying to analyse
263        the logs produced by the ``-d`` option.
264
265    ``split-wx=on|off``
266        Controls the use of split w^x mapping for the TCG code generation
267        buffer. Some operating systems require this to be enabled, and in
268        such a case this will default on. On other operating systems, this
269        will default off, but one may enable this for testing or debugging.
270
271    ``tb-size=n``
272        Controls the size (in MiB) of the TCG translation block cache.
273
274    ``thread=single|multi``
275        Controls number of TCG threads. When the TCG is multi-threaded
276        there will be one thread per vCPU therefore taking advantage of
277        additional host cores. The default is to enable multi-threading
278        where both the back-end and front-ends support it and no
279        incompatible TCG features have been enabled (e.g.
280        icount/replay).
281
282    ``dirty-ring-size=n``
283        When the KVM accelerator is used, it controls the size of the per-vCPU
284        dirty page ring buffer (number of entries for each vCPU). It should
285        be a value that is power of two, and it should be 1024 or bigger (but
286        still less than the maximum value that the kernel supports).  4096
287        could be a good initial value if you have no idea which is the best.
288        Set this value to 0 to disable the feature.  By default, this feature
289        is disabled (dirty-ring-size=0).  When enabled, KVM will instead
290        record dirty pages in a bitmap.
291
292    ``eager-split-size=n``
293        KVM implements dirty page logging at the PAGE_SIZE granularity and
294        enabling dirty-logging on a huge-page requires breaking it into
295        PAGE_SIZE pages in the first place. KVM on ARM does this splitting
296        lazily by default. There are performance benefits in doing huge-page
297        split eagerly, especially in situations where TLBI costs associated
298        with break-before-make sequences are considerable and also if guest
299        workloads are read intensive. The size here specifies how many pages
300        to break at a time and needs to be a valid block size which is
301        1GB/2MB/4KB, 32MB/16KB and 512MB/64KB for 4KB/16KB/64KB PAGE_SIZE
302        respectively. Be wary of specifying a higher size as it will have an
303        impact on the memory. By default, this feature is disabled
304        (eager-split-size=0).
305
306    ``notify-vmexit=run|internal-error|disable,notify-window=n``
307        Enables or disables notify VM exit support on x86 host and specify
308        the corresponding notify window to trigger the VM exit if enabled.
309        ``run`` option enables the feature. It does nothing and continue
310        if the exit happens. ``internal-error`` option enables the feature.
311        It raises a internal error. ``disable`` option doesn't enable the feature.
312        This feature can mitigate the CPU stuck issue due to event windows don't
313        open up for a specified of time (i.e. notify-window).
314        Default: notify-vmexit=run,notify-window=0.
315
316    ``device=path``
317        Sets the path to the KVM device node. Defaults to ``/dev/kvm``. This
318        option can be used to pass the KVM device to use via a file descriptor
319        by setting the value to ``/dev/fdset/NN``.
320
321ERST
322
323DEF("smp", HAS_ARG, QEMU_OPTION_smp,
324    "-smp [[cpus=]n][,maxcpus=maxcpus][,drawers=drawers][,books=books][,sockets=sockets]\n"
325    "               [,dies=dies][,clusters=clusters][,modules=modules][,cores=cores]\n"
326    "               [,threads=threads]\n"
327    "                set the number of initial CPUs to 'n' [default=1]\n"
328    "                maxcpus= maximum number of total CPUs, including\n"
329    "                offline CPUs for hotplug, etc\n"
330    "                drawers= number of drawers on the machine board\n"
331    "                books= number of books in one drawer\n"
332    "                sockets= number of sockets in one book\n"
333    "                dies= number of dies in one socket\n"
334    "                clusters= number of clusters in one die\n"
335    "                modules= number of modules in one cluster\n"
336    "                cores= number of cores in one module\n"
337    "                threads= number of threads in one core\n"
338    "Note: Different machines may have different subsets of the CPU topology\n"
339    "      parameters supported, so the actual meaning of the supported parameters\n"
340    "      will vary accordingly. For example, for a machine type that supports a\n"
341    "      three-level CPU hierarchy of sockets/cores/threads, the parameters will\n"
342    "      sequentially mean as below:\n"
343    "                sockets means the number of sockets on the machine board\n"
344    "                cores means the number of cores in one socket\n"
345    "                threads means the number of threads in one core\n"
346    "      For a particular machine type board, an expected CPU topology hierarchy\n"
347    "      can be defined through the supported sub-option. Unsupported parameters\n"
348    "      can also be provided in addition to the sub-option, but their values\n"
349    "      must be set as 1 in the purpose of correct parsing.\n",
350    QEMU_ARCH_ALL)
351SRST
352``-smp [[cpus=]n][,maxcpus=maxcpus][,drawers=drawers][,books=books][,sockets=sockets][,dies=dies][,clusters=clusters][,modules=modules][,cores=cores][,threads=threads]``
353    Simulate a SMP system with '\ ``n``\ ' CPUs initially present on
354    the machine type board. On boards supporting CPU hotplug, the optional
355    '\ ``maxcpus``\ ' parameter can be set to enable further CPUs to be
356    added at runtime. When both parameters are omitted, the maximum number
357    of CPUs will be calculated from the provided topology members and the
358    initial CPU count will match the maximum number. When only one of them
359    is given then the omitted one will be set to its counterpart's value.
360    Both parameters may be specified, but the maximum number of CPUs must
361    be equal to or greater than the initial CPU count. Product of the
362    CPU topology hierarchy must be equal to the maximum number of CPUs.
363    Both parameters are subject to an upper limit that is determined by
364    the specific machine type chosen.
365
366    To control reporting of CPU topology information, values of the topology
367    parameters can be specified. Machines may only support a subset of the
368    parameters and different machines may have different subsets supported
369    which vary depending on capacity of the corresponding CPU targets. So
370    for a particular machine type board, an expected topology hierarchy can
371    be defined through the supported sub-option. Unsupported parameters can
372    also be provided in addition to the sub-option, but their values must be
373    set as 1 in the purpose of correct parsing.
374
375    Either the initial CPU count, or at least one of the topology parameters
376    must be specified. The specified parameters must be greater than zero,
377    explicit configuration like "cpus=0" is not allowed. Values for any
378    omitted parameters will be computed from those which are given.
379
380    For example, the following sub-option defines a CPU topology hierarchy
381    (2 sockets totally on the machine, 2 cores per socket, 2 threads per
382    core) for a machine that only supports sockets/cores/threads.
383    Some members of the option can be omitted but their values will be
384    automatically computed:
385
386    ::
387
388        -smp 8,sockets=2,cores=2,threads=2,maxcpus=8
389
390    The following sub-option defines a CPU topology hierarchy (2 sockets
391    totally on the machine, 2 dies per socket, 2 modules per die, 2 cores per
392    module, 2 threads per core) for PC machines which support sockets/dies
393    /modules/cores/threads. Some members of the option can be omitted but
394    their values will be automatically computed:
395
396    ::
397
398        -smp 32,sockets=2,dies=2,modules=2,cores=2,threads=2,maxcpus=32
399
400    The following sub-option defines a CPU topology hierarchy (2 sockets
401    totally on the machine, 2 clusters per socket, 2 cores per cluster,
402    2 threads per core) for ARM virt machines which support sockets/clusters
403    /cores/threads. Some members of the option can be omitted but their values
404    will be automatically computed:
405
406    ::
407
408        -smp 16,sockets=2,clusters=2,cores=2,threads=2,maxcpus=16
409
410    Historically preference was given to the coarsest topology parameters
411    when computing missing values (ie sockets preferred over cores, which
412    were preferred over threads), however, this behaviour is considered
413    liable to change. Prior to 6.2 the preference was sockets over cores
414    over threads. Since 6.2 the preference is cores over sockets over threads.
415
416    For example, the following option defines a machine board with 2 sockets
417    of 1 core before 6.2 and 1 socket of 2 cores after 6.2:
418
419    ::
420
421        -smp 2
422
423    Note: The cluster topology will only be generated in ACPI and exposed
424    to guest if it's explicitly specified in -smp.
425ERST
426
427DEF("numa", HAS_ARG, QEMU_OPTION_numa,
428    "-numa node[,mem=size][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=node]\n"
429    "-numa node[,memdev=id][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=node]\n"
430    "-numa dist,src=source,dst=destination,val=distance\n"
431    "-numa cpu,node-id=node[,socket-id=x][,core-id=y][,thread-id=z]\n"
432    "-numa hmat-lb,initiator=node,target=node,hierarchy=memory|first-level|second-level|third-level,data-type=access-latency|read-latency|write-latency[,latency=lat][,bandwidth=bw]\n"
433    "-numa hmat-cache,node-id=node,size=size,level=level[,associativity=none|direct|complex][,policy=none|write-back|write-through][,line=size]\n",
434    QEMU_ARCH_ALL)
435SRST
436``-numa node[,mem=size][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=initiator]``
437  \
438``-numa node[,memdev=id][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=initiator]``
439  \
440``-numa dist,src=source,dst=destination,val=distance``
441  \
442``-numa cpu,node-id=node[,socket-id=x][,core-id=y][,thread-id=z]``
443  \
444``-numa hmat-lb,initiator=node,target=node,hierarchy=hierarchy,data-type=type[,latency=lat][,bandwidth=bw]``
445  \
446``-numa hmat-cache,node-id=node,size=size,level=level[,associativity=str][,policy=str][,line=size]``
447    Define a NUMA node and assign RAM and VCPUs to it. Set the NUMA
448    distance from a source node to a destination node. Set the ACPI
449    Heterogeneous Memory Attributes for the given nodes.
450
451    Legacy VCPU assignment uses '\ ``cpus``\ ' option where firstcpu and
452    lastcpu are CPU indexes. Each '\ ``cpus``\ ' option represent a
453    contiguous range of CPU indexes (or a single VCPU if lastcpu is
454    omitted). A non-contiguous set of VCPUs can be represented by
455    providing multiple '\ ``cpus``\ ' options. If '\ ``cpus``\ ' is
456    omitted on all nodes, VCPUs are automatically split between them.
457
458    For example, the following option assigns VCPUs 0, 1, 2 and 5 to a
459    NUMA node:
460
461    ::
462
463        -numa node,cpus=0-2,cpus=5
464
465    '\ ``cpu``\ ' option is a new alternative to '\ ``cpus``\ ' option
466    which uses '\ ``socket-id|core-id|thread-id``\ ' properties to
467    assign CPU objects to a node using topology layout properties of
468    CPU. The set of properties is machine specific, and depends on used
469    machine type/'\ ``smp``\ ' options. It could be queried with
470    '\ ``hotpluggable-cpus``\ ' monitor command. '\ ``node-id``\ '
471    property specifies node to which CPU object will be assigned, it's
472    required for node to be declared with '\ ``node``\ ' option before
473    it's used with '\ ``cpu``\ ' option.
474
475    For example:
476
477    ::
478
479        -M pc \
480        -smp 1,sockets=2,maxcpus=2 \
481        -numa node,nodeid=0 -numa node,nodeid=1 \
482        -numa cpu,node-id=0,socket-id=0 -numa cpu,node-id=1,socket-id=1
483
484    '\ ``memdev``\ ' option assigns RAM from a given memory backend
485    device to a node. It is recommended to use '\ ``memdev``\ ' option
486    over legacy '\ ``mem``\ ' option. This is because '\ ``memdev``\ '
487    option provides better performance and more control over the
488    backend's RAM (e.g. '\ ``prealloc``\ ' parameter of
489    '\ ``-memory-backend-ram``\ ' allows memory preallocation).
490
491    For compatibility reasons, legacy '\ ``mem``\ ' option is
492    supported in 5.0 and older machine types. Note that '\ ``mem``\ '
493    and '\ ``memdev``\ ' are mutually exclusive. If one node uses
494    '\ ``memdev``\ ', the rest nodes have to use '\ ``memdev``\ '
495    option, and vice versa.
496
497    Users must specify memory for all NUMA nodes by '\ ``memdev``\ '
498    (or legacy '\ ``mem``\ ' if available). In QEMU 5.2, the support
499    for '\ ``-numa node``\ ' without memory specified was removed.
500
501    '\ ``initiator``\ ' is an additional option that points to an
502    initiator NUMA node that has best performance (the lowest latency or
503    largest bandwidth) to this NUMA node. Note that this option can be
504    set only when the machine property 'hmat' is set to 'on'.
505
506    Following example creates a machine with 2 NUMA nodes, node 0 has
507    CPU. node 1 has only memory, and its initiator is node 0. Note that
508    because node 0 has CPU, by default the initiator of node 0 is itself
509    and must be itself.
510
511    ::
512
513        -machine hmat=on \
514        -m 2G,slots=2,maxmem=4G \
515        -object memory-backend-ram,size=1G,id=m0 \
516        -object memory-backend-ram,size=1G,id=m1 \
517        -numa node,nodeid=0,memdev=m0 \
518        -numa node,nodeid=1,memdev=m1,initiator=0 \
519        -smp 2,sockets=2,maxcpus=2  \
520        -numa cpu,node-id=0,socket-id=0 \
521        -numa cpu,node-id=0,socket-id=1
522
523    source and destination are NUMA node IDs. distance is the NUMA
524    distance from source to destination. The distance from a node to
525    itself is always 10. If any pair of nodes is given a distance, then
526    all pairs must be given distances. Although, when distances are only
527    given in one direction for each pair of nodes, then the distances in
528    the opposite directions are assumed to be the same. If, however, an
529    asymmetrical pair of distances is given for even one node pair, then
530    all node pairs must be provided distance values for both directions,
531    even when they are symmetrical. When a node is unreachable from
532    another node, set the pair's distance to 255.
533
534    Note that the -``numa`` option doesn't allocate any of the specified
535    resources, it just assigns existing resources to NUMA nodes. This
536    means that one still has to use the ``-m``, ``-smp`` options to
537    allocate RAM and VCPUs respectively.
538
539    Use '\ ``hmat-lb``\ ' to set System Locality Latency and Bandwidth
540    Information between initiator and target NUMA nodes in ACPI
541    Heterogeneous Attribute Memory Table (HMAT). Initiator NUMA node can
542    create memory requests, usually it has one or more processors.
543    Target NUMA node contains addressable memory.
544
545    In '\ ``hmat-lb``\ ' option, node are NUMA node IDs. hierarchy is
546    the memory hierarchy of the target NUMA node: if hierarchy is
547    'memory', the structure represents the memory performance; if
548    hierarchy is 'first-level\|second-level\|third-level', this
549    structure represents aggregated performance of memory side caches
550    for each domain. type of 'data-type' is type of data represented by
551    this structure instance: if 'hierarchy' is 'memory', 'data-type' is
552    'access\|read\|write' latency or 'access\|read\|write' bandwidth of
553    the target memory; if 'hierarchy' is
554    'first-level\|second-level\|third-level', 'data-type' is
555    'access\|read\|write' hit latency or 'access\|read\|write' hit
556    bandwidth of the target memory side cache.
557
558    lat is latency value in nanoseconds. bw is bandwidth value, the
559    possible value and units are NUM[M\|G\|T], mean that the bandwidth
560    value are NUM byte per second (or MB/s, GB/s or TB/s depending on
561    used suffix). Note that if latency or bandwidth value is 0, means
562    the corresponding latency or bandwidth information is not provided.
563
564    In '\ ``hmat-cache``\ ' option, node-id is the NUMA-id of the memory
565    belongs. size is the size of memory side cache in bytes. level is
566    the cache level described in this structure, note that the cache
567    level 0 should not be used with '\ ``hmat-cache``\ ' option.
568    associativity is the cache associativity, the possible value is
569    'none/direct(direct-mapped)/complex(complex cache indexing)'. policy
570    is the write policy. line is the cache Line size in bytes.
571
572    For example, the following options describe 2 NUMA nodes. Node 0 has
573    2 cpus and a ram, node 1 has only a ram. The processors in node 0
574    access memory in node 0 with access-latency 5 nanoseconds,
575    access-bandwidth is 200 MB/s; The processors in NUMA node 0 access
576    memory in NUMA node 1 with access-latency 10 nanoseconds,
577    access-bandwidth is 100 MB/s. And for memory side cache information,
578    NUMA node 0 and 1 both have 1 level memory cache, size is 10KB,
579    policy is write-back, the cache Line size is 8 bytes:
580
581    ::
582
583        -machine hmat=on \
584        -m 2G \
585        -object memory-backend-ram,size=1G,id=m0 \
586        -object memory-backend-ram,size=1G,id=m1 \
587        -smp 2,sockets=2,maxcpus=2 \
588        -numa node,nodeid=0,memdev=m0 \
589        -numa node,nodeid=1,memdev=m1,initiator=0 \
590        -numa cpu,node-id=0,socket-id=0 \
591        -numa cpu,node-id=0,socket-id=1 \
592        -numa hmat-lb,initiator=0,target=0,hierarchy=memory,data-type=access-latency,latency=5 \
593        -numa hmat-lb,initiator=0,target=0,hierarchy=memory,data-type=access-bandwidth,bandwidth=200M \
594        -numa hmat-lb,initiator=0,target=1,hierarchy=memory,data-type=access-latency,latency=10 \
595        -numa hmat-lb,initiator=0,target=1,hierarchy=memory,data-type=access-bandwidth,bandwidth=100M \
596        -numa hmat-cache,node-id=0,size=10K,level=1,associativity=direct,policy=write-back,line=8 \
597        -numa hmat-cache,node-id=1,size=10K,level=1,associativity=direct,policy=write-back,line=8
598ERST
599
600DEF("add-fd", HAS_ARG, QEMU_OPTION_add_fd,
601    "-add-fd fd=fd,set=set[,opaque=opaque]\n"
602    "                Add 'fd' to fd 'set'\n", QEMU_ARCH_ALL)
603SRST
604``-add-fd fd=fd,set=set[,opaque=opaque]``
605    Add a file descriptor to an fd set. Valid options are:
606
607    ``fd=fd``
608        This option defines the file descriptor of which a duplicate is
609        added to fd set. The file descriptor cannot be stdin, stdout, or
610        stderr.
611
612    ``set=set``
613        This option defines the ID of the fd set to add the file
614        descriptor to.
615
616    ``opaque=opaque``
617        This option defines a free-form string that can be used to
618        describe fd.
619
620    You can open an image using pre-opened file descriptors from an fd
621    set:
622
623    .. parsed-literal::
624
625        |qemu_system| \\
626         -add-fd fd=3,set=2,opaque="rdwr:/path/to/file" \\
627         -add-fd fd=4,set=2,opaque="rdonly:/path/to/file" \\
628         -drive file=/dev/fdset/2,index=0,media=disk
629ERST
630
631DEF("set", HAS_ARG, QEMU_OPTION_set,
632    "-set group.id.arg=value\n"
633    "                set <arg> parameter for item <id> of type <group>\n"
634    "                i.e. -set drive.$id.file=/path/to/image\n", QEMU_ARCH_ALL)
635SRST
636``-set group.id.arg=value``
637    Set parameter arg for item id of type group
638ERST
639
640DEF("global", HAS_ARG, QEMU_OPTION_global,
641    "-global driver.property=value\n"
642    "-global driver=driver,property=property,value=value\n"
643    "                set a global default for a driver property\n",
644    QEMU_ARCH_ALL)
645SRST
646``-global driver.prop=value``
647  \
648``-global driver=driver,property=property,value=value``
649    Set default value of driver's property prop to value, e.g.:
650
651    .. parsed-literal::
652
653        |qemu_system_x86| -global ide-hd.physical_block_size=4096 disk-image.img
654
655    In particular, you can use this to set driver properties for devices
656    which are created automatically by the machine model. To create a
657    device which is not created automatically and set properties on it,
658    use -``device``.
659
660    -global driver.prop=value is shorthand for -global
661    driver=driver,property=prop,value=value. The longhand syntax works
662    even when driver contains a dot.
663ERST
664
665DEF("boot", HAS_ARG, QEMU_OPTION_boot,
666    "-boot [order=drives][,once=drives][,menu=on|off]\n"
667    "      [,splash=sp_name][,splash-time=sp_time][,reboot-timeout=rb_time][,strict=on|off]\n"
668    "                'drives': floppy (a), hard disk (c), CD-ROM (d), network (n)\n"
669    "                'sp_name': the file's name that would be passed to bios as logo picture, if menu=on\n"
670    "                'sp_time': the period that splash picture last if menu=on, unit is ms\n"
671    "                'rb_timeout': the timeout before guest reboot when boot failed, unit is ms\n",
672    QEMU_ARCH_ALL)
673SRST
674``-boot [order=drives][,once=drives][,menu=on|off][,splash=sp_name][,splash-time=sp_time][,reboot-timeout=rb_timeout][,strict=on|off]``
675    Specify boot order drives as a string of drive letters. Valid drive
676    letters depend on the target architecture. The x86 PC uses: a, b
677    (floppy 1 and 2), c (first hard disk), d (first CD-ROM), n-p
678    (Etherboot from network adapter 1-4), hard disk boot is the default.
679    To apply a particular boot order only on the first startup, specify
680    it via ``once``. Note that the ``order`` or ``once`` parameter
681    should not be used together with the ``bootindex`` property of
682    devices, since the firmware implementations normally do not support
683    both at the same time.
684
685    Interactive boot menus/prompts can be enabled via ``menu=on`` as far
686    as firmware/BIOS supports them. The default is non-interactive boot.
687
688    A splash picture could be passed to bios, enabling user to show it
689    as logo, when option splash=sp\_name is given and menu=on, If
690    firmware/BIOS supports them. Currently Seabios for X86 system
691    support it. limitation: The splash file could be a jpeg file or a
692    BMP file in 24 BPP format(true color). The resolution should be
693    supported by the SVGA mode, so the recommended is 320x240, 640x480,
694    800x640.
695
696    A timeout could be passed to bios, guest will pause for rb\_timeout
697    ms when boot failed, then reboot. If rb\_timeout is '-1', guest will
698    not reboot, qemu passes '-1' to bios by default. Currently Seabios
699    for X86 system support it.
700
701    Do strict boot via ``strict=on`` as far as firmware/BIOS supports
702    it. This only effects when boot priority is changed by bootindex
703    options. The default is non-strict boot.
704
705    .. parsed-literal::
706
707        # try to boot from network first, then from hard disk
708        |qemu_system_x86| -boot order=nc
709        # boot from CD-ROM first, switch back to default order after reboot
710        |qemu_system_x86| -boot once=d
711        # boot with a splash picture for 5 seconds.
712        |qemu_system_x86| -boot menu=on,splash=/root/boot.bmp,splash-time=5000
713
714    Note: The legacy format '-boot drives' is still supported but its
715    use is discouraged as it may be removed from future versions.
716ERST
717
718DEF("m", HAS_ARG, QEMU_OPTION_m,
719    "-m [size=]megs[,slots=n,maxmem=size]\n"
720    "                configure guest RAM\n"
721    "                size: initial amount of guest memory\n"
722    "                slots: number of hotplug slots (default: none)\n"
723    "                maxmem: maximum amount of guest memory (default: none)\n"
724    "                Note: Some architectures might enforce a specific granularity\n",
725    QEMU_ARCH_ALL)
726SRST
727``-m [size=]megs[,slots=n,maxmem=size]``
728    Sets guest startup RAM size to megs megabytes. Default is 128 MiB.
729    Optionally, a suffix of "M" or "G" can be used to signify a value in
730    megabytes or gigabytes respectively. Optional pair slots, maxmem
731    could be used to set amount of hotpluggable memory slots and maximum
732    amount of memory. Note that maxmem must be aligned to the page size.
733
734    For example, the following command-line sets the guest startup RAM
735    size to 1GB, creates 3 slots to hotplug additional memory and sets
736    the maximum memory the guest can reach to 4GB:
737
738    .. parsed-literal::
739
740        |qemu_system| -m 1G,slots=3,maxmem=4G
741
742    If slots and maxmem are not specified, memory hotplug won't be
743    enabled and the guest startup RAM will never increase.
744ERST
745
746DEF("mem-path", HAS_ARG, QEMU_OPTION_mempath,
747    "-mem-path FILE  provide backing storage for guest RAM\n", QEMU_ARCH_ALL)
748SRST
749``-mem-path path``
750    Allocate guest RAM from a temporarily created file in path.
751ERST
752
753DEF("mem-prealloc", 0, QEMU_OPTION_mem_prealloc,
754    "-mem-prealloc   preallocate guest memory (use with -mem-path)\n",
755    QEMU_ARCH_ALL)
756SRST
757``-mem-prealloc``
758    Preallocate memory when using -mem-path.
759ERST
760
761DEF("k", HAS_ARG, QEMU_OPTION_k,
762    "-k language     use keyboard layout (for example 'fr' for French)\n",
763    QEMU_ARCH_ALL)
764SRST
765``-k language``
766    Use keyboard layout language (for example ``fr`` for French). This
767    option is only needed where it is not easy to get raw PC keycodes
768    (e.g. on Macs, with some X11 servers or with a VNC or curses
769    display). You don't normally need to use it on PC/Linux or
770    PC/Windows hosts.
771
772    The available layouts are:
773
774    ::
775
776        ar  de-ch  es  fo     fr-ca  hu  ja  mk     no  pt-br  sv
777        da  en-gb  et  fr     fr-ch  is  lt  nl     pl  ru     th
778        de  en-us  fi  fr-be  hr     it  lv  nl-be  pt  sl     tr
779
780    The default is ``en-us``.
781ERST
782
783
784DEF("audio", HAS_ARG, QEMU_OPTION_audio,
785    "-audio [driver=]driver[,prop[=value][,...]]\n"
786    "                specifies default audio backend when `audiodev` is not\n"
787    "                used to create a machine or sound device;"
788    "                options are the same as for -audiodev\n"
789    "-audio [driver=]driver,model=value[,prop[=value][,...]]\n"
790    "                specifies the audio backend and device to use;\n"
791    "                apart from 'model', options are the same as for -audiodev.\n"
792    "                use '-audio model=help' to show possible devices.\n",
793    QEMU_ARCH_ALL)
794SRST
795``-audio [driver=]driver[,model=value][,prop[=value][,...]]``
796    If the ``model`` option is specified, ``-audio`` is a shortcut
797    for configuring both the guest audio hardware and the host audio
798    backend in one go. The guest hardware model can be set with
799    ``model=modelname``.  Use ``model=help`` to list the available
800    device types.
801
802    The following two example do exactly the same, to show how ``-audio``
803    can be used to shorten the command line length:
804
805    .. parsed-literal::
806
807        |qemu_system| -audiodev pa,id=pa -device sb16,audiodev=pa
808        |qemu_system| -audio pa,model=sb16
809
810    If the ``model`` option is not specified, ``-audio`` is used to
811    configure a default audio backend that will be used whenever the
812    ``audiodev`` property is not set on a device or machine.  In
813    particular, ``-audio none`` ensures that no audio is produced even
814    for machines that have embedded sound hardware.
815
816    In both cases, the driver option is the same as with the corresponding
817    ``-audiodev`` option below.  Use ``driver=help`` to list the available
818    drivers.
819
820ERST
821
822DEF("audiodev", HAS_ARG, QEMU_OPTION_audiodev,
823    "-audiodev [driver=]driver,id=id[,prop[=value][,...]]\n"
824    "                specifies the audio backend to use\n"
825    "                Use ``-audiodev help`` to list the available drivers\n"
826    "                id= identifier of the backend\n"
827    "                timer-period= timer period in microseconds\n"
828    "                in|out.mixing-engine= use mixing engine to mix streams inside QEMU\n"
829    "                in|out.fixed-settings= use fixed settings for host audio\n"
830    "                in|out.frequency= frequency to use with fixed settings\n"
831    "                in|out.channels= number of channels to use with fixed settings\n"
832    "                in|out.format= sample format to use with fixed settings\n"
833    "                valid values: s8, s16, s32, u8, u16, u32, f32\n"
834    "                in|out.voices= number of voices to use\n"
835    "                in|out.buffer-length= length of buffer in microseconds\n"
836    "-audiodev none,id=id,[,prop[=value][,...]]\n"
837    "                dummy driver that discards all output\n"
838#ifdef CONFIG_AUDIO_ALSA
839    "-audiodev alsa,id=id[,prop[=value][,...]]\n"
840    "                in|out.dev= name of the audio device to use\n"
841    "                in|out.period-length= length of period in microseconds\n"
842    "                in|out.try-poll= attempt to use poll mode\n"
843    "                threshold= threshold (in microseconds) when playback starts\n"
844#endif
845#ifdef CONFIG_AUDIO_COREAUDIO
846    "-audiodev coreaudio,id=id[,prop[=value][,...]]\n"
847    "                in|out.buffer-count= number of buffers\n"
848#endif
849#ifdef CONFIG_AUDIO_DSOUND
850    "-audiodev dsound,id=id[,prop[=value][,...]]\n"
851    "                latency= add extra latency to playback in microseconds\n"
852#endif
853#ifdef CONFIG_AUDIO_OSS
854    "-audiodev oss,id=id[,prop[=value][,...]]\n"
855    "                in|out.dev= path of the audio device to use\n"
856    "                in|out.buffer-count= number of buffers\n"
857    "                in|out.try-poll= attempt to use poll mode\n"
858    "                try-mmap= try using memory mapped access\n"
859    "                exclusive= open device in exclusive mode\n"
860    "                dsp-policy= set timing policy (0..10), -1 to use fragment mode\n"
861#endif
862#ifdef CONFIG_AUDIO_PA
863    "-audiodev pa,id=id[,prop[=value][,...]]\n"
864    "                server= PulseAudio server address\n"
865    "                in|out.name= source/sink device name\n"
866    "                in|out.latency= desired latency in microseconds\n"
867#endif
868#ifdef CONFIG_AUDIO_PIPEWIRE
869    "-audiodev pipewire,id=id[,prop[=value][,...]]\n"
870    "                in|out.name= source/sink device name\n"
871    "                in|out.stream-name= name of pipewire stream\n"
872    "                in|out.latency= desired latency in microseconds\n"
873#endif
874#ifdef CONFIG_AUDIO_SDL
875    "-audiodev sdl,id=id[,prop[=value][,...]]\n"
876    "                in|out.buffer-count= number of buffers\n"
877#endif
878#ifdef CONFIG_AUDIO_SNDIO
879    "-audiodev sndio,id=id[,prop[=value][,...]]\n"
880#endif
881#ifdef CONFIG_SPICE
882    "-audiodev spice,id=id[,prop[=value][,...]]\n"
883#endif
884#ifdef CONFIG_DBUS_DISPLAY
885    "-audiodev dbus,id=id[,prop[=value][,...]]\n"
886#endif
887    "-audiodev wav,id=id[,prop[=value][,...]]\n"
888    "                path= path of wav file to record\n",
889    QEMU_ARCH_ALL)
890SRST
891``-audiodev [driver=]driver,id=id[,prop[=value][,...]]``
892    Adds a new audio backend driver identified by id. There are global
893    and driver specific properties. Some values can be set differently
894    for input and output, they're marked with ``in|out.``. You can set
895    the input's property with ``in.prop`` and the output's property with
896    ``out.prop``. For example:
897
898    ::
899
900        -audiodev alsa,id=example,in.frequency=44110,out.frequency=8000
901        -audiodev alsa,id=example,out.channels=1 # leaves in.channels unspecified
902
903    NOTE: parameter validation is known to be incomplete, in many cases
904    specifying an invalid option causes QEMU to print an error message
905    and continue emulation without sound.
906
907    Valid global options are:
908
909    ``id=identifier``
910        Identifies the audio backend.
911
912    ``timer-period=period``
913        Sets the timer period used by the audio subsystem in
914        microseconds. Default is 10000 (10 ms).
915
916    ``in|out.mixing-engine=on|off``
917        Use QEMU's mixing engine to mix all streams inside QEMU and
918        convert audio formats when not supported by the backend. When
919        off, fixed-settings must be off too. Note that disabling this
920        option means that the selected backend must support multiple
921        streams and the audio formats used by the virtual cards,
922        otherwise you'll get no sound. It's not recommended to disable
923        this option unless you want to use 5.1 or 7.1 audio, as mixing
924        engine only supports mono and stereo audio. Default is on.
925
926    ``in|out.fixed-settings=on|off``
927        Use fixed settings for host audio. When off, it will change
928        based on how the guest opens the sound card. In this case you
929        must not specify frequency, channels or format. Default is on.
930
931    ``in|out.frequency=frequency``
932        Specify the frequency to use when using fixed-settings. Default
933        is 44100Hz.
934
935    ``in|out.channels=channels``
936        Specify the number of channels to use when using fixed-settings.
937        Default is 2 (stereo).
938
939    ``in|out.format=format``
940        Specify the sample format to use when using fixed-settings.
941        Valid values are: ``s8``, ``s16``, ``s32``, ``u8``, ``u16``,
942        ``u32``, ``f32``. Default is ``s16``.
943
944    ``in|out.voices=voices``
945        Specify the number of voices to use. Default is 1.
946
947    ``in|out.buffer-length=usecs``
948        Sets the size of the buffer in microseconds.
949
950``-audiodev none,id=id[,prop[=value][,...]]``
951    Creates a dummy backend that discards all outputs. This backend has
952    no backend specific properties.
953
954``-audiodev alsa,id=id[,prop[=value][,...]]``
955    Creates backend using the ALSA. This backend is only available on
956    Linux.
957
958    ALSA specific options are:
959
960    ``in|out.dev=device``
961        Specify the ALSA device to use for input and/or output. Default
962        is ``default``.
963
964    ``in|out.period-length=usecs``
965        Sets the period length in microseconds.
966
967    ``in|out.try-poll=on|off``
968        Attempt to use poll mode with the device. Default is off.
969
970    ``threshold=threshold``
971        Threshold (in microseconds) when playback starts. Default is 0.
972
973``-audiodev coreaudio,id=id[,prop[=value][,...]]``
974    Creates a backend using Apple's Core Audio. This backend is only
975    available on Mac OS and only supports playback.
976
977    Core Audio specific options are:
978
979    ``in|out.buffer-count=count``
980        Sets the count of the buffers.
981
982``-audiodev dsound,id=id[,prop[=value][,...]]``
983    Creates a backend using Microsoft's DirectSound. This backend is
984    only available on Windows and only supports playback.
985
986    DirectSound specific options are:
987
988    ``latency=usecs``
989        Add extra usecs microseconds latency to playback. Default is
990        10000 (10 ms).
991
992``-audiodev oss,id=id[,prop[=value][,...]]``
993    Creates a backend using OSS. This backend is available on most
994    Unix-like systems.
995
996    OSS specific options are:
997
998    ``in|out.dev=device``
999        Specify the file name of the OSS device to use. Default is
1000        ``/dev/dsp``.
1001
1002    ``in|out.buffer-count=count``
1003        Sets the count of the buffers.
1004
1005    ``in|out.try-poll=on|off``
1006        Attempt to use poll mode with the device. Default is on.
1007
1008    ``try-mmap=on|off``
1009        Try using memory mapped device access. Default is off.
1010
1011    ``exclusive=on|off``
1012        Open the device in exclusive mode (vmix won't work in this
1013        case). Default is off.
1014
1015    ``dsp-policy=policy``
1016        Sets the timing policy (between 0 and 10, where smaller number
1017        means smaller latency but higher CPU usage). Use -1 to use
1018        buffer sizes specified by ``buffer`` and ``buffer-count``. This
1019        option is ignored if you do not have OSS 4. Default is 5.
1020
1021``-audiodev pa,id=id[,prop[=value][,...]]``
1022    Creates a backend using PulseAudio. This backend is available on
1023    most systems.
1024
1025    PulseAudio specific options are:
1026
1027    ``server=server``
1028        Sets the PulseAudio server to connect to.
1029
1030    ``in|out.name=sink``
1031        Use the specified source/sink for recording/playback.
1032
1033    ``in|out.latency=usecs``
1034        Desired latency in microseconds. The PulseAudio server will try
1035        to honor this value but actual latencies may be lower or higher.
1036
1037``-audiodev pipewire,id=id[,prop[=value][,...]]``
1038    Creates a backend using PipeWire. This backend is available on
1039    most systems.
1040
1041    PipeWire specific options are:
1042
1043    ``in|out.latency=usecs``
1044        Desired latency in microseconds.
1045
1046    ``in|out.name=sink``
1047        Use the specified source/sink for recording/playback.
1048
1049    ``in|out.stream-name``
1050        Specify the name of pipewire stream.
1051
1052``-audiodev sdl,id=id[,prop[=value][,...]]``
1053    Creates a backend using SDL. This backend is available on most
1054    systems, but you should use your platform's native backend if
1055    possible.
1056
1057    SDL specific options are:
1058
1059    ``in|out.buffer-count=count``
1060        Sets the count of the buffers.
1061
1062``-audiodev sndio,id=id[,prop[=value][,...]]``
1063    Creates a backend using SNDIO. This backend is available on
1064    OpenBSD and most other Unix-like systems.
1065
1066    Sndio specific options are:
1067
1068    ``in|out.dev=device``
1069        Specify the sndio device to use for input and/or output. Default
1070        is ``default``.
1071
1072    ``in|out.latency=usecs``
1073        Sets the desired period length in microseconds.
1074
1075``-audiodev spice,id=id[,prop[=value][,...]]``
1076    Creates a backend that sends audio through SPICE. This backend
1077    requires ``-spice`` and automatically selected in that case, so
1078    usually you can ignore this option. This backend has no backend
1079    specific properties.
1080
1081``-audiodev wav,id=id[,prop[=value][,...]]``
1082    Creates a backend that writes audio to a WAV file.
1083
1084    Backend specific options are:
1085
1086    ``path=path``
1087        Write recorded audio into the specified file. Default is
1088        ``qemu.wav``.
1089ERST
1090
1091DEF("device", HAS_ARG, QEMU_OPTION_device,
1092    "-device driver[,prop[=value][,...]]\n"
1093    "                add device (based on driver)\n"
1094    "                prop=value,... sets driver properties\n"
1095    "                use '-device help' to print all possible drivers\n"
1096    "                use '-device driver,help' to print all possible properties\n",
1097    QEMU_ARCH_ALL)
1098SRST
1099``-device driver[,prop[=value][,...]]``
1100    Add device driver. prop=value sets driver properties. Valid
1101    properties depend on the driver. To get help on possible drivers and
1102    properties, use ``-device help`` and ``-device driver,help``.
1103
1104    Some drivers are:
1105
1106``-device ipmi-bmc-sim,id=id[,prop[=value][,...]]``
1107    Add an IPMI BMC. This is a simulation of a hardware management
1108    interface processor that normally sits on a system. It provides a
1109    watchdog and the ability to reset and power control the system. You
1110    need to connect this to an IPMI interface to make it useful
1111
1112    The IPMI slave address to use for the BMC. The default is 0x20. This
1113    address is the BMC's address on the I2C network of management
1114    controllers. If you don't know what this means, it is safe to ignore
1115    it.
1116
1117    ``id=id``
1118        The BMC id for interfaces to use this device.
1119
1120    ``slave_addr=val``
1121        Define slave address to use for the BMC. The default is 0x20.
1122
1123    ``sdrfile=file``
1124        file containing raw Sensor Data Records (SDR) data. The default
1125        is none.
1126
1127    ``fruareasize=val``
1128        size of a Field Replaceable Unit (FRU) area. The default is
1129        1024.
1130
1131    ``frudatafile=file``
1132        file containing raw Field Replaceable Unit (FRU) inventory data.
1133        The default is none.
1134
1135    ``guid=uuid``
1136        value for the GUID for the BMC, in standard UUID format. If this
1137        is set, get "Get GUID" command to the BMC will return it.
1138        Otherwise "Get GUID" will return an error.
1139
1140``-device ipmi-bmc-extern,id=id,chardev=id[,slave_addr=val]``
1141    Add a connection to an external IPMI BMC simulator. Instead of
1142    locally emulating the BMC like the above item, instead connect to an
1143    external entity that provides the IPMI services.
1144
1145    A connection is made to an external BMC simulator. If you do this,
1146    it is strongly recommended that you use the "reconnect-ms=" chardev
1147    option to reconnect to the simulator if the connection is lost. Note
1148    that if this is not used carefully, it can be a security issue, as
1149    the interface has the ability to send resets, NMIs, and power off
1150    the VM. It's best if QEMU makes a connection to an external
1151    simulator running on a secure port on localhost, so neither the
1152    simulator nor QEMU is exposed to any outside network.
1153
1154    See the "lanserv/README.vm" file in the OpenIPMI library for more
1155    details on the external interface.
1156
1157``-device isa-ipmi-kcs,bmc=id[,ioport=val][,irq=val]``
1158    Add a KCS IPMI interface on the ISA bus. This also adds a
1159    corresponding ACPI and SMBIOS entries, if appropriate.
1160
1161    ``bmc=id``
1162        The BMC to connect to, one of ipmi-bmc-sim or ipmi-bmc-extern
1163        above.
1164
1165    ``ioport=val``
1166        Define the I/O address of the interface. The default is 0xca0
1167        for KCS.
1168
1169    ``irq=val``
1170        Define the interrupt to use. The default is 5. To disable
1171        interrupts, set this to 0.
1172
1173``-device isa-ipmi-bt,bmc=id[,ioport=val][,irq=val]``
1174    Like the KCS interface, but defines a BT interface. The default port
1175    is 0xe4 and the default interrupt is 5.
1176
1177``-device pci-ipmi-kcs,bmc=id``
1178    Add a KCS IPMI interface on the PCI bus.
1179
1180    ``bmc=id``
1181        The BMC to connect to, one of ipmi-bmc-sim or ipmi-bmc-extern above.
1182
1183``-device pci-ipmi-bt,bmc=id``
1184    Like the KCS interface, but defines a BT interface on the PCI bus.
1185
1186``-device intel-iommu[,option=...]``
1187    This is only supported by ``-machine q35``, which will enable Intel VT-d
1188    emulation within the guest.  It supports below options:
1189
1190    ``intremap=on|off`` (default: auto)
1191        This enables interrupt remapping feature.  It's required to enable
1192        complete x2apic.  Currently it only supports kvm kernel-irqchip modes
1193        ``off`` or ``split``, while full kernel-irqchip is not yet supported.
1194        The default value is "auto", which will be decided by the mode of
1195        kernel-irqchip.
1196
1197    ``caching-mode=on|off`` (default: off)
1198        This enables caching mode for the VT-d emulated device.  When
1199        caching-mode is enabled, each guest DMA buffer mapping will generate an
1200        IOTLB invalidation from the guest IOMMU driver to the vIOMMU device in
1201        a synchronous way.  It is required for ``-device vfio-pci`` to work
1202        with the VT-d device, because host assigned devices requires to setup
1203        the DMA mapping on the host before guest DMA starts.
1204
1205    ``device-iotlb=on|off`` (default: off)
1206        This enables device-iotlb capability for the emulated VT-d device.  So
1207        far virtio/vhost should be the only real user for this parameter,
1208        paired with ats=on configured for the device.
1209
1210    ``aw-bits=39|48`` (default: 39)
1211        This decides the address width of IOVA address space.  The address
1212        space has 39 bits width for 3-level IOMMU page tables, and 48 bits for
1213        4-level IOMMU page tables.
1214
1215    Please also refer to the wiki page for general scenarios of VT-d
1216    emulation in QEMU: https://wiki.qemu.org/Features/VT-d.
1217
1218``-device virtio-iommu-pci[,option=...]``
1219    This is only supported by ``-machine q35`` (x86_64) and ``-machine virt`` (ARM).
1220    It supports below options:
1221
1222    ``granule=val`` (possible values are 4k, 8k, 16k, 64k and host; default: host)
1223        This decides the default granule to be be exposed by the
1224        virtio-iommu. If host, the granule matches the host page size.
1225
1226    ``aw-bits=val`` (val between 32 and 64, default depends on machine)
1227        This decides the address width of the IOVA address space.
1228
1229ERST
1230
1231DEF("name", HAS_ARG, QEMU_OPTION_name,
1232    "-name string1[,process=string2][,debug-threads=on|off]\n"
1233    "                set the name of the guest\n"
1234    "                string1 sets the window title and string2 the process name\n"
1235    "                When debug-threads is enabled, individual threads are given a separate name\n"
1236    "                NOTE: The thread names are for debugging and not a stable API.\n",
1237    QEMU_ARCH_ALL)
1238SRST
1239``-name name``
1240    Sets the name of the guest. This name will be displayed in the SDL
1241    window caption. The name will also be used for the VNC server. Also
1242    optionally set the top visible process name in Linux. Naming of
1243    individual threads can also be enabled on Linux to aid debugging.
1244ERST
1245
1246DEF("uuid", HAS_ARG, QEMU_OPTION_uuid,
1247    "-uuid %08x-%04x-%04x-%04x-%012x\n"
1248    "                specify machine UUID\n", QEMU_ARCH_ALL)
1249SRST
1250``-uuid uuid``
1251    Set system UUID.
1252ERST
1253
1254DEFHEADING()
1255
1256DEFHEADING(Block device options:)
1257
1258SRST
1259The QEMU block device handling options have a long history and
1260have gone through several iterations as the feature set and complexity
1261of the block layer have grown. Many online guides to QEMU often
1262reference older and deprecated options, which can lead to confusion.
1263
1264The most explicit way to describe disks is to use a combination of
1265``-device`` to specify the hardware device and ``-blockdev`` to
1266describe the backend. The device defines what the guest sees and the
1267backend describes how QEMU handles the data. It is the only guaranteed
1268stable interface for describing block devices and as such is
1269recommended for management tools and scripting.
1270
1271The ``-drive`` option combines the device and backend into a single
1272command line option which is a more human friendly. There is however no
1273interface stability guarantee although some older board models still
1274need updating to work with the modern blockdev forms.
1275
1276Older options like ``-hda`` are essentially macros which expand into
1277``-drive`` options for various drive interfaces. The original forms
1278bake in a lot of assumptions from the days when QEMU was emulating a
1279legacy PC, they are not recommended for modern configurations.
1280
1281ERST
1282
1283DEF("fda", HAS_ARG, QEMU_OPTION_fda,
1284    "-fda/-fdb file  use 'file' as floppy disk 0/1 image\n", QEMU_ARCH_ALL)
1285DEF("fdb", HAS_ARG, QEMU_OPTION_fdb, "", QEMU_ARCH_ALL)
1286SRST
1287``-fda file``
1288  \
1289``-fdb file``
1290    Use file as floppy disk 0/1 image (see the :ref:`disk images` chapter in
1291    the System Emulation Users Guide).
1292ERST
1293
1294DEF("hda", HAS_ARG, QEMU_OPTION_hda,
1295    "-hda/-hdb file  use 'file' as hard disk 0/1 image\n", QEMU_ARCH_ALL)
1296DEF("hdb", HAS_ARG, QEMU_OPTION_hdb, "", QEMU_ARCH_ALL)
1297DEF("hdc", HAS_ARG, QEMU_OPTION_hdc,
1298    "-hdc/-hdd file  use 'file' as hard disk 2/3 image\n", QEMU_ARCH_ALL)
1299DEF("hdd", HAS_ARG, QEMU_OPTION_hdd, "", QEMU_ARCH_ALL)
1300SRST
1301``-hda file``
1302  \
1303``-hdb file``
1304  \
1305``-hdc file``
1306  \
1307``-hdd file``
1308    Use file as hard disk 0, 1, 2 or 3 image on the default bus of the
1309    emulated machine (this is for example the IDE bus on most x86 machines,
1310    but it can also be SCSI, virtio or something else on other target
1311    architectures). See also the :ref:`disk images` chapter in the System
1312    Emulation Users Guide.
1313ERST
1314
1315DEF("cdrom", HAS_ARG, QEMU_OPTION_cdrom,
1316    "-cdrom file     use 'file' as CD-ROM image\n",
1317    QEMU_ARCH_ALL)
1318SRST
1319``-cdrom file``
1320    Use file as CD-ROM image on the default bus of the emulated machine
1321    (which is IDE1 master on x86, so you cannot use ``-hdc`` and ``-cdrom``
1322    at the same time there). On systems that support it, you can use the
1323    host CD-ROM by using ``/dev/cdrom`` as filename.
1324ERST
1325
1326DEF("blockdev", HAS_ARG, QEMU_OPTION_blockdev,
1327    "-blockdev [driver=]driver[,node-name=N][,discard=ignore|unmap]\n"
1328    "          [,cache.direct=on|off][,cache.no-flush=on|off]\n"
1329    "          [,read-only=on|off][,auto-read-only=on|off]\n"
1330    "          [,force-share=on|off][,detect-zeroes=on|off|unmap]\n"
1331    "          [,driver specific parameters...]\n"
1332    "                configure a block backend\n", QEMU_ARCH_ALL)
1333SRST
1334``-blockdev option[,option[,option[,...]]]``
1335    Define a new block driver node. Some of the options apply to all
1336    block drivers, other options are only accepted for a specific block
1337    driver. See below for a list of generic options and options for the
1338    most common block drivers.
1339
1340    Options that expect a reference to another node (e.g. ``file``) can
1341    be given in two ways. Either you specify the node name of an already
1342    existing node (file=node-name), or you define a new node inline,
1343    adding options for the referenced node after a dot
1344    (file.filename=path,file.aio=native).
1345
1346    A block driver node created with ``-blockdev`` can be used for a
1347    guest device by specifying its node name for the ``drive`` property
1348    in a ``-device`` argument that defines a block device.
1349
1350    ``Valid options for any block driver node:``
1351        ``driver``
1352            Specifies the block driver to use for the given node.
1353
1354        ``node-name``
1355            This defines the name of the block driver node by which it
1356            will be referenced later. The name must be unique, i.e. it
1357            must not match the name of a different block driver node, or
1358            (if you use ``-drive`` as well) the ID of a drive.
1359
1360            If no node name is specified, it is automatically generated.
1361            The generated node name is not intended to be predictable
1362            and changes between QEMU invocations. For the top level, an
1363            explicit node name must be specified.
1364
1365        ``read-only``
1366            Open the node read-only. Guest write attempts will fail.
1367
1368            Note that some block drivers support only read-only access,
1369            either generally or in certain configurations. In this case,
1370            the default value ``read-only=off`` does not work and the
1371            option must be specified explicitly.
1372
1373        ``auto-read-only``
1374            If ``auto-read-only=on`` is set, QEMU may fall back to
1375            read-only usage even when ``read-only=off`` is requested, or
1376            even switch between modes as needed, e.g. depending on
1377            whether the image file is writable or whether a writing user
1378            is attached to the node.
1379
1380        ``force-share``
1381            Override the image locking system of QEMU by forcing the
1382            node to utilize weaker shared access for permissions where
1383            it would normally request exclusive access. When there is
1384            the potential for multiple instances to have the same file
1385            open (whether this invocation of QEMU is the first or the
1386            second instance), both instances must permit shared access
1387            for the second instance to succeed at opening the file.
1388
1389            Enabling ``force-share=on`` requires ``read-only=on``.
1390
1391        ``cache.direct``
1392            The host page cache can be avoided with ``cache.direct=on``.
1393            This will attempt to do disk IO directly to the guest's
1394            memory. QEMU may still perform an internal copy of the data.
1395
1396        ``cache.no-flush``
1397            In case you don't care about data integrity over host
1398            failures, you can use ``cache.no-flush=on``. This option
1399            tells QEMU that it never needs to write any data to the disk
1400            but can instead keep things in cache. If anything goes
1401            wrong, like your host losing power, the disk storage getting
1402            disconnected accidentally, etc. your image will most
1403            probably be rendered unusable.
1404
1405        ``discard=discard``
1406            discard is one of "ignore" (or "off") or "unmap" (or "on")
1407            and controls whether ``discard`` (also known as ``trim`` or
1408            ``unmap``) requests are ignored or passed to the filesystem.
1409            Some machine types may not support discard requests.
1410
1411        ``detect-zeroes=detect-zeroes``
1412            detect-zeroes is "off", "on" or "unmap" and enables the
1413            automatic conversion of plain zero writes by the OS to
1414            driver specific optimized zero write commands. You may even
1415            choose "unmap" if discard is set to "unmap" to allow a zero
1416            write to be converted to an ``unmap`` operation.
1417
1418    ``Driver-specific options for file``
1419        This is the protocol-level block driver for accessing regular
1420        files.
1421
1422        ``filename``
1423            The path to the image file in the local filesystem
1424
1425        ``aio``
1426            Specifies the AIO backend (threads/native/io_uring,
1427            default: threads)
1428
1429        ``locking``
1430            Specifies whether the image file is protected with Linux OFD
1431            / POSIX locks. The default is to use the Linux Open File
1432            Descriptor API if available, otherwise no lock is applied.
1433            (auto/on/off, default: auto)
1434
1435        Example:
1436
1437        ::
1438
1439            -blockdev driver=file,node-name=disk,filename=disk.img
1440
1441    ``Driver-specific options for raw``
1442        This is the image format block driver for raw images. It is
1443        usually stacked on top of a protocol level block driver such as
1444        ``file``.
1445
1446        ``file``
1447            Reference to or definition of the data source block driver
1448            node (e.g. a ``file`` driver node)
1449
1450        Example 1:
1451
1452        ::
1453
1454            -blockdev driver=file,node-name=disk_file,filename=disk.img
1455            -blockdev driver=raw,node-name=disk,file=disk_file
1456
1457        Example 2:
1458
1459        ::
1460
1461            -blockdev driver=raw,node-name=disk,file.driver=file,file.filename=disk.img
1462
1463    ``Driver-specific options for qcow2``
1464        This is the image format block driver for qcow2 images. It is
1465        usually stacked on top of a protocol level block driver such as
1466        ``file``.
1467
1468        ``file``
1469            Reference to or definition of the data source block driver
1470            node (e.g. a ``file`` driver node)
1471
1472        ``backing``
1473            Reference to or definition of the backing file block device
1474            (default is taken from the image file). It is allowed to
1475            pass ``null`` here in order to disable the default backing
1476            file.
1477
1478        ``lazy-refcounts``
1479            Whether to enable the lazy refcounts feature (on/off;
1480            default is taken from the image file)
1481
1482        ``cache-size``
1483            The maximum total size of the L2 table and refcount block
1484            caches in bytes (default: the sum of l2-cache-size and
1485            refcount-cache-size)
1486
1487        ``l2-cache-size``
1488            The maximum size of the L2 table cache in bytes (default: if
1489            cache-size is not specified - 32M on Linux platforms, and 8M
1490            on non-Linux platforms; otherwise, as large as possible
1491            within the cache-size, while permitting the requested or the
1492            minimal refcount cache size)
1493
1494        ``refcount-cache-size``
1495            The maximum size of the refcount block cache in bytes
1496            (default: 4 times the cluster size; or if cache-size is
1497            specified, the part of it which is not used for the L2
1498            cache)
1499
1500        ``cache-clean-interval``
1501            Clean unused entries in the L2 and refcount caches. The
1502            interval is in seconds. The default value is 600 on
1503            supporting platforms, and 0 on other platforms. Setting it
1504            to 0 disables this feature.
1505
1506        ``pass-discard-request``
1507            Whether discard requests to the qcow2 device should be
1508            forwarded to the data source (on/off; default: on if
1509            discard=unmap is specified, off otherwise)
1510
1511        ``pass-discard-snapshot``
1512            Whether discard requests for the data source should be
1513            issued when a snapshot operation (e.g. deleting a snapshot)
1514            frees clusters in the qcow2 file (on/off; default: on)
1515
1516        ``pass-discard-other``
1517            Whether discard requests for the data source should be
1518            issued on other occasions where a cluster gets freed
1519            (on/off; default: off)
1520
1521        ``discard-no-unref``
1522            When enabled, data clusters will remain preallocated when they are
1523            no longer used, e.g. because they are discarded or converted to
1524            zero clusters. As usual, whether the old data is discarded or kept
1525            on the protocol level (i.e. in the image file) depends on the
1526            setting of the pass-discard-request option. Keeping the clusters
1527            preallocated prevents qcow2 fragmentation that would otherwise be
1528            caused by freeing and re-allocating them later. Besides potential
1529            performance degradation, such fragmentation can lead to increased
1530            allocation of clusters past the end of the image file,
1531            resulting in image files whose file length can grow much larger
1532            than their guest disk size would suggest.
1533            If image file length is of concern (e.g. when storing qcow2
1534            images directly on block devices), you should consider enabling
1535            this option.
1536
1537        ``overlap-check``
1538            Which overlap checks to perform for writes to the image
1539            (none/constant/cached/all; default: cached). For details or
1540            finer granularity control refer to the QAPI documentation of
1541            ``blockdev-add``.
1542
1543        Example 1:
1544
1545        ::
1546
1547            -blockdev driver=file,node-name=my_file,filename=/tmp/disk.qcow2
1548            -blockdev driver=qcow2,node-name=hda,file=my_file,overlap-check=none,cache-size=16777216
1549
1550        Example 2:
1551
1552        ::
1553
1554            -blockdev driver=qcow2,node-name=disk,file.driver=http,file.filename=http://example.com/image.qcow2
1555
1556    ``Driver-specific options for other drivers``
1557        Please refer to the QAPI documentation of the ``blockdev-add``
1558        QMP command.
1559ERST
1560
1561DEF("drive", HAS_ARG, QEMU_OPTION_drive,
1562    "-drive [file=file][,if=type][,bus=n][,unit=m][,media=d][,index=i]\n"
1563    "       [,cache=writethrough|writeback|none|directsync|unsafe][,format=f]\n"
1564    "       [,snapshot=on|off][,rerror=ignore|stop|report]\n"
1565    "       [,werror=ignore|stop|report|enospc][,id=name]\n"
1566    "       [,aio=threads|native|io_uring]\n"
1567    "       [,readonly=on|off][,copy-on-read=on|off]\n"
1568    "       [,discard=ignore|unmap][,detect-zeroes=on|off|unmap]\n"
1569    "       [[,bps=b]|[[,bps_rd=r][,bps_wr=w]]]\n"
1570    "       [[,iops=i]|[[,iops_rd=r][,iops_wr=w]]]\n"
1571    "       [[,bps_max=bm]|[[,bps_rd_max=rm][,bps_wr_max=wm]]]\n"
1572    "       [[,iops_max=im]|[[,iops_rd_max=irm][,iops_wr_max=iwm]]]\n"
1573    "       [[,iops_size=is]]\n"
1574    "       [[,group=g]]\n"
1575    "                use 'file' as a drive image\n", QEMU_ARCH_ALL)
1576SRST
1577``-drive option[,option[,option[,...]]]``
1578    Define a new drive. This includes creating a block driver node (the
1579    backend) as well as a guest device, and is mostly a shortcut for
1580    defining the corresponding ``-blockdev`` and ``-device`` options.
1581
1582    ``-drive`` accepts all options that are accepted by ``-blockdev``.
1583    In addition, it knows the following options:
1584
1585    ``file=file``
1586        This option defines which disk image (see the :ref:`disk images`
1587        chapter in the System Emulation Users Guide) to use with this drive.
1588        If the filename contains comma, you must double it (for instance,
1589        "file=my,,file" to use file "my,file").
1590
1591        Special files such as iSCSI devices can be specified using
1592        protocol specific URLs. See the section for "Device URL Syntax"
1593        for more information.
1594
1595    ``if=interface``
1596        This option defines on which type on interface the drive is
1597        connected. Available types are: ide, scsi, sd, mtd, floppy,
1598        pflash, virtio, none.
1599
1600    ``bus=bus,unit=unit``
1601        These options define where is connected the drive by defining
1602        the bus number and the unit id.
1603
1604    ``index=index``
1605        This option defines where the drive is connected by using an
1606        index in the list of available connectors of a given interface
1607        type.
1608
1609    ``media=media``
1610        This option defines the type of the media: disk or cdrom.
1611
1612    ``snapshot=snapshot``
1613        snapshot is "on" or "off" and controls snapshot mode for the
1614        given drive (see ``-snapshot``).
1615
1616    ``cache=cache``
1617        cache is "none", "writeback", "unsafe", "directsync" or
1618        "writethrough" and controls how the host cache is used to access
1619        block data. This is a shortcut that sets the ``cache.direct``
1620        and ``cache.no-flush`` options (as in ``-blockdev``), and
1621        additionally ``cache.writeback``, which provides a default for
1622        the ``write-cache`` option of block guest devices (as in
1623        ``-device``). The modes correspond to the following settings:
1624
1625        =============  ===============   ============   ==============
1626        \              cache.writeback   cache.direct   cache.no-flush
1627        =============  ===============   ============   ==============
1628        writeback      on                off            off
1629        none           on                on             off
1630        writethrough   off               off            off
1631        directsync     off               on             off
1632        unsafe         on                off            on
1633        =============  ===============   ============   ==============
1634
1635        The default mode is ``cache=writeback``.
1636
1637    ``aio=aio``
1638        aio is "threads", "native", or "io_uring" and selects between pthread
1639        based disk I/O, native Linux AIO, or Linux io_uring API.
1640
1641    ``format=format``
1642        Specify which disk format will be used rather than detecting the
1643        format. Can be used to specify format=raw to avoid interpreting
1644        an untrusted format header.
1645
1646    ``werror=action,rerror=action``
1647        Specify which action to take on write and read errors. Valid
1648        actions are: "ignore" (ignore the error and try to continue),
1649        "stop" (pause QEMU), "report" (report the error to the guest),
1650        "enospc" (pause QEMU only if the host disk is full; report the
1651        error to the guest otherwise). The default setting is
1652        ``werror=enospc`` and ``rerror=report``.
1653
1654    ``copy-on-read=copy-on-read``
1655        copy-on-read is "on" or "off" and enables whether to copy read
1656        backing file sectors into the image file.
1657
1658    ``bps=b,bps_rd=r,bps_wr=w``
1659        Specify bandwidth throttling limits in bytes per second, either
1660        for all request types or for reads or writes only. Small values
1661        can lead to timeouts or hangs inside the guest. A safe minimum
1662        for disks is 2 MB/s.
1663
1664    ``bps_max=bm,bps_rd_max=rm,bps_wr_max=wm``
1665        Specify bursts in bytes per second, either for all request types
1666        or for reads or writes only. Bursts allow the guest I/O to spike
1667        above the limit temporarily.
1668
1669    ``iops=i,iops_rd=r,iops_wr=w``
1670        Specify request rate limits in requests per second, either for
1671        all request types or for reads or writes only.
1672
1673    ``iops_max=bm,iops_rd_max=rm,iops_wr_max=wm``
1674        Specify bursts in requests per second, either for all request
1675        types or for reads or writes only. Bursts allow the guest I/O to
1676        spike above the limit temporarily.
1677
1678    ``iops_size=is``
1679        Let every is bytes of a request count as a new request for iops
1680        throttling purposes. Use this option to prevent guests from
1681        circumventing iops limits by sending fewer but larger requests.
1682
1683    ``group=g``
1684        Join a throttling quota group with given name g. All drives that
1685        are members of the same group are accounted for together. Use
1686        this option to prevent guests from circumventing throttling
1687        limits by using many small disks instead of a single larger
1688        disk.
1689
1690    By default, the ``cache.writeback=on`` mode is used. It will report
1691    data writes as completed as soon as the data is present in the host
1692    page cache. This is safe as long as your guest OS makes sure to
1693    correctly flush disk caches where needed. If your guest OS does not
1694    handle volatile disk write caches correctly and your host crashes or
1695    loses power, then the guest may experience data corruption.
1696
1697    For such guests, you should consider using ``cache.writeback=off``.
1698    This means that the host page cache will be used to read and write
1699    data, but write notification will be sent to the guest only after
1700    QEMU has made sure to flush each write to the disk. Be aware that
1701    this has a major impact on performance.
1702
1703    When using the ``-snapshot`` option, unsafe caching is always used.
1704
1705    Copy-on-read avoids accessing the same backing file sectors
1706    repeatedly and is useful when the backing file is over a slow
1707    network. By default copy-on-read is off.
1708
1709    Instead of ``-cdrom`` you can use:
1710
1711    .. parsed-literal::
1712
1713        |qemu_system| -drive file=file,index=2,media=cdrom
1714
1715    Instead of ``-hda``, ``-hdb``, ``-hdc``, ``-hdd``, you can use:
1716
1717    .. parsed-literal::
1718
1719        |qemu_system| -drive file=file,index=0,media=disk
1720        |qemu_system| -drive file=file,index=1,media=disk
1721        |qemu_system| -drive file=file,index=2,media=disk
1722        |qemu_system| -drive file=file,index=3,media=disk
1723
1724    You can open an image using pre-opened file descriptors from an fd
1725    set:
1726
1727    .. parsed-literal::
1728
1729        |qemu_system| \\
1730         -add-fd fd=3,set=2,opaque="rdwr:/path/to/file" \\
1731         -add-fd fd=4,set=2,opaque="rdonly:/path/to/file" \\
1732         -drive file=/dev/fdset/2,index=0,media=disk
1733
1734    You can connect a CDROM to the slave of ide0:
1735
1736    .. parsed-literal::
1737
1738        |qemu_system_x86| -drive file=file,if=ide,index=1,media=cdrom
1739
1740    If you don't specify the "file=" argument, you define an empty
1741    drive:
1742
1743    .. parsed-literal::
1744
1745        |qemu_system_x86| -drive if=ide,index=1,media=cdrom
1746
1747    Instead of ``-fda``, ``-fdb``, you can use:
1748
1749    .. parsed-literal::
1750
1751        |qemu_system_x86| -drive file=file,index=0,if=floppy
1752        |qemu_system_x86| -drive file=file,index=1,if=floppy
1753
1754    By default, interface is "ide" and index is automatically
1755    incremented:
1756
1757    .. parsed-literal::
1758
1759        |qemu_system_x86| -drive file=a -drive file=b
1760
1761    is interpreted like:
1762
1763    .. parsed-literal::
1764
1765        |qemu_system_x86| -hda a -hdb b
1766ERST
1767
1768DEF("mtdblock", HAS_ARG, QEMU_OPTION_mtdblock,
1769    "-mtdblock file  use 'file' as on-board Flash memory image\n",
1770    QEMU_ARCH_ALL)
1771SRST
1772``-mtdblock file``
1773    Use file as on-board Flash memory image.
1774ERST
1775
1776DEF("sd", HAS_ARG, QEMU_OPTION_sd,
1777    "-sd file        use 'file' as SecureDigital card image\n", QEMU_ARCH_ALL)
1778SRST
1779``-sd file``
1780    Use file as SecureDigital card image.
1781ERST
1782
1783DEF("snapshot", 0, QEMU_OPTION_snapshot,
1784    "-snapshot       write to temporary files instead of disk image files\n",
1785    QEMU_ARCH_ALL)
1786SRST
1787``-snapshot``
1788    Write to temporary files instead of disk image files. In this case,
1789    the raw disk image you use is not written back. You can however
1790    force the write back by pressing C-a s (see the :ref:`disk images`
1791    chapter in the System Emulation Users Guide).
1792
1793    .. warning::
1794       snapshot is incompatible with ``-blockdev`` (instead use qemu-img
1795       to manually create snapshot images to attach to your blockdev).
1796       If you have mixed ``-blockdev`` and ``-drive`` declarations you
1797       can use the 'snapshot' property on your drive declarations
1798       instead of this global option.
1799
1800ERST
1801
1802DEF("fsdev", HAS_ARG, QEMU_OPTION_fsdev,
1803    "-fsdev local,id=id,path=path,security_model=mapped-xattr|mapped-file|passthrough|none\n"
1804    " [,writeout=immediate][,readonly=on][,fmode=fmode][,dmode=dmode]\n"
1805    " [[,throttling.bps-total=b]|[[,throttling.bps-read=r][,throttling.bps-write=w]]]\n"
1806    " [[,throttling.iops-total=i]|[[,throttling.iops-read=r][,throttling.iops-write=w]]]\n"
1807    " [[,throttling.bps-total-max=bm]|[[,throttling.bps-read-max=rm][,throttling.bps-write-max=wm]]]\n"
1808    " [[,throttling.iops-total-max=im]|[[,throttling.iops-read-max=irm][,throttling.iops-write-max=iwm]]]\n"
1809    " [[,throttling.iops-size=is]]\n"
1810    "-fsdev synth,id=id\n",
1811    QEMU_ARCH_ALL)
1812
1813SRST
1814``-fsdev local,id=id,path=path,security_model=security_model [,writeout=writeout][,readonly=on][,fmode=fmode][,dmode=dmode] [,throttling.option=value[,throttling.option=value[,...]]]``
1815  \
1816``-fsdev synth,id=id[,readonly=on]``
1817    Define a new file system device. Valid options are:
1818
1819    ``local``
1820        Accesses to the filesystem are done by QEMU.
1821
1822    ``synth``
1823        Synthetic filesystem, only used by QTests.
1824
1825    ``id=id``
1826        Specifies identifier for this device.
1827
1828    ``path=path``
1829        Specifies the export path for the file system device. Files
1830        under this path will be available to the 9p client on the guest.
1831
1832    ``security_model=security_model``
1833        Specifies the security model to be used for this export path.
1834        Supported security models are "passthrough", "mapped-xattr",
1835        "mapped-file" and "none". In "passthrough" security model, files
1836        are stored using the same credentials as they are created on the
1837        guest. This requires QEMU to run as root. In "mapped-xattr"
1838        security model, some of the file attributes like uid, gid, mode
1839        bits and link target are stored as file attributes. For
1840        "mapped-file" these attributes are stored in the hidden
1841        .virtfs\_metadata directory. Directories exported by this
1842        security model cannot interact with other unix tools. "none"
1843        security model is same as passthrough except the sever won't
1844        report failures if it fails to set file attributes like
1845        ownership. Security model is mandatory only for local fsdriver.
1846
1847    ``writeout=writeout``
1848        This is an optional argument. The only supported value is
1849        "immediate". This means that host page cache will be used to
1850        read and write data but write notification will be sent to the
1851        guest only when the data has been reported as written by the
1852        storage subsystem.
1853
1854    ``readonly=on``
1855        Enables exporting 9p share as a readonly mount for guests. By
1856        default read-write access is given.
1857
1858    ``fmode=fmode``
1859        Specifies the default mode for newly created files on the host.
1860        Works only with security models "mapped-xattr" and
1861        "mapped-file".
1862
1863    ``dmode=dmode``
1864        Specifies the default mode for newly created directories on the
1865        host. Works only with security models "mapped-xattr" and
1866        "mapped-file".
1867
1868    ``throttling.bps-total=b,throttling.bps-read=r,throttling.bps-write=w``
1869        Specify bandwidth throttling limits in bytes per second, either
1870        for all request types or for reads or writes only.
1871
1872    ``throttling.bps-total-max=bm,bps-read-max=rm,bps-write-max=wm``
1873        Specify bursts in bytes per second, either for all request types
1874        or for reads or writes only. Bursts allow the guest I/O to spike
1875        above the limit temporarily.
1876
1877    ``throttling.iops-total=i,throttling.iops-read=r, throttling.iops-write=w``
1878        Specify request rate limits in requests per second, either for
1879        all request types or for reads or writes only.
1880
1881    ``throttling.iops-total-max=im,throttling.iops-read-max=irm, throttling.iops-write-max=iwm``
1882        Specify bursts in requests per second, either for all request
1883        types or for reads or writes only. Bursts allow the guest I/O to
1884        spike above the limit temporarily.
1885
1886    ``throttling.iops-size=is``
1887        Let every is bytes of a request count as a new request for iops
1888        throttling purposes.
1889
1890    -fsdev option is used along with -device driver "virtio-9p-...".
1891
1892``-device virtio-9p-type,fsdev=id,mount_tag=mount_tag``
1893    Options for virtio-9p-... driver are:
1894
1895    ``type``
1896        Specifies the variant to be used. Supported values are "pci",
1897        "ccw" or "device", depending on the machine type.
1898
1899    ``fsdev=id``
1900        Specifies the id value specified along with -fsdev option.
1901
1902    ``mount_tag=mount_tag``
1903        Specifies the tag name to be used by the guest to mount this
1904        export point.
1905ERST
1906
1907DEF("virtfs", HAS_ARG, QEMU_OPTION_virtfs,
1908    "-virtfs local,path=path,mount_tag=tag,security_model=mapped-xattr|mapped-file|passthrough|none\n"
1909    "        [,id=id][,writeout=immediate][,readonly=on][,fmode=fmode][,dmode=dmode][,multidevs=remap|forbid|warn]\n"
1910    "-virtfs synth,mount_tag=tag[,id=id][,readonly=on]\n",
1911    QEMU_ARCH_ALL)
1912
1913SRST
1914``-virtfs local,path=path,mount_tag=mount_tag ,security_model=security_model[,writeout=writeout][,readonly=on] [,fmode=fmode][,dmode=dmode][,multidevs=multidevs]``
1915  \
1916``-virtfs synth,mount_tag=mount_tag``
1917    Define a new virtual filesystem device and expose it to the guest using
1918    a virtio-9p-device (a.k.a. 9pfs), which essentially means that a certain
1919    directory on host is made directly accessible by guest as a pass-through
1920    file system by using the 9P network protocol for communication between
1921    host and guests, if desired even accessible, shared by several guests
1922    simultaneously.
1923
1924    Note that ``-virtfs`` is actually just a convenience shortcut for its
1925    generalized form ``-fsdev -device virtio-9p-pci``.
1926
1927    The general form of pass-through file system options are:
1928
1929    ``local``
1930        Accesses to the filesystem are done by QEMU.
1931
1932    ``synth``
1933        Synthetic filesystem, only used by QTests.
1934
1935    ``id=id``
1936        Specifies identifier for the filesystem device
1937
1938    ``path=path``
1939        Specifies the export path for the file system device. Files
1940        under this path will be available to the 9p client on the guest.
1941
1942    ``security_model=security_model``
1943        Specifies the security model to be used for this export path.
1944        Supported security models are "passthrough", "mapped-xattr",
1945        "mapped-file" and "none". In "passthrough" security model, files
1946        are stored using the same credentials as they are created on the
1947        guest. This requires QEMU to run as root. In "mapped-xattr"
1948        security model, some of the file attributes like uid, gid, mode
1949        bits and link target are stored as file attributes. For
1950        "mapped-file" these attributes are stored in the hidden
1951        .virtfs\_metadata directory. Directories exported by this
1952        security model cannot interact with other unix tools. "none"
1953        security model is same as passthrough except the sever won't
1954        report failures if it fails to set file attributes like
1955        ownership. Security model is mandatory only for local fsdriver.
1956
1957    ``writeout=writeout``
1958        This is an optional argument. The only supported value is
1959        "immediate". This means that host page cache will be used to
1960        read and write data but write notification will be sent to the
1961        guest only when the data has been reported as written by the
1962        storage subsystem.
1963
1964    ``readonly=on``
1965        Enables exporting 9p share as a readonly mount for guests. By
1966        default read-write access is given.
1967
1968    ``fmode=fmode``
1969        Specifies the default mode for newly created files on the host.
1970        Works only with security models "mapped-xattr" and
1971        "mapped-file".
1972
1973    ``dmode=dmode``
1974        Specifies the default mode for newly created directories on the
1975        host. Works only with security models "mapped-xattr" and
1976        "mapped-file".
1977
1978    ``mount_tag=mount_tag``
1979        Specifies the tag name to be used by the guest to mount this
1980        export point.
1981
1982    ``multidevs=remap|forbid|warn``
1983        Specifies how to deal with multiple devices being shared with
1984        the same 9p export in order to avoid file ID collisions on guest.
1985        Supported behaviours are either "remap" (default), "forbid" or
1986        "warn".
1987
1988        ``remap`` : assumes the possibility that more than one device is
1989        shared with the same 9p export. Therefore inode numbers from host
1990        are remapped for guest in a way that would prevent file ID
1991        collisions on guest. Remapping inodes in such cases is required
1992        because the original device IDs from host are never passed and
1993        exposed on guest. Instead all files of an export shared with
1994        virtfs always share the same device ID on guest. So two files
1995        with identical inode numbers but from actually different devices
1996        on host would otherwise cause a file ID collision and hence
1997        potential severe misbehaviours on guest.
1998
1999        ``warn`` : virtfs 9p expects only one device to be shared with
2000        the same export. If however more than one device is shared and
2001        accessed via the same 9p export then only a warning message is
2002        logged (once) by qemu on host side. No further action is performed
2003        in this case that would prevent file ID collisions on guest. This
2004        could thus lead to severe misbehaviours in this case like wrong
2005        files being accessed and data corruption on the exported tree.
2006
2007        ``forbid`` : assumes like "warn" that only one device is shared
2008        by the same 9p export, however it will not only log a warning
2009        message but also deny access to additional devices on guest. Note
2010        though that "forbid" does currently not block all possible file
2011        access operations (e.g. readdir() would still return entries from
2012        other devices).
2013ERST
2014
2015DEF("iscsi", HAS_ARG, QEMU_OPTION_iscsi,
2016    "-iscsi [user=user][,password=password][,password-secret=secret-id]\n"
2017    "       [,header-digest=CRC32C|CR32C-NONE|NONE-CRC32C|NONE]\n"
2018    "       [,initiator-name=initiator-iqn][,id=target-iqn]\n"
2019    "       [,timeout=timeout]\n"
2020    "                iSCSI session parameters\n", QEMU_ARCH_ALL)
2021
2022SRST
2023``-iscsi``
2024    Configure iSCSI session parameters.
2025ERST
2026
2027DEFHEADING()
2028
2029DEFHEADING(USB convenience options:)
2030
2031DEF("usb", 0, QEMU_OPTION_usb,
2032    "-usb            enable on-board USB host controller (if not enabled by default)\n",
2033    QEMU_ARCH_ALL)
2034SRST
2035``-usb``
2036    Enable USB emulation on machine types with an on-board USB host
2037    controller (if not enabled by default). Note that on-board USB host
2038    controllers may not support USB 3.0. In this case
2039    ``-device qemu-xhci`` can be used instead on machines with PCI.
2040ERST
2041
2042DEF("usbdevice", HAS_ARG, QEMU_OPTION_usbdevice,
2043    "-usbdevice name add the host or guest USB device 'name'\n",
2044    QEMU_ARCH_ALL)
2045SRST
2046``-usbdevice devname``
2047    Add the USB device devname, and enable an on-board USB controller
2048    if possible and necessary (just like it can be done via
2049    ``-machine usb=on``). Note that this option is mainly intended for
2050    the user's convenience only. More fine-grained control can be
2051    achieved by selecting a USB host controller (if necessary) and the
2052    desired USB device via the ``-device`` option instead. For example,
2053    instead of using ``-usbdevice mouse`` it is possible to use
2054    ``-device qemu-xhci -device usb-mouse`` to connect the USB mouse
2055    to a USB 3.0 controller instead (at least on machines that support
2056    PCI and do not have an USB controller enabled by default yet).
2057    For more details, see the chapter about
2058    :ref:`Connecting USB devices` in the System Emulation Users Guide.
2059    Possible devices for devname are:
2060
2061    ``braille``
2062        Braille device. This will use BrlAPI to display the braille
2063        output on a real or fake device (i.e. it also creates a
2064        corresponding ``braille`` chardev automatically beside the
2065        ``usb-braille`` USB device).
2066
2067    ``keyboard``
2068        Standard USB keyboard. Will override the PS/2 keyboard (if present).
2069
2070    ``mouse``
2071        Virtual Mouse. This will override the PS/2 mouse emulation when
2072        activated.
2073
2074    ``tablet``
2075        Pointer device that uses absolute coordinates (like a
2076        touchscreen). This means QEMU is able to report the mouse
2077        position without having to grab the mouse. Also overrides the
2078        PS/2 mouse emulation when activated.
2079
2080    ``wacom-tablet``
2081        Wacom PenPartner USB tablet.
2082
2083
2084ERST
2085
2086DEFHEADING()
2087
2088DEFHEADING(Display options:)
2089
2090DEF("display", HAS_ARG, QEMU_OPTION_display,
2091#if defined(CONFIG_SPICE)
2092    "-display spice-app[,gl=on|off]\n"
2093#endif
2094#if defined(CONFIG_SDL)
2095    "-display sdl[,gl=on|core|es|off][,grab-mod=<mod>][,show-cursor=on|off]\n"
2096    "            [,window-close=on|off]\n"
2097#endif
2098#if defined(CONFIG_GTK)
2099    "-display gtk[,full-screen=on|off][,gl=on|off][,grab-on-hover=on|off]\n"
2100    "            [,show-tabs=on|off][,show-cursor=on|off][,window-close=on|off]\n"
2101    "            [,show-menubar=on|off][,zoom-to-fit=on|off]\n"
2102#endif
2103#if defined(CONFIG_VNC)
2104    "-display vnc=<display>[,<optargs>]\n"
2105#endif
2106#if defined(CONFIG_CURSES)
2107    "-display curses[,charset=<encoding>]\n"
2108#endif
2109#if defined(CONFIG_COCOA)
2110    "-display cocoa[,full-grab=on|off][,swap-opt-cmd=on|off]\n"
2111    "              [,show-cursor=on|off][,left-command-key=on|off]\n"
2112    "              [,full-screen=on|off][,zoom-to-fit=on|off]\n"
2113#endif
2114#if defined(CONFIG_OPENGL)
2115    "-display egl-headless[,rendernode=<file>]\n"
2116#endif
2117#if defined(CONFIG_DBUS_DISPLAY)
2118    "-display dbus[,addr=<dbusaddr>]\n"
2119    "             [,gl=on|core|es|off][,rendernode=<file>]\n"
2120#endif
2121    "-display none\n"
2122    "                select display backend type\n"
2123    "                The default display is equivalent to\n                "
2124#if defined(CONFIG_GTK)
2125            "\"-display gtk\"\n"
2126#elif defined(CONFIG_SDL)
2127            "\"-display sdl\"\n"
2128#elif defined(CONFIG_COCOA)
2129            "\"-display cocoa\"\n"
2130#elif defined(CONFIG_VNC)
2131            "\"-vnc localhost:0,to=99,id=default\"\n"
2132#else
2133            "\"-display none\"\n"
2134#endif
2135    , QEMU_ARCH_ALL)
2136SRST
2137``-display type``
2138    Select type of display to use. Use ``-display help`` to list the available
2139    display types. Valid values for type are
2140
2141    ``spice-app[,gl=on|off]``
2142        Start QEMU as a Spice server and launch the default Spice client
2143        application. The Spice server will redirect the serial consoles
2144        and QEMU monitors. (Since 4.0)
2145
2146    ``dbus``
2147        Export the display over D-Bus interfaces. (Since 7.0)
2148
2149        The connection is registered with the "org.qemu" name (and queued when
2150        already owned).
2151
2152        ``addr=<dbusaddr>`` : D-Bus bus address to connect to.
2153
2154        ``p2p=yes|no`` : Use peer-to-peer connection, accepted via QMP ``add_client``.
2155
2156        ``gl=on|off|core|es`` : Use OpenGL for rendering (the D-Bus interface
2157        will share framebuffers with DMABUF file descriptors).
2158
2159    ``sdl``
2160        Display video output via SDL (usually in a separate graphics
2161        window; see the SDL documentation for other possibilities).
2162        Valid parameters are:
2163
2164        ``grab-mod=<mods>`` : Used to select the modifier keys for toggling
2165        the mouse grabbing in conjunction with the "g" key. ``<mods>`` can be
2166        either ``lshift-lctrl-lalt`` or ``rctrl``.
2167
2168        ``gl=on|off|core|es`` : Use OpenGL for displaying
2169
2170        ``show-cursor=on|off`` :  Force showing the mouse cursor
2171
2172        ``window-close=on|off`` : Allow to quit qemu with window close button
2173
2174    ``gtk``
2175        Display video output in a GTK window. This interface provides
2176        drop-down menus and other UI elements to configure and control
2177        the VM during runtime. Valid parameters are:
2178
2179        ``full-screen=on|off`` : Start in fullscreen mode
2180
2181        ``gl=on|off`` : Use OpenGL for displaying
2182
2183        ``grab-on-hover=on|off`` : Grab keyboard input on mouse hover
2184
2185        ``show-tabs=on|off`` : Display the tab bar for switching between the
2186                               various graphical interfaces (e.g. VGA and
2187                               virtual console character devices) by default.
2188
2189        ``show-cursor=on|off`` :  Force showing the mouse cursor
2190
2191        ``window-close=on|off`` : Allow to quit qemu with window close button
2192
2193        ``show-menubar=on|off`` : Display the main window menubar, defaults to "on"
2194
2195        ``zoom-to-fit=on|off`` : Expand video output to the window size,
2196                                 defaults to "off"
2197
2198    ``curses[,charset=<encoding>]``
2199        Display video output via curses. For graphics device models
2200        which support a text mode, QEMU can display this output using a
2201        curses/ncurses interface. Nothing is displayed when the graphics
2202        device is in graphical mode or if the graphics device does not
2203        support a text mode. Generally only the VGA device models
2204        support text mode. The font charset used by the guest can be
2205        specified with the ``charset`` option, for example
2206        ``charset=CP850`` for IBM CP850 encoding. The default is
2207        ``CP437``.
2208
2209    ``cocoa``
2210        Display video output in a Cocoa window. Mac only. This interface
2211        provides drop-down menus and other UI elements to configure and
2212        control the VM during runtime. Valid parameters are:
2213
2214        ``full-grab=on|off`` : Capture all key presses, including system combos.
2215                               This requires accessibility permissions, since it
2216                               performs a global grab on key events.
2217                               (default: off) See
2218                               https://support.apple.com/en-in/guide/mac-help/mh32356/mac
2219
2220        ``swap-opt-cmd=on|off`` : Swap the Option and Command keys so that their
2221                                  key codes match their position on non-Mac
2222                                  keyboards and you can use Meta/Super and Alt
2223                                  where you expect them.  (default: off)
2224
2225        ``show-cursor=on|off`` :  Force showing the mouse cursor
2226
2227        ``left-command-key=on|off`` : Disable forwarding left command key to host
2228
2229        ``full-screen=on|off`` : Start in fullscreen mode
2230
2231        ``zoom-to-fit=on|off`` : Expand video output to the window size,
2232                                 defaults to "off"
2233
2234    ``egl-headless[,rendernode=<file>]``
2235        Offload all OpenGL operations to a local DRI device. For any
2236        graphical display, this display needs to be paired with either
2237        VNC or SPICE displays.
2238
2239    ``vnc=<display>``
2240        Start a VNC server on display <display>
2241
2242    ``none``
2243        Do not display video output. The guest will still see an
2244        emulated graphics card, but its output will not be displayed to
2245        the QEMU user. This option differs from the -nographic option in
2246        that it only affects what is done with video output; -nographic
2247        also changes the destination of the serial and parallel port
2248        data.
2249ERST
2250
2251DEF("nographic", 0, QEMU_OPTION_nographic,
2252    "-nographic      disable graphical output and redirect serial I/Os to console\n",
2253    QEMU_ARCH_ALL)
2254SRST
2255``-nographic``
2256    Normally, if QEMU is compiled with graphical window support, it
2257    displays output such as guest graphics, guest console, and the QEMU
2258    monitor in a window. With this option, you can totally disable
2259    graphical output so that QEMU is a simple command line application.
2260    The emulated serial port is redirected on the console and muxed with
2261    the monitor (unless redirected elsewhere explicitly). Therefore, you
2262    can still use QEMU to debug a Linux kernel with a serial console.
2263    Use C-a h for help on switching between the console and monitor.
2264ERST
2265
2266#ifdef CONFIG_SPICE
2267DEF("spice", HAS_ARG, QEMU_OPTION_spice,
2268    "-spice [port=port][,tls-port=secured-port][,x509-dir=<dir>]\n"
2269    "       [,x509-key-file=<file>][,x509-key-password=<file>]\n"
2270    "       [,x509-cert-file=<file>][,x509-cacert-file=<file>]\n"
2271    "       [,x509-dh-key-file=<file>][,addr=addr]\n"
2272    "       [,ipv4=on|off][,ipv6=on|off][,unix=on|off]\n"
2273    "       [,tls-ciphers=<list>]\n"
2274    "       [,tls-channel=[main|display|cursor|inputs|record|playback]]\n"
2275    "       [,plaintext-channel=[main|display|cursor|inputs|record|playback]]\n"
2276    "       [,sasl=on|off][,disable-ticketing=on|off]\n"
2277    "       [,password-secret=<secret-id>]\n"
2278    "       [,image-compression=[auto_glz|auto_lz|quic|glz|lz|off]]\n"
2279    "       [,jpeg-wan-compression=[auto|never|always]]\n"
2280    "       [,zlib-glz-wan-compression=[auto|never|always]]\n"
2281    "       [,streaming-video=[off|all|filter]][,disable-copy-paste=on|off]\n"
2282    "       [,disable-agent-file-xfer=on|off][,agent-mouse=[on|off]]\n"
2283    "       [,playback-compression=[on|off]][,seamless-migration=[on|off]]\n"
2284    "       [,gl=[on|off]][,rendernode=<file>]\n"
2285    "                enable spice\n"
2286    "                at least one of {port, tls-port} is mandatory\n",
2287    QEMU_ARCH_ALL)
2288#endif
2289SRST
2290``-spice option[,option[,...]]``
2291    Enable the spice remote desktop protocol. Valid options are
2292
2293    ``port=<nr>``
2294        Set the TCP port spice is listening on for plaintext channels.
2295
2296    ``addr=<addr>``
2297        Set the IP address spice is listening on. Default is any
2298        address.
2299
2300    ``ipv4=on|off``; \ ``ipv6=on|off``; \ ``unix=on|off``
2301        Force using the specified IP version.
2302
2303    ``password-secret=<secret-id>``
2304        Set the ID of the ``secret`` object containing the password
2305        you need to authenticate.
2306
2307    ``sasl=on|off``
2308        Require that the client use SASL to authenticate with the spice.
2309        The exact choice of authentication method used is controlled
2310        from the system / user's SASL configuration file for the 'qemu'
2311        service. This is typically found in /etc/sasl2/qemu.conf. If
2312        running QEMU as an unprivileged user, an environment variable
2313        SASL\_CONF\_PATH can be used to make it search alternate
2314        locations for the service config. While some SASL auth methods
2315        can also provide data encryption (eg GSSAPI), it is recommended
2316        that SASL always be combined with the 'tls' and 'x509' settings
2317        to enable use of SSL and server certificates. This ensures a
2318        data encryption preventing compromise of authentication
2319        credentials.
2320
2321    ``disable-ticketing=on|off``
2322        Allow client connects without authentication.
2323
2324    ``disable-copy-paste=on|off``
2325        Disable copy paste between the client and the guest.
2326
2327    ``disable-agent-file-xfer=on|off``
2328        Disable spice-vdagent based file-xfer between the client and the
2329        guest.
2330
2331    ``tls-port=<nr>``
2332        Set the TCP port spice is listening on for encrypted channels.
2333
2334    ``x509-dir=<dir>``
2335        Set the x509 file directory. Expects same filenames as -vnc
2336        $display,x509=$dir
2337
2338    ``x509-key-file=<file>``; \ ``x509-key-password=<file>``; \ ``x509-cert-file=<file>``; \ ``x509-cacert-file=<file>``; \ ``x509-dh-key-file=<file>``
2339        The x509 file names can also be configured individually.
2340
2341    ``tls-ciphers=<list>``
2342        Specify which ciphers to use.
2343
2344    ``tls-channel=[main|display|cursor|inputs|record|playback]``; \ ``plaintext-channel=[main|display|cursor|inputs|record|playback]``
2345        Force specific channel to be used with or without TLS
2346        encryption. The options can be specified multiple times to
2347        configure multiple channels. The special name "default" can be
2348        used to set the default mode. For channels which are not
2349        explicitly forced into one mode the spice client is allowed to
2350        pick tls/plaintext as he pleases.
2351
2352    ``image-compression=[auto_glz|auto_lz|quic|glz|lz|off]``
2353        Configure image compression (lossless). Default is auto\_glz.
2354
2355    ``jpeg-wan-compression=[auto|never|always]``; \ ``zlib-glz-wan-compression=[auto|never|always]``
2356        Configure wan image compression (lossy for slow links). Default
2357        is auto.
2358
2359    ``streaming-video=[off|all|filter]``
2360        Configure video stream detection. Default is off.
2361
2362    ``agent-mouse=[on|off]``
2363        Enable/disable passing mouse events via vdagent. Default is on.
2364
2365    ``playback-compression=[on|off]``
2366        Enable/disable audio stream compression (using celt 0.5.1).
2367        Default is on.
2368
2369    ``seamless-migration=[on|off]``
2370        Enable/disable spice seamless migration. Default is off.
2371
2372    ``gl=[on|off]``
2373        Enable/disable OpenGL context. Default is off.
2374
2375    ``rendernode=<file>``
2376        DRM render node for OpenGL rendering. If not specified, it will
2377        pick the first available. (Since 2.9)
2378ERST
2379
2380DEF("vga", HAS_ARG, QEMU_OPTION_vga,
2381    "-vga [std|cirrus|vmware|qxl|xenfb|tcx|cg3|virtio|none]\n"
2382    "                select video card type\n", QEMU_ARCH_ALL)
2383SRST
2384``-vga type``
2385    Select type of VGA card to emulate. Valid values for type are
2386
2387    ``cirrus``
2388        Cirrus Logic GD5446 Video card. All Windows versions starting
2389        from Windows 95 should recognize and use this graphic card. For
2390        optimal performances, use 16 bit color depth in the guest and
2391        the host OS. (This card was the default before QEMU 2.2)
2392
2393    ``std``
2394        Standard VGA card with Bochs VBE extensions. If your guest OS
2395        supports the VESA 2.0 VBE extensions (e.g. Windows XP) and if
2396        you want to use high resolution modes (>= 1280x1024x16) then you
2397        should use this option. (This card is the default since QEMU
2398        2.2)
2399
2400    ``vmware``
2401        VMWare SVGA-II compatible adapter. Use it if you have
2402        sufficiently recent XFree86/XOrg server or Windows guest with a
2403        driver for this card.
2404
2405    ``qxl``
2406        QXL paravirtual graphic card. It is VGA compatible (including
2407        VESA 2.0 VBE support). Works best with qxl guest drivers
2408        installed though. Recommended choice when using the spice
2409        protocol.
2410
2411    ``tcx``
2412        (sun4m only) Sun TCX framebuffer. This is the default
2413        framebuffer for sun4m machines and offers both 8-bit and 24-bit
2414        colour depths at a fixed resolution of 1024x768.
2415
2416    ``cg3``
2417        (sun4m only) Sun cgthree framebuffer. This is a simple 8-bit
2418        framebuffer for sun4m machines available in both 1024x768
2419        (OpenBIOS) and 1152x900 (OBP) resolutions aimed at people
2420        wishing to run older Solaris versions.
2421
2422    ``virtio``
2423        Virtio VGA card.
2424
2425    ``none``
2426        Disable VGA card.
2427ERST
2428
2429DEF("full-screen", 0, QEMU_OPTION_full_screen,
2430    "-full-screen    start in full screen\n", QEMU_ARCH_ALL)
2431SRST
2432``-full-screen``
2433    Start in full screen.
2434ERST
2435
2436DEF("g", HAS_ARG, QEMU_OPTION_g ,
2437    "-g WxH[xDEPTH]  Set the initial graphical resolution and depth\n",
2438    QEMU_ARCH_PPC | QEMU_ARCH_SPARC | QEMU_ARCH_M68K)
2439SRST
2440``-g`` *width*\ ``x``\ *height*\ ``[x``\ *depth*\ ``]``
2441    Set the initial graphical resolution and depth (PPC, SPARC only).
2442
2443    For PPC the default is 800x600x32.
2444
2445    For SPARC with the TCX graphics device, the default is 1024x768x8
2446    with the option of 1024x768x24. For cgthree, the default is
2447    1024x768x8 with the option of 1152x900x8 for people who wish to use
2448    OBP.
2449ERST
2450
2451#ifdef CONFIG_VNC
2452DEF("vnc", HAS_ARG, QEMU_OPTION_vnc ,
2453    "-vnc <display>  shorthand for -display vnc=<display>\n", QEMU_ARCH_ALL)
2454#endif
2455SRST
2456``-vnc display[,option[,option[,...]]]``
2457    Normally, if QEMU is compiled with graphical window support, it
2458    displays output such as guest graphics, guest console, and the QEMU
2459    monitor in a window. With this option, you can have QEMU listen on
2460    VNC display display and redirect the VGA display over the VNC
2461    session. It is very useful to enable the usb tablet device when
2462    using this option (option ``-device usb-tablet``). When using the
2463    VNC display, you must use the ``-k`` parameter to set the keyboard
2464    layout if you are not using en-us. Valid syntax for the display is
2465
2466    ``to=L``
2467        With this option, QEMU will try next available VNC displays,
2468        until the number L, if the originally defined "-vnc display" is
2469        not available, e.g. port 5900+display is already used by another
2470        application. By default, to=0.
2471
2472    ``host:d``
2473        TCP connections will only be allowed from host on display d. By
2474        convention the TCP port is 5900+d. Optionally, host can be
2475        omitted in which case the server will accept connections from
2476        any host.
2477
2478    ``unix:path``
2479        Connections will be allowed over UNIX domain sockets where path
2480        is the location of a unix socket to listen for connections on.
2481
2482    ``none``
2483        VNC is initialized but not started. The monitor ``change``
2484        command can be used to later start the VNC server.
2485
2486    Following the display value there may be one or more option flags
2487    separated by commas. Valid options are
2488
2489    ``reverse=on|off``
2490        Connect to a listening VNC client via a "reverse" connection.
2491        The client is specified by the display. For reverse network
2492        connections (host:d,``reverse``), the d argument is a TCP port
2493        number, not a display number.
2494
2495    ``websocket=on|off``
2496        Opens an additional TCP listening port dedicated to VNC
2497        Websocket connections. If a bare websocket option is given, the
2498        Websocket port is 5700+display. An alternative port can be
2499        specified with the syntax ``websocket``\ =port.
2500
2501        If host is specified connections will only be allowed from this
2502        host. It is possible to control the websocket listen address
2503        independently, using the syntax ``websocket``\ =host:port.
2504
2505        Websocket could be allowed over UNIX domain socket, using the syntax
2506        ``websocket``\ =unix:path, where path is the location of a unix socket
2507        to listen for connections on.
2508
2509        If no TLS credentials are provided, the websocket connection
2510        runs in unencrypted mode. If TLS credentials are provided, the
2511        websocket connection requires encrypted client connections.
2512
2513    ``password=on|off``
2514        Require that password based authentication is used for client
2515        connections.
2516
2517        The password must be set separately using the ``set_password``
2518        command in the :ref:`QEMU monitor`. The
2519        syntax to change your password is:
2520        ``set_password <protocol> <password>`` where <protocol> could be
2521        either "vnc" or "spice".
2522
2523        If you would like to change <protocol> password expiration, you
2524        should use ``expire_password <protocol> <expiration-time>``
2525        where expiration time could be one of the following options:
2526        now, never, +seconds or UNIX time of expiration, e.g. +60 to
2527        make password expire in 60 seconds, or 1335196800 to make
2528        password expire on "Mon Apr 23 12:00:00 EDT 2012" (UNIX time for
2529        this date and time).
2530
2531        You can also use keywords "now" or "never" for the expiration
2532        time to allow <protocol> password to expire immediately or never
2533        expire.
2534
2535    ``password-secret=<secret-id>``
2536        Require that password based authentication is used for client
2537        connections, using the password provided by the ``secret``
2538        object identified by ``secret-id``.
2539
2540    ``tls-creds=ID``
2541        Provides the ID of a set of TLS credentials to use to secure the
2542        VNC server. They will apply to both the normal VNC server socket
2543        and the websocket socket (if enabled). Setting TLS credentials
2544        will cause the VNC server socket to enable the VeNCrypt auth
2545        mechanism. The credentials should have been previously created
2546        using the ``-object tls-creds`` argument.
2547
2548    ``tls-authz=ID``
2549        Provides the ID of the QAuthZ authorization object against which
2550        the client's x509 distinguished name will validated. This object
2551        is only resolved at time of use, so can be deleted and recreated
2552        on the fly while the VNC server is active. If missing, it will
2553        default to denying access.
2554
2555    ``sasl=on|off``
2556        Require that the client use SASL to authenticate with the VNC
2557        server. The exact choice of authentication method used is
2558        controlled from the system / user's SASL configuration file for
2559        the 'qemu' service. This is typically found in
2560        /etc/sasl2/qemu.conf. If running QEMU as an unprivileged user,
2561        an environment variable SASL\_CONF\_PATH can be used to make it
2562        search alternate locations for the service config. While some
2563        SASL auth methods can also provide data encryption (eg GSSAPI),
2564        it is recommended that SASL always be combined with the 'tls'
2565        and 'x509' settings to enable use of SSL and server
2566        certificates. This ensures a data encryption preventing
2567        compromise of authentication credentials. See the
2568        :ref:`VNC security` section in the System Emulation Users Guide
2569        for details on using SASL authentication.
2570
2571    ``sasl-authz=ID``
2572        Provides the ID of the QAuthZ authorization object against which
2573        the client's SASL username will validated. This object is only
2574        resolved at time of use, so can be deleted and recreated on the
2575        fly while the VNC server is active. If missing, it will default
2576        to denying access.
2577
2578    ``acl=on|off``
2579        Legacy method for enabling authorization of clients against the
2580        x509 distinguished name and SASL username. It results in the
2581        creation of two ``authz-list`` objects with IDs of
2582        ``vnc.username`` and ``vnc.x509dname``. The rules for these
2583        objects must be configured with the HMP ACL commands.
2584
2585        This option is deprecated and should no longer be used. The new
2586        ``sasl-authz`` and ``tls-authz`` options are a replacement.
2587
2588    ``lossy=on|off``
2589        Enable lossy compression methods (gradient, JPEG, ...). If this
2590        option is set, VNC client may receive lossy framebuffer updates
2591        depending on its encoding settings. Enabling this option can
2592        save a lot of bandwidth at the expense of quality.
2593
2594    ``non-adaptive=on|off``
2595        Disable adaptive encodings. Adaptive encodings are enabled by
2596        default. An adaptive encoding will try to detect frequently
2597        updated screen regions, and send updates in these regions using
2598        a lossy encoding (like JPEG). This can be really helpful to save
2599        bandwidth when playing videos. Disabling adaptive encodings
2600        restores the original static behavior of encodings like Tight.
2601
2602    ``share=[allow-exclusive|force-shared|ignore]``
2603        Set display sharing policy. 'allow-exclusive' allows clients to
2604        ask for exclusive access. As suggested by the rfb spec this is
2605        implemented by dropping other connections. Connecting multiple
2606        clients in parallel requires all clients asking for a shared
2607        session (vncviewer: -shared switch). This is the default.
2608        'force-shared' disables exclusive client access. Useful for
2609        shared desktop sessions, where you don't want someone forgetting
2610        specify -shared disconnect everybody else. 'ignore' completely
2611        ignores the shared flag and allows everybody connect
2612        unconditionally. Doesn't conform to the rfb spec but is
2613        traditional QEMU behavior.
2614
2615    ``key-delay-ms``
2616        Set keyboard delay, for key down and key up events, in
2617        milliseconds. Default is 10. Keyboards are low-bandwidth
2618        devices, so this slowdown can help the device and guest to keep
2619        up and not lose events in case events are arriving in bulk.
2620        Possible causes for the latter are flaky network connections, or
2621        scripts for automated testing.
2622
2623    ``audiodev=audiodev``
2624        Use the specified audiodev when the VNC client requests audio
2625        transmission. When not using an -audiodev argument, this option
2626        must be omitted, otherwise is must be present and specify a
2627        valid audiodev.
2628
2629    ``power-control=on|off``
2630        Permit the remote client to issue shutdown, reboot or reset power
2631        control requests.
2632ERST
2633
2634ARCHHEADING(, QEMU_ARCH_I386)
2635
2636ARCHHEADING(i386 target only:, QEMU_ARCH_I386)
2637
2638DEF("win2k-hack", 0, QEMU_OPTION_win2k_hack,
2639    "-win2k-hack     use it when installing Windows 2000 to avoid a disk full bug\n",
2640    QEMU_ARCH_I386)
2641SRST
2642``-win2k-hack``
2643    Use it when installing Windows 2000 to avoid a disk full bug. After
2644    Windows 2000 is installed, you no longer need this option (this
2645    option slows down the IDE transfers).  Synonym of ``-global
2646    ide-device.win2k-install-hack=on``.
2647ERST
2648
2649DEF("no-fd-bootchk", 0, QEMU_OPTION_no_fd_bootchk,
2650    "-no-fd-bootchk  disable boot signature checking for floppy disks\n",
2651    QEMU_ARCH_I386)
2652SRST
2653``-no-fd-bootchk``
2654    Disable boot signature checking for floppy disks in BIOS. May be
2655    needed to boot from old floppy disks.  Synonym of ``-m fd-bootchk=off``.
2656ERST
2657
2658DEF("acpitable", HAS_ARG, QEMU_OPTION_acpitable,
2659    "-acpitable [sig=str][,rev=n][,oem_id=str][,oem_table_id=str][,oem_rev=n][,asl_compiler_id=str][,asl_compiler_rev=n][,{data|file}=file1[:file2]...]\n"
2660    "                ACPI table description\n", QEMU_ARCH_I386)
2661SRST
2662``-acpitable [sig=str][,rev=n][,oem_id=str][,oem_table_id=str][,oem_rev=n] [,asl_compiler_id=str][,asl_compiler_rev=n][,data=file1[:file2]...]``
2663    Add ACPI table with specified header fields and context from
2664    specified files. For file=, take whole ACPI table from the specified
2665    files, including all ACPI headers (possible overridden by other
2666    options). For data=, only data portion of the table is used, all
2667    header information is specified in the command line. If a SLIC table
2668    is supplied to QEMU, then the SLIC's oem\_id and oem\_table\_id
2669    fields will override the same in the RSDT and the FADT (a.k.a.
2670    FACP), in order to ensure the field matches required by the
2671    Microsoft SLIC spec and the ACPI spec.
2672ERST
2673
2674DEF("smbios", HAS_ARG, QEMU_OPTION_smbios,
2675    "-smbios file=binary\n"
2676    "                load SMBIOS entry from binary file\n"
2677    "-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]\n"
2678    "              [,uefi=on|off]\n"
2679    "                specify SMBIOS type 0 fields\n"
2680    "-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]\n"
2681    "              [,uuid=uuid][,sku=str][,family=str]\n"
2682    "                specify SMBIOS type 1 fields\n"
2683    "-smbios type=2[,manufacturer=str][,product=str][,version=str][,serial=str]\n"
2684    "              [,asset=str][,location=str]\n"
2685    "                specify SMBIOS type 2 fields\n"
2686    "-smbios type=3[,manufacturer=str][,version=str][,serial=str][,asset=str]\n"
2687    "              [,sku=str]\n"
2688    "                specify SMBIOS type 3 fields\n"
2689    "-smbios type=4[,sock_pfx=str][,manufacturer=str][,version=str][,serial=str]\n"
2690    "              [,asset=str][,part=str][,max-speed=%d][,current-speed=%d]\n"
2691    "              [,processor-family=%d][,processor-id=%d]\n"
2692    "                specify SMBIOS type 4 fields\n"
2693    "-smbios type=8[,external_reference=str][,internal_reference=str][,connector_type=%d][,port_type=%d]\n"
2694    "                specify SMBIOS type 8 fields\n"
2695    "-smbios type=11[,value=str][,path=filename]\n"
2696    "                specify SMBIOS type 11 fields\n"
2697    "-smbios type=17[,loc_pfx=str][,bank=str][,manufacturer=str][,serial=str]\n"
2698    "               [,asset=str][,part=str][,speed=%d]\n"
2699    "                specify SMBIOS type 17 fields\n"
2700    "-smbios type=41[,designation=str][,kind=str][,instance=%d][,pcidev=str]\n"
2701    "                specify SMBIOS type 41 fields\n",
2702    QEMU_ARCH_I386 | QEMU_ARCH_ARM | QEMU_ARCH_LOONGARCH | QEMU_ARCH_RISCV)
2703SRST
2704``-smbios file=binary``
2705    Load SMBIOS entry from binary file.
2706
2707``-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d][,uefi=on|off]``
2708    Specify SMBIOS type 0 fields
2709
2710``-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str][,uuid=uuid][,sku=str][,family=str]``
2711    Specify SMBIOS type 1 fields
2712
2713``-smbios type=2[,manufacturer=str][,product=str][,version=str][,serial=str][,asset=str][,location=str]``
2714    Specify SMBIOS type 2 fields
2715
2716``-smbios type=3[,manufacturer=str][,version=str][,serial=str][,asset=str][,sku=str]``
2717    Specify SMBIOS type 3 fields
2718
2719``-smbios type=4[,sock_pfx=str][,manufacturer=str][,version=str][,serial=str][,asset=str][,part=str][,processor-family=%d][,processor-id=%d]``
2720    Specify SMBIOS type 4 fields
2721
2722``-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]``
2723    Specify SMBIOS type 9 fields
2724
2725``-smbios type=11[,value=str][,path=filename]``
2726    Specify SMBIOS type 11 fields
2727
2728    This argument can be repeated multiple times, and values are added in the order they are parsed.
2729    Applications intending to use OEM strings data are encouraged to use their application name as
2730    a prefix for the value string. This facilitates passing information for multiple applications
2731    concurrently.
2732
2733    The ``value=str`` syntax provides the string data inline, while the ``path=filename`` syntax
2734    loads data from a file on disk. Note that the file is not permitted to contain any NUL bytes.
2735
2736    Both the ``value`` and ``path`` options can be repeated multiple times and will be added to
2737    the SMBIOS table in the order in which they appear.
2738
2739    Note that on the x86 architecture, the total size of all SMBIOS tables is limited to 65535
2740    bytes. Thus the OEM strings data is not suitable for passing large amounts of data into the
2741    guest. Instead it should be used as a indicator to inform the guest where to locate the real
2742    data set, for example, by specifying the serial ID of a block device.
2743
2744    An example passing three strings is
2745
2746    .. parsed-literal::
2747
2748        -smbios type=11,value=cloud-init:ds=nocloud-net;s=http://10.10.0.1:8000/,\\
2749                        value=anaconda:method=http://dl.fedoraproject.org/pub/fedora/linux/releases/25/x86_64/os,\\
2750                        path=/some/file/with/oemstringsdata.txt
2751
2752    In the guest OS this is visible with the ``dmidecode`` command
2753
2754     .. parsed-literal::
2755
2756         $ dmidecode -t 11
2757         Handle 0x0E00, DMI type 11, 5 bytes
2758         OEM Strings
2759              String 1: cloud-init:ds=nocloud-net;s=http://10.10.0.1:8000/
2760              String 2: anaconda:method=http://dl.fedoraproject.org/pub/fedora/linux/releases/25/x86_64/os
2761              String 3: myapp:some extra data
2762
2763
2764``-smbios type=17[,loc_pfx=str][,bank=str][,manufacturer=str][,serial=str][,asset=str][,part=str][,speed=%d]``
2765    Specify SMBIOS type 17 fields
2766
2767``-smbios type=41[,designation=str][,kind=str][,instance=%d][,pcidev=str]``
2768    Specify SMBIOS type 41 fields
2769
2770    This argument can be repeated multiple times.  Its main use is to allow network interfaces be created
2771    as ``enoX`` on Linux, with X being the instance number, instead of the name depending on the interface
2772    position on the PCI bus.
2773
2774    Here is an example of use:
2775
2776    .. parsed-literal::
2777
2778        -netdev user,id=internet \\
2779        -device virtio-net-pci,mac=50:54:00:00:00:42,netdev=internet,id=internet-dev \\
2780        -smbios type=41,designation='Onboard LAN',instance=1,kind=ethernet,pcidev=internet-dev
2781
2782    In the guest OS, the device should then appear as ``eno1``:
2783
2784    ..parsed-literal::
2785
2786         $ ip -brief l
2787         lo               UNKNOWN        00:00:00:00:00:00 <LOOPBACK,UP,LOWER_UP>
2788         eno1             UP             50:54:00:00:00:42 <BROADCAST,MULTICAST,UP,LOWER_UP>
2789
2790    Currently, the PCI device has to be attached to the root bus.
2791
2792ERST
2793
2794DEFHEADING()
2795
2796DEFHEADING(Network options:)
2797
2798DEF("netdev", HAS_ARG, QEMU_OPTION_netdev,
2799#ifdef CONFIG_PASST
2800    "-netdev passt,id=str[,path=file][,quiet=on|off][,vhost-user=on|off]\n"
2801    "[,mtu=mtu][,address=addr][,netmask=mask][,mac=addr][,gateway=addr]\n"
2802    "          [,interface=name][,outbound=address][,outbound-if4=name]\n"
2803    "          [,outbound-if6=name][,dns=addr][,search=list][,fqdn=name]\n"
2804    "          [,dhcp-dns=on|off][,dhcp-search=on|off][,map-host-loopback=addr]\n"
2805    "          [,map-guest-addr=addr][,dns-forward=addr][,dns-host=addr]\n"
2806    "          [,tcp=on|off][,udp=on|off][,icmp=on|off][,dhcp=on|off]\n"
2807    "          [,ndp=on|off][,dhcpv6=on|off][,ra=on|off][,freebind=on|off]\n"
2808    "          [,ipv4=on|off][,ipv6=on|off][,tcp-ports=spec][,udp-ports=spec]\n"
2809    "          [,param=list]\n"
2810    "                configure a passt network backend with ID 'str'\n"
2811    "                if 'path' is not provided 'passt' will be started according to PATH\n"
2812    "                by default, informational message of passt are not displayed (quiet=on)\n"
2813    "                to display this message, use 'quiet=off'\n"
2814    "                by default, passt will be started in socket-based mode, to enable vhost-mode,\n"
2815    "                use 'vhost-user=on'\n"
2816    "                for details on other options, refer to passt(1)\n"
2817    "                'param' allows to pass any option defined by passt(1)\n"
2818#endif
2819#ifdef CONFIG_SLIRP
2820    "-netdev user,id=str[,ipv4=on|off][,net=addr[/mask]][,host=addr]\n"
2821    "         [,ipv6=on|off][,ipv6-net=addr[/int]][,ipv6-host=addr]\n"
2822    "         [,restrict=on|off][,hostname=host][,dhcpstart=addr]\n"
2823    "         [,dns=addr][,ipv6-dns=addr][,dnssearch=domain][,domainname=domain]\n"
2824    "         [,tftp=dir][,tftp-server-name=name][,bootfile=f][,hostfwd=rule][,guestfwd=rule]"
2825#ifndef _WIN32
2826                                             "[,smb=dir[,smbserver=addr]]\n"
2827#endif
2828    "                configure a user mode network backend with ID 'str',\n"
2829    "                its DHCP server and optional services\n"
2830#endif
2831#ifdef _WIN32
2832    "-netdev tap,id=str,ifname=name\n"
2833    "                configure a host TAP network backend with ID 'str'\n"
2834#else
2835    "-netdev tap,id=str[,fd=h][,fds=x:y:...:z][,ifname=name][,script=file][,downscript=dfile]\n"
2836    "         [,br=bridge][,helper=helper][,sndbuf=nbytes][,vnet_hdr=on|off][,vhost=on|off]\n"
2837    "         [,vhostfd=h][,vhostfds=x:y:...:z][,vhostforce=on|off][,queues=n]\n"
2838    "         [,poll-us=n]\n"
2839    "                configure a host TAP network backend with ID 'str'\n"
2840    "                connected to a bridge (default=" DEFAULT_BRIDGE_INTERFACE ")\n"
2841    "                use network scripts 'file' (default=" DEFAULT_NETWORK_SCRIPT ")\n"
2842    "                to configure it and 'dfile' (default=" DEFAULT_NETWORK_DOWN_SCRIPT ")\n"
2843    "                to deconfigure it\n"
2844    "                use '[down]script=no' to disable script execution\n"
2845    "                use network helper 'helper' (default=" DEFAULT_BRIDGE_HELPER ") to\n"
2846    "                configure it\n"
2847    "                use 'fd=h' to connect to an already opened TAP interface\n"
2848    "                use 'fds=x:y:...:z' to connect to already opened multiqueue capable TAP interfaces\n"
2849    "                use 'sndbuf=nbytes' to limit the size of the send buffer (the\n"
2850    "                default is disabled 'sndbuf=0' to enable flow control set 'sndbuf=1048576')\n"
2851    "                use vnet_hdr=off to avoid enabling the IFF_VNET_HDR tap flag\n"
2852    "                use vnet_hdr=on to make the lack of IFF_VNET_HDR support an error condition\n"
2853    "                use vhost=on to enable experimental in kernel accelerator\n"
2854    "                    (only has effect for virtio guests which use MSIX)\n"
2855    "                use vhostforce=on to force vhost on for non-MSIX virtio guests\n"
2856    "                use 'vhostfd=h' to connect to an already opened vhost net device\n"
2857    "                use 'vhostfds=x:y:...:z to connect to multiple already opened vhost net devices\n"
2858    "                use 'queues=n' to specify the number of queues to be created for multiqueue TAP\n"
2859    "                use 'poll-us=n' to specify the maximum number of microseconds that could be\n"
2860    "                spent on busy polling for vhost net\n"
2861    "-netdev bridge,id=str[,br=bridge][,helper=helper]\n"
2862    "                configure a host TAP network backend with ID 'str' that is\n"
2863    "                connected to a bridge (default=" DEFAULT_BRIDGE_INTERFACE ")\n"
2864    "                using the program 'helper (default=" DEFAULT_BRIDGE_HELPER ")\n"
2865#endif
2866#ifdef __linux__
2867    "-netdev l2tpv3,id=str,src=srcaddr,dst=dstaddr[,srcport=srcport][,dstport=dstport]\n"
2868    "         [,rxsession=rxsession],txsession=txsession[,ipv6=on|off][,udp=on|off]\n"
2869    "         [,cookie64=on|off][,counter][,pincounter][,txcookie=txcookie]\n"
2870    "         [,rxcookie=rxcookie][,offset=offset]\n"
2871    "                configure a network backend with ID 'str' connected to\n"
2872    "                an Ethernet over L2TPv3 pseudowire.\n"
2873    "                Linux kernel 3.3+ as well as most routers can talk\n"
2874    "                L2TPv3. This transport allows connecting a VM to a VM,\n"
2875    "                VM to a router and even VM to Host. It is a nearly-universal\n"
2876    "                standard (RFC3931). Note - this implementation uses static\n"
2877    "                pre-configured tunnels (same as the Linux kernel).\n"
2878    "                use 'src=' to specify source address\n"
2879    "                use 'dst=' to specify destination address\n"
2880    "                use 'udp=on' to specify udp encapsulation\n"
2881    "                use 'srcport=' to specify source udp port\n"
2882    "                use 'dstport=' to specify destination udp port\n"
2883    "                use 'ipv6=on' to force v6\n"
2884    "                L2TPv3 uses cookies to prevent misconfiguration as\n"
2885    "                well as a weak security measure\n"
2886    "                use 'rxcookie=0x012345678' to specify a rxcookie\n"
2887    "                use 'txcookie=0x012345678' to specify a txcookie\n"
2888    "                use 'cookie64=on' to set cookie size to 64 bit, otherwise 32\n"
2889    "                use 'counter=off' to force a 'cut-down' L2TPv3 with no counter\n"
2890    "                use 'pincounter=on' to work around broken counter handling in peer\n"
2891    "                use 'offset=X' to add an extra offset between header and data\n"
2892#endif
2893    "-netdev socket,id=str[,fd=h][,listen=[host]:port][,connect=host:port]\n"
2894    "                configure a network backend to connect to another network\n"
2895    "                using a socket connection\n"
2896    "-netdev socket,id=str[,fd=h][,mcast=maddr:port[,localaddr=addr]]\n"
2897    "                configure a network backend to connect to a multicast maddr and port\n"
2898    "                use 'localaddr=addr' to specify the host address to send packets from\n"
2899    "-netdev socket,id=str[,fd=h][,udp=host:port][,localaddr=host:port]\n"
2900    "                configure a network backend to connect to another network\n"
2901    "                using an UDP tunnel\n"
2902    "-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-ms=milliseconds]\n"
2903    "-netdev stream,id=str[,server=on|off],addr.type=unix,addr.path=path[,abstract=on|off][,tight=on|off][,reconnect-ms=milliseconds]\n"
2904    "-netdev stream,id=str[,server=on|off],addr.type=fd,addr.str=file-descriptor[,reconnect-ms=milliseconds]\n"
2905    "                configure a network backend to connect to another network\n"
2906    "                using a socket connection in stream mode.\n"
2907    "-netdev dgram,id=str,remote.type=inet,remote.host=maddr,remote.port=port[,local.type=inet,local.host=addr]\n"
2908    "-netdev dgram,id=str,remote.type=inet,remote.host=maddr,remote.port=port[,local.type=fd,local.str=file-descriptor]\n"
2909    "                configure a network backend to connect to a multicast maddr and port\n"
2910    "                use ``local.host=addr`` to specify the host address to send packets from\n"
2911    "-netdev dgram,id=str,local.type=inet,local.host=addr,local.port=port[,remote.type=inet,remote.host=addr,remote.port=port]\n"
2912    "-netdev dgram,id=str,local.type=unix,local.path=path[,remote.type=unix,remote.path=path]\n"
2913    "-netdev dgram,id=str,local.type=fd,local.str=file-descriptor\n"
2914    "                configure a network backend to connect to another network\n"
2915    "                using an UDP tunnel\n"
2916#ifdef CONFIG_VDE
2917    "-netdev vde,id=str[,sock=socketpath][,port=n][,group=groupname][,mode=octalmode]\n"
2918    "                configure a network backend to connect to port 'n' of a vde switch\n"
2919    "                running on host and listening for incoming connections on 'socketpath'.\n"
2920    "                Use group 'groupname' and mode 'octalmode' to change default\n"
2921    "                ownership and permissions for communication port.\n"
2922#endif
2923#ifdef CONFIG_NETMAP
2924    "-netdev netmap,id=str,ifname=name[,devname=nmname]\n"
2925    "                attach to the existing netmap-enabled network interface 'name', or to a\n"
2926    "                VALE port (created on the fly) called 'name' ('nmname' is name of the \n"
2927    "                netmap device, defaults to '/dev/netmap')\n"
2928#endif
2929#ifdef CONFIG_AF_XDP
2930    "-netdev af-xdp,id=str,ifname=name[,mode=native|skb][,force-copy=on|off]\n"
2931    "         [,queues=n][,start-queue=m][,inhibit=on|off][,sock-fds=x:y:...:z]\n"
2932    "                attach to the existing network interface 'name' with AF_XDP socket\n"
2933    "                use 'mode=MODE' to specify an XDP program attach mode\n"
2934    "                use 'force-copy=on|off' to force XDP copy mode even if device supports zero-copy (default: off)\n"
2935    "                use 'inhibit=on|off' to inhibit loading of a default XDP program (default: off)\n"
2936    "                with inhibit=on,\n"
2937    "                  use 'sock-fds' to provide file descriptors for already open AF_XDP sockets\n"
2938    "                  added to a socket map in XDP program.  One socket per queue.\n"
2939    "                use 'queues=n' to specify how many queues of a multiqueue interface should be used\n"
2940    "                use 'start-queue=m' to specify the first queue that should be used\n"
2941#endif
2942#ifdef CONFIG_POSIX
2943    "-netdev vhost-user,id=str,chardev=dev[,vhostforce=on|off]\n"
2944    "                configure a vhost-user network, backed by a chardev 'dev'\n"
2945#endif
2946#ifdef __linux__
2947    "-netdev vhost-vdpa,id=str[,vhostdev=/path/to/dev][,vhostfd=h]\n"
2948    "                configure a vhost-vdpa network,Establish a vhost-vdpa netdev\n"
2949    "                use 'vhostdev=/path/to/dev' to open a vhost vdpa device\n"
2950    "                use 'vhostfd=h' to connect to an already opened vhost vdpa device\n"
2951#endif
2952#ifdef CONFIG_VMNET
2953    "-netdev vmnet-host,id=str[,isolated=on|off][,net-uuid=uuid]\n"
2954    "         [,start-address=addr,end-address=addr,subnet-mask=mask]\n"
2955    "                configure a vmnet network backend in host mode with ID 'str',\n"
2956    "                isolate this interface from others with 'isolated',\n"
2957    "                configure the address range and choose a subnet mask,\n"
2958    "                specify network UUID 'uuid' to disable DHCP and interact with\n"
2959    "                vmnet-host interfaces within this isolated network\n"
2960    "-netdev vmnet-shared,id=str[,isolated=on|off][,nat66-prefix=addr]\n"
2961    "         [,start-address=addr,end-address=addr,subnet-mask=mask]\n"
2962    "                configure a vmnet network backend in shared mode with ID 'str',\n"
2963    "                configure the address range and choose a subnet mask,\n"
2964    "                set IPv6 ULA prefix (of length 64) to use for internal network,\n"
2965    "                isolate this interface from others with 'isolated'\n"
2966    "-netdev vmnet-bridged,id=str,ifname=name[,isolated=on|off]\n"
2967    "                configure a vmnet network backend in bridged mode with ID 'str',\n"
2968    "                use 'ifname=name' to select a physical network interface to be bridged,\n"
2969    "                isolate this interface from others with 'isolated'\n"
2970#endif
2971    "-netdev hubport,id=str,hubid=n[,netdev=nd]\n"
2972    "                configure a hub port on the hub with ID 'n'\n", QEMU_ARCH_ALL)
2973DEF("nic", HAS_ARG, QEMU_OPTION_nic,
2974    "-nic [tap|bridge|"
2975#ifdef CONFIG_PASST
2976    "passt|"
2977#endif
2978#ifdef CONFIG_SLIRP
2979    "user|"
2980#endif
2981#ifdef __linux__
2982    "l2tpv3|"
2983#endif
2984#ifdef CONFIG_VDE
2985    "vde|"
2986#endif
2987#ifdef CONFIG_NETMAP
2988    "netmap|"
2989#endif
2990#ifdef CONFIG_AF_XDP
2991    "af-xdp|"
2992#endif
2993#ifdef CONFIG_POSIX
2994    "vhost-user|"
2995#endif
2996#ifdef CONFIG_VMNET
2997    "vmnet-host|vmnet-shared|vmnet-bridged|"
2998#endif
2999    "socket][,option][,...][mac=macaddr]\n"
3000    "                initialize an on-board / default host NIC (using MAC address\n"
3001    "                macaddr) and connect it to the given host network backend\n"
3002    "-nic none       use it alone to have zero network devices (the default is to\n"
3003    "                provided a 'user' network connection)\n",
3004    QEMU_ARCH_ALL)
3005DEF("net", HAS_ARG, QEMU_OPTION_net,
3006    "-net nic[,macaddr=mac][,model=type][,name=str][,addr=str][,vectors=v]\n"
3007    "                configure or create an on-board (or machine default) NIC and\n"
3008    "                connect it to hub 0 (please use -nic unless you need a hub)\n"
3009    "-net ["
3010#ifdef CONFIG_PASST
3011    "passt|"
3012#endif
3013#ifdef CONFIG_SLIRP
3014    "user|"
3015#endif
3016    "tap|"
3017    "bridge|"
3018#ifdef CONFIG_VDE
3019    "vde|"
3020#endif
3021#ifdef CONFIG_NETMAP
3022    "netmap|"
3023#endif
3024#ifdef CONFIG_AF_XDP
3025    "af-xdp|"
3026#endif
3027#ifdef CONFIG_VMNET
3028    "vmnet-host|vmnet-shared|vmnet-bridged|"
3029#endif
3030    "socket][,option][,option][,...]\n"
3031    "                old way to initialize a host network interface\n"
3032    "                (use the -netdev option if possible instead)\n", QEMU_ARCH_ALL)
3033SRST
3034``-nic [tap|passt|bridge|user|l2tpv3|vde|netmap|af-xdp|vhost-user|socket][,...][,mac=macaddr][,model=mn]``
3035    This option is a shortcut for configuring both the on-board
3036    (default) guest NIC hardware and the host network backend in one go.
3037    The host backend options are the same as with the corresponding
3038    ``-netdev`` options below. The guest NIC model can be set with
3039    ``model=modelname``. Use ``model=help`` to list the available device
3040    types. The hardware MAC address can be set with ``mac=macaddr``.
3041
3042    The following two example do exactly the same, to show how ``-nic``
3043    can be used to shorten the command line length:
3044
3045    .. parsed-literal::
3046
3047        |qemu_system| -netdev user,id=n1,ipv6=off -device e1000,netdev=n1,mac=52:54:98:76:54:32
3048        |qemu_system| -nic user,ipv6=off,model=e1000,mac=52:54:98:76:54:32
3049
3050``-nic none``
3051    Indicate that no network devices should be configured. It is used to
3052    override the default configuration (default NIC with "user" host
3053    network backend) which is activated if no other networking options
3054    are provided.
3055
3056``-netdev passt,id=str[,option][,...]``
3057    Configure a passt network backend which requires no administrator
3058    privilege to run. Valid options are:
3059
3060    ``id=id``
3061        Assign symbolic name for use in monitor commands.
3062
3063    ``path=file``
3064        Filename of the passt program to run. If it is not provided,
3065        passt command will be started with the help of the PATH environment
3066        variable.
3067
3068    ``quiet=on|off``
3069        By default, ``quiet=on`` to disable informational message from
3070        passt. ``quiet=on`` is passed as ``--quiet`` to passt.
3071
3072    ``vhost-user=on|off``
3073        By default, ``vhost-user=off`` and QEMU uses the stream network
3074        backend to communicate with passt. If ``vhost-user=on``, passt is
3075        started with ``--vhost-user`` and QEMU uses the vhost-user network
3076        backend to communicate with passt.
3077
3078    ``@mtu``
3079        Assign MTU via DHCP/NDP
3080
3081    ``address``
3082        IPv4 or IPv6 address
3083
3084    ``netmask``
3085        IPv4 mask
3086
3087    ``mac``
3088        source MAC address
3089
3090    ``gateway``
3091        IPv4 or IPv6 address as gateway
3092
3093    ``interface``
3094        Interface for addresses and routes
3095
3096    ``outbound``
3097        Bind to address as outbound source
3098
3099    ``outbound-if4``
3100        Bind to outbound interface for IPv4
3101
3102    ``outbound-if6``
3103        Bind to outbound interface for IPv6
3104
3105    ``dns``
3106        IPv4 or IPv6 address as DNS
3107
3108    ``search``
3109        Search domains
3110
3111    ``fqdn``
3112        FQDN to configure client with
3113
3114    ``dhcp-dns``
3115        Enable/disable DNS list in DHCP/DHCPv6/NDP
3116
3117    ``dhcp-search``
3118        Enable/disable list in DHCP/DHCPv6/NDP
3119
3120    ``map-host-loopback``
3121        Addresse to refer to host
3122
3123    ``map-guest-addr``
3124        Addr to translate to guest's address
3125
3126    ``dns-forward``
3127        Forward DNS queries sent to
3128
3129    ``dns-host``
3130        Host nameserver to direct queries to
3131
3132    ``tcp``
3133        Enable/disable TCP
3134
3135    ``udp``
3136        Enable/disable UDP
3137
3138    ``icmp``
3139        Enable/disable ICMP
3140
3141    ``dhcp``
3142        Enable/disable DHCP
3143
3144    ``ndp``
3145        Enable/disable NDP
3146
3147    ``dhcpv6``
3148        Enable/disable DHCPv6
3149
3150    ``ra``
3151        Enable/disable route advertisements
3152
3153    ``freebind``
3154        Bind to any address for forwarding
3155
3156    ``ipv4``
3157        Enable/disable IPv4
3158
3159    ``ipv6``
3160        Enable/disable IPv6
3161
3162    ``tcp-ports``
3163        TCP ports to forward
3164
3165    ``udp-ports``
3166        UDP ports to forward
3167
3168    ``param=string``
3169         ``string`` will be passed to passt has a command line parameter,
3170         we can have multiple occurences of the ``param`` parameter to
3171         pass multiple parameters to passt.
3172
3173         For instance, to pass ``--trace --log=trace.log``:
3174
3175    .. parsed-literal::
3176
3177        |qemu_system| -nic passt,param=--trace,param=--log=trace.log
3178
3179``-netdev user,id=id[,option][,option][,...]``
3180    Configure user mode host network backend which requires no
3181    administrator privilege to run. Valid options are:
3182
3183    ``id=id``
3184        Assign symbolic name for use in monitor commands.
3185
3186    ``ipv4=on|off and ipv6=on|off``
3187        Specify that either IPv4 or IPv6 must be enabled. If neither is
3188        specified both protocols are enabled.
3189
3190    ``net=addr[/mask]``
3191        Set IP network address the guest will see. Optionally specify
3192        the netmask, either in the form a.b.c.d or as number of valid
3193        top-most bits. Default is 10.0.2.0/24.
3194
3195    ``host=addr``
3196        Specify the guest-visible address of the host. Default is the
3197        2nd IP in the guest network, i.e. x.x.x.2.
3198
3199    ``ipv6-net=addr[/int]``
3200        Set IPv6 network address the guest will see (default is
3201        fec0::/64). The network prefix is given in the usual hexadecimal
3202        IPv6 address notation. The prefix size is optional, and is given
3203        as the number of valid top-most bits (default is 64).
3204
3205    ``ipv6-host=addr``
3206        Specify the guest-visible IPv6 address of the host. Default is
3207        the 2nd IPv6 in the guest network, i.e. xxxx::2.
3208
3209    ``restrict=on|off``
3210        If this option is enabled, the guest will be isolated, i.e. it
3211        will not be able to contact the host and no guest IP packets
3212        will be routed over the host to the outside. This option does
3213        not affect any explicitly set forwarding rules.
3214
3215    ``hostname=name``
3216        Specifies the client hostname reported by the built-in DHCP
3217        server.
3218
3219    ``dhcpstart=addr``
3220        Specify the first of the 16 IPs the built-in DHCP server can
3221        assign. Default is the 15th to 31st IP in the guest network,
3222        i.e. x.x.x.15 to x.x.x.31.
3223
3224    ``dns=addr``
3225        Specify the guest-visible address of the virtual nameserver. The
3226        address must be different from the host address. Default is the
3227        3rd IP in the guest network, i.e. x.x.x.3.
3228
3229    ``ipv6-dns=addr``
3230        Specify the guest-visible address of the IPv6 virtual
3231        nameserver. The address must be different from the host address.
3232        Default is the 3rd IP in the guest network, i.e. xxxx::3.
3233
3234    ``dnssearch=domain``
3235        Provides an entry for the domain-search list sent by the
3236        built-in DHCP server. More than one domain suffix can be
3237        transmitted by specifying this option multiple times. If
3238        supported, this will cause the guest to automatically try to
3239        append the given domain suffix(es) in case a domain name can not
3240        be resolved.
3241
3242        Example:
3243
3244        .. parsed-literal::
3245
3246            |qemu_system| -nic user,dnssearch=mgmt.example.org,dnssearch=example.org
3247
3248    ``domainname=domain``
3249        Specifies the client domain name reported by the built-in DHCP
3250        server.
3251
3252    ``tftp=dir``
3253        When using the user mode network stack, activate a built-in TFTP
3254        server. The files in dir will be exposed as the root of a TFTP
3255        server. The TFTP client on the guest must be configured in
3256        binary mode (use the command ``bin`` of the Unix TFTP client).
3257        The built-in TFTP server is read-only; it does not implement any
3258        command for writing files. QEMU will not write to this directory.
3259
3260    ``tftp-server-name=name``
3261        In BOOTP reply, broadcast name as the "TFTP server name"
3262        (RFC2132 option 66). This can be used to advise the guest to
3263        load boot files or configurations from a different server than
3264        the host address.
3265
3266    ``bootfile=file``
3267        When using the user mode network stack, broadcast file as the
3268        BOOTP filename. In conjunction with ``tftp``, this can be used
3269        to network boot a guest from a local directory.
3270
3271        Example (using pxelinux):
3272
3273        .. parsed-literal::
3274
3275            |qemu_system| -hda linux.img -boot n -device e1000,netdev=n1 \\
3276                -netdev user,id=n1,tftp=/path/to/tftp/files,bootfile=/pxelinux.0
3277
3278    ``smb=dir[,smbserver=addr]``
3279        When using the user mode network stack, activate a built-in SMB
3280        server so that Windows OSes can access to the host files in
3281        ``dir`` transparently. The IP address of the SMB server can be
3282        set to addr. By default the 4th IP in the guest network is used,
3283        i.e. x.x.x.4.
3284
3285        In the guest Windows OS, the line:
3286
3287        ::
3288
3289            10.0.2.4 smbserver
3290
3291        must be added in the file ``C:\WINDOWS\LMHOSTS`` (for windows
3292        9x/Me) or ``C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS`` (Windows
3293        NT/2000).
3294
3295        Then ``dir`` can be accessed in ``\\smbserver\qemu``.
3296
3297        Note that a SAMBA server must be installed on the host OS.
3298
3299    ``hostfwd=[tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport``
3300        Redirect incoming TCP or UDP connections to the host port
3301        hostport to the guest IP address guestaddr on guest port
3302        guestport. If guestaddr is not specified, its value is x.x.x.15
3303        (default first address given by the built-in DHCP server). By
3304        specifying hostaddr, the rule can be bound to a specific host
3305        interface. If no connection type is set, TCP is used. This
3306        option can be given multiple times.
3307
3308        For example, to redirect host X11 connection from screen 1 to
3309        guest screen 0, use the following:
3310
3311        .. parsed-literal::
3312
3313            # on the host
3314            |qemu_system| -nic user,hostfwd=tcp:127.0.0.1:6001-:6000
3315            # this host xterm should open in the guest X11 server
3316            xterm -display :1
3317
3318        To redirect telnet connections from host port 5555 to telnet
3319        port on the guest, use the following:
3320
3321        .. parsed-literal::
3322
3323            # on the host
3324            |qemu_system| -nic user,hostfwd=tcp::5555-:23
3325            telnet localhost 5555
3326
3327        Then when you use on the host ``telnet localhost 5555``, you
3328        connect to the guest telnet server.
3329
3330    ``guestfwd=[tcp]:server:port-dev``; \ ``guestfwd=[tcp]:server:port-cmd:command``
3331        Forward guest TCP connections to the IP address server on port
3332        port to the character device dev or to a program executed by
3333        cmd:command which gets spawned for each connection. This option
3334        can be given multiple times.
3335
3336        You can either use a chardev directly and have that one used
3337        throughout QEMU's lifetime, like in the following example:
3338
3339        .. parsed-literal::
3340
3341            # open 10.10.1.1:4321 on bootup, connect 10.0.2.100:1234 to it whenever
3342            # the guest accesses it
3343            |qemu_system| -nic user,guestfwd=tcp:10.0.2.100:1234-tcp:10.10.1.1:4321
3344
3345        Or you can execute a command on every TCP connection established
3346        by the guest, so that QEMU behaves similar to an inetd process
3347        for that virtual server:
3348
3349        .. parsed-literal::
3350
3351            # call "netcat 10.10.1.1 4321" on every TCP connection to 10.0.2.100:1234
3352            # and connect the TCP stream to its stdin/stdout
3353            |qemu_system| -nic  'user,id=n1,guestfwd=tcp:10.0.2.100:1234-cmd:netcat 10.10.1.1 4321'
3354
3355``-netdev tap,id=id[,fd=h][,ifname=name][,script=file][,downscript=dfile][,br=bridge][,helper=helper]``
3356    Configure a host TAP network backend with ID id.
3357
3358    Use the network script file to configure it and the network script
3359    dfile to deconfigure it. If name is not provided, the OS
3360    automatically provides one. The default network configure script is
3361    ``/etc/qemu-ifup`` and the default network deconfigure script is
3362    ``/etc/qemu-ifdown``. Use ``script=no`` or ``downscript=no`` to
3363    disable script execution.
3364
3365    If running QEMU as an unprivileged user, use the network helper
3366    to configure the TAP interface and attach it to the bridge.
3367    The default network helper executable is
3368    ``/path/to/qemu-bridge-helper`` and the default bridge device is
3369    ``br0``.
3370
3371    ``fd``\ =h can be used to specify the handle of an already opened
3372    host TAP interface.
3373
3374    Examples:
3375
3376    .. parsed-literal::
3377
3378        #launch a QEMU instance with the default network script
3379        |qemu_system| linux.img -nic tap
3380
3381    .. parsed-literal::
3382
3383        #launch a QEMU instance with two NICs, each one connected
3384        #to a TAP device
3385        |qemu_system| linux.img \\
3386                -netdev tap,id=nd0,ifname=tap0 -device e1000,netdev=nd0 \\
3387                -netdev tap,id=nd1,ifname=tap1 -device rtl8139,netdev=nd1
3388
3389    .. parsed-literal::
3390
3391        #launch a QEMU instance with the default network helper to
3392        #connect a TAP device to bridge br0
3393        |qemu_system| linux.img -device virtio-net-pci,netdev=n1 \\
3394                -netdev tap,id=n1,"helper=/path/to/qemu-bridge-helper"
3395
3396``-netdev bridge,id=id[,br=bridge][,helper=helper]``
3397    Connect a host TAP network interface to a host bridge device.
3398
3399    Use the network helper helper to configure the TAP interface and
3400    attach it to the bridge. The default network helper executable is
3401    ``/path/to/qemu-bridge-helper`` and the default bridge device is
3402    ``br0``.
3403
3404    Examples:
3405
3406    .. parsed-literal::
3407
3408        #launch a QEMU instance with the default network helper to
3409        #connect a TAP device to bridge br0
3410        |qemu_system| linux.img -netdev bridge,id=n1 -device virtio-net,netdev=n1
3411
3412    .. parsed-literal::
3413
3414        #launch a QEMU instance with the default network helper to
3415        #connect a TAP device to bridge qemubr0
3416        |qemu_system| linux.img -netdev bridge,br=qemubr0,id=n1 -device virtio-net,netdev=n1
3417
3418``-netdev socket,id=id[,fd=h][,listen=[host]:port][,connect=host:port]``
3419    This host network backend can be used to connect the guest's network
3420    to another QEMU virtual machine using a TCP socket connection. If
3421    ``listen`` is specified, QEMU waits for incoming connections on port
3422    (host is optional). ``connect`` is used to connect to another QEMU
3423    instance using the ``listen`` option. ``fd``\ =h specifies an
3424    already opened TCP socket.
3425
3426    Example:
3427
3428    .. parsed-literal::
3429
3430        # launch a first QEMU instance
3431        |qemu_system| linux.img \\
3432                         -device e1000,netdev=n1,mac=52:54:00:12:34:56 \\
3433                         -netdev socket,id=n1,listen=:1234
3434        # connect the network of this instance to the network of the first instance
3435        |qemu_system| linux.img \\
3436                         -device e1000,netdev=n2,mac=52:54:00:12:34:57 \\
3437                         -netdev socket,id=n2,connect=127.0.0.1:1234
3438
3439``-netdev socket,id=id[,fd=h][,mcast=maddr:port[,localaddr=addr]]``
3440    Configure a socket host network backend to share the guest's network
3441    traffic with another QEMU virtual machines using a UDP multicast
3442    socket, effectively making a bus for every QEMU with same multicast
3443    address maddr and port. NOTES:
3444
3445    1. Several QEMU can be running on different hosts and share same bus
3446       (assuming correct multicast setup for these hosts).
3447
3448    2. mcast support is compatible with User Mode Linux (argument
3449       ``ethN=mcast``), see http://user-mode-linux.sf.net.
3450
3451    3. Use ``fd=h`` to specify an already opened UDP multicast socket.
3452
3453    Example:
3454
3455    .. parsed-literal::
3456
3457        # launch one QEMU instance
3458        |qemu_system| linux.img \\
3459                         -device e1000,netdev=n1,mac=52:54:00:12:34:56 \\
3460                         -netdev socket,id=n1,mcast=230.0.0.1:1234
3461        # launch another QEMU instance on same "bus"
3462        |qemu_system| linux.img \\
3463                         -device e1000,netdev=n2,mac=52:54:00:12:34:57 \\
3464                         -netdev socket,id=n2,mcast=230.0.0.1:1234
3465        # launch yet another QEMU instance on same "bus"
3466        |qemu_system| linux.img \\
3467                         -device e1000,netdev=n3,mac=52:54:00:12:34:58 \\
3468                         -netdev socket,id=n3,mcast=230.0.0.1:1234
3469
3470    Example (User Mode Linux compat.):
3471
3472    .. parsed-literal::
3473
3474        # launch QEMU instance (note mcast address selected is UML's default)
3475        |qemu_system| linux.img \\
3476                         -device e1000,netdev=n1,mac=52:54:00:12:34:56 \\
3477                         -netdev socket,id=n1,mcast=239.192.168.1:1102
3478        # launch UML
3479        /path/to/linux ubd0=/path/to/root_fs eth0=mcast
3480
3481    Example (send packets from host's 1.2.3.4):
3482
3483    .. parsed-literal::
3484
3485        |qemu_system| linux.img \\
3486                         -device e1000,netdev=n1,mac=52:54:00:12:34:56 \\
3487                         -netdev socket,id=n1,mcast=239.192.168.1:1102,localaddr=1.2.3.4
3488
3489``-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-ms=milliseconds]``
3490    Configure a network backend to connect to another QEMU virtual machine or a proxy using a TCP/IP socket.
3491
3492    ``server=on|off``
3493        if ``on`` create a server socket
3494
3495    ``addr.host=host,addr.port=port``
3496        socket address to listen on (server=on) or connect to (server=off)
3497
3498    ``to=maxport``
3499        if present, this is range of possible addresses, with port between ``port`` and ``maxport``.
3500
3501    ``numeric=on|off``
3502        if ``on`` ``host`` and ``port`` are guaranteed to be numeric, otherwise a name resolution should be attempted (default: ``off``)
3503
3504    ``keep-alive=on|off``
3505        enable keep-alive when connecting to this socket.  Not supported for passive sockets.
3506
3507    ``mptcp=on|off``
3508        enable multipath TCP
3509
3510    ``ipv4=on|off``
3511        whether to accept IPv4 addresses, default to try both IPv4 and IPv6
3512
3513    ``ipv6=on|off``
3514        whether to accept IPv6 addresses, default to try both IPv4 and IPv6
3515
3516    ``reconnect-ms=milliseconds``
3517        for a client socket, if a socket is disconnected, then attempt a reconnect after the given number of milliseconds.
3518        Setting this to zero disables this function.  (default: 0)
3519
3520    Example (two guests connected using a TCP/IP socket):
3521
3522    .. parsed-literal::
3523
3524        # first VM
3525        |qemu_system| linux.img \\
3526                      -device virtio-net,netdev=net0,mac=52:54:00:12:34:56 \\
3527                      -netdev stream,id=net0,server=on,addr.type=inet,addr.host=localhost,addr.port=1234
3528        # second VM
3529        |qemu_system| linux.img \\
3530                      -device virtio-net,netdev=net0,mac=52:54:00:12:34:57 \\
3531                      -netdev stream,id=net0,server=off,addr.type=inet,addr.host=localhost,addr.port=1234,reconnect-ms=5000
3532
3533``-netdev stream,id=str[,server=on|off],addr.type=unix,addr.path=path[,abstract=on|off][,tight=on|off][,reconnect-ms=milliseconds]``
3534    Configure a network backend to connect to another QEMU virtual machine or a proxy using a stream oriented unix domain socket.
3535
3536    ``server=on|off``
3537        if ``on`` create a server socket
3538
3539    ``addr.path=path``
3540        filesystem path to use
3541
3542    ``abstract=on|off``
3543        if ``on``, this is a Linux abstract socket address.
3544
3545    ``tight=on|off``
3546        if false, pad an abstract socket address with enough null bytes to make it fill struct sockaddr_un member sun_path.
3547
3548    ``reconnect-ms=milliseconds``
3549        for a client socket, if a socket is disconnected, then attempt a reconnect after the given number of milliseconds.
3550        Setting this to zero disables this function.  (default: 0)
3551
3552    Example (using passt as a replacement of -netdev user):
3553
3554    .. parsed-literal::
3555
3556        # start passt server as a non privileged user
3557        passt
3558        UNIX domain socket bound at /tmp/passt_1.socket
3559        # start QEMU to connect to passt
3560        |qemu_system| linux.img \\
3561                      -device virtio-net,netdev=net0 \\
3562                      -netdev stream,id=net0,server=off,addr.type=unix,addr.path=/tmp/passt_1.socket
3563
3564    Example (two guests connected using a stream oriented unix domain socket):
3565
3566    .. parsed-literal::
3567
3568        # first VM
3569        |qemu_system| linux.img \\
3570                      -device virtio-net,netdev=net0,mac=52:54:00:12:34:56 \\
3571                      netdev stream,id=net0,server=on,addr.type=unix,addr.path=/tmp/qemu0
3572        # second VM
3573        |qemu_system| linux.img \\
3574                      -device virtio-net,netdev=net0,mac=52:54:00:12:34:57 \\
3575                      -netdev stream,id=net0,server=off,addr.type=unix,addr.path=/tmp/qemu0,reconnect-ms=5000
3576
3577``-netdev stream,id=str[,server=on|off],addr.type=fd,addr.str=file-descriptor[,reconnect-ms=milliseconds]``
3578    Configure a network backend to connect to another QEMU virtual machine or a proxy using a stream oriented socket file descriptor.
3579
3580    ``server=on|off``
3581        if ``on`` create a server socket
3582
3583    ``addr.str=file-descriptor``
3584        file descriptor number to use as a socket
3585
3586    ``reconnect-ms=milliseconds``
3587        for a client socket, if a socket is disconnected, then attempt a reconnect after the given number of milliseconds.
3588        Setting this to zero disables this function.  (default: 0)
3589
3590``-netdev dgram,id=str,remote.type=inet,remote.host=maddr,remote.port=port[,local.type=inet,local.host=addr]``
3591    Configure a network backend to connect to a multicast address.
3592
3593    ``remote.host=maddr,remote.port=port``
3594        multicast address
3595
3596    ``local.host=addr``
3597        specify the host address to send packets from
3598
3599    Example:
3600
3601    .. parsed-literal::
3602
3603        # launch one QEMU instance
3604        |qemu_system| linux.img \\
3605                      -device virtio-net,netdev=net0,mac=52:54:00:12:34:56 \\
3606                      -netdev dgram,id=net0,remote.type=inet,remote.host=224.0.0.1,remote.port=1234
3607        # launch another QEMU instance on same "bus"
3608        |qemu_system| linux.img \\
3609                      -device virtio-net,netdev=net0,mac=52:54:00:12:34:57 \\
3610                      -netdev dgram,id=net0,remote.type=inet,remote.host=224.0.0.1,remote.port=1234
3611        # launch yet another QEMU instance on same "bus"
3612        |qemu_system| linux.img \\
3613                      -device virtio-net,netdev=net0,mac=52:54:00:12:34:58 \\
3614                      -netdev dgram,id=net0,remote.type=inet,remote.host=224.0.0.1,remote.port=1234
3615
3616``-netdev dgram,id=str,remote.type=inet,remote.host=maddr,remote.port=port[,local.type=fd,local.str=file-descriptor]``
3617    Configure a network backend to connect to a multicast address using a UDP socket file descriptor.
3618
3619    ``remote.host=maddr,remote.port=port``
3620        multicast address
3621
3622    ``local.str=file-descriptor``
3623        File descriptor to use to send packets
3624
3625``-netdev dgram,id=str,local.type=inet,local.host=addr,local.port=port[,remote.type=inet,remote.host=addr,remote.port=port]``
3626    Configure a network backend to connect to another QEMU virtual
3627    machine or a proxy using a datagram oriented unix domain socket.
3628
3629    ``local.host=addr,local.port=port``
3630        IP address to use to send the packets from
3631
3632    ``remote.host=addr,remote.port=port``
3633        Destination IP address
3634
3635    Example (two guests connected using an UDP/IP socket):
3636
3637    .. parsed-literal::
3638
3639        # first VM
3640        |qemu_system| linux.img \\
3641                      -device virtio-net,netdev=net0,mac=52:54:00:12:34:56 \\
3642                      -netdev dgram,id=net0,local.type=inet,local.host=localhost,local.port=1234,remote.type=inet,remote.host=localhost,remote.port=1235
3643        # second VM
3644        |qemu_system| linux.img \\
3645                      -device virtio-net,netdev=net0,mac=52:54:00:12:34:56 \\
3646                      -netdev dgram,id=net0,local.type=inet,local.host=localhost,local.port=1235,remote.type=inet,remote.host=localhost,remote.port=1234
3647
3648``-netdev dgram,id=str,local.type=unix,local.path=path[,remote.type=unix,remote.path=path]``
3649    Configure a network backend to connect to another QEMU virtual
3650    machine or a proxy using a datagram oriented unix socket.
3651
3652    ``local.path=path``
3653        filesystem path to use to bind the socket
3654
3655    ``remote.path=path``
3656        filesystem path to use as a destination (see sendto(2))
3657
3658    Example (two guests connected using an UDP/UNIX socket):
3659
3660    .. parsed-literal::
3661
3662        # first VM
3663        |qemu_system| linux.img \\
3664                      -device virtio-net,netdev=net0,mac=52:54:00:12:34:56 \\
3665                      -netdev dgram,id=net0,local.type=unix,local.path=/tmp/qemu0,remote.type=unix,remote.path=/tmp/qemu1
3666        # second VM
3667        |qemu_system| linux.img \\
3668                      -device virtio-net,netdev=net0,mac=52:54:00:12:34:57 \\
3669                      -netdev dgram,id=net0,local.type=unix,local.path=/tmp/qemu1,remote.type=unix,remote.path=/tmp/qemu0
3670
3671``-netdev dgram,id=str,local.type=fd,local.str=file-descriptor``
3672    Configure a network backend to connect to another QEMU virtual
3673    machine or a proxy using a datagram oriented socket file descriptor.
3674
3675    ``local.str=file-descriptor``
3676        File descriptor to use to send packets
3677
3678``-netdev l2tpv3,id=id,src=srcaddr,dst=dstaddr[,srcport=srcport][,dstport=dstport],txsession=txsession[,rxsession=rxsession][,ipv6=on|off][,udp=on|off][,cookie64=on|off][,counter=on|off][,pincounter=on|off][,txcookie=txcookie][,rxcookie=rxcookie][,offset=offset]``
3679    Configure a L2TPv3 pseudowire host network backend. L2TPv3 (RFC3931)
3680    is a popular protocol to transport Ethernet (and other Layer 2) data
3681    frames between two systems. It is present in routers, firewalls and
3682    the Linux kernel (from version 3.3 onwards).
3683
3684    This transport allows a VM to communicate to another VM, router or
3685    firewall directly.
3686
3687    ``src=srcaddr``
3688        source address (mandatory)
3689
3690    ``dst=dstaddr``
3691        destination address (mandatory)
3692
3693    ``udp=on``
3694        select udp encapsulation (default is ip).
3695
3696    ``srcport=srcport``
3697        source udp port.
3698
3699    ``dstport=dstport``
3700        destination udp port.
3701
3702    ``ipv6=on``
3703        force v6, otherwise defaults to v4.
3704
3705    ``rxcookie=rxcookie``; \ ``txcookie=txcookie``
3706        Cookies are a weak form of security in the l2tpv3 specification.
3707        Their function is mostly to prevent misconfiguration. By default
3708        they are 32 bit.
3709
3710    ``cookie64=on``
3711        Set cookie size to 64 bit instead of the default 32
3712
3713    ``counter=off``
3714        Force a 'cut-down' L2TPv3 with no counter as in
3715        draft-mkonstan-l2tpext-keyed-ipv6-tunnel-00
3716
3717    ``pincounter=on``
3718        Work around broken counter handling in peer. This may also help
3719        on networks which have packet reorder.
3720
3721    ``offset=offset``
3722        Add an extra offset between header and data
3723
3724    For example, to attach a VM running on host 4.3.2.1 via L2TPv3 to
3725    the bridge br-lan on the remote Linux host 1.2.3.4:
3726
3727    .. parsed-literal::
3728
3729        # Setup tunnel on linux host using raw ip as encapsulation
3730        # on 1.2.3.4
3731        ip l2tp add tunnel remote 4.3.2.1 local 1.2.3.4 tunnel_id 1 peer_tunnel_id 1 \\
3732            encap udp udp_sport 16384 udp_dport 16384
3733        ip l2tp add session tunnel_id 1 name vmtunnel0 session_id \\
3734            0xFFFFFFFF peer_session_id 0xFFFFFFFF
3735        ifconfig vmtunnel0 mtu 1500
3736        ifconfig vmtunnel0 up
3737        brctl addif br-lan vmtunnel0
3738
3739
3740        # on 4.3.2.1
3741        # launch QEMU instance - if your network has reorder or is very lossy add ,pincounter
3742
3743        |qemu_system| linux.img -device e1000,netdev=n1 \\
3744            -netdev l2tpv3,id=n1,src=4.2.3.1,dst=1.2.3.4,udp=on,srcport=16384,dstport=16384,rxsession=0xffffffff,txsession=0xffffffff,counter=on
3745
3746``-netdev vde,id=id[,sock=socketpath][,port=n][,group=groupname][,mode=octalmode]``
3747    Configure VDE backend to connect to PORT n of a vde switch running
3748    on host and listening for incoming connections on socketpath. Use
3749    GROUP groupname and MODE octalmode to change default ownership and
3750    permissions for communication port. This option is only available if
3751    QEMU has been compiled with vde support enabled.
3752
3753    Example:
3754
3755    .. parsed-literal::
3756
3757        # launch vde switch
3758        vde_switch -F -sock /tmp/myswitch
3759        # launch QEMU instance
3760        |qemu_system| linux.img -nic vde,sock=/tmp/myswitch
3761
3762``-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]``
3763    Configure AF_XDP backend to connect to a network interface 'name'
3764    using AF_XDP socket.  A specific program attach mode for a default
3765    XDP program can be forced with 'mode', defaults to best-effort,
3766    where the likely most performant mode will be in use.  Number of queues
3767    'n' should generally match the number or queues in the interface,
3768    defaults to 1.  Traffic arriving on non-configured device queues will
3769    not be delivered to the network backend.
3770
3771    .. parsed-literal::
3772
3773        # set number of queues to 4
3774        ethtool -L eth0 combined 4
3775        # launch QEMU instance
3776        |qemu_system| linux.img -device virtio-net-pci,netdev=n1 \\
3777            -netdev af-xdp,id=n1,ifname=eth0,queues=4
3778
3779    'start-queue' option can be specified if a particular range of queues
3780    [m, m + n] should be in use.  For example, this is may be necessary in
3781    order to use certain NICs in native mode.  Kernel allows the driver to
3782    create a separate set of XDP queues on top of regular ones, and only
3783    these queues can be used for AF_XDP sockets.  NICs that work this way
3784    may also require an additional traffic redirection with ethtool to these
3785    special queues.
3786
3787    .. parsed-literal::
3788
3789        # set number of queues to 1
3790        ethtool -L eth0 combined 1
3791        # redirect all the traffic to the second queue (id: 1)
3792        # note: drivers may require non-empty key/mask pair.
3793        ethtool -N eth0 flow-type ether \\
3794            dst 00:00:00:00:00:00 m FF:FF:FF:FF:FF:FE action 1
3795        ethtool -N eth0 flow-type ether \\
3796            dst 00:00:00:00:00:01 m FF:FF:FF:FF:FF:FE action 1
3797        # launch QEMU instance
3798        |qemu_system| linux.img -device virtio-net-pci,netdev=n1 \\
3799            -netdev af-xdp,id=n1,ifname=eth0,queues=1,start-queue=1
3800
3801    XDP program can also be loaded externally.  In this case 'inhibit' option
3802    should be set to 'on' and 'sock-fds' provided with file descriptors for
3803    already open but not bound XDP sockets already added to a socket map for
3804    corresponding queues.  One socket per queue.
3805
3806    .. parsed-literal::
3807
3808        |qemu_system| linux.img -device virtio-net-pci,netdev=n1 \\
3809            -netdev af-xdp,id=n1,ifname=eth0,queues=3,inhibit=on,sock-fds=15:16:17
3810
3811``-netdev vhost-user,chardev=id[,vhostforce=on|off][,queues=n]``
3812    Establish a vhost-user netdev, backed by a chardev id. The chardev
3813    should be a unix domain socket backed one. The vhost-user uses a
3814    specifically defined protocol to pass vhost ioctl replacement
3815    messages to an application on the other end of the socket. On
3816    non-MSIX guests, the feature can be forced with vhostforce. Use
3817    'queues=n' to specify the number of queues to be created for
3818    multiqueue vhost-user.
3819
3820    Example:
3821
3822    ::
3823
3824        qemu -m 512 -object memory-backend-file,id=mem,size=512M,mem-path=/hugetlbfs,share=on \
3825             -numa node,memdev=mem \
3826             -chardev socket,id=chr0,path=/path/to/socket \
3827             -netdev type=vhost-user,id=net0,chardev=chr0 \
3828             -device virtio-net-pci,netdev=net0
3829
3830``-netdev vhost-vdpa[,vhostdev=/path/to/dev][,vhostfd=h]``
3831    Establish a vhost-vdpa netdev.
3832
3833    vDPA device is a device that uses a datapath which complies with
3834    the virtio specifications with a vendor specific control path.
3835    vDPA devices can be both physically located on the hardware or
3836    emulated by software.
3837
3838``-netdev hubport,id=id,hubid=hubid[,netdev=nd]``
3839    Create a hub port on the emulated hub with ID hubid.
3840
3841    The hubport netdev lets you connect a NIC to a QEMU emulated hub
3842    instead of a single netdev. Alternatively, you can also connect the
3843    hubport to another netdev with ID nd by using the ``netdev=nd``
3844    option.
3845
3846``-net nic[,netdev=nd][,macaddr=mac][,model=type] [,name=name][,addr=addr][,vectors=v]``
3847    Legacy option to configure or create an on-board (or machine
3848    default) Network Interface Card(NIC) and connect it either to the
3849    emulated hub with ID 0 (i.e. the default hub), or to the netdev nd.
3850    If model is omitted, then the default NIC model associated with the
3851    machine type is used. Note that the default NIC model may change in
3852    future QEMU releases, so it is highly recommended to always specify
3853    a model. Optionally, the MAC address can be changed to mac, the
3854    device address set to addr (PCI cards only), and a name can be
3855    assigned for use in monitor commands. Optionally, for PCI cards, you
3856    can specify the number v of MSI-X vectors that the card should have;
3857    this option currently only affects virtio cards; set v = 0 to
3858    disable MSI-X. If no ``-net`` option is specified, a single NIC is
3859    created. QEMU can emulate several different models of network card.
3860    Use ``-net nic,model=help`` for a list of available devices for your
3861    target.
3862
3863``-net user|passt|tap|bridge|socket|l2tpv3|vde[,...][,name=name]``
3864    Configure a host network backend (with the options corresponding to
3865    the same ``-netdev`` option) and connect it to the emulated hub 0
3866    (the default hub). Use name to specify the name of the hub port.
3867ERST
3868
3869DEFHEADING()
3870
3871DEFHEADING(Character device options:)
3872
3873DEF("chardev", HAS_ARG, QEMU_OPTION_chardev,
3874    "-chardev help\n"
3875    "-chardev null,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
3876    "-chardev socket,id=id[,host=host],port=port[,to=to][,ipv4=on|off][,ipv6=on|off][,nodelay=on|off]\n"
3877    "         [,server=on|off][,wait=on|off][,telnet=on|off][,websocket=on|off][,reconnect-ms=milliseconds][,mux=on|off]\n"
3878    "         [,logfile=PATH][,logappend=on|off][,tls-creds=ID][,tls-authz=ID] (tcp)\n"
3879    "-chardev socket,id=id,path=path[,server=on|off][,wait=on|off][,telnet=on|off][,websocket=on|off][,reconnect-ms=milliseconds]\n"
3880    "         [,mux=on|off][,logfile=PATH][,logappend=on|off][,abstract=on|off][,tight=on|off] (unix)\n"
3881    "-chardev udp,id=id[,host=host],port=port[,localaddr=localaddr]\n"
3882    "         [,localport=localport][,ipv4=on|off][,ipv6=on|off][,mux=on|off]\n"
3883    "         [,logfile=PATH][,logappend=on|off]\n"
3884    "-chardev msmouse,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
3885    "-chardev vc,id=id[[,width=width][,height=height]][[,cols=cols][,rows=rows]]\n"
3886    "         [,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
3887    "-chardev ringbuf,id=id[,size=size][,logfile=PATH][,logappend=on|off]\n"
3888    "-chardev file,id=id,path=path[,input-path=input-file][,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
3889    "-chardev pipe,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
3890#ifdef _WIN32
3891    "-chardev console,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
3892    "-chardev serial,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
3893#else
3894    "-chardev pty,id=id[,path=path][,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
3895    "-chardev stdio,id=id[,mux=on|off][,signal=on|off][,logfile=PATH][,logappend=on|off]\n"
3896#endif
3897#ifdef CONFIG_BRLAPI
3898    "-chardev braille,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
3899#endif
3900#if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \
3901        || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
3902    "-chardev serial,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
3903#endif
3904#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__)
3905    "-chardev parallel,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
3906#endif
3907#if defined(CONFIG_SPICE)
3908    "-chardev spicevmc,id=id,name=name[,debug=debug][,logfile=PATH][,logappend=on|off]\n"
3909    "-chardev spiceport,id=id,name=name[,debug=debug][,logfile=PATH][,logappend=on|off]\n"
3910#endif
3911    , QEMU_ARCH_ALL
3912)
3913
3914SRST
3915The general form of a character device option is:
3916
3917``-chardev backend,id=id[,mux=on|off][,options]``
3918    Backend is one of: ``null``, ``socket``, ``udp``, ``msmouse``, ``hub``,
3919    ``vc``, ``ringbuf``, ``file``, ``pipe``, ``console``, ``serial``,
3920    ``pty``, ``stdio``, ``braille``, ``parallel``,
3921    ``spicevmc``, ``spiceport``. The specific backend will determine the
3922    applicable options.
3923
3924    Use ``-chardev help`` to print all available chardev backend types.
3925
3926    All devices must have an id, which can be any string up to 127
3927    characters long. It is used to uniquely identify this device in
3928    other command line directives.
3929
3930    A character device may be used in multiplexing mode by multiple
3931    front-ends. Specify ``mux=on`` to enable this mode. A multiplexer is
3932    a "1:N" device, and here the "1" end is your specified chardev
3933    backend, and the "N" end is the various parts of QEMU that can talk
3934    to a chardev. If you create a chardev with ``id=myid`` and
3935    ``mux=on``, QEMU will create a multiplexer with your specified ID,
3936    and you can then configure multiple front ends to use that chardev
3937    ID for their input/output. Up to four different front ends can be
3938    connected to a single multiplexed chardev. (Without multiplexing
3939    enabled, a chardev can only be used by a single front end.) For
3940    instance you could use this to allow a single stdio chardev to be
3941    used by two serial ports and the QEMU monitor:
3942
3943    ::
3944
3945        -chardev stdio,mux=on,id=char0 \
3946        -mon chardev=char0,mode=readline \
3947        -serial chardev:char0 \
3948        -serial chardev:char0
3949
3950    You can have more than one multiplexer in a system configuration;
3951    for instance you could have a TCP port multiplexed between UART 0
3952    and UART 1, and stdio multiplexed between the QEMU monitor and a
3953    parallel port:
3954
3955    ::
3956
3957        -chardev stdio,mux=on,id=char0 \
3958        -mon chardev=char0,mode=readline \
3959        -parallel chardev:char0 \
3960        -chardev tcp,...,mux=on,id=char1 \
3961        -serial chardev:char1 \
3962        -serial chardev:char1
3963
3964    When you're using a multiplexed character device, some escape
3965    sequences are interpreted in the input. See the chapter about
3966    :ref:`keys in the character backend multiplexer` in the
3967    System Emulation Users Guide for more details.
3968
3969    Note that some other command line options may implicitly create
3970    multiplexed character backends; for instance ``-serial mon:stdio``
3971    creates a multiplexed stdio backend connected to the serial port and
3972    the QEMU monitor, and ``-nographic`` also multiplexes the console
3973    and the monitor to stdio.
3974
3975    If you need to aggregate data in the opposite direction (where one
3976    QEMU frontend interface receives input and output from multiple
3977    backend chardev devices), please refer to the paragraph below
3978    regarding chardev ``hub`` aggregator device configuration.
3979
3980    Every backend supports the ``logfile`` option, which supplies the
3981    path to a file to record all data transmitted via the backend. The
3982    ``logappend`` option controls whether the log file will be truncated
3983    or appended to when opened.
3984
3985The available backends are:
3986
3987``-chardev null,id=id``
3988    A void device. This device will not emit any data, and will drop any
3989    data it receives. The null backend does not take any options.
3990
3991``-chardev socket,id=id[,TCP options or unix options][,server=on|off][,wait=on|off][,telnet=on|off][,websocket=on|off][,reconnect-ms=milliseconds][,tls-creds=id][,tls-authz=id]``
3992    Create a two-way stream socket, which can be either a TCP or a unix
3993    socket. A unix socket will be created if ``path`` is specified.
3994    Behaviour is undefined if TCP options are specified for a unix
3995    socket.
3996
3997    ``server=on|off`` specifies that the socket shall be a listening socket.
3998
3999    ``wait=on|off`` specifies that QEMU should not block waiting for a client
4000    to connect to a listening socket.
4001
4002    ``telnet=on|off`` specifies that traffic on the socket should interpret
4003    telnet escape sequences.
4004
4005    ``websocket=on|off`` specifies that the socket uses WebSocket protocol for
4006    communication.
4007
4008    ``reconnect-ms`` sets the timeout for reconnecting on non-server
4009    sockets when the remote end goes away. qemu will delay this many
4010    milliseconds and then attempt to reconnect. Zero disables reconnecting,
4011    and is the default.
4012
4013    ``tls-creds`` requests enablement of the TLS protocol for
4014    encryption, and specifies the id of the TLS credentials to use for
4015    the handshake. The credentials must be previously created with the
4016    ``-object tls-creds`` argument.
4017
4018    ``tls-auth`` provides the ID of the QAuthZ authorization object
4019    against which the client's x509 distinguished name will be
4020    validated. This object is only resolved at time of use, so can be
4021    deleted and recreated on the fly while the chardev server is active.
4022    If missing, it will default to denying access.
4023
4024    TCP and unix socket options are given below:
4025
4026    ``TCP options: port=port[,host=host][,to=to][,ipv4=on|off][,ipv6=on|off][,nodelay=on|off]``
4027        ``host`` for a listening socket specifies the local address to
4028        be bound. For a connecting socket species the remote host to
4029        connect to. ``host`` is optional for listening sockets. If not
4030        specified it defaults to ``0.0.0.0``.
4031
4032        ``port`` for a listening socket specifies the local port to be
4033        bound. For a connecting socket specifies the port on the remote
4034        host to connect to. ``port`` can be given as either a port
4035        number or a service name. ``port`` is required.
4036
4037        ``to`` is only relevant to listening sockets. If it is
4038        specified, and ``port`` cannot be bound, QEMU will attempt to
4039        bind to subsequent ports up to and including ``to`` until it
4040        succeeds. ``to`` must be specified as a port number.
4041
4042        ``ipv4=on|off`` and ``ipv6=on|off`` specify that either IPv4
4043        or IPv6 must be used. If neither is specified the socket may
4044        use either protocol.
4045
4046        ``nodelay=on|off`` disables the Nagle algorithm.
4047
4048    ``unix options: path=path[,abstract=on|off][,tight=on|off]``
4049        ``path`` specifies the local path of the unix socket. ``path``
4050        is required.
4051        ``abstract=on|off`` specifies the use of the abstract socket namespace,
4052        rather than the filesystem.  Optional, defaults to false.
4053        ``tight=on|off`` sets the socket length of abstract sockets to their minimum,
4054        rather than the full sun_path length.  Optional, defaults to true.
4055
4056``-chardev udp,id=id[,host=host],port=port[,localaddr=localaddr][,localport=localport][,ipv4=on|off][,ipv6=on|off]``
4057    Sends all traffic from the guest to a remote host over UDP.
4058
4059    ``host`` specifies the remote host to connect to. If not specified
4060    it defaults to ``localhost``.
4061
4062    ``port`` specifies the port on the remote host to connect to.
4063    ``port`` is required.
4064
4065    ``localaddr`` specifies the local address to bind to. If not
4066    specified it defaults to ``0.0.0.0``.
4067
4068    ``localport`` specifies the local port to bind to. If not specified
4069    any available local port will be used.
4070
4071    ``ipv4=on|off`` and ``ipv6=on|off`` specify that either IPv4 or IPv6 must be used.
4072    If neither is specified the device may use either protocol.
4073
4074``-chardev msmouse,id=id``
4075    Forward QEMU's emulated msmouse events to the guest. ``msmouse``
4076    does not take any options.
4077
4078``-chardev hub,id=id,chardevs.0=id[,chardevs.N=id]``
4079    Explicitly create chardev backend hub device with the possibility
4080    to aggregate input from multiple backend devices and forward it to
4081    a single frontend device. Additionally, ``hub`` device takes the
4082    output from the frontend device and sends it back to all the
4083    connected backend devices. This allows for seamless interaction
4084    between different backend devices and a single frontend
4085    interface. Aggregation supported for up to 4 chardev
4086    devices. (Since 10.0)
4087
4088    For example, the following is a use case of 2 backend devices:
4089    virtual console ``vc0`` and a pseudo TTY ``pty0`` connected to
4090    a single virtio hvc console frontend device with a hub ``hub0``
4091    help. Virtual console renders text to an image, which can be
4092    shared over the VNC protocol. In turn, pty backend provides
4093    bidirectional communication to the virtio hvc console over the
4094    pseudo TTY file. The example configuration can be as follows:
4095
4096    ::
4097
4098       -chardev pty,path=/tmp/pty,id=pty0 \
4099       -chardev vc,id=vc0 \
4100       -chardev hub,id=hub0,chardevs.0=pty0,chardevs.1=vc0 \
4101       -device virtconsole,chardev=hub0 \
4102       -vnc 0.0.0.0:0
4103
4104    Once QEMU starts VNC client and any TTY emulator can be used to
4105    control a single hvc console:
4106
4107    ::
4108
4109       # Start TTY emulator
4110       tio /tmp/pty
4111
4112       # Start VNC client and switch to virtual console Ctrl-Alt-2
4113       vncviewer :0
4114
4115    Several frontend devices is not supported. Stacking of multiplexers
4116    and hub devices is not supported as well.
4117
4118``-chardev vc,id=id[[,width=width][,height=height]][[,cols=cols][,rows=rows]]``
4119    Connect to a QEMU text console. ``vc`` may optionally be given a
4120    specific size.
4121
4122    ``width`` and ``height`` specify the width and height respectively
4123    of the console, in pixels.
4124
4125    ``cols`` and ``rows`` specify that the console be sized to fit a
4126    text console with the given dimensions.
4127
4128``-chardev ringbuf,id=id[,size=size]``
4129    Create a ring buffer with fixed size ``size``. size must be a power
4130    of two and defaults to ``64K``.
4131
4132``-chardev file,id=id,path=path[,input-path=input-path]``
4133    Log all traffic received from the guest to a file.
4134
4135    ``path`` specifies the path of the file to be opened. This file will
4136    be created if it does not already exist, and overwritten if it does.
4137    ``path`` is required.
4138
4139    If ``input-path`` is specified, this is the path of a second file
4140    which will be used for input. If ``input-path`` is not specified,
4141    no input will be available from the chardev.
4142
4143    Note that ``input-path`` is not supported on Windows hosts.
4144
4145``-chardev pipe,id=id,path=path``
4146    Create a two-way connection to the guest. The behaviour differs
4147    slightly between Windows hosts and other hosts:
4148
4149    On Windows, a single duplex pipe will be created at
4150    ``\\.pipe\path``.
4151
4152    On other hosts, 2 pipes will be created called ``path.in`` and
4153    ``path.out``. Data written to ``path.in`` will be received by the
4154    guest. Data written by the guest can be read from ``path.out``. QEMU
4155    will not create these fifos, and requires them to be present.
4156
4157    ``path`` forms part of the pipe path as described above. ``path`` is
4158    required.
4159
4160``-chardev console,id=id``
4161    Send traffic from the guest to QEMU's standard output. ``console``
4162    does not take any options.
4163
4164    ``console`` is only available on Windows hosts.
4165
4166``-chardev serial,id=id,path=path``
4167    Send traffic from the guest to a serial device on the host.
4168
4169    On Unix hosts serial will actually accept any tty device, not only
4170    serial lines.
4171
4172    ``path`` specifies the name of the serial device to open.
4173
4174``-chardev pty,id=id[,path=path]``
4175    Create a new pseudo-terminal on the host and connect to it.
4176
4177    ``pty`` is not available on Windows hosts.
4178
4179    If ``path`` is specified, QEMU will create a symbolic link at
4180    that location which points to the new PTY device.
4181
4182    This avoids having to make QMP or HMP monitor queries to find out
4183    what the new PTY device path is.
4184
4185    Note that while QEMU will remove the symlink when it exits
4186    gracefully, it will not do so in case of crashes or on certain
4187    startup errors. It is recommended that the user checks and removes
4188    the symlink after QEMU terminates to account for this.
4189
4190``-chardev stdio,id=id[,signal=on|off]``
4191    Connect to standard input and standard output of the QEMU process.
4192
4193    ``signal`` controls if signals are enabled on the terminal, that
4194    includes exiting QEMU with the key sequence Control-c. This option
4195    is enabled by default, use ``signal=off`` to disable it.
4196
4197``-chardev braille,id=id``
4198    Connect to a local BrlAPI server. ``braille`` does not take any
4199    options.
4200
4201``-chardev parallel,id=id,path=path``
4202  \
4203    ``parallel`` is only available on Linux, FreeBSD and DragonFlyBSD
4204    hosts.
4205
4206    Connect to a local parallel port.
4207
4208    ``path`` specifies the path to the parallel port device. ``path`` is
4209    required.
4210
4211``-chardev spicevmc,id=id,debug=debug,name=name``
4212    ``spicevmc`` is only available when spice support is built in.
4213
4214    ``debug`` debug level for spicevmc
4215
4216    ``name`` name of spice channel to connect to
4217
4218    Connect to a spice virtual machine channel, such as vdiport.
4219
4220``-chardev spiceport,id=id,debug=debug,name=name``
4221    ``spiceport`` is only available when spice support is built in.
4222
4223    ``debug`` debug level for spicevmc
4224
4225    ``name`` name of spice port to connect to
4226
4227    Connect to a spice port, allowing a Spice client to handle the
4228    traffic identified by a name (preferably a fqdn).
4229ERST
4230
4231DEFHEADING()
4232
4233#ifdef CONFIG_TPM
4234DEFHEADING(TPM device options:)
4235
4236DEF("tpmdev", HAS_ARG, QEMU_OPTION_tpmdev, \
4237    "-tpmdev passthrough,id=id[,path=path][,cancel-path=path]\n"
4238    "                use path to provide path to a character device; default is /dev/tpm0\n"
4239    "                use cancel-path to provide path to TPM's cancel sysfs entry; if\n"
4240    "                not provided it will be searched for in /sys/class/misc/tpm?/device\n"
4241    "-tpmdev emulator,id=id,chardev=dev\n"
4242    "                configure the TPM device using chardev backend\n",
4243    QEMU_ARCH_ALL)
4244SRST
4245The general form of a TPM device option is:
4246
4247``-tpmdev backend,id=id[,options]``
4248    The specific backend type will determine the applicable options. The
4249    ``-tpmdev`` option creates the TPM backend and requires a
4250    ``-device`` option that specifies the TPM frontend interface model.
4251
4252    Use ``-tpmdev help`` to print all available TPM backend types.
4253
4254The available backends are:
4255
4256``-tpmdev passthrough,id=id,path=path,cancel-path=cancel-path``
4257    (Linux-host only) Enable access to the host's TPM using the
4258    passthrough driver.
4259
4260    ``path`` specifies the path to the host's TPM device, i.e., on a
4261    Linux host this would be ``/dev/tpm0``. ``path`` is optional and by
4262    default ``/dev/tpm0`` is used.
4263
4264    ``cancel-path`` specifies the path to the host TPM device's sysfs
4265    entry allowing for cancellation of an ongoing TPM command.
4266    ``cancel-path`` is optional and by default QEMU will search for the
4267    sysfs entry to use.
4268
4269    Some notes about using the host's TPM with the passthrough driver:
4270
4271    The TPM device accessed by the passthrough driver must not be used
4272    by any other application on the host.
4273
4274    Since the host's firmware (BIOS/UEFI) has already initialized the
4275    TPM, the VM's firmware (BIOS/UEFI) will not be able to initialize
4276    the TPM again and may therefore not show a TPM-specific menu that
4277    would otherwise allow the user to configure the TPM, e.g., allow the
4278    user to enable/disable or activate/deactivate the TPM. Further, if
4279    TPM ownership is released from within a VM then the host's TPM will
4280    get disabled and deactivated. To enable and activate the TPM again
4281    afterwards, the host has to be rebooted and the user is required to
4282    enter the firmware's menu to enable and activate the TPM. If the TPM
4283    is left disabled and/or deactivated most TPM commands will fail.
4284
4285    To create a passthrough TPM use the following two options:
4286
4287    ::
4288
4289        -tpmdev passthrough,id=tpm0 -device tpm-tis,tpmdev=tpm0
4290
4291    Note that the ``-tpmdev`` id is ``tpm0`` and is referenced by
4292    ``tpmdev=tpm0`` in the device option.
4293
4294``-tpmdev emulator,id=id,chardev=dev``
4295    (Linux-host only) Enable access to a TPM emulator using Unix domain
4296    socket based chardev backend.
4297
4298    ``chardev`` specifies the unique ID of a character device backend
4299    that provides connection to the software TPM server.
4300
4301    To create a TPM emulator backend device with chardev socket backend:
4302
4303    ::
4304
4305        -chardev socket,id=chrtpm,path=/tmp/swtpm-sock -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis,tpmdev=tpm0
4306ERST
4307
4308DEFHEADING()
4309
4310#endif
4311
4312DEFHEADING(Boot Image or Kernel specific:)
4313SRST
4314There are broadly 4 ways you can boot a system with QEMU.
4315
4316 - specify a firmware and let it control finding a kernel
4317 - specify a firmware and pass a hint to the kernel to boot
4318 - direct kernel image boot
4319 - manually load files into the guest's address space
4320
4321The third method is useful for quickly testing kernels but as there is
4322no firmware to pass configuration information to the kernel the
4323hardware must either be probeable, the kernel built for the exact
4324configuration or passed some configuration data (e.g. a DTB blob)
4325which tells the kernel what drivers it needs. This exact details are
4326often hardware specific.
4327
4328The final method is the most generic way of loading images into the
4329guest address space and used mostly for ``bare metal`` type
4330development where the reset vectors of the processor are taken into
4331account.
4332
4333ERST
4334
4335SRST
4336
4337For x86 machines and some other architectures ``-bios`` will generally
4338do the right thing with whatever it is given. For other machines the
4339more strict ``-pflash`` option needs an image that is sized for the
4340flash device for the given machine type.
4341
4342Please see the :ref:`system-targets-ref` section of the manual for
4343more detailed documentation.
4344
4345ERST
4346
4347DEF("bios", HAS_ARG, QEMU_OPTION_bios, \
4348    "-bios file      set the filename for the BIOS\n", QEMU_ARCH_ALL)
4349SRST
4350``-bios file``
4351    Set the filename for the BIOS.
4352ERST
4353
4354DEF("pflash", HAS_ARG, QEMU_OPTION_pflash,
4355    "-pflash file    use 'file' as a parallel flash image\n", QEMU_ARCH_ALL)
4356SRST
4357``-pflash file``
4358    Use file as a parallel flash image.
4359ERST
4360
4361SRST
4362
4363The kernel options were designed to work with Linux kernels although
4364other things (like hypervisors) can be packaged up as a kernel
4365executable image. The exact format of a executable image is usually
4366architecture specific.
4367
4368The way in which the kernel is started (what address it is loaded at,
4369what if any information is passed to it via CPU registers, the state
4370of the hardware when it is started, and so on) is also architecture
4371specific. Typically it follows the specification laid down by the
4372Linux kernel for how kernels for that architecture must be started.
4373
4374ERST
4375
4376DEF("kernel", HAS_ARG, QEMU_OPTION_kernel, \
4377    "-kernel bzImage use 'bzImage' as kernel image\n", QEMU_ARCH_ALL)
4378SRST
4379``-kernel bzImage``
4380    Use bzImage as kernel image. The kernel can be either a Linux kernel
4381    or in multiboot format.
4382ERST
4383
4384DEF("shim", HAS_ARG, QEMU_OPTION_shim, \
4385    "-shim shim.efi use 'shim.efi' to boot the kernel\n", QEMU_ARCH_ALL)
4386SRST
4387``-shim shim.efi``
4388    Use 'shim.efi' to boot the kernel
4389ERST
4390
4391DEF("append", HAS_ARG, QEMU_OPTION_append, \
4392    "-append cmdline use 'cmdline' as kernel command line\n", QEMU_ARCH_ALL)
4393SRST
4394``-append cmdline``
4395    Use cmdline as kernel command line
4396ERST
4397
4398DEF("initrd", HAS_ARG, QEMU_OPTION_initrd, \
4399           "-initrd file    use 'file' as initial ram disk\n", QEMU_ARCH_ALL)
4400SRST(initrd)
4401
4402``-initrd file``
4403    Use file as initial ram disk.
4404
4405``-initrd "file1 arg=foo,file2"``
4406    This syntax is only available with multiboot.
4407
4408    Use file1 and file2 as modules and pass ``arg=foo`` as parameter to the
4409    first module. Commas can be provided in module parameters by doubling
4410    them on the command line to escape them:
4411
4412``-initrd "bzImage earlyprintk=xen,,keep root=/dev/xvda1,initrd.img"``
4413    Multiboot only. Use bzImage as the first module with
4414    "``earlyprintk=xen,keep root=/dev/xvda1``" as its command line,
4415    and initrd.img as the second module.
4416
4417ERST
4418
4419DEF("dtb", HAS_ARG, QEMU_OPTION_dtb, \
4420    "-dtb    file    use 'file' as device tree image\n", QEMU_ARCH_ALL)
4421SRST
4422``-dtb file``
4423    Use file as a device tree binary (dtb) image and pass it to the
4424    kernel on boot.
4425ERST
4426
4427SRST
4428
4429Finally you can also manually load images directly into the address
4430space of the guest. This is most useful for developers who already
4431know the layout of their guest and take care to ensure something sane
4432will happen when the reset vector executes.
4433
4434The generic loader can be invoked by using the loader device:
4435
4436``-device loader,addr=<addr>,data=<data>,data-len=<data-len>[,data-be=<data-be>][,cpu-num=<cpu-num>]``
4437
4438there is also the guest loader which operates in a similar way but
4439tweaks the DTB so a hypervisor loaded via ``-kernel`` can find where
4440the guest image is:
4441
4442``-device guest-loader,addr=<addr>[,kernel=<path>,[bootargs=<arguments>]][,initrd=<path>]``
4443
4444ERST
4445
4446DEFHEADING()
4447
4448DEFHEADING(Debug/Expert options:)
4449
4450DEF("compat", HAS_ARG, QEMU_OPTION_compat,
4451    "-compat [deprecated-input=accept|reject|crash][,deprecated-output=accept|hide]\n"
4452    "                Policy for handling deprecated management interfaces\n"
4453    "-compat [unstable-input=accept|reject|crash][,unstable-output=accept|hide]\n"
4454    "                Policy for handling unstable management interfaces\n",
4455    QEMU_ARCH_ALL)
4456SRST
4457``-compat [deprecated-input=@var{input-policy}][,deprecated-output=@var{output-policy}]``
4458    Set policy for handling deprecated management interfaces (experimental):
4459
4460    ``deprecated-input=accept`` (default)
4461        Accept deprecated commands and arguments
4462    ``deprecated-input=reject``
4463        Reject deprecated commands and arguments
4464    ``deprecated-input=crash``
4465        Crash on deprecated commands and arguments
4466    ``deprecated-output=accept`` (default)
4467        Emit deprecated command results and events
4468    ``deprecated-output=hide``
4469        Suppress deprecated command results and events
4470
4471    Limitation: covers only syntactic aspects of QMP.
4472
4473``-compat [unstable-input=@var{input-policy}][,unstable-output=@var{output-policy}]``
4474    Set policy for handling unstable management interfaces (experimental):
4475
4476    ``unstable-input=accept`` (default)
4477        Accept unstable commands and arguments
4478    ``unstable-input=reject``
4479        Reject unstable commands and arguments
4480    ``unstable-input=crash``
4481        Crash on unstable commands and arguments
4482    ``unstable-output=accept`` (default)
4483        Emit unstable command results and events
4484    ``unstable-output=hide``
4485        Suppress unstable command results and events
4486
4487    Limitation: covers only syntactic aspects of QMP.
4488ERST
4489
4490DEF("fw_cfg", HAS_ARG, QEMU_OPTION_fwcfg,
4491    "-fw_cfg [name=]<name>,file=<file>\n"
4492    "                add named fw_cfg entry with contents from file\n"
4493    "-fw_cfg [name=]<name>,string=<str>\n"
4494    "                add named fw_cfg entry with contents from string\n",
4495    QEMU_ARCH_ALL)
4496SRST
4497``-fw_cfg [name=]name,file=file``
4498    Add named fw\_cfg entry with contents from file file.
4499    If the filename contains comma, you must double it (for instance,
4500    "file=my,,file" to use file "my,file").
4501
4502``-fw_cfg [name=]name,string=str``
4503    Add named fw\_cfg entry with contents from string str.
4504    If the string contains comma, you must double it (for instance,
4505    "string=my,,string" to use file "my,string").
4506
4507    The terminating NUL character of the contents of str will not be
4508    included as part of the fw\_cfg item data. To insert contents with
4509    embedded NUL characters, you have to use the file parameter.
4510
4511    The fw\_cfg entries are passed by QEMU through to the guest.
4512
4513    Example:
4514
4515    ::
4516
4517            -fw_cfg name=opt/com.mycompany/blob,file=./my_blob.bin
4518
4519    creates an fw\_cfg entry named opt/com.mycompany/blob with contents
4520    from ./my\_blob.bin.
4521ERST
4522
4523DEF("serial", HAS_ARG, QEMU_OPTION_serial, \
4524    "-serial dev     redirect the serial port to char device 'dev'\n",
4525    QEMU_ARCH_ALL)
4526SRST
4527``-serial dev``
4528    Redirect the virtual serial port to host character device dev. The
4529    default device is ``vc`` in graphical mode and ``stdio`` in non
4530    graphical mode.
4531
4532    This option can be used several times to simulate multiple serial
4533    ports.
4534
4535    You can use ``-serial none`` to suppress the creation of default
4536    serial devices.
4537
4538    Available character devices are:
4539
4540    ``vc[:WxH]``
4541        Virtual console. Optionally, a width and height can be given in
4542        pixel with
4543
4544        ::
4545
4546            vc:800x600
4547
4548        It is also possible to specify width or height in characters:
4549
4550        ::
4551
4552            vc:80Cx24C
4553
4554    ``pty[:path]``
4555        [Linux only] Pseudo TTY (a new PTY is automatically allocated).
4556
4557        If ``path`` is specified, QEMU will create a symbolic link at
4558        that location which points to the new PTY device.
4559
4560        This avoids having to make QMP or HMP monitor queries to find
4561        out what the new PTY device path is.
4562
4563        Note that while QEMU will remove the symlink when it exits
4564        gracefully, it will not do so in case of crashes or on certain
4565        startup errors. It is recommended that the user checks and
4566        removes the symlink after QEMU terminates to account for this.
4567
4568    ``none``
4569        No device is allocated. Note that for machine types which
4570        emulate systems where a serial device is always present in
4571        real hardware, this may be equivalent to the ``null`` option,
4572        in that the serial device is still present but all output
4573        is discarded. For boards where the number of serial ports is
4574        truly variable, this suppresses the creation of the device.
4575
4576    ``null``
4577        A guest will see the UART or serial device as present in the
4578        machine, but all output is discarded, and there is no input.
4579        Conceptually equivalent to redirecting the output to ``/dev/null``.
4580
4581    ``chardev:id``
4582        Use a named character device defined with the ``-chardev``
4583        option.
4584
4585    ``/dev/XXX``
4586        [Linux only] Use host tty, e.g. ``/dev/ttyS0``. The host serial
4587        port parameters are set according to the emulated ones.
4588
4589    ``/dev/parportN``
4590        [Linux only, parallel port only] Use host parallel port N.
4591        Currently SPP and EPP parallel port features can be used.
4592
4593    ``file:filename``
4594        Write output to filename. No character can be read.
4595
4596    ``stdio``
4597        [Unix only] standard input/output
4598
4599    ``pipe:filename``
4600        name pipe filename
4601
4602    ``COMn``
4603        [Windows only] Use host serial port n
4604
4605    ``udp:[remote_host]:remote_port[@[src_ip]:src_port]``
4606        This implements UDP Net Console. When remote\_host or src\_ip
4607        are not specified they default to ``0.0.0.0``. When not using a
4608        specified src\_port a random port is automatically chosen.
4609
4610        If you just want a simple readonly console you can use
4611        ``netcat`` or ``nc``, by starting QEMU with:
4612        ``-serial udp::4555`` and nc as: ``nc -u -l -p 4555``. Any time
4613        QEMU writes something to that port it will appear in the
4614        netconsole session.
4615
4616        If you plan to send characters back via netconsole or you want
4617        to stop and start QEMU a lot of times, you should have QEMU use
4618        the same source port each time by using something like ``-serial
4619        udp::4555@:4556`` to QEMU. Another approach is to use a patched
4620        version of netcat which can listen to a TCP port and send and
4621        receive characters via udp. If you have a patched version of
4622        netcat which activates telnet remote echo and single char
4623        transfer, then you can use the following options to set up a
4624        netcat redirector to allow telnet on port 5555 to access the
4625        QEMU port.
4626
4627        ``QEMU Options:``
4628            -serial udp::4555@:4556
4629
4630        ``netcat options:``
4631            -u -P 4555 -L 0.0.0.0:4556 -t -p 5555 -I -T
4632
4633        ``telnet options:``
4634            localhost 5555
4635
4636    ``tcp:[host]:port[,server=on|off][,wait=on|off][,nodelay=on|off][,reconnect-ms=milliseconds]``
4637        The TCP Net Console has two modes of operation. It can send the
4638        serial I/O to a location or wait for a connection from a
4639        location. By default the TCP Net Console is sent to host at the
4640        port. If you use the ``server=on`` option QEMU will wait for a client
4641        socket application to connect to the port before continuing,
4642        unless the ``wait=on|off`` option was specified. The ``nodelay=on|off``
4643        option disables the Nagle buffering algorithm. The ``reconnect-ms``
4644        option only applies if ``server=no`` is set, if the connection goes
4645        down it will attempt to reconnect at the given interval. If host
4646        is omitted, 0.0.0.0 is assumed. Only one TCP connection at a
4647        time is accepted. You can use ``telnet=on`` to connect to the
4648        corresponding character device.
4649
4650        ``Example to send tcp console to 192.168.0.2 port 4444``
4651            -serial tcp:192.168.0.2:4444
4652
4653        ``Example to listen and wait on port 4444 for connection``
4654            -serial tcp::4444,server=on
4655
4656        ``Example to not wait and listen on ip 192.168.0.100 port 4444``
4657            -serial tcp:192.168.0.100:4444,server=on,wait=off
4658
4659    ``telnet:host:port[,server=on|off][,wait=on|off][,nodelay=on|off]``
4660        The telnet protocol is used instead of raw tcp sockets. The
4661        options work the same as if you had specified ``-serial tcp``.
4662        The difference is that the port acts like a telnet server or
4663        client using telnet option negotiation. This will also allow you
4664        to send the MAGIC\_SYSRQ sequence if you use a telnet that
4665        supports sending the break sequence. Typically in unix telnet
4666        you do it with Control-] and then type "send break" followed by
4667        pressing the enter key.
4668
4669    ``websocket:host:port,server=on[,wait=on|off][,nodelay=on|off]``
4670        The WebSocket protocol is used instead of raw tcp socket. The
4671        port acts as a WebSocket server. Client mode is not supported.
4672
4673    ``unix:path[,server=on|off][,wait=on|off][,reconnect-ms=milliseconds]``
4674        A unix domain socket is used instead of a tcp socket. The option
4675        works the same as if you had specified ``-serial tcp`` except
4676        the unix domain socket path is used for connections.
4677
4678    ``mon:dev_string``
4679        This is a special option to allow the monitor to be multiplexed
4680        onto another serial port. The monitor is accessed with key
4681        sequence of Control-a and then pressing c. dev\_string should be
4682        any one of the serial devices specified above. An example to
4683        multiplex the monitor onto a telnet server listening on port
4684        4444 would be:
4685
4686        ``-serial mon:telnet::4444,server=on,wait=off``
4687
4688        When the monitor is multiplexed to stdio in this way, Ctrl+C
4689        will not terminate QEMU any more but will be passed to the guest
4690        instead.
4691
4692    ``braille``
4693        Braille device. This will use BrlAPI to display the braille
4694        output on a real or fake device.
4695
4696    ``msmouse``
4697        Three button serial mouse. Configure the guest to use Microsoft
4698        protocol.
4699ERST
4700
4701DEF("parallel", HAS_ARG, QEMU_OPTION_parallel, \
4702    "-parallel dev   redirect the parallel port to char device 'dev'\n",
4703    QEMU_ARCH_ALL)
4704SRST
4705``-parallel dev``
4706    Redirect the virtual parallel port to host device dev (same devices
4707    as the serial port). On Linux hosts, ``/dev/parportN`` can be used
4708    to use hardware devices connected on the corresponding host parallel
4709    port.
4710
4711    This option can be used several times to simulate up to 3 parallel
4712    ports.
4713
4714    Use ``-parallel none`` to disable all parallel ports.
4715ERST
4716
4717DEF("monitor", HAS_ARG, QEMU_OPTION_monitor, \
4718    "-monitor dev    redirect the monitor to char device 'dev'\n",
4719    QEMU_ARCH_ALL)
4720SRST
4721``-monitor dev``
4722    Redirect the monitor to host device dev (same devices as the serial
4723    port). The default device is ``vc`` in graphical mode and ``stdio``
4724    in non graphical mode. Use ``-monitor none`` to disable the default
4725    monitor.
4726ERST
4727DEF("qmp", HAS_ARG, QEMU_OPTION_qmp, \
4728    "-qmp dev        like -monitor but opens in 'control' mode\n",
4729    QEMU_ARCH_ALL)
4730SRST
4731``-qmp dev``
4732    Like ``-monitor`` but opens in 'control' mode. For example, to make
4733    QMP available on localhost port 4444::
4734
4735        -qmp tcp:localhost:4444,server=on,wait=off
4736
4737    Not all options are configurable via this syntax; for maximum
4738    flexibility use the ``-mon`` option and an accompanying ``-chardev``.
4739
4740ERST
4741DEF("qmp-pretty", HAS_ARG, QEMU_OPTION_qmp_pretty, \
4742    "-qmp-pretty dev like -qmp but uses pretty JSON formatting\n",
4743    QEMU_ARCH_ALL)
4744SRST
4745``-qmp-pretty dev``
4746    Like ``-qmp`` but uses pretty JSON formatting.
4747ERST
4748
4749DEF("mon", HAS_ARG, QEMU_OPTION_mon, \
4750    "-mon [chardev=]name[,mode=readline|control][,pretty[=on|off]]\n", QEMU_ARCH_ALL)
4751SRST
4752``-mon [chardev=]name[,mode=readline|control][,pretty[=on|off]]``
4753    Set up a monitor connected to the chardev ``name``.
4754    QEMU supports two monitors: the Human Monitor Protocol
4755    (HMP; for human interaction), and the QEMU Monitor Protocol
4756    (QMP; a JSON RPC-style protocol).
4757    The default is HMP; ``mode=control`` selects QMP instead.
4758    ``pretty`` is only valid when ``mode=control``,
4759    turning on JSON pretty printing to ease
4760    human reading and debugging.
4761
4762    For example::
4763
4764      -chardev socket,id=mon1,host=localhost,port=4444,server=on,wait=off \
4765      -mon chardev=mon1,mode=control,pretty=on
4766
4767    enables the QMP monitor on localhost port 4444 with pretty-printing.
4768ERST
4769
4770DEF("debugcon", HAS_ARG, QEMU_OPTION_debugcon, \
4771    "-debugcon dev   redirect the debug console to char device 'dev'\n",
4772    QEMU_ARCH_ALL)
4773SRST
4774``-debugcon dev``
4775    Redirect the debug console to host device dev (same devices as the
4776    serial port). The debug console is an I/O port which is typically
4777    port 0xe9; writing to that I/O port sends output to this device. The
4778    default device is ``vc`` in graphical mode and ``stdio`` in non
4779    graphical mode.
4780ERST
4781
4782DEF("pidfile", HAS_ARG, QEMU_OPTION_pidfile, \
4783    "-pidfile file   write PID to 'file'\n", QEMU_ARCH_ALL)
4784SRST
4785``-pidfile file``
4786    Store the QEMU process PID in file. It is useful if you launch QEMU
4787    from a script.
4788ERST
4789
4790DEF("preconfig", 0, QEMU_OPTION_preconfig, \
4791    "--preconfig     pause QEMU before machine is initialized (experimental)\n",
4792    QEMU_ARCH_ALL)
4793SRST
4794``--preconfig``
4795    Pause QEMU for interactive configuration before the machine is
4796    created, which allows querying and configuring properties that will
4797    affect machine initialization. Use QMP command 'x-exit-preconfig' to
4798    exit the preconfig state and move to the next state (i.e. run guest
4799    if -S isn't used or pause the second time if -S is used). This
4800    option is experimental.
4801ERST
4802
4803DEF("S", 0, QEMU_OPTION_S, \
4804    "-S              freeze CPU at startup (use 'c' to start execution)\n",
4805    QEMU_ARCH_ALL)
4806SRST
4807``-S``
4808    Do not start CPU at startup (you must type 'c' in the monitor).
4809ERST
4810
4811DEF("overcommit", HAS_ARG, QEMU_OPTION_overcommit,
4812    "-overcommit [mem-lock=on|off|on-fault][cpu-pm=on|off]\n"
4813    "                run qemu with overcommit hints\n"
4814    "                mem-lock=on|off|on-fault controls memory lock support (default: off)\n"
4815    "                cpu-pm=on|off controls cpu power management (default: off)\n",
4816    QEMU_ARCH_ALL)
4817SRST
4818``-overcommit mem-lock=on|off|on-fault``
4819  \
4820``-overcommit cpu-pm=on|off``
4821    Run qemu with hints about host resource overcommit. The default is
4822    to assume that host overcommits all resources.
4823
4824    Locking qemu and guest memory can be enabled via ``mem-lock=on``
4825    or ``mem-lock=on-fault`` (disabled by default). This works when
4826    host memory is not overcommitted and reduces the worst-case latency for
4827    guest. The on-fault option is better for reducing the memory footprint
4828    since it makes allocations lazy, but the pages still get locked in place
4829    once faulted by the guest or QEMU. Note that the two options are mutually
4830    exclusive.
4831
4832    Guest ability to manage power state of host cpus (increasing latency
4833    for other processes on the same host cpu, but decreasing latency for
4834    guest) can be enabled via ``cpu-pm=on`` (disabled by default). This
4835    works best when host CPU is not overcommitted. When used, host
4836    estimates of CPU cycle and power utilization will be incorrect, not
4837    taking into account guest idle time.
4838ERST
4839
4840DEF("gdb", HAS_ARG, QEMU_OPTION_gdb, \
4841    "-gdb dev        accept gdb connection on 'dev'. (QEMU defaults to starting\n"
4842    "                the guest without waiting for gdb to connect; use -S too\n"
4843    "                if you want it to not start execution.)\n",
4844    QEMU_ARCH_ALL)
4845SRST
4846``-gdb dev``
4847    Accept a gdb connection on device dev (see the :ref:`GDB usage` chapter
4848    in the System Emulation Users Guide). Note that this option does not pause QEMU
4849    execution -- if you want QEMU to not start the guest until you
4850    connect with gdb and issue a ``continue`` command, you will need to
4851    also pass the ``-S`` option to QEMU.
4852
4853    The most usual configuration is to listen on a local TCP socket::
4854
4855        -gdb tcp::3117
4856
4857    but you can specify other backends; UDP, pseudo TTY, or even stdio
4858    are all reasonable use cases. For example, a stdio connection
4859    allows you to start QEMU from within gdb and establish the
4860    connection via a pipe:
4861
4862    .. parsed-literal::
4863
4864        (gdb) target remote | exec |qemu_system| -gdb stdio ...
4865ERST
4866
4867DEF("s", 0, QEMU_OPTION_s, \
4868    "-s              shorthand for -gdb tcp::" DEFAULT_GDBSTUB_PORT "\n",
4869    QEMU_ARCH_ALL)
4870SRST
4871``-s``
4872    Shorthand for -gdb tcp::1234, i.e. open a gdbserver on TCP port 1234
4873    (see the :ref:`GDB usage` chapter in the System Emulation Users Guide).
4874ERST
4875
4876DEF("d", HAS_ARG, QEMU_OPTION_d, \
4877    "-d item1,...    enable logging of specified items (use '-d help' for a list of log items)\n",
4878    QEMU_ARCH_ALL)
4879SRST
4880``-d item1[,...]``
4881    Enable logging of specified items. Use '-d help' for a list of log
4882    items.
4883ERST
4884
4885DEF("D", HAS_ARG, QEMU_OPTION_D, \
4886    "-D logfile      output log to logfile (default stderr)\n",
4887    QEMU_ARCH_ALL)
4888SRST
4889``-D logfile``
4890    Output log in logfile instead of to stderr
4891ERST
4892
4893DEF("dfilter", HAS_ARG, QEMU_OPTION_DFILTER, \
4894    "-dfilter range,..  filter debug output to range of addresses (useful for -d cpu,exec,etc..)\n",
4895    QEMU_ARCH_ALL)
4896SRST
4897``-dfilter range1[,...]``
4898    Filter debug output to that relevant to a range of target addresses.
4899    The filter spec can be either start+size, start-size or start..end
4900    where start end and size are the addresses and sizes required. For
4901    example:
4902
4903    ::
4904
4905            -dfilter 0x8000..0x8fff,0xffffffc000080000+0x200,0xffffffc000060000-0x1000
4906
4907    Will dump output for any code in the 0x1000 sized block starting at
4908    0x8000 and the 0x200 sized block starting at 0xffffffc000080000 and
4909    another 0x1000 sized block starting at 0xffffffc00005f000.
4910ERST
4911
4912DEF("seed", HAS_ARG, QEMU_OPTION_seed, \
4913    "-seed number       seed the pseudo-random number generator\n",
4914    QEMU_ARCH_ALL)
4915SRST
4916``-seed number``
4917    Force the guest to use a deterministic pseudo-random number
4918    generator, seeded with number. This does not affect crypto routines
4919    within the host.
4920ERST
4921
4922DEF("L", HAS_ARG, QEMU_OPTION_L, \
4923    "-L path         set the directory for the BIOS, VGA BIOS and keymaps\n",
4924    QEMU_ARCH_ALL)
4925SRST
4926``-L  path``
4927    Set the directory for the BIOS, VGA BIOS and keymaps.
4928
4929    To list all the data directories, use ``-L help``.
4930ERST
4931
4932DEF("enable-kvm", 0, QEMU_OPTION_enable_kvm, \
4933    "-enable-kvm     enable KVM full virtualization support\n",
4934    QEMU_ARCH_ARM | QEMU_ARCH_I386 | QEMU_ARCH_MIPS | QEMU_ARCH_PPC |
4935    QEMU_ARCH_RISCV | QEMU_ARCH_S390X)
4936SRST
4937``-enable-kvm``
4938    Enable KVM full virtualization support. This option is only
4939    available if KVM support is enabled when compiling.
4940ERST
4941
4942DEF("xen-domid", HAS_ARG, QEMU_OPTION_xen_domid,
4943    "-xen-domid id   specify xen guest domain id\n",
4944    QEMU_ARCH_ARM | QEMU_ARCH_I386)
4945DEF("xen-attach", 0, QEMU_OPTION_xen_attach,
4946    "-xen-attach     attach to existing xen domain\n"
4947    "                libxl will use this when starting QEMU\n",
4948    QEMU_ARCH_ARM | QEMU_ARCH_I386)
4949DEF("xen-domid-restrict", 0, QEMU_OPTION_xen_domid_restrict,
4950    "-xen-domid-restrict     restrict set of available xen operations\n"
4951    "                        to specified domain id. (Does not affect\n"
4952    "                        xenpv machine type).\n",
4953    QEMU_ARCH_ARM | QEMU_ARCH_I386)
4954SRST
4955``-xen-domid id``
4956    Specify xen guest domain id (XEN only).
4957
4958``-xen-attach``
4959    Attach to existing xen domain. libxl will use this when starting
4960    QEMU (XEN only). Restrict set of available xen operations to
4961    specified domain id (XEN only).
4962ERST
4963
4964DEF("no-reboot", 0, QEMU_OPTION_no_reboot, \
4965    "-no-reboot      exit instead of rebooting\n", QEMU_ARCH_ALL)
4966SRST
4967``-no-reboot``
4968    Exit instead of rebooting.
4969ERST
4970
4971DEF("no-shutdown", 0, QEMU_OPTION_no_shutdown, \
4972    "-no-shutdown    stop before shutdown\n", QEMU_ARCH_ALL)
4973SRST
4974``-no-shutdown``
4975    Don't exit QEMU on guest shutdown, but instead only stop the
4976    emulation. This allows for instance switching to monitor to commit
4977    changes to the disk image.
4978ERST
4979
4980DEF("action", HAS_ARG, QEMU_OPTION_action,
4981    "-action reboot=reset|shutdown\n"
4982    "                   action when guest reboots [default=reset]\n"
4983    "-action shutdown=poweroff|pause\n"
4984    "                   action when guest shuts down [default=poweroff]\n"
4985    "-action panic=pause|shutdown|exit-failure|none\n"
4986    "                   action when guest panics [default=shutdown]\n"
4987    "-action watchdog=reset|shutdown|poweroff|inject-nmi|pause|debug|none\n"
4988    "                   action when watchdog fires [default=reset]\n",
4989    QEMU_ARCH_ALL)
4990SRST
4991``-action event=action``
4992    The action parameter serves to modify QEMU's default behavior when
4993    certain guest events occur. It provides a generic method for specifying the
4994    same behaviors that are modified by the ``-no-reboot`` and ``-no-shutdown``
4995    parameters.
4996
4997    Examples:
4998
4999    ``-action panic=none``
5000    ``-action reboot=shutdown,shutdown=pause``
5001    ``-device i6300esb -action watchdog=pause``
5002
5003ERST
5004
5005DEF("loadvm", HAS_ARG, QEMU_OPTION_loadvm, \
5006    "-loadvm [tag|id]\n" \
5007    "                start right away with a saved state (loadvm in monitor)\n",
5008    QEMU_ARCH_ALL)
5009SRST
5010``-loadvm file``
5011    Start right away with a saved state (``loadvm`` in monitor)
5012ERST
5013
5014#if !defined(_WIN32) && !defined(EMSCRIPTEN)
5015DEF("daemonize", 0, QEMU_OPTION_daemonize, \
5016    "-daemonize      daemonize QEMU after initializing\n", QEMU_ARCH_ALL)
5017#endif
5018SRST
5019``-daemonize``
5020    Daemonize the QEMU process after initialization. QEMU will not
5021    detach from standard IO until it is ready to receive connections on
5022    any of its devices. This option is a useful way for external
5023    programs to launch QEMU without having to cope with initialization
5024    race conditions.
5025ERST
5026
5027DEF("option-rom", HAS_ARG, QEMU_OPTION_option_rom, \
5028    "-option-rom rom load a file, rom, into the option ROM space\n",
5029    QEMU_ARCH_ALL)
5030SRST
5031``-option-rom file``
5032    Load the contents of file as an option ROM. This option is useful to
5033    load things like EtherBoot.
5034ERST
5035
5036DEF("rtc", HAS_ARG, QEMU_OPTION_rtc, \
5037    "-rtc [base=utc|localtime|<datetime>][,clock=host|rt|vm][,driftfix=none|slew]\n" \
5038    "                set the RTC base and clock, enable drift fix for clock ticks (x86 only)\n",
5039    QEMU_ARCH_ALL)
5040
5041SRST
5042``-rtc [base=utc|localtime|datetime][,clock=host|rt|vm][,driftfix=none|slew]``
5043    Specify ``base`` as ``utc`` or ``localtime`` to let the RTC start at
5044    the current UTC or local time, respectively. ``localtime`` is
5045    required for correct date in MS-DOS or Windows. To start at a
5046    specific point in time, provide datetime in the format
5047    ``2006-06-17T16:01:21`` or ``2006-06-17``. The default base is UTC.
5048
5049    By default the RTC is driven by the host system time. This allows
5050    using of the RTC as accurate reference clock inside the guest,
5051    specifically if the host time is smoothly following an accurate
5052    external reference clock, e.g. via NTP. If you want to isolate the
5053    guest time from the host, you can set ``clock`` to ``rt`` instead,
5054    which provides a host monotonic clock if host support it. To even
5055    prevent the RTC from progressing during suspension, you can set
5056    ``clock`` to ``vm`` (virtual clock). '\ ``clock=vm``\ ' is
5057    recommended especially in icount mode in order to preserve
5058    determinism; however, note that in icount mode the speed of the
5059    virtual clock is variable and can in general differ from the host
5060    clock.
5061
5062    Enable ``driftfix`` (i386 targets only) if you experience time drift
5063    problems, specifically with Windows' ACPI HAL. This option will try
5064    to figure out how many timer interrupts were not processed by the
5065    Windows guest and will re-inject them.
5066ERST
5067
5068DEF("icount", HAS_ARG, QEMU_OPTION_icount, \
5069    "-icount [shift=N|auto][,align=on|off][,sleep=on|off][,rr=record|replay,rrfile=<filename>[,rrsnapshot=<snapshot>]]\n" \
5070    "                enable virtual instruction counter with 2^N clock ticks per\n" \
5071    "                instruction, enable aligning the host and virtual clocks\n" \
5072    "                or disable real time cpu sleeping, and optionally enable\n" \
5073    "                record-and-replay mode\n", QEMU_ARCH_ALL)
5074SRST
5075``-icount [shift=N|auto][,align=on|off][,sleep=on|off][,rr=record|replay,rrfile=filename[,rrsnapshot=snapshot]]``
5076    Enable virtual instruction counter. The virtual cpu will execute one
5077    instruction every 2^N ns of virtual time. If ``auto`` is specified
5078    then the virtual cpu speed will be automatically adjusted to keep
5079    virtual time within a few seconds of real time.
5080
5081    Note that while this option can give deterministic behavior, it does
5082    not provide cycle accurate emulation. Modern CPUs contain
5083    superscalar out of order cores with complex cache hierarchies. The
5084    number of instructions executed often has little or no correlation
5085    with actual performance.
5086
5087    When the virtual cpu is sleeping, the virtual time will advance at
5088    default speed unless ``sleep=off`` is specified. With
5089    ``sleep=off``, the virtual time will jump to the next timer
5090    deadline instantly whenever the virtual cpu goes to sleep mode and
5091    will not advance if no timer is enabled. This behavior gives
5092    deterministic execution times from the guest point of view.
5093    The default if icount is enabled is ``sleep=on``.
5094    ``sleep=off`` cannot be used together with either ``shift=auto``
5095    or ``align=on``.
5096
5097    ``align=on`` will activate the delay algorithm which will try to
5098    synchronise the host clock and the virtual clock. The goal is to
5099    have a guest running at the real frequency imposed by the shift
5100    option. Whenever the guest clock is behind the host clock and if
5101    ``align=on`` is specified then we print a message to the user to
5102    inform about the delay. Currently this option does not work when
5103    ``shift`` is ``auto``. Note: The sync algorithm will work for those
5104    shift values for which the guest clock runs ahead of the host clock.
5105    Typically this happens when the shift value is high (how high
5106    depends on the host machine). The default if icount is enabled
5107    is ``align=off``.
5108
5109    When the ``rr`` option is specified deterministic record/replay is
5110    enabled. The ``rrfile=`` option must also be provided to
5111    specify the path to the replay log. In record mode data is written
5112    to this file, and in replay mode it is read back.
5113    If the ``rrsnapshot`` option is given then it specifies a VM snapshot
5114    name. In record mode, a new VM snapshot with the given name is created
5115    at the start of execution recording. In replay mode this option
5116    specifies the snapshot name used to load the initial VM state.
5117ERST
5118
5119DEF("watchdog-action", HAS_ARG, QEMU_OPTION_watchdog_action, \
5120    "-watchdog-action reset|shutdown|poweroff|inject-nmi|pause|debug|none\n" \
5121    "                action when watchdog fires [default=reset]\n",
5122    QEMU_ARCH_ALL)
5123SRST
5124``-watchdog-action action``
5125    The action controls what QEMU will do when the watchdog timer
5126    expires. The default is ``reset`` (forcefully reset the guest).
5127    Other possible actions are: ``shutdown`` (attempt to gracefully
5128    shutdown the guest), ``poweroff`` (forcefully poweroff the guest),
5129    ``inject-nmi`` (inject a NMI into the guest), ``pause`` (pause the
5130    guest), ``debug`` (print a debug message and continue), or ``none``
5131    (do nothing).
5132
5133    Note that the ``shutdown`` action requires that the guest responds
5134    to ACPI signals, which it may not be able to do in the sort of
5135    situations where the watchdog would have expired, and thus
5136    ``-watchdog-action shutdown`` is not recommended for production use.
5137
5138    Examples:
5139
5140    ``-device i6300esb -watchdog-action pause``
5141
5142ERST
5143
5144DEF("echr", HAS_ARG, QEMU_OPTION_echr, \
5145    "-echr chr       set terminal escape character instead of ctrl-a\n",
5146    QEMU_ARCH_ALL)
5147SRST
5148``-echr numeric_ascii_value``
5149    Change the escape character used for switching to the monitor when
5150    using monitor and serial sharing. The default is ``0x01`` when using
5151    the ``-nographic`` option. ``0x01`` is equal to pressing
5152    ``Control-a``. You can select a different character from the ascii
5153    control keys where 1 through 26 map to Control-a through Control-z.
5154    For instance you could use the either of the following to change the
5155    escape character to Control-t.
5156
5157    ``-echr 0x14``; \ ``-echr 20``
5158
5159ERST
5160
5161DEF("incoming", HAS_ARG, QEMU_OPTION_incoming, \
5162    "-incoming tcp:[host]:port[,to=maxport][,ipv4=on|off][,ipv6=on|off]\n" \
5163    "-incoming rdma:host:port[,ipv4=on|off][,ipv6=on|off]\n" \
5164    "-incoming unix:socketpath\n" \
5165    "                prepare for incoming migration, listen on\n" \
5166    "                specified protocol and socket address\n" \
5167    "-incoming fd:fd\n" \
5168    "-incoming file:filename[,offset=offset]\n" \
5169    "-incoming exec:cmdline\n" \
5170    "                accept incoming migration on given file descriptor\n" \
5171    "                or from given external command\n" \
5172    "-incoming <channel>\n" \
5173    "                accept incoming migration on the migration channel\n" \
5174    "-incoming defer\n" \
5175    "                wait for the URI to be specified via migrate_incoming\n",
5176    QEMU_ARCH_ALL)
5177SRST
5178The -incoming option specifies the migration channel for an incoming
5179migration.  It may be used multiple times to specify multiple
5180migration channel types.  The channel type is specified in <channel>,
5181or is 'main' for all other forms of -incoming.  If multiple -incoming
5182options are specified for a channel type, the last one takes precedence.
5183
5184``-incoming tcp:[host]:port[,to=maxport][,ipv4=on|off][,ipv6=on|off]``
5185  \
5186``-incoming rdma:host:port[,ipv4=on|off][,ipv6=on|off]``
5187    Prepare for incoming migration, listen on a given tcp port.
5188
5189``-incoming unix:socketpath``
5190    Prepare for incoming migration, listen on a given unix socket.
5191
5192``-incoming fd:fd``
5193    Accept incoming migration from a given file descriptor.
5194
5195``-incoming file:filename[,offset=offset]``
5196    Accept incoming migration from a given file starting at offset.
5197    offset allows the common size suffixes, or a 0x prefix, but not both.
5198
5199``-incoming exec:cmdline``
5200    Accept incoming migration as an output from specified external
5201    command.
5202
5203``-incoming <channel>``
5204    Accept incoming migration on the migration channel.  For the syntax
5205    of <channel>, see the QAPI documentation of ``MigrationChannel``.
5206    Examples:
5207    ::
5208
5209        -incoming '{"channel-type": "main",
5210                    "addr": { "transport": "socket",
5211                              "type": "unix",
5212                              "path": "my.sock" }}'
5213
5214        -incoming main,addr.transport=socket,addr.type=unix,addr.path=my.sock
5215
5216``-incoming defer``
5217    Wait for the URI to be specified via migrate\_incoming. The monitor
5218    can be used to change settings (such as migration parameters) prior
5219    to issuing the migrate\_incoming to allow the migration to begin.
5220ERST
5221
5222DEF("only-migratable", 0, QEMU_OPTION_only_migratable, \
5223    "-only-migratable     allow only migratable devices\n", QEMU_ARCH_ALL)
5224SRST
5225``-only-migratable``
5226    Only allow migratable devices. Devices will not be allowed to enter
5227    an unmigratable state.
5228ERST
5229
5230DEF("nodefaults", 0, QEMU_OPTION_nodefaults, \
5231    "-nodefaults     don't create default devices\n", QEMU_ARCH_ALL)
5232SRST
5233``-nodefaults``
5234    Don't create default devices. Normally, QEMU sets the default
5235    devices like serial port, parallel port, virtual console, monitor
5236    device, VGA adapter, floppy and CD-ROM drive and others. The
5237    ``-nodefaults`` option will disable all those default devices.
5238ERST
5239
5240DEF("prom-env", HAS_ARG, QEMU_OPTION_prom_env,
5241    "-prom-env variable=value\n"
5242    "                set OpenBIOS nvram variables\n",
5243    QEMU_ARCH_PPC | QEMU_ARCH_SPARC)
5244SRST
5245``-prom-env variable=value``
5246    Set OpenBIOS nvram variable to given value (PPC, SPARC only).
5247
5248    ::
5249
5250        qemu-system-sparc -prom-env 'auto-boot?=false' \
5251         -prom-env 'boot-device=sd(0,2,0):d' -prom-env 'boot-args=linux single'
5252
5253    ::
5254
5255        qemu-system-ppc -prom-env 'auto-boot?=false' \
5256         -prom-env 'boot-device=hd:2,\yaboot' \
5257         -prom-env 'boot-args=conf=hd:2,\yaboot.conf'
5258ERST
5259DEF("semihosting", 0, QEMU_OPTION_semihosting,
5260    "-semihosting    semihosting mode\n",
5261    QEMU_ARCH_ARM | QEMU_ARCH_M68K | QEMU_ARCH_XTENSA |
5262    QEMU_ARCH_MIPS | QEMU_ARCH_RISCV)
5263SRST
5264``-semihosting``
5265    Enable :ref:`Semihosting` mode (ARM, M68K, Xtensa, MIPS, RISC-V only).
5266
5267    .. warning::
5268      Note that this allows guest direct access to the host filesystem, so
5269      should only be used with a trusted guest OS.
5270
5271    See the -semihosting-config option documentation for further
5272    information about the facilities this enables.
5273ERST
5274DEF("semihosting-config", HAS_ARG, QEMU_OPTION_semihosting_config,
5275    "-semihosting-config [enable=on|off][,target=native|gdb|auto][,chardev=id][,userspace=on|off][,arg=str[,...]]\n" \
5276    "                semihosting configuration\n",
5277QEMU_ARCH_ARM | QEMU_ARCH_M68K | QEMU_ARCH_XTENSA |
5278QEMU_ARCH_MIPS | QEMU_ARCH_RISCV)
5279SRST
5280``-semihosting-config [enable=on|off][,target=native|gdb|auto][,chardev=id][,userspace=on|off][,arg=str[,...]]``
5281    Enable and configure :ref:`Semihosting` (ARM, M68K, Xtensa, MIPS, RISC-V
5282    only).
5283
5284    .. warning::
5285      Note that this allows guest direct access to the host filesystem, so
5286      should only be used with a trusted guest OS.
5287
5288    ``target=native|gdb|auto``
5289        Defines where the semihosting calls will be addressed, to QEMU
5290        (``native``) or to GDB (``gdb``). The default is ``auto``, which
5291        means ``gdb`` during debug sessions and ``native`` otherwise.
5292
5293    ``chardev=str1``
5294        Send the output to a chardev backend output for native or auto
5295        output when not in gdb
5296
5297    ``userspace=on|off``
5298        Allows code running in guest userspace to access the semihosting
5299        interface. The default is that only privileged guest code can
5300        make semihosting calls. Note that setting ``userspace=on`` should
5301        only be used if all guest code is trusted (for example, in
5302        bare-metal test case code).
5303
5304    ``arg=str1,arg=str2,...``
5305        Allows the user to pass input arguments, and can be used
5306        multiple times to build up a list. The old-style
5307        ``-kernel``/``-append`` method of passing a command line is
5308        still supported for backward compatibility. If both the
5309        ``--semihosting-config arg`` and the ``-kernel``/``-append`` are
5310        specified, the former is passed to semihosting as it always
5311        takes precedence.
5312ERST
5313DEF("old-param", 0, QEMU_OPTION_old_param,
5314    "-old-param      old param mode\n", QEMU_ARCH_ARM)
5315SRST
5316``-old-param``
5317    Old param mode (ARM only).
5318ERST
5319
5320DEF("sandbox", HAS_ARG, QEMU_OPTION_sandbox, \
5321    "-sandbox on[,obsolete=allow|deny][,elevateprivileges=allow|deny|children]\n" \
5322    "          [,spawn=allow|deny][,resourcecontrol=allow|deny]\n" \
5323    "                Enable seccomp mode 2 system call filter (default 'off').\n" \
5324    "                use 'obsolete' to allow obsolete system calls that are provided\n" \
5325    "                    by the kernel, but typically no longer used by modern\n" \
5326    "                    C library implementations.\n" \
5327    "                use 'elevateprivileges' to allow or deny the QEMU process ability\n" \
5328    "                    to elevate privileges using set*uid|gid system calls.\n" \
5329    "                    The value 'children' will deny set*uid|gid system calls for\n" \
5330    "                    main QEMU process but will allow forks and execves to run unprivileged\n" \
5331    "                use 'spawn' to avoid QEMU to spawn new threads or processes by\n" \
5332    "                     blocking *fork and execve\n" \
5333    "                use 'resourcecontrol' to disable process affinity and schedular priority\n",
5334    QEMU_ARCH_ALL)
5335SRST
5336``-sandbox arg[,obsolete=string][,elevateprivileges=string][,spawn=string][,resourcecontrol=string]``
5337    Enable Seccomp mode 2 system call filter. 'on' will enable syscall
5338    filtering and 'off' will disable it. The default is 'off'.
5339
5340    ``obsolete=string``
5341        Enable Obsolete system calls
5342
5343    ``elevateprivileges=string``
5344        Disable set\*uid\|gid system calls
5345
5346    ``spawn=string``
5347        Disable \*fork and execve
5348
5349    ``resourcecontrol=string``
5350        Disable process affinity and schedular priority
5351ERST
5352
5353DEF("readconfig", HAS_ARG, QEMU_OPTION_readconfig,
5354    "-readconfig <file>\n"
5355    "                read config file\n", QEMU_ARCH_ALL)
5356SRST
5357``-readconfig file``
5358    Read device configuration from file. This approach is useful when
5359    you want to spawn QEMU process with many command line options but
5360    you don't want to exceed the command line character limit.
5361ERST
5362
5363DEF("no-user-config", 0, QEMU_OPTION_nouserconfig,
5364    "-no-user-config\n"
5365    "                do not load default user-provided config files at startup\n",
5366    QEMU_ARCH_ALL)
5367SRST
5368``-no-user-config``
5369    The ``-no-user-config`` option makes QEMU not load any of the
5370    user-provided config files on sysconfdir.
5371ERST
5372
5373DEF("trace", HAS_ARG, QEMU_OPTION_trace,
5374    "-trace [[enable=]<pattern>][,events=<file>][,file=<file>]\n"
5375    "                specify tracing options\n",
5376    QEMU_ARCH_ALL)
5377SRST
5378``-trace [[enable=]pattern][,events=file][,file=file]``
5379  .. include:: ../qemu-option-trace.rst.inc
5380
5381ERST
5382DEF("plugin", HAS_ARG, QEMU_OPTION_plugin,
5383    "-plugin [file=]<file>[,<argname>=<argvalue>]\n"
5384    "                load a plugin\n",
5385    QEMU_ARCH_ALL)
5386SRST
5387``-plugin file=file[,argname=argvalue]``
5388    Load a plugin.
5389
5390    ``file=file``
5391        Load the given plugin from a shared library file.
5392
5393    ``argname=argvalue``
5394        Argument passed to the plugin. (Can be given multiple times.)
5395ERST
5396
5397HXCOMM Internal use
5398DEF("qtest", HAS_ARG, QEMU_OPTION_qtest, "", QEMU_ARCH_ALL)
5399DEF("qtest-log", HAS_ARG, QEMU_OPTION_qtest_log, "", QEMU_ARCH_ALL)
5400
5401#if defined(CONFIG_POSIX) && !defined(EMSCRIPTEN)
5402DEF("run-with", HAS_ARG, QEMU_OPTION_run_with,
5403    "-run-with [async-teardown=on|off][,chroot=dir][user=username|uid:gid]\n"
5404    "                Set miscellaneous QEMU process lifecycle options:\n"
5405    "                async-teardown=on enables asynchronous teardown (Linux only)\n"
5406    "                chroot=dir chroot to dir just before starting the VM\n"
5407    "                user=username switch to the specified user before starting the VM\n"
5408    "                user=uid:gid ditto, but use specified user-ID and group-ID instead\n",
5409    QEMU_ARCH_ALL)
5410SRST
5411``-run-with [async-teardown=on|off][,chroot=dir][user=username|uid:gid]``
5412    Set QEMU process lifecycle options.
5413
5414    ``async-teardown=on`` enables asynchronous teardown. A new process called
5415    "cleanup/<QEMU_PID>" will be created at startup sharing the address
5416    space with the main QEMU process, using clone. It will wait for the
5417    main QEMU process to terminate completely, and then exit. This allows
5418    QEMU to terminate very quickly even if the guest was huge, leaving the
5419    teardown of the address space to the cleanup process. Since the cleanup
5420    process shares the same cgroups as the main QEMU process, accounting is
5421    performed correctly. This only works if the cleanup process is not
5422    forcefully killed with SIGKILL before the main QEMU process has
5423    terminated completely.
5424
5425    ``chroot=dir`` can be used for doing a chroot to the specified directory
5426    immediately before starting the guest execution. This is especially useful
5427    in combination with ``user=...``.
5428
5429    ``user=username`` or ``user=uid:gid`` can be used to drop root privileges
5430    before starting guest execution. QEMU will use the ``setuid`` and ``setgid``
5431    system calls to switch to the specified identity.  Note that the
5432    ``user=username`` syntax will also apply the full set of supplementary
5433    groups for the user, whereas the ``user=uid:gid`` will use only the
5434    ``gid`` group.
5435ERST
5436#endif
5437
5438DEF("msg", HAS_ARG, QEMU_OPTION_msg,
5439    "-msg [timestamp[=on|off]][,guest-name=[on|off]]\n"
5440    "                control error message format\n"
5441    "                timestamp=on enables timestamps (default: off)\n"
5442    "                guest-name=on enables guest name prefix but only if\n"
5443    "                              -name guest option is set (default: off)\n",
5444    QEMU_ARCH_ALL)
5445SRST
5446``-msg [timestamp[=on|off]][,guest-name[=on|off]]``
5447    Control error message format.
5448
5449    ``timestamp=on|off``
5450        Prefix messages with a timestamp. Default is off.
5451
5452    ``guest-name=on|off``
5453        Prefix messages with guest name but only if -name guest option is set
5454        otherwise the option is ignored. Default is off.
5455ERST
5456
5457DEF("dump-vmstate", HAS_ARG, QEMU_OPTION_dump_vmstate,
5458    "-dump-vmstate <file>\n"
5459    "                Output vmstate information in JSON format to file.\n"
5460    "                Use the scripts/vmstate-static-checker.py file to\n"
5461    "                check for possible regressions in migration code\n"
5462    "                by comparing two such vmstate dumps.\n",
5463    QEMU_ARCH_ALL)
5464SRST
5465``-dump-vmstate file``
5466    Dump json-encoded vmstate information for current machine type to
5467    file in file
5468ERST
5469
5470DEF("enable-sync-profile", 0, QEMU_OPTION_enable_sync_profile,
5471    "-enable-sync-profile\n"
5472    "                enable synchronization profiling\n",
5473    QEMU_ARCH_ALL)
5474SRST
5475``-enable-sync-profile``
5476    Enable synchronization profiling.
5477ERST
5478
5479#if defined(CONFIG_TCG) && defined(CONFIG_LINUX)
5480DEF("perfmap", 0, QEMU_OPTION_perfmap,
5481    "-perfmap        generate a /tmp/perf-${pid}.map file for perf\n",
5482    QEMU_ARCH_ALL)
5483SRST
5484``-perfmap``
5485    Generate a map file for Linux perf tools that will allow basic profiling
5486    information to be broken down into basic blocks.
5487ERST
5488
5489DEF("jitdump", 0, QEMU_OPTION_jitdump,
5490    "-jitdump        generate a jit-${pid}.dump file for perf\n",
5491    QEMU_ARCH_ALL)
5492SRST
5493``-jitdump``
5494    Generate a dump file for Linux perf tools that maps basic blocks to symbol
5495    names, line numbers and JITted code.
5496ERST
5497#endif
5498
5499DEFHEADING()
5500
5501DEFHEADING(Generic object creation:)
5502
5503DEF("object", HAS_ARG, QEMU_OPTION_object,
5504    "-object TYPENAME[,PROP1=VALUE1,...]\n"
5505    "                create a new object of type TYPENAME setting properties\n"
5506    "                in the order they are specified.  Note that the 'id'\n"
5507    "                property must be set.  These objects are placed in the\n"
5508    "                '/objects' path.\n",
5509    QEMU_ARCH_ALL)
5510SRST
5511``-object typename[,prop1=value1,...]``
5512    Create a new object of type typename setting properties in the order
5513    they are specified. Note that the 'id' property must be set. These
5514    objects are placed in the '/objects' path.
5515
5516    ``-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``
5517        Creates a memory file backend object, which can be used to back
5518        the guest RAM with huge pages.
5519
5520        The ``id`` parameter is a unique ID that will be used to
5521        reference this memory region in other parameters, e.g. ``-numa``,
5522        ``-device nvdimm``, etc.
5523
5524        The ``size`` option provides the size of the memory region, and
5525        accepts common suffixes, e.g. ``500M``.
5526
5527        The ``mem-path`` provides the path to either a shared memory or
5528        huge page filesystem mount.
5529
5530        The ``share`` boolean option determines whether the memory
5531        region is marked as private to QEMU, or shared. The latter
5532        allows a co-operating external process to access the QEMU memory
5533        region.
5534
5535        Setting share=on might affect the ability to configure NUMA
5536        bindings for the memory backend under some circumstances, see
5537        Documentation/vm/numa\_memory\_policy.txt on the Linux kernel
5538        source tree for additional details.
5539
5540        Setting the ``discard-data`` boolean option to on indicates that
5541        file contents can be destroyed when QEMU exits, to avoid
5542        unnecessarily flushing data to the backing file. Note that
5543        ``discard-data`` is only an optimization, and QEMU might not
5544        discard file contents if it aborts unexpectedly or is terminated
5545        using SIGKILL.
5546
5547        The ``merge`` boolean option enables memory merge, also known as
5548        MADV\_MERGEABLE, so that Kernel Samepage Merging will consider
5549        the pages for memory deduplication.
5550
5551        Setting the ``dump`` boolean option to off excludes the memory
5552        from core dumps. This feature is also known as MADV\_DONTDUMP.
5553
5554        The ``prealloc`` boolean option enables memory preallocation.
5555
5556        The ``host-nodes`` option binds the memory range to a list of
5557        NUMA host nodes.
5558
5559        The ``policy`` option sets the NUMA policy to one of the
5560        following values:
5561
5562        ``default``
5563            default host policy
5564
5565        ``preferred``
5566            prefer the given host node list for allocation
5567
5568        ``bind``
5569            restrict memory allocation to the given host node list
5570
5571        ``interleave``
5572            interleave memory allocations across the given host node
5573            list
5574
5575        The ``align`` option specifies the base address alignment when
5576        QEMU mmap(2) ``mem-path``, and accepts common suffixes, eg
5577        ``2M``. Some backend store specified by ``mem-path`` requires an
5578        alignment different than the default one used by QEMU, eg the
5579        device DAX /dev/dax0.0 requires 2M alignment rather than 4K. In
5580        such cases, users can specify the required alignment via this
5581        option.
5582
5583        The ``offset`` option specifies the offset into the target file
5584        that the region starts at. You can use this parameter to back
5585        multiple regions with a single file.
5586
5587        The ``pmem`` option specifies whether the backing file specified
5588        by ``mem-path`` is in host persistent memory that can be
5589        accessed using the SNIA NVM programming model (e.g. Intel
5590        NVDIMM). If ``pmem`` is set to 'on', QEMU will take necessary
5591        operations to guarantee the persistence of its own writes to
5592        ``mem-path`` (e.g. in vNVDIMM label emulation and live
5593        migration). Also, we will map the backend-file with MAP\_SYNC
5594        flag, which ensures the file metadata is in sync for
5595        ``mem-path`` in case of host crash or a power failure. MAP\_SYNC
5596        requires support from both the host kernel (since Linux kernel
5597        4.15) and the filesystem of ``mem-path`` mounted with DAX
5598        option.
5599
5600        The ``readonly`` option specifies whether the backing file is opened
5601        read-only or read-write (default).
5602
5603        The ``rom`` option specifies whether to create Read Only Memory
5604        (ROM) that cannot be modified by the VM. Any write attempts to such
5605        ROM will be denied. Most use cases want proper RAM instead of ROM.
5606        However, selected use cases, like R/O NVDIMMs, can benefit from
5607        ROM. If set to ``on``, create ROM; if set to ``off``, create
5608        writable RAM; if set to ``auto`` (default), the value of the
5609        ``readonly`` option is used. This option is primarily helpful when
5610        we want to have writable RAM in configurations that would
5611        traditionally create ROM before the ``rom`` option was introduced:
5612        VM templating, where we want to open a file readonly
5613        (``readonly=on``) and mark the memory to be private for QEMU
5614        (``share=off``). For this use case, we need writable RAM instead
5615        of ROM, and want to also set ``rom=off``.
5616
5617    ``-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``
5618        Creates a memory backend object, which can be used to back the
5619        guest RAM. Memory backend objects offer more control than the
5620        ``-m`` option that is traditionally used to define guest RAM.
5621        Please refer to ``memory-backend-file`` for a description of the
5622        options.
5623
5624    ``-object memory-backend-memfd,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,seal=on|off,hugetlb=on|off,hugetlbsize=size``
5625        Creates an anonymous memory file backend object, which allows
5626        QEMU to share the memory with an external process (e.g. when
5627        using vhost-user). The memory is allocated with memfd and
5628        optional sealing. (Linux only)
5629
5630        The ``seal`` option creates a sealed-file, that will block
5631        further resizing the memory ('on' by default).
5632
5633        The ``hugetlb`` option specify the file to be created resides in
5634        the hugetlbfs filesystem (since Linux 4.14). Used in conjunction
5635        with the ``hugetlb`` option, the ``hugetlbsize`` option specify
5636        the hugetlb page size on systems that support multiple hugetlb
5637        page sizes (it must be a power of 2 value supported by the
5638        system).
5639
5640        In some versions of Linux, the ``hugetlb`` option is
5641        incompatible with the ``seal`` option (requires at least Linux
5642        4.16).
5643
5644        Please refer to ``memory-backend-file`` for a description of the
5645        other options.
5646
5647        The ``share`` boolean option is on by default with memfd.
5648
5649    ``-object memory-backend-shm,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``
5650        Creates a POSIX shared memory backend object, which allows
5651        QEMU to share the memory with an external process (e.g. when
5652        using vhost-user).
5653
5654        ``memory-backend-shm`` is a more portable and less featureful version
5655        of ``memory-backend-memfd``. It can then be used in any POSIX system,
5656        especially when memfd is not supported.
5657
5658        Please refer to ``memory-backend-file`` for a description of the
5659        options.
5660
5661        The ``share`` boolean option is on by default with shm. Setting it to
5662        off will cause a failure during allocation because it is not supported
5663        by this backend.
5664
5665    ``-object iommufd,id=id[,fd=fd]``
5666        Creates an iommufd backend which allows control of DMA mapping
5667        through the ``/dev/iommu`` device.
5668
5669        The ``id`` parameter is a unique ID which frontends (such as
5670        vfio-pci of vdpa) will use to connect with the iommufd backend.
5671
5672        The ``fd`` parameter is an optional pre-opened file descriptor
5673        resulting from ``/dev/iommu`` opening. Usually the iommufd is shared
5674        across all subsystems, bringing the benefit of centralized
5675        reference counting.
5676
5677    ``-object rng-builtin,id=id``
5678        Creates a random number generator backend which obtains entropy
5679        from QEMU builtin functions. The ``id`` parameter is a unique ID
5680        that will be used to reference this entropy backend from the
5681        ``virtio-rng`` device. By default, the ``virtio-rng`` device
5682        uses this RNG backend.
5683
5684    ``-object rng-random,id=id,filename=/dev/random``
5685        Creates a random number generator backend which obtains entropy
5686        from a device on the host. The ``id`` parameter is a unique ID
5687        that will be used to reference this entropy backend from the
5688        ``virtio-rng`` device. The ``filename`` parameter specifies
5689        which file to obtain entropy from and if omitted defaults to
5690        ``/dev/urandom``.
5691
5692    ``-object rng-egd,id=id,chardev=chardevid``
5693        Creates a random number generator backend which obtains entropy
5694        from an external daemon running on the host. The ``id``
5695        parameter is a unique ID that will be used to reference this
5696        entropy backend from the ``virtio-rng`` device. The ``chardev``
5697        parameter is the unique ID of a character device backend that
5698        provides the connection to the RNG daemon.
5699
5700    ``-object tls-creds-anon,id=id,endpoint=endpoint,dir=/path/to/cred/dir,verify-peer=on|off``
5701        Creates a TLS anonymous credentials object, which can be used to
5702        provide TLS support on network backends. The ``id`` parameter is
5703        a unique ID which network backends will use to access the
5704        credentials. The ``endpoint`` is either ``server`` or ``client``
5705        depending on whether the QEMU network backend that uses the
5706        credentials will be acting as a client or as a server. If
5707        ``verify-peer`` is enabled (the default) then once the handshake
5708        is completed, the peer credentials will be verified, though this
5709        is a no-op for anonymous credentials.
5710
5711        The dir parameter tells QEMU where to find the credential files.
5712        For server endpoints, this directory may contain a file
5713        dh-params.pem providing diffie-hellman parameters to use for the
5714        TLS server. If the file is missing, QEMU will generate a set of
5715        DH parameters at startup. This is a computationally expensive
5716        operation that consumes random pool entropy, so it is
5717        recommended that a persistent set of parameters be generated
5718        upfront and saved.
5719
5720    ``-object tls-creds-psk,id=id,endpoint=endpoint,dir=/path/to/keys/dir[,username=username]``
5721        Creates a TLS Pre-Shared Keys (PSK) credentials object, which
5722        can be used to provide TLS support on network backends. The
5723        ``id`` parameter is a unique ID which network backends will use
5724        to access the credentials. The ``endpoint`` is either ``server``
5725        or ``client`` depending on whether the QEMU network backend that
5726        uses the credentials will be acting as a client or as a server.
5727        For clients only, ``username`` is the username which will be
5728        sent to the server. If omitted it defaults to "qemu".
5729
5730        The dir parameter tells QEMU where to find the keys file. It is
5731        called "dir/keys.psk" and contains "username:key" pairs. This
5732        file can most easily be created using the GnuTLS ``psktool``
5733        program.
5734
5735        For server endpoints, dir may also contain a file dh-params.pem
5736        providing diffie-hellman parameters to use for the TLS server.
5737        If the file is missing, QEMU will generate a set of DH
5738        parameters at startup. This is a computationally expensive
5739        operation that consumes random pool entropy, so it is
5740        recommended that a persistent set of parameters be generated up
5741        front and saved.
5742
5743    ``-object tls-creds-x509,id=id,endpoint=endpoint,dir=/path/to/cred/dir,priority=priority,verify-peer=on|off,passwordid=id``
5744        Creates a TLS anonymous credentials object, which can be used to
5745        provide TLS support on network backends. The ``id`` parameter is
5746        a unique ID which network backends will use to access the
5747        credentials. The ``endpoint`` is either ``server`` or ``client``
5748        depending on whether the QEMU network backend that uses the
5749        credentials will be acting as a client or as a server. If
5750        ``verify-peer`` is enabled (the default) then once the handshake
5751        is completed, the peer credentials will be verified. With x509
5752        certificates, this implies that the clients must be provided
5753        with valid client certificates too.
5754
5755        The dir parameter tells QEMU where to find the credential files.
5756        For server endpoints, this directory may contain a file
5757        dh-params.pem providing diffie-hellman parameters to use for the
5758        TLS server. If the file is missing, QEMU will generate a set of
5759        DH parameters at startup. This is a computationally expensive
5760        operation that consumes random pool entropy, so it is
5761        recommended that a persistent set of parameters be generated
5762        upfront and saved.
5763
5764        For x509 certificate credentials the directory will contain
5765        further files providing the x509 certificates. The certificates
5766        must be stored in PEM format, in filenames ca-cert.pem,
5767        ca-crl.pem (optional), server-cert.pem (only servers),
5768        server-key.pem (only servers), client-cert.pem (only clients),
5769        and client-key.pem (only clients).
5770
5771        For the server-key.pem and client-key.pem files which contain
5772        sensitive private keys, it is possible to use an encrypted
5773        version by providing the passwordid parameter. This provides the
5774        ID of a previously created ``secret`` object containing the
5775        password for decryption.
5776
5777        The priority parameter allows to override the global default
5778        priority used by gnutls. This can be useful if the system
5779        administrator needs to use a weaker set of crypto priorities for
5780        QEMU without potentially forcing the weakness onto all
5781        applications. Or conversely if one wants wants a stronger
5782        default for QEMU than for all other applications, they can do
5783        this through this parameter. Its format is a gnutls priority
5784        string as described at
5785        https://gnutls.org/manual/html_node/Priority-Strings.html.
5786
5787    ``-object tls-cipher-suites,id=id,priority=priority``
5788        Creates a TLS cipher suites object, which can be used to control
5789        the TLS cipher/protocol algorithms that applications are permitted
5790        to use.
5791
5792        The ``id`` parameter is a unique ID which frontends will use to
5793        access the ordered list of permitted TLS cipher suites from the
5794        host.
5795
5796        The ``priority`` parameter allows to override the global default
5797        priority used by gnutls. This can be useful if the system
5798        administrator needs to use a weaker set of crypto priorities for
5799        QEMU without potentially forcing the weakness onto all
5800        applications. Or conversely if one wants wants a stronger
5801        default for QEMU than for all other applications, they can do
5802        this through this parameter. Its format is a gnutls priority
5803        string as described at
5804        https://gnutls.org/manual/html_node/Priority-Strings.html.
5805
5806        An example of use of this object is to control UEFI HTTPS Boot.
5807        The tls-cipher-suites object exposes the ordered list of permitted
5808        TLS cipher suites from the host side to the guest firmware, via
5809        fw_cfg. The list is represented as an array of IANA_TLS_CIPHER
5810        objects. The firmware uses the IANA_TLS_CIPHER array for configuring
5811        guest-side TLS.
5812
5813        In the following example, the priority at which the host-side policy
5814        is retrieved is given by the ``priority`` property.
5815        Given that QEMU uses GNUTLS, ``priority=@SYSTEM`` may be used to
5816        refer to /etc/crypto-policies/back-ends/gnutls.config.
5817
5818        .. parsed-literal::
5819
5820             # |qemu_system| \\
5821                 -object tls-cipher-suites,id=mysuite0,priority=@SYSTEM \\
5822                 -fw_cfg name=etc/edk2/https/ciphers,gen_id=mysuite0
5823
5824    ``-object filter-buffer,id=id,netdev=netdevid,interval=t[,queue=all|rx|tx][,status=on|off][,position=head|tail|id=<id>][,insert=behind|before]``
5825        Interval t can't be 0, this filter batches the packet delivery:
5826        all packets arriving in a given interval on netdev netdevid are
5827        delayed until the end of the interval. Interval is in
5828        microseconds. ``status`` is optional that indicate whether the
5829        netfilter is on (enabled) or off (disabled), the default status
5830        for netfilter will be 'on'.
5831
5832        queue all\|rx\|tx is an option that can be applied to any
5833        netfilter.
5834
5835        ``all``: the filter is attached both to the receive and the
5836        transmit queue of the netdev (default).
5837
5838        ``rx``: the filter is attached to the receive queue of the
5839        netdev, where it will receive packets sent to the netdev.
5840
5841        ``tx``: the filter is attached to the transmit queue of the
5842        netdev, where it will receive packets sent by the netdev.
5843
5844        position head\|tail\|id=<id> is an option to specify where the
5845        filter should be inserted in the filter list. It can be applied
5846        to any netfilter.
5847
5848        ``head``: the filter is inserted at the head of the filter list,
5849        before any existing filters.
5850
5851        ``tail``: the filter is inserted at the tail of the filter list,
5852        behind any existing filters (default).
5853
5854        ``id=<id>``: the filter is inserted before or behind the filter
5855        specified by <id>, see the insert option below.
5856
5857        insert behind\|before is an option to specify where to insert
5858        the new filter relative to the one specified with
5859        position=id=<id>. It can be applied to any netfilter.
5860
5861        ``before``: insert before the specified filter.
5862
5863        ``behind``: insert behind the specified filter (default).
5864
5865    ``-object filter-mirror,id=id,netdev=netdevid,outdev=chardevid,queue=all|rx|tx[,vnet_hdr_support][,position=head|tail|id=<id>][,insert=behind|before]``
5866        filter-mirror on netdev netdevid,mirror net packet to
5867        chardevchardevid, if it has the vnet\_hdr\_support flag,
5868        filter-mirror will mirror packet with vnet\_hdr\_len.
5869
5870    ``-object filter-redirector,id=id,netdev=netdevid,indev=chardevid,outdev=chardevid,queue=all|rx|tx[,vnet_hdr_support][,position=head|tail|id=<id>][,insert=behind|before]``
5871        filter-redirector on netdev netdevid,redirect filter's net
5872        packet to chardev chardevid,and redirect indev's packet to
5873        filter.if it has the vnet\_hdr\_support flag, filter-redirector
5874        will redirect packet with vnet\_hdr\_len. Create a
5875        filter-redirector we need to differ outdev id from indev id, id
5876        can not be the same. we can just use indev or outdev, but at
5877        least one of indev or outdev need to be specified.
5878
5879    ``-object filter-rewriter,id=id,netdev=netdevid,queue=all|rx|tx,[vnet_hdr_support][,position=head|tail|id=<id>][,insert=behind|before]``
5880        Filter-rewriter is a part of COLO project.It will rewrite tcp
5881        packet to secondary from primary to keep secondary tcp
5882        connection,and rewrite tcp packet to primary from secondary make
5883        tcp packet can be handled by client.if it has the
5884        vnet\_hdr\_support flag, we can parse packet with vnet header.
5885
5886        usage: colo secondary: -object
5887        filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0 -object
5888        filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1 -object
5889        filter-rewriter,id=rew0,netdev=hn0,queue=all
5890
5891    ``-object filter-dump,id=id,netdev=dev[,file=filename][,maxlen=len][,position=head|tail|id=<id>][,insert=behind|before]``
5892        Dump the network traffic on netdev dev to the file specified by
5893        filename. At most len bytes (64k by default) per packet are
5894        stored. The file format is libpcap, so it can be analyzed with
5895        tools such as tcpdump or Wireshark.
5896
5897    ``-object colo-compare,id=id,primary_in=chardevid,secondary_in=chardevid,outdev=chardevid,iothread=id[,vnet_hdr_support][,notify_dev=id][,compare_timeout=@var{ms}][,expired_scan_cycle=@var{ms}][,max_queue_size=@var{size}]``
5898        Colo-compare gets packet from primary\_in chardevid and
5899        secondary\_in, then compare whether the payload of primary packet
5900        and secondary packet are the same. If same, it will output
5901        primary packet to out\_dev, else it will notify COLO-framework to do
5902        checkpoint and send primary packet to out\_dev. In order to
5903        improve efficiency, we need to put the task of comparison in
5904        another iothread. If it has the vnet\_hdr\_support flag,
5905        colo compare will send/recv packet with vnet\_hdr\_len.
5906        The compare\_timeout=@var{ms} determines the maximum time of the
5907        colo-compare hold the packet. The expired\_scan\_cycle=@var{ms}
5908        is to set the period of scanning expired primary node network packets.
5909        The max\_queue\_size=@var{size} is to set the max compare queue
5910        size depend on user environment.
5911        If user want to use Xen COLO, need to add the notify\_dev to
5912        notify Xen colo-frame to do checkpoint.
5913
5914        COLO-compare must be used with the help of filter-mirror,
5915        filter-redirector and filter-rewriter.
5916
5917        ::
5918
5919            KVM COLO
5920
5921            primary:
5922            -netdev tap,id=hn0,vhost=off
5923            -device e1000,id=e0,netdev=hn0,mac=52:a4:00:12:78:66
5924            -chardev socket,id=mirror0,host=3.3.3.3,port=9003,server=on,wait=off
5925            -chardev socket,id=compare1,host=3.3.3.3,port=9004,server=on,wait=off
5926            -chardev socket,id=compare0,host=3.3.3.3,port=9001,server=on,wait=off
5927            -chardev socket,id=compare0-0,host=3.3.3.3,port=9001
5928            -chardev socket,id=compare_out,host=3.3.3.3,port=9005,server=on,wait=off
5929            -chardev socket,id=compare_out0,host=3.3.3.3,port=9005
5930            -object iothread,id=iothread1
5931            -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0
5932            -object filter-redirector,netdev=hn0,id=redire0,queue=rx,indev=compare_out
5933            -object filter-redirector,netdev=hn0,id=redire1,queue=rx,outdev=compare0
5934            -object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0,iothread=iothread1
5935
5936            secondary:
5937            -netdev tap,id=hn0,vhost=off
5938            -device e1000,netdev=hn0,mac=52:a4:00:12:78:66
5939            -chardev socket,id=red0,host=3.3.3.3,port=9003
5940            -chardev socket,id=red1,host=3.3.3.3,port=9004
5941            -object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0
5942            -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1
5943
5944
5945            Xen COLO
5946
5947            primary:
5948            -netdev tap,id=hn0,vhost=off
5949            -device e1000,id=e0,netdev=hn0,mac=52:a4:00:12:78:66
5950            -chardev socket,id=mirror0,host=3.3.3.3,port=9003,server=on,wait=off
5951            -chardev socket,id=compare1,host=3.3.3.3,port=9004,server=on,wait=off
5952            -chardev socket,id=compare0,host=3.3.3.3,port=9001,server=on,wait=off
5953            -chardev socket,id=compare0-0,host=3.3.3.3,port=9001
5954            -chardev socket,id=compare_out,host=3.3.3.3,port=9005,server=on,wait=off
5955            -chardev socket,id=compare_out0,host=3.3.3.3,port=9005
5956            -chardev socket,id=notify_way,host=3.3.3.3,port=9009,server=on,wait=off
5957            -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0
5958            -object filter-redirector,netdev=hn0,id=redire0,queue=rx,indev=compare_out
5959            -object filter-redirector,netdev=hn0,id=redire1,queue=rx,outdev=compare0
5960            -object iothread,id=iothread1
5961            -object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0,notify_dev=notify_way,iothread=iothread1
5962
5963            secondary:
5964            -netdev tap,id=hn0,vhost=off
5965            -device e1000,netdev=hn0,mac=52:a4:00:12:78:66
5966            -chardev socket,id=red0,host=3.3.3.3,port=9003
5967            -chardev socket,id=red1,host=3.3.3.3,port=9004
5968            -object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0
5969            -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1
5970
5971        If you want to know the detail of above command line, you can
5972        read the colo-compare git log.
5973
5974    ``-object cryptodev-backend-builtin,id=id[,queues=queues]``
5975        Creates a cryptodev backend which executes crypto operations from
5976        the QEMU cipher APIs. The id parameter is a unique ID that will
5977        be used to reference this cryptodev backend from the
5978        ``virtio-crypto`` device. The queues parameter is optional,
5979        which specify the queue number of cryptodev backend, the default
5980        of queues is 1.
5981
5982        .. parsed-literal::
5983
5984             # |qemu_system| \\
5985               [...] \\
5986                   -object cryptodev-backend-builtin,id=cryptodev0 \\
5987                   -device virtio-crypto-pci,id=crypto0,cryptodev=cryptodev0 \\
5988               [...]
5989
5990    ``-object cryptodev-vhost-user,id=id,chardev=chardevid[,queues=queues]``
5991        Creates a vhost-user cryptodev backend, backed by a chardev
5992        chardevid. The id parameter is a unique ID that will be used to
5993        reference this cryptodev backend from the ``virtio-crypto``
5994        device. The chardev should be a unix domain socket backed one.
5995        The vhost-user uses a specifically defined protocol to pass
5996        vhost ioctl replacement messages to an application on the other
5997        end of the socket. The queues parameter is optional, which
5998        specify the queue number of cryptodev backend for multiqueue
5999        vhost-user, the default of queues is 1.
6000
6001        .. parsed-literal::
6002
6003             # |qemu_system| \\
6004               [...] \\
6005                   -chardev socket,id=chardev0,path=/path/to/socket \\
6006                   -object cryptodev-vhost-user,id=cryptodev0,chardev=chardev0 \\
6007                   -device virtio-crypto-pci,id=crypto0,cryptodev=cryptodev0 \\
6008               [...]
6009
6010    ``-object secret,id=id,data=string,format=raw|base64[,keyid=secretid,iv=string]``
6011      \
6012    ``-object secret,id=id,file=filename,format=raw|base64[,keyid=secretid,iv=string]``
6013        Defines a secret to store a password, encryption key, or some
6014        other sensitive data. The sensitive data can either be passed
6015        directly via the data parameter, or indirectly via the file
6016        parameter. Using the data parameter is insecure unless the
6017        sensitive data is encrypted.
6018
6019        The sensitive data can be provided in raw format (the default),
6020        or base64. When encoded as JSON, the raw format only supports
6021        valid UTF-8 characters, so base64 is recommended for sending
6022        binary data. QEMU will convert from which ever format is
6023        provided to the format it needs internally. eg, an RBD password
6024        can be provided in raw format, even though it will be base64
6025        encoded when passed onto the RBD sever.
6026
6027        For added protection, it is possible to encrypt the data
6028        associated with a secret using the AES-256-CBC cipher. Use of
6029        encryption is indicated by providing the keyid and iv
6030        parameters. The keyid parameter provides the ID of a previously
6031        defined secret that contains the AES-256 decryption key. This
6032        key should be 32-bytes long and be base64 encoded. The iv
6033        parameter provides the random initialization vector used for
6034        encryption of this particular secret and should be a base64
6035        encrypted string of the 16-byte IV.
6036
6037        The simplest (insecure) usage is to provide the secret inline
6038
6039        .. parsed-literal::
6040
6041             # |qemu_system| -object secret,id=sec0,data=letmein,format=raw
6042
6043        The simplest secure usage is to provide the secret via a file
6044
6045        # printf "letmein" > mypasswd.txt # QEMU\_SYSTEM\_MACRO -object
6046        secret,id=sec0,file=mypasswd.txt,format=raw
6047
6048        For greater security, AES-256-CBC should be used. To illustrate
6049        usage, consider the openssl command line tool which can encrypt
6050        the data. Note that when encrypting, the plaintext must be
6051        padded to the cipher block size (32 bytes) using the standard
6052        PKCS#5/6 compatible padding algorithm.
6053
6054        First a master key needs to be created in base64 encoding:
6055
6056        ::
6057
6058             # openssl rand -base64 32 > key.b64
6059             # KEY=$(base64 -d key.b64 | hexdump  -v -e '/1 "%02X"')
6060
6061        Each secret to be encrypted needs to have a random
6062        initialization vector generated. These do not need to be kept
6063        secret
6064
6065        ::
6066
6067             # openssl rand -base64 16 > iv.b64
6068             # IV=$(base64 -d iv.b64 | hexdump  -v -e '/1 "%02X"')
6069
6070        The secret to be defined can now be encrypted, in this case
6071        we're telling openssl to base64 encode the result, but it could
6072        be left as raw bytes if desired.
6073
6074        ::
6075
6076             # SECRET=$(printf "letmein" |
6077                        openssl enc -aes-256-cbc -a -K $KEY -iv $IV)
6078
6079        When launching QEMU, create a master secret pointing to
6080        ``key.b64`` and specify that to be used to decrypt the user
6081        password. Pass the contents of ``iv.b64`` to the second secret
6082
6083        .. parsed-literal::
6084
6085             # |qemu_system| \\
6086                 -object secret,id=secmaster0,format=base64,file=key.b64 \\
6087                 -object secret,id=sec0,keyid=secmaster0,format=base64,\\
6088                     data=$SECRET,iv=$(<iv.b64)
6089
6090    ``-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]``
6091        Create a Secure Encrypted Virtualization (SEV) guest object,
6092        which can be used to provide the guest memory encryption support
6093        on AMD processors.
6094
6095        When memory encryption is enabled, one of the physical address
6096        bit (aka the C-bit) is utilized to mark if a memory page is
6097        protected. The ``cbitpos`` is used to provide the C-bit
6098        position. The C-bit position is Host family dependent hence user
6099        must provide this value. On EPYC, the value should be 47.
6100
6101        When memory encryption is enabled, we loose certain bits in
6102        physical address space. The ``reduced-phys-bits`` is used to
6103        provide the number of bits we loose in physical address space.
6104        Similar to C-bit, the value is Host family dependent. On EPYC,
6105        a guest will lose a maximum of 1 bit, so the value should be 1.
6106
6107        The ``sev-device`` provides the device file to use for
6108        communicating with the SEV firmware running inside AMD Secure
6109        Processor. The default device is '/dev/sev'. If hardware
6110        supports memory encryption then /dev/sev devices are created by
6111        CCP driver.
6112
6113        The ``policy`` provides the guest policy to be enforced by the
6114        SEV firmware and restrict what configuration and operational
6115        commands can be performed on this guest by the hypervisor. The
6116        policy should be provided by the guest owner and is bound to the
6117        guest and cannot be changed throughout the lifetime of the
6118        guest. The default is 0.
6119
6120        If guest ``policy`` allows sharing the key with another SEV
6121        guest then ``handle`` can be use to provide handle of the guest
6122        from which to share the key.
6123
6124        The ``dh-cert-file`` and ``session-file`` provides the guest
6125        owner's Public Diffie-Hillman key defined in SEV spec. The PDH
6126        and session parameters are used for establishing a cryptographic
6127        session with the guest owner to negotiate keys used for
6128        attestation. The file must be encoded in base64.
6129
6130        The ``kernel-hashes`` adds the hashes of given kernel/initrd/
6131        cmdline to a designated guest firmware page for measured Linux
6132        boot with -kernel. The default is off. (Since 6.2)
6133
6134        e.g to launch a SEV guest
6135
6136        .. parsed-literal::
6137
6138             # |qemu_system_x86| \\
6139                 ...... \\
6140                 -object sev-guest,id=sev0,cbitpos=47,reduced-phys-bits=1 \\
6141                 -machine ...,memory-encryption=sev0 \\
6142                 .....
6143
6144    ``-object igvm-cfg,file=file``
6145        Create an IGVM configuration object that defines the initial state
6146        of the guest using a file in that conforms to the Independent Guest
6147        Virtual Machine (IGVM) file format.
6148
6149        This is currently only supported by ``-machine q35`` and
6150        ``-machine pc``.
6151
6152        The ``file`` parameter is used to specify the IGVM file to load.
6153        When provided, the IGVM file is used to populate the initial
6154        memory of the virtual machine and, depending on the platform, can
6155        define the initial processor state, memory map and parameters.
6156
6157        The IGVM file is expected to contain the firmware for the virtual
6158        machine, therefore an ``igvm-cfg`` object cannot be provided along
6159        with other ways of specifying firmware, such as the ``-bios``
6160        parameter on x86 machines.
6161
6162        e.g to launch a machine providing the firmware in an IGVM file
6163
6164        .. parsed-literal::
6165
6166             # |qemu_system_x86| \\
6167                 ...... \\
6168                 -object igvm-cfg,id=igvm0,file=bios.igvm \\
6169                 -machine ...,igvm-cfg=igvm0 \\
6170                 .....
6171
6172    ``-object authz-simple,id=id,identity=string``
6173        Create an authorization object that will control access to
6174        network services.
6175
6176        The ``identity`` parameter is identifies the user and its format
6177        depends on the network service that authorization object is
6178        associated with. For authorizing based on TLS x509 certificates,
6179        the identity must be the x509 distinguished name. Note that care
6180        must be taken to escape any commas in the distinguished name.
6181
6182        An example authorization object to validate a x509 distinguished
6183        name would look like:
6184
6185        .. parsed-literal::
6186
6187             # |qemu_system| \\
6188                 ... \\
6189                 -object 'authz-simple,id=auth0,identity=CN=laptop.example.com,,O=Example Org,,L=London,,ST=London,,C=GB' \\
6190                 ...
6191
6192        Note the use of quotes due to the x509 distinguished name
6193        containing whitespace, and escaping of ','.
6194
6195    ``-object authz-listfile,id=id,filename=path,refresh=on|off``
6196        Create an authorization object that will control access to
6197        network services.
6198
6199        The ``filename`` parameter is the fully qualified path to a file
6200        containing the access control list rules in JSON format.
6201
6202        An example set of rules that match against SASL usernames might
6203        look like:
6204
6205        ::
6206
6207              {
6208                "rules": [
6209                   { "match": "fred", "policy": "allow", "format": "exact" },
6210                   { "match": "bob", "policy": "allow", "format": "exact" },
6211                   { "match": "danb", "policy": "deny", "format": "glob" },
6212                   { "match": "dan*", "policy": "allow", "format": "exact" },
6213                ],
6214                "policy": "deny"
6215              }
6216
6217        When checking access the object will iterate over all the rules
6218        and the first rule to match will have its ``policy`` value
6219        returned as the result. If no rules match, then the default
6220        ``policy`` value is returned.
6221
6222        The rules can either be an exact string match, or they can use
6223        the simple UNIX glob pattern matching to allow wildcards to be
6224        used.
6225
6226        If ``refresh`` is set to true the file will be monitored and
6227        automatically reloaded whenever its content changes.
6228
6229        As with the ``authz-simple`` object, the format of the identity
6230        strings being matched depends on the network service, but is
6231        usually a TLS x509 distinguished name, or a SASL username.
6232
6233        An example authorization object to validate a SASL username
6234        would look like:
6235
6236        .. parsed-literal::
6237
6238             # |qemu_system| \\
6239                 ... \\
6240                 -object authz-simple,id=auth0,filename=/etc/qemu/vnc-sasl.acl,refresh=on \\
6241                 ...
6242
6243    ``-object authz-pam,id=id,service=string``
6244        Create an authorization object that will control access to
6245        network services.
6246
6247        The ``service`` parameter provides the name of a PAM service to
6248        use for authorization. It requires that a file
6249        ``/etc/pam.d/service`` exist to provide the configuration for
6250        the ``account`` subsystem.
6251
6252        An example authorization object to validate a TLS x509
6253        distinguished name would look like:
6254
6255        .. parsed-literal::
6256
6257             # |qemu_system| \\
6258                 ... \\
6259                 -object authz-pam,id=auth0,service=qemu-vnc \\
6260                 ...
6261
6262        There would then be a corresponding config file for PAM at
6263        ``/etc/pam.d/qemu-vnc`` that contains:
6264
6265        ::
6266
6267            account requisite  pam_listfile.so item=user sense=allow \
6268                       file=/etc/qemu/vnc.allow
6269
6270        Finally the ``/etc/qemu/vnc.allow`` file would contain the list
6271        of x509 distinguished names that are permitted access
6272
6273        ::
6274
6275            CN=laptop.example.com,O=Example Home,L=London,ST=London,C=GB
6276
6277    ``-object iothread,id=id,poll-max-ns=poll-max-ns,poll-grow=poll-grow,poll-shrink=poll-shrink,aio-max-batch=aio-max-batch``
6278        Creates a dedicated event loop thread that devices can be
6279        assigned to. This is known as an IOThread. By default device
6280        emulation happens in vCPU threads or the main event loop thread.
6281        This can become a scalability bottleneck. IOThreads allow device
6282        emulation and I/O to run on other host CPUs.
6283
6284        The ``id`` parameter is a unique ID that will be used to
6285        reference this IOThread from ``-device ...,iothread=id``.
6286        Multiple devices can be assigned to an IOThread. Note that not
6287        all devices support an ``iothread`` parameter.
6288
6289        The ``query-iothreads`` QMP command lists IOThreads and reports
6290        their thread IDs so that the user can configure host CPU
6291        pinning/affinity.
6292
6293        IOThreads use an adaptive polling algorithm to reduce event loop
6294        latency. Instead of entering a blocking system call to monitor
6295        file descriptors and then pay the cost of being woken up when an
6296        event occurs, the polling algorithm spins waiting for events for
6297        a short time. The algorithm's default parameters are suitable
6298        for many cases but can be adjusted based on knowledge of the
6299        workload and/or host device latency.
6300
6301        The ``poll-max-ns`` parameter is the maximum number of
6302        nanoseconds to busy wait for events. Polling can be disabled by
6303        setting this value to 0.
6304
6305        The ``poll-grow`` parameter is the multiplier used to increase
6306        the polling time when the algorithm detects it is missing events
6307        due to not polling long enough.
6308
6309        The ``poll-shrink`` parameter is the divisor used to decrease
6310        the polling time when the algorithm detects it is spending too
6311        long polling without encountering events.
6312
6313        The ``aio-max-batch`` parameter is the maximum number of requests
6314        in a batch for the AIO engine, 0 means that the engine will use
6315        its default.
6316
6317        The IOThread parameters can be modified at run-time using the
6318        ``qom-set`` command (where ``iothread1`` is the IOThread's
6319        ``id``):
6320
6321        ::
6322
6323            (qemu) qom-set /objects/iothread1 poll-max-ns 100000
6324ERST
6325
6326
6327HXCOMM This is the last statement. Insert new options before this line!
6328
6329#undef DEF
6330#undef DEFHEADING
6331#undef ARCHHEADING
6332