xref: /openbmc/qemu/qemu-options.hx (revision 3c95fdef)
1*3c95fdefSPeter MaydellHXCOMM Use DEFHEADING() to define headings in both help text and rST.
2*3c95fdefSPeter MaydellHXCOMM Text between SRST and ERST is copied to the rST version and
3*3c95fdefSPeter MaydellHXCOMM discarded from C version.
4ad96090aSBlue SwirlHXCOMM DEF(option, HAS_ARG/0, opt_enum, opt_help, arch_mask) is used to
5ad96090aSBlue SwirlHXCOMM construct option structures, enums and help message for specified
6ad96090aSBlue SwirlHXCOMM architectures.
7*3c95fdefSPeter MaydellHXCOMM HXCOMM can be used for comments, discarded from both rST and C.
85824d651Sblueswir1
9de6b4f90SMarkus ArmbrusterDEFHEADING(Standard options:)
105824d651Sblueswir1
115824d651Sblueswir1DEF("help", 0, QEMU_OPTION_h,
12ad96090aSBlue Swirl    "-h or -help     display this help and exit\n", QEMU_ARCH_ALL)
13e2fcbf42SPeter MaydellSRST
14e2fcbf42SPeter Maydell``-h``
15e2fcbf42SPeter Maydell    Display help and exit
16e2fcbf42SPeter MaydellERST
175824d651Sblueswir1
189bd7e6d9SpbrookDEF("version", 0, QEMU_OPTION_version,
19ad96090aSBlue Swirl    "-version        display version information and exit\n", QEMU_ARCH_ALL)
20e2fcbf42SPeter MaydellSRST
21e2fcbf42SPeter Maydell``-version``
22e2fcbf42SPeter Maydell    Display version information and exit
23e2fcbf42SPeter MaydellERST
249bd7e6d9Spbrook
2580f52a66SJan KiszkaDEF("machine", HAS_ARG, QEMU_OPTION_machine, \
2680f52a66SJan Kiszka    "-machine [type=]name[,prop[=value][,...]]\n"
27585f6036SPeter Maydell    "                selects emulated machine ('-machine help' for list)\n"
2880f52a66SJan Kiszka    "                property accel=accel1[:accel2[:...]] selects accelerator\n"
29d661d9a4SJustin Terry (VM)    "                supported accelerators are kvm, xen, hax, hvf, whpx or tcg (default: tcg)\n"
30d1048befSDon Slutz    "                vmport=on|off|auto controls emulation of vmport (default: auto)\n"
318490fc78SLuiz Capitulino    "                dump-guest-core=on|off include guest memory in a core dump (default=on)\n"
32a52a7fdfSLe Tan    "                mem-merge=on|off controls memory merge support (default: on)\n"
332eb1cd07STony Krowiak    "                aes-key-wrap=on|off controls support for AES key wrapping (default=on)\n"
349850c604SAlexander Graf    "                dea-key-wrap=on|off controls support for DEA key wrapping (default=on)\n"
3587252e1bSXiao Guangrong    "                suppress-vmdesc=on|off disables self-describing migration (default=off)\n"
36902c053dSGreg Kurz    "                nvdimm=on|off controls NVDIMM support (default=off)\n"
37274250c3SXiao Feng Ren    "                enforce-config-section=on|off enforce configuration section migration (default=off)\n"
38244b3f44STao Xu    "                memory-encryption=@var{} memory encryption object to use (default=none)\n"
39244b3f44STao Xu    "                hmat=on|off controls ACPI HMAT support (default=off)\n",
4080f52a66SJan Kiszka    QEMU_ARCH_ALL)
41e2fcbf42SPeter MaydellSRST
42e2fcbf42SPeter Maydell``-machine [type=]name[,prop=value[,...]]``
43e2fcbf42SPeter Maydell    Select the emulated machine by name. Use ``-machine help`` to list
44e2fcbf42SPeter Maydell    available machines.
45e2fcbf42SPeter Maydell
46e2fcbf42SPeter Maydell    For architectures which aim to support live migration compatibility
47e2fcbf42SPeter Maydell    across releases, each release will introduce a new versioned machine
48e2fcbf42SPeter Maydell    type. For example, the 2.8.0 release introduced machine types
49e2fcbf42SPeter Maydell    "pc-i440fx-2.8" and "pc-q35-2.8" for the x86\_64/i686 architectures.
50e2fcbf42SPeter Maydell
51e2fcbf42SPeter Maydell    To allow live migration of guests from QEMU version 2.8.0, to QEMU
52e2fcbf42SPeter Maydell    version 2.9.0, the 2.9.0 version must support the "pc-i440fx-2.8"
53e2fcbf42SPeter Maydell    and "pc-q35-2.8" machines too. To allow users live migrating VMs to
54e2fcbf42SPeter Maydell    skip multiple intermediate releases when upgrading, new releases of
55e2fcbf42SPeter Maydell    QEMU will support machine types from many previous versions.
56e2fcbf42SPeter Maydell
57e2fcbf42SPeter Maydell    Supported machine properties are:
58e2fcbf42SPeter Maydell
59e2fcbf42SPeter Maydell    ``accel=accels1[:accels2[:...]]``
60e2fcbf42SPeter Maydell        This is used to enable an accelerator. Depending on the target
61e2fcbf42SPeter Maydell        architecture, kvm, xen, hax, hvf, whpx or tcg can be available.
62e2fcbf42SPeter Maydell        By default, tcg is used. If there is more than one accelerator
63e2fcbf42SPeter Maydell        specified, the next one is used if the previous one fails to
64e2fcbf42SPeter Maydell        initialize.
65e2fcbf42SPeter Maydell
66e2fcbf42SPeter Maydell    ``vmport=on|off|auto``
67e2fcbf42SPeter Maydell        Enables emulation of VMWare IO port, for vmmouse etc. auto says
68e2fcbf42SPeter Maydell        to select the value based on accel. For accel=xen the default is
69e2fcbf42SPeter Maydell        off otherwise the default is on.
70e2fcbf42SPeter Maydell
71e2fcbf42SPeter Maydell    ``dump-guest-core=on|off``
72e2fcbf42SPeter Maydell        Include guest memory in a core dump. The default is on.
73e2fcbf42SPeter Maydell
74e2fcbf42SPeter Maydell    ``mem-merge=on|off``
75e2fcbf42SPeter Maydell        Enables or disables memory merge support. This feature, when
76e2fcbf42SPeter Maydell        supported by the host, de-duplicates identical memory pages
77e2fcbf42SPeter Maydell        among VMs instances (enabled by default).
78e2fcbf42SPeter Maydell
79e2fcbf42SPeter Maydell    ``aes-key-wrap=on|off``
80e2fcbf42SPeter Maydell        Enables or disables AES key wrapping support on s390-ccw hosts.
81e2fcbf42SPeter Maydell        This feature controls whether AES wrapping keys will be created
82e2fcbf42SPeter Maydell        to allow execution of AES cryptographic functions. The default
83e2fcbf42SPeter Maydell        is on.
84e2fcbf42SPeter Maydell
85e2fcbf42SPeter Maydell    ``dea-key-wrap=on|off``
86e2fcbf42SPeter Maydell        Enables or disables DEA key wrapping support on s390-ccw hosts.
87e2fcbf42SPeter Maydell        This feature controls whether DEA wrapping keys will be created
88e2fcbf42SPeter Maydell        to allow execution of DEA cryptographic functions. The default
89e2fcbf42SPeter Maydell        is on.
90e2fcbf42SPeter Maydell
91e2fcbf42SPeter Maydell    ``nvdimm=on|off``
92e2fcbf42SPeter Maydell        Enables or disables NVDIMM support. The default is off.
93e2fcbf42SPeter Maydell
94e2fcbf42SPeter Maydell    ``enforce-config-section=on|off``
95e2fcbf42SPeter Maydell        If ``enforce-config-section`` is set to on, force migration code
96e2fcbf42SPeter Maydell        to send configuration section even if the machine-type sets the
97e2fcbf42SPeter Maydell        ``migration.send-configuration`` property to off. NOTE: this
98e2fcbf42SPeter Maydell        parameter is deprecated. Please use ``-global``
99e2fcbf42SPeter Maydell        ``migration.send-configuration``\ =on\|off instead.
100e2fcbf42SPeter Maydell
101e2fcbf42SPeter Maydell    ``memory-encryption=``
102e2fcbf42SPeter Maydell        Memory encryption object to use. The default is none.
103e2fcbf42SPeter Maydell
104e2fcbf42SPeter Maydell    ``hmat=on|off``
105e2fcbf42SPeter Maydell        Enables or disables ACPI Heterogeneous Memory Attribute Table
106e2fcbf42SPeter Maydell        (HMAT) support. The default is off.
107e2fcbf42SPeter MaydellERST
1085824d651Sblueswir1
10980f52a66SJan KiszkaHXCOMM Deprecated by -machine
11080f52a66SJan KiszkaDEF("M", HAS_ARG, QEMU_OPTION_M, "", QEMU_ARCH_ALL)
11180f52a66SJan Kiszka
1125824d651Sblueswir1DEF("cpu", HAS_ARG, QEMU_OPTION_cpu,
113585f6036SPeter Maydell    "-cpu cpu        select CPU ('-cpu help' for list)\n", QEMU_ARCH_ALL)
114e2fcbf42SPeter MaydellSRST
115e2fcbf42SPeter Maydell``-cpu model``
116e2fcbf42SPeter Maydell    Select CPU model (``-cpu help`` for list and additional feature
117e2fcbf42SPeter Maydell    selection)
118e2fcbf42SPeter MaydellERST
1195824d651Sblueswir1
1208d4e9146SKONRAD FredericDEF("accel", HAS_ARG, QEMU_OPTION_accel,
121fe174132SPaolo Bonzini    "-accel [accel=]accelerator[,prop[=value][,...]]\n"
122d661d9a4SJustin Terry (VM)    "                select accelerator (kvm, xen, hax, hvf, whpx or tcg; use 'help' for a list)\n"
12346472d82SPaolo Bonzini    "                igd-passthru=on|off (enable Xen integrated Intel graphics passthrough, default=off)\n"
12411bc4a13SPaolo Bonzini    "                kernel-irqchip=on|off|split controls accelerated irqchip support (default=on)\n"
12523b0898eSPaolo Bonzini    "                kvm-shadow-mem=size of KVM shadow MMU in bytes\n"
126fe174132SPaolo Bonzini    "                tb-size=n (TCG translation block cache size)\n"
1270b3c5c81SEduardo Habkost    "                thread=single|multi (enable multi-threaded TCG)\n", QEMU_ARCH_ALL)
128e2fcbf42SPeter MaydellSRST
129e2fcbf42SPeter Maydell``-accel name[,prop=value[,...]]``
130e2fcbf42SPeter Maydell    This is used to enable an accelerator. Depending on the target
131e2fcbf42SPeter Maydell    architecture, kvm, xen, hax, hvf, whpx or tcg can be available. By
132e2fcbf42SPeter Maydell    default, tcg is used. If there is more than one accelerator
133e2fcbf42SPeter Maydell    specified, the next one is used if the previous one fails to
134e2fcbf42SPeter Maydell    initialize.
135e2fcbf42SPeter Maydell
136e2fcbf42SPeter Maydell    ``igd-passthru=on|off``
137e2fcbf42SPeter Maydell        When Xen is in use, this option controls whether Intel
138e2fcbf42SPeter Maydell        integrated graphics devices can be passed through to the guest
139e2fcbf42SPeter Maydell        (default=off)
140e2fcbf42SPeter Maydell
141e2fcbf42SPeter Maydell    ``kernel-irqchip=on|off|split``
142e2fcbf42SPeter Maydell        Controls KVM in-kernel irqchip support. The default is full
143e2fcbf42SPeter Maydell        acceleration of the interrupt controllers. On x86, split irqchip
144e2fcbf42SPeter Maydell        reduces the kernel attack surface, at a performance cost for
145e2fcbf42SPeter Maydell        non-MSI interrupts. Disabling the in-kernel irqchip completely
146e2fcbf42SPeter Maydell        is not recommended except for debugging purposes.
147e2fcbf42SPeter Maydell
148e2fcbf42SPeter Maydell    ``kvm-shadow-mem=size``
149e2fcbf42SPeter Maydell        Defines the size of the KVM shadow MMU.
150e2fcbf42SPeter Maydell
151e2fcbf42SPeter Maydell    ``tb-size=n``
152e2fcbf42SPeter Maydell        Controls the size (in MiB) of the TCG translation block cache.
153e2fcbf42SPeter Maydell
154e2fcbf42SPeter Maydell    ``thread=single|multi``
155e2fcbf42SPeter Maydell        Controls number of TCG threads. When the TCG is multi-threaded
156e2fcbf42SPeter Maydell        there will be one thread per vCPU therefor taking advantage of
157e2fcbf42SPeter Maydell        additional host cores. The default is to enable multi-threading
158e2fcbf42SPeter Maydell        where both the back-end and front-ends support it and no
159e2fcbf42SPeter Maydell        incompatible TCG features have been enabled (e.g.
160e2fcbf42SPeter Maydell        icount/replay).
161e2fcbf42SPeter MaydellERST
1628d4e9146SKONRAD Frederic
1635824d651Sblueswir1DEF("smp", HAS_ARG, QEMU_OPTION_smp,
1641b458422SLike Xu    "-smp [cpus=]n[,maxcpus=cpus][,cores=cores][,threads=threads][,dies=dies][,sockets=sockets]\n"
1656be68d7eSJes Sorensen    "                set the number of CPUs to 'n' [default=1]\n"
1666be68d7eSJes Sorensen    "                maxcpus= maximum number of total cpus, including\n"
167ca1a8a06SBruce Rogers    "                offline CPUs for hotplug, etc\n"
1681b458422SLike Xu    "                cores= number of CPU cores on one socket (for PC, it's on one die)\n"
16958a04db1SAndre Przywara    "                threads= number of threads on one CPU core\n"
1701b458422SLike Xu    "                dies= number of CPU dies on one socket (for PC only)\n"
171ad96090aSBlue Swirl    "                sockets= number of discrete sockets in the system\n",
172ad96090aSBlue Swirl        QEMU_ARCH_ALL)
173e2fcbf42SPeter MaydellSRST
174e2fcbf42SPeter Maydell``-smp [cpus=]n[,cores=cores][,threads=threads][,dies=dies][,sockets=sockets][,maxcpus=maxcpus]``
175e2fcbf42SPeter Maydell    Simulate an SMP system with n CPUs. On the PC target, up to 255 CPUs
176e2fcbf42SPeter Maydell    are supported. On Sparc32 target, Linux limits the number of usable
177e2fcbf42SPeter Maydell    CPUs to 4. For the PC target, the number of cores per die, the
178e2fcbf42SPeter Maydell    number of threads per cores, the number of dies per packages and the
179e2fcbf42SPeter Maydell    total number of sockets can be specified. Missing values will be
180e2fcbf42SPeter Maydell    computed. If any on the three values is given, the total number of
181e2fcbf42SPeter Maydell    CPUs n can be omitted. maxcpus specifies the maximum number of
182e2fcbf42SPeter Maydell    hotpluggable CPUs.
183e2fcbf42SPeter MaydellERST
1845824d651Sblueswir1
185268a362cSaliguoriDEF("numa", HAS_ARG, QEMU_OPTION_numa,
186244b3f44STao Xu    "-numa node[,mem=size][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=node]\n"
187244b3f44STao Xu    "-numa node[,memdev=id][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=node]\n"
1882d19c656SIgor Mammedov    "-numa dist,src=source,dst=destination,val=distance\n"
1899b12dfa0SLiu Jingqi    "-numa cpu,node-id=node[,socket-id=x][,core-id=y][,thread-id=z]\n"
190c412a48dSLiu Jingqi    "-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"
191c412a48dSLiu Jingqi    "-numa hmat-cache,node-id=node,size=size,level=level[,associativity=none|direct|complex][,policy=none|write-back|write-through][,line=size]\n",
1922d19c656SIgor Mammedov    QEMU_ARCH_ALL)
193e2fcbf42SPeter MaydellSRST
19409ce5f2dSPeter Maydell``-numa node[,mem=size][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=initiator]``
19509ce5f2dSPeter Maydell  \
19609ce5f2dSPeter Maydell``-numa node[,memdev=id][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=initiator]``
19709ce5f2dSPeter Maydell  \
19809ce5f2dSPeter Maydell``-numa dist,src=source,dst=destination,val=distance``
19909ce5f2dSPeter Maydell  \
20009ce5f2dSPeter Maydell``-numa cpu,node-id=node[,socket-id=x][,core-id=y][,thread-id=z]``
20109ce5f2dSPeter Maydell  \
20209ce5f2dSPeter Maydell``-numa hmat-lb,initiator=node,target=node,hierarchy=hierarchy,data-type=tpye[,latency=lat][,bandwidth=bw]``
20309ce5f2dSPeter Maydell  \
20409ce5f2dSPeter Maydell``-numa hmat-cache,node-id=node,size=size,level=level[,associativity=str][,policy=str][,line=size]``
205e2fcbf42SPeter Maydell    Define a NUMA node and assign RAM and VCPUs to it. Set the NUMA
206e2fcbf42SPeter Maydell    distance from a source node to a destination node. Set the ACPI
207e2fcbf42SPeter Maydell    Heterogeneous Memory Attributes for the given nodes.
208e2fcbf42SPeter Maydell
209e2fcbf42SPeter Maydell    Legacy VCPU assignment uses '\ ``cpus``\ ' option where firstcpu and
210e2fcbf42SPeter Maydell    lastcpu are CPU indexes. Each '\ ``cpus``\ ' option represent a
211e2fcbf42SPeter Maydell    contiguous range of CPU indexes (or a single VCPU if lastcpu is
212e2fcbf42SPeter Maydell    omitted). A non-contiguous set of VCPUs can be represented by
213e2fcbf42SPeter Maydell    providing multiple '\ ``cpus``\ ' options. If '\ ``cpus``\ ' is
214e2fcbf42SPeter Maydell    omitted on all nodes, VCPUs are automatically split between them.
215e2fcbf42SPeter Maydell
216e2fcbf42SPeter Maydell    For example, the following option assigns VCPUs 0, 1, 2 and 5 to a
217e2fcbf42SPeter Maydell    NUMA node:
218e2fcbf42SPeter Maydell
219e2fcbf42SPeter Maydell    ::
220e2fcbf42SPeter Maydell
221e2fcbf42SPeter Maydell        -numa node,cpus=0-2,cpus=5
222e2fcbf42SPeter Maydell
223e2fcbf42SPeter Maydell    '\ ``cpu``\ ' option is a new alternative to '\ ``cpus``\ ' option
224e2fcbf42SPeter Maydell    which uses '\ ``socket-id|core-id|thread-id``\ ' properties to
225e2fcbf42SPeter Maydell    assign CPU objects to a node using topology layout properties of
226e2fcbf42SPeter Maydell    CPU. The set of properties is machine specific, and depends on used
227e2fcbf42SPeter Maydell    machine type/'\ ``smp``\ ' options. It could be queried with
228e2fcbf42SPeter Maydell    '\ ``hotpluggable-cpus``\ ' monitor command. '\ ``node-id``\ '
229e2fcbf42SPeter Maydell    property specifies node to which CPU object will be assigned, it's
230e2fcbf42SPeter Maydell    required for node to be declared with '\ ``node``\ ' option before
231e2fcbf42SPeter Maydell    it's used with '\ ``cpu``\ ' option.
232e2fcbf42SPeter Maydell
233e2fcbf42SPeter Maydell    For example:
234e2fcbf42SPeter Maydell
235e2fcbf42SPeter Maydell    ::
236e2fcbf42SPeter Maydell
237e2fcbf42SPeter Maydell        -M pc \
238e2fcbf42SPeter Maydell        -smp 1,sockets=2,maxcpus=2 \
239e2fcbf42SPeter Maydell        -numa node,nodeid=0 -numa node,nodeid=1 \
240e2fcbf42SPeter Maydell        -numa cpu,node-id=0,socket-id=0 -numa cpu,node-id=1,socket-id=1
241e2fcbf42SPeter Maydell
242e2fcbf42SPeter Maydell    '\ ``mem``\ ' assigns a given RAM amount to a node. '\ ``memdev``\ '
243e2fcbf42SPeter Maydell    assigns RAM from a given memory backend device to a node. If
244e2fcbf42SPeter Maydell    '\ ``mem``\ ' and '\ ``memdev``\ ' are omitted in all nodes, RAM is
245e2fcbf42SPeter Maydell    split equally between them.
246e2fcbf42SPeter Maydell
247e2fcbf42SPeter Maydell    '\ ``mem``\ ' and '\ ``memdev``\ ' are mutually exclusive.
248e2fcbf42SPeter Maydell    Furthermore, if one node uses '\ ``memdev``\ ', all of them have to
249e2fcbf42SPeter Maydell    use it.
250e2fcbf42SPeter Maydell
251e2fcbf42SPeter Maydell    '\ ``initiator``\ ' is an additional option that points to an
252e2fcbf42SPeter Maydell    initiator NUMA node that has best performance (the lowest latency or
253e2fcbf42SPeter Maydell    largest bandwidth) to this NUMA node. Note that this option can be
254e2fcbf42SPeter Maydell    set only when the machine property 'hmat' is set to 'on'.
255e2fcbf42SPeter Maydell
256e2fcbf42SPeter Maydell    Following example creates a machine with 2 NUMA nodes, node 0 has
257e2fcbf42SPeter Maydell    CPU. node 1 has only memory, and its initiator is node 0. Note that
258e2fcbf42SPeter Maydell    because node 0 has CPU, by default the initiator of node 0 is itself
259e2fcbf42SPeter Maydell    and must be itself.
260e2fcbf42SPeter Maydell
261e2fcbf42SPeter Maydell    ::
262e2fcbf42SPeter Maydell
263e2fcbf42SPeter Maydell        -machine hmat=on \
264e2fcbf42SPeter Maydell        -m 2G,slots=2,maxmem=4G \
265e2fcbf42SPeter Maydell        -object memory-backend-ram,size=1G,id=m0 \
266e2fcbf42SPeter Maydell        -object memory-backend-ram,size=1G,id=m1 \
267e2fcbf42SPeter Maydell        -numa node,nodeid=0,memdev=m0 \
268e2fcbf42SPeter Maydell        -numa node,nodeid=1,memdev=m1,initiator=0 \
269e2fcbf42SPeter Maydell        -smp 2,sockets=2,maxcpus=2  \
270e2fcbf42SPeter Maydell        -numa cpu,node-id=0,socket-id=0 \
271e2fcbf42SPeter Maydell        -numa cpu,node-id=0,socket-id=1
272e2fcbf42SPeter Maydell
273e2fcbf42SPeter Maydell    source and destination are NUMA node IDs. distance is the NUMA
274e2fcbf42SPeter Maydell    distance from source to destination. The distance from a node to
275e2fcbf42SPeter Maydell    itself is always 10. If any pair of nodes is given a distance, then
276e2fcbf42SPeter Maydell    all pairs must be given distances. Although, when distances are only
277e2fcbf42SPeter Maydell    given in one direction for each pair of nodes, then the distances in
278e2fcbf42SPeter Maydell    the opposite directions are assumed to be the same. If, however, an
279e2fcbf42SPeter Maydell    asymmetrical pair of distances is given for even one node pair, then
280e2fcbf42SPeter Maydell    all node pairs must be provided distance values for both directions,
281e2fcbf42SPeter Maydell    even when they are symmetrical. When a node is unreachable from
282e2fcbf42SPeter Maydell    another node, set the pair's distance to 255.
283e2fcbf42SPeter Maydell
284e2fcbf42SPeter Maydell    Note that the -``numa`` option doesn't allocate any of the specified
285e2fcbf42SPeter Maydell    resources, it just assigns existing resources to NUMA nodes. This
286e2fcbf42SPeter Maydell    means that one still has to use the ``-m``, ``-smp`` options to
287e2fcbf42SPeter Maydell    allocate RAM and VCPUs respectively.
288e2fcbf42SPeter Maydell
289e2fcbf42SPeter Maydell    Use '\ ``hmat-lb``\ ' to set System Locality Latency and Bandwidth
290e2fcbf42SPeter Maydell    Information between initiator and target NUMA nodes in ACPI
291e2fcbf42SPeter Maydell    Heterogeneous Attribute Memory Table (HMAT). Initiator NUMA node can
292e2fcbf42SPeter Maydell    create memory requests, usually it has one or more processors.
293e2fcbf42SPeter Maydell    Target NUMA node contains addressable memory.
294e2fcbf42SPeter Maydell
295e2fcbf42SPeter Maydell    In '\ ``hmat-lb``\ ' option, node are NUMA node IDs. hierarchy is
296e2fcbf42SPeter Maydell    the memory hierarchy of the target NUMA node: if hierarchy is
297e2fcbf42SPeter Maydell    'memory', the structure represents the memory performance; if
298e2fcbf42SPeter Maydell    hierarchy is 'first-level\|second-level\|third-level', this
299e2fcbf42SPeter Maydell    structure represents aggregated performance of memory side caches
300e2fcbf42SPeter Maydell    for each domain. type of 'data-type' is type of data represented by
301e2fcbf42SPeter Maydell    this structure instance: if 'hierarchy' is 'memory', 'data-type' is
302e2fcbf42SPeter Maydell    'access\|read\|write' latency or 'access\|read\|write' bandwidth of
303e2fcbf42SPeter Maydell    the target memory; if 'hierarchy' is
304e2fcbf42SPeter Maydell    'first-level\|second-level\|third-level', 'data-type' is
305e2fcbf42SPeter Maydell    'access\|read\|write' hit latency or 'access\|read\|write' hit
306e2fcbf42SPeter Maydell    bandwidth of the target memory side cache.
307e2fcbf42SPeter Maydell
308e2fcbf42SPeter Maydell    lat is latency value in nanoseconds. bw is bandwidth value, the
309e2fcbf42SPeter Maydell    possible value and units are NUM[M\|G\|T], mean that the bandwidth
310e2fcbf42SPeter Maydell    value are NUM byte per second (or MB/s, GB/s or TB/s depending on
311e2fcbf42SPeter Maydell    used suffix). Note that if latency or bandwidth value is 0, means
312e2fcbf42SPeter Maydell    the corresponding latency or bandwidth information is not provided.
313e2fcbf42SPeter Maydell
314e2fcbf42SPeter Maydell    In '\ ``hmat-cache``\ ' option, node-id is the NUMA-id of the memory
315e2fcbf42SPeter Maydell    belongs. size is the size of memory side cache in bytes. level is
316e2fcbf42SPeter Maydell    the cache level described in this structure, note that the cache
317e2fcbf42SPeter Maydell    level 0 should not be used with '\ ``hmat-cache``\ ' option.
318e2fcbf42SPeter Maydell    associativity is the cache associativity, the possible value is
319e2fcbf42SPeter Maydell    'none/direct(direct-mapped)/complex(complex cache indexing)'. policy
320e2fcbf42SPeter Maydell    is the write policy. line is the cache Line size in bytes.
321e2fcbf42SPeter Maydell
322e2fcbf42SPeter Maydell    For example, the following options describe 2 NUMA nodes. Node 0 has
323e2fcbf42SPeter Maydell    2 cpus and a ram, node 1 has only a ram. The processors in node 0
324e2fcbf42SPeter Maydell    access memory in node 0 with access-latency 5 nanoseconds,
325e2fcbf42SPeter Maydell    access-bandwidth is 200 MB/s; The processors in NUMA node 0 access
326e2fcbf42SPeter Maydell    memory in NUMA node 1 with access-latency 10 nanoseconds,
327e2fcbf42SPeter Maydell    access-bandwidth is 100 MB/s. And for memory side cache information,
328e2fcbf42SPeter Maydell    NUMA node 0 and 1 both have 1 level memory cache, size is 10KB,
329e2fcbf42SPeter Maydell    policy is write-back, the cache Line size is 8 bytes:
330e2fcbf42SPeter Maydell
331e2fcbf42SPeter Maydell    ::
332e2fcbf42SPeter Maydell
333e2fcbf42SPeter Maydell        -machine hmat=on \
334e2fcbf42SPeter Maydell        -m 2G \
335e2fcbf42SPeter Maydell        -object memory-backend-ram,size=1G,id=m0 \
336e2fcbf42SPeter Maydell        -object memory-backend-ram,size=1G,id=m1 \
337e2fcbf42SPeter Maydell        -smp 2 \
338e2fcbf42SPeter Maydell        -numa node,nodeid=0,memdev=m0 \
339e2fcbf42SPeter Maydell        -numa node,nodeid=1,memdev=m1,initiator=0 \
340e2fcbf42SPeter Maydell        -numa cpu,node-id=0,socket-id=0 \
341e2fcbf42SPeter Maydell        -numa cpu,node-id=0,socket-id=1 \
342e2fcbf42SPeter Maydell        -numa hmat-lb,initiator=0,target=0,hierarchy=memory,data-type=access-latency,latency=5 \
343e2fcbf42SPeter Maydell        -numa hmat-lb,initiator=0,target=0,hierarchy=memory,data-type=access-bandwidth,bandwidth=200M \
344e2fcbf42SPeter Maydell        -numa hmat-lb,initiator=0,target=1,hierarchy=memory,data-type=access-latency,latency=10 \
345e2fcbf42SPeter Maydell        -numa hmat-lb,initiator=0,target=1,hierarchy=memory,data-type=access-bandwidth,bandwidth=100M \
346e2fcbf42SPeter Maydell        -numa hmat-cache,node-id=0,size=10K,level=1,associativity=direct,policy=write-back,line=8 \
347e2fcbf42SPeter Maydell        -numa hmat-cache,node-id=1,size=10K,level=1,associativity=direct,policy=write-back,line=8
348e2fcbf42SPeter MaydellERST
349268a362cSaliguori
35010adb8beSMarkus ArmbrusterDEF("add-fd", HAS_ARG, QEMU_OPTION_add_fd,
35110adb8beSMarkus Armbruster    "-add-fd fd=fd,set=set[,opaque=opaque]\n"
35210adb8beSMarkus Armbruster    "                Add 'fd' to fd 'set'\n", QEMU_ARCH_ALL)
353e2fcbf42SPeter MaydellSRST
354e2fcbf42SPeter Maydell``-add-fd fd=fd,set=set[,opaque=opaque]``
355e2fcbf42SPeter Maydell    Add a file descriptor to an fd set. Valid options are:
356e2fcbf42SPeter Maydell
357e2fcbf42SPeter Maydell    ``fd=fd``
358e2fcbf42SPeter Maydell        This option defines the file descriptor of which a duplicate is
359e2fcbf42SPeter Maydell        added to fd set. The file descriptor cannot be stdin, stdout, or
360e2fcbf42SPeter Maydell        stderr.
361e2fcbf42SPeter Maydell
362e2fcbf42SPeter Maydell    ``set=set``
363e2fcbf42SPeter Maydell        This option defines the ID of the fd set to add the file
364e2fcbf42SPeter Maydell        descriptor to.
365e2fcbf42SPeter Maydell
366e2fcbf42SPeter Maydell    ``opaque=opaque``
367e2fcbf42SPeter Maydell        This option defines a free-form string that can be used to
368e2fcbf42SPeter Maydell        describe fd.
369e2fcbf42SPeter Maydell
370e2fcbf42SPeter Maydell    You can open an image using pre-opened file descriptors from an fd
371e2fcbf42SPeter Maydell    set:
372e2fcbf42SPeter Maydell
373e2fcbf42SPeter Maydell    .. parsed-literal::
374e2fcbf42SPeter Maydell
375e2fcbf42SPeter Maydell        |qemu_system| \
376e2fcbf42SPeter Maydell         -add-fd fd=3,set=2,opaque="rdwr:/path/to/file" \
377e2fcbf42SPeter Maydell         -add-fd fd=4,set=2,opaque="rdonly:/path/to/file" \
378e2fcbf42SPeter Maydell         -drive file=/dev/fdset/2,index=0,media=disk
379e2fcbf42SPeter MaydellERST
38010adb8beSMarkus Armbruster
38110adb8beSMarkus ArmbrusterDEF("set", HAS_ARG, QEMU_OPTION_set,
38210adb8beSMarkus Armbruster    "-set group.id.arg=value\n"
38310adb8beSMarkus Armbruster    "                set <arg> parameter for item <id> of type <group>\n"
38410adb8beSMarkus Armbruster    "                i.e. -set drive.$id.file=/path/to/image\n", QEMU_ARCH_ALL)
385e2fcbf42SPeter MaydellSRST
386e2fcbf42SPeter Maydell``-set group.id.arg=value``
387e2fcbf42SPeter Maydell    Set parameter arg for item id of type group
388e2fcbf42SPeter MaydellERST
38910adb8beSMarkus Armbruster
39010adb8beSMarkus ArmbrusterDEF("global", HAS_ARG, QEMU_OPTION_global,
3913751d7c4SPaolo Bonzini    "-global driver.property=value\n"
3923751d7c4SPaolo Bonzini    "-global driver=driver,property=property,value=value\n"
39310adb8beSMarkus Armbruster    "                set a global default for a driver property\n",
39410adb8beSMarkus Armbruster    QEMU_ARCH_ALL)
395e2fcbf42SPeter MaydellSRST
39609ce5f2dSPeter Maydell``-global driver.prop=value``
39709ce5f2dSPeter Maydell  \
39809ce5f2dSPeter Maydell``-global driver=driver,property=property,value=value``
399e2fcbf42SPeter Maydell    Set default value of driver's property prop to value, e.g.:
400e2fcbf42SPeter Maydell
401e2fcbf42SPeter Maydell    .. parsed-literal::
402e2fcbf42SPeter Maydell
403e2fcbf42SPeter Maydell        |qemu_system_x86| -global ide-hd.physical_block_size=4096 disk-image.img
404e2fcbf42SPeter Maydell
405e2fcbf42SPeter Maydell    In particular, you can use this to set driver properties for devices
406e2fcbf42SPeter Maydell    which are created automatically by the machine model. To create a
407e2fcbf42SPeter Maydell    device which is not created automatically and set properties on it,
408e2fcbf42SPeter Maydell    use -``device``.
409e2fcbf42SPeter Maydell
410e2fcbf42SPeter Maydell    -global driver.prop=value is shorthand for -global
411e2fcbf42SPeter Maydell    driver=driver,property=prop,value=value. The longhand syntax works
412e2fcbf42SPeter Maydell    even when driver contains a dot.
413e2fcbf42SPeter MaydellERST
41410adb8beSMarkus Armbruster
41510adb8beSMarkus ArmbrusterDEF("boot", HAS_ARG, QEMU_OPTION_boot,
41610adb8beSMarkus Armbruster    "-boot [order=drives][,once=drives][,menu=on|off]\n"
417c8a6ae8bSAmos Kong    "      [,splash=sp_name][,splash-time=sp_time][,reboot-timeout=rb_time][,strict=on|off]\n"
41810adb8beSMarkus Armbruster    "                'drives': floppy (a), hard disk (c), CD-ROM (d), network (n)\n"
41910adb8beSMarkus Armbruster    "                'sp_name': the file's name that would be passed to bios as logo picture, if menu=on\n"
42010adb8beSMarkus Armbruster    "                'sp_time': the period that splash picture last if menu=on, unit is ms\n"
42110adb8beSMarkus Armbruster    "                'rb_timeout': the timeout before guest reboot when boot failed, unit is ms\n",
42210adb8beSMarkus Armbruster    QEMU_ARCH_ALL)
423e2fcbf42SPeter MaydellSRST
424e2fcbf42SPeter Maydell``-boot [order=drives][,once=drives][,menu=on|off][,splash=sp_name][,splash-time=sp_time][,reboot-timeout=rb_timeout][,strict=on|off]``
425e2fcbf42SPeter Maydell    Specify boot order drives as a string of drive letters. Valid drive
426e2fcbf42SPeter Maydell    letters depend on the target architecture. The x86 PC uses: a, b
427e2fcbf42SPeter Maydell    (floppy 1 and 2), c (first hard disk), d (first CD-ROM), n-p
428e2fcbf42SPeter Maydell    (Etherboot from network adapter 1-4), hard disk boot is the default.
429e2fcbf42SPeter Maydell    To apply a particular boot order only on the first startup, specify
430e2fcbf42SPeter Maydell    it via ``once``. Note that the ``order`` or ``once`` parameter
431e2fcbf42SPeter Maydell    should not be used together with the ``bootindex`` property of
432e2fcbf42SPeter Maydell    devices, since the firmware implementations normally do not support
433e2fcbf42SPeter Maydell    both at the same time.
434e2fcbf42SPeter Maydell
435e2fcbf42SPeter Maydell    Interactive boot menus/prompts can be enabled via ``menu=on`` as far
436e2fcbf42SPeter Maydell    as firmware/BIOS supports them. The default is non-interactive boot.
437e2fcbf42SPeter Maydell
438e2fcbf42SPeter Maydell    A splash picture could be passed to bios, enabling user to show it
439e2fcbf42SPeter Maydell    as logo, when option splash=sp\_name is given and menu=on, If
440e2fcbf42SPeter Maydell    firmware/BIOS supports them. Currently Seabios for X86 system
441e2fcbf42SPeter Maydell    support it. limitation: The splash file could be a jpeg file or a
442e2fcbf42SPeter Maydell    BMP file in 24 BPP format(true color). The resolution should be
443e2fcbf42SPeter Maydell    supported by the SVGA mode, so the recommended is 320x240, 640x480,
444e2fcbf42SPeter Maydell    800x640.
445e2fcbf42SPeter Maydell
446e2fcbf42SPeter Maydell    A timeout could be passed to bios, guest will pause for rb\_timeout
447e2fcbf42SPeter Maydell    ms when boot failed, then reboot. If rb\_timeout is '-1', guest will
448e2fcbf42SPeter Maydell    not reboot, qemu passes '-1' to bios by default. Currently Seabios
449e2fcbf42SPeter Maydell    for X86 system support it.
450e2fcbf42SPeter Maydell
451e2fcbf42SPeter Maydell    Do strict boot via ``strict=on`` as far as firmware/BIOS supports
452e2fcbf42SPeter Maydell    it. This only effects when boot priority is changed by bootindex
453e2fcbf42SPeter Maydell    options. The default is non-strict boot.
454e2fcbf42SPeter Maydell
45509ce5f2dSPeter Maydell    .. parsed-literal::
456e2fcbf42SPeter Maydell
457e2fcbf42SPeter Maydell        # try to boot from network first, then from hard disk
458e2fcbf42SPeter Maydell        |qemu_system_x86| -boot order=nc
459e2fcbf42SPeter Maydell        # boot from CD-ROM first, switch back to default order after reboot
460e2fcbf42SPeter Maydell        |qemu_system_x86| -boot once=d
461e2fcbf42SPeter Maydell        # boot with a splash picture for 5 seconds.
462e2fcbf42SPeter Maydell        |qemu_system_x86| -boot menu=on,splash=/root/boot.bmp,splash-time=5000
463e2fcbf42SPeter Maydell
464e2fcbf42SPeter Maydell    Note: The legacy format '-boot drives' is still supported but its
465e2fcbf42SPeter Maydell    use is discouraged as it may be removed from future versions.
466e2fcbf42SPeter MaydellERST
46710adb8beSMarkus Armbruster
46810adb8beSMarkus ArmbrusterDEF("m", HAS_ARG, QEMU_OPTION_m,
46989f3ea2bSMichael Tokarev    "-m [size=]megs[,slots=n,maxmem=size]\n"
4706e1d3c1cSIgor Mammedov    "                configure guest RAM\n"
4710daba1f0SAlexander Graf    "                size: initial amount of guest memory\n"
472c270fb9eSIgor Mammedov    "                slots: number of hotplug slots (default: none)\n"
473b6fe0124SMatthew Rosato    "                maxmem: maximum amount of guest memory (default: none)\n"
474b6fe0124SMatthew Rosato    "NOTE: Some architectures might enforce a specific granularity\n",
4756e1d3c1cSIgor Mammedov    QEMU_ARCH_ALL)
476e2fcbf42SPeter MaydellSRST
477e2fcbf42SPeter Maydell``-m [size=]megs[,slots=n,maxmem=size]``
478e2fcbf42SPeter Maydell    Sets guest startup RAM size to megs megabytes. Default is 128 MiB.
479e2fcbf42SPeter Maydell    Optionally, a suffix of "M" or "G" can be used to signify a value in
480e2fcbf42SPeter Maydell    megabytes or gigabytes respectively. Optional pair slots, maxmem
481e2fcbf42SPeter Maydell    could be used to set amount of hotpluggable memory slots and maximum
482e2fcbf42SPeter Maydell    amount of memory. Note that maxmem must be aligned to the page size.
483e2fcbf42SPeter Maydell
484e2fcbf42SPeter Maydell    For example, the following command-line sets the guest startup RAM
485e2fcbf42SPeter Maydell    size to 1GB, creates 3 slots to hotplug additional memory and sets
486e2fcbf42SPeter Maydell    the maximum memory the guest can reach to 4GB:
487e2fcbf42SPeter Maydell
488e2fcbf42SPeter Maydell    .. parsed-literal::
489e2fcbf42SPeter Maydell
490e2fcbf42SPeter Maydell        |qemu_system| -m 1G,slots=3,maxmem=4G
491e2fcbf42SPeter Maydell
492e2fcbf42SPeter Maydell    If slots and maxmem are not specified, memory hotplug won't be
493e2fcbf42SPeter Maydell    enabled and the guest startup RAM will never increase.
494e2fcbf42SPeter MaydellERST
49510adb8beSMarkus Armbruster
49610adb8beSMarkus ArmbrusterDEF("mem-path", HAS_ARG, QEMU_OPTION_mempath,
49710adb8beSMarkus Armbruster    "-mem-path FILE  provide backing storage for guest RAM\n", QEMU_ARCH_ALL)
498e2fcbf42SPeter MaydellSRST
499e2fcbf42SPeter Maydell``-mem-path path``
500e2fcbf42SPeter Maydell    Allocate guest RAM from a temporarily created file in path.
501e2fcbf42SPeter MaydellERST
50210adb8beSMarkus Armbruster
50310adb8beSMarkus ArmbrusterDEF("mem-prealloc", 0, QEMU_OPTION_mem_prealloc,
50410adb8beSMarkus Armbruster    "-mem-prealloc   preallocate guest memory (use with -mem-path)\n",
50510adb8beSMarkus Armbruster    QEMU_ARCH_ALL)
506e2fcbf42SPeter MaydellSRST
507e2fcbf42SPeter Maydell``-mem-prealloc``
508e2fcbf42SPeter Maydell    Preallocate memory when using -mem-path.
509e2fcbf42SPeter MaydellERST
51010adb8beSMarkus Armbruster
51110adb8beSMarkus ArmbrusterDEF("k", HAS_ARG, QEMU_OPTION_k,
51210adb8beSMarkus Armbruster    "-k language     use keyboard layout (for example 'fr' for French)\n",
51310adb8beSMarkus Armbruster    QEMU_ARCH_ALL)
514e2fcbf42SPeter MaydellSRST
515e2fcbf42SPeter Maydell``-k language``
516e2fcbf42SPeter Maydell    Use keyboard layout language (for example ``fr`` for French). This
517e2fcbf42SPeter Maydell    option is only needed where it is not easy to get raw PC keycodes
518e2fcbf42SPeter Maydell    (e.g. on Macs, with some X11 servers or with a VNC or curses
519e2fcbf42SPeter Maydell    display). You don't normally need to use it on PC/Linux or
520e2fcbf42SPeter Maydell    PC/Windows hosts.
521e2fcbf42SPeter Maydell
522e2fcbf42SPeter Maydell    The available layouts are:
523e2fcbf42SPeter Maydell
524e2fcbf42SPeter Maydell    ::
525e2fcbf42SPeter Maydell
526e2fcbf42SPeter Maydell        ar  de-ch  es  fo     fr-ca  hu  ja  mk     no  pt-br  sv
527e2fcbf42SPeter Maydell        da  en-gb  et  fr     fr-ch  is  lt  nl     pl  ru     th
528e2fcbf42SPeter Maydell        de  en-us  fi  fr-be  hr     it  lv  nl-be  pt  sl     tr
529e2fcbf42SPeter Maydell
530e2fcbf42SPeter Maydell    The default is ``en-us``.
531e2fcbf42SPeter MaydellERST
53210adb8beSMarkus Armbruster
53310adb8beSMarkus Armbruster
534f0b3d811SKővágó, ZoltánHXCOMM Deprecated by -audiodev
53510adb8beSMarkus ArmbrusterDEF("audio-help", 0, QEMU_OPTION_audio_help,
536f0b3d811SKővágó, Zoltán    "-audio-help     show -audiodev equivalent of the currently specified audio settings\n",
53710adb8beSMarkus Armbruster    QEMU_ARCH_ALL)
538e2fcbf42SPeter MaydellSRST
539e2fcbf42SPeter Maydell``-audio-help``
540e2fcbf42SPeter Maydell    Will show the -audiodev equivalent of the currently specified
541e2fcbf42SPeter Maydell    (deprecated) environment variables.
542e2fcbf42SPeter MaydellERST
543f0b3d811SKővágó, Zoltán
544f0b3d811SKővágó, ZoltánDEF("audiodev", HAS_ARG, QEMU_OPTION_audiodev,
545f0b3d811SKővágó, Zoltán    "-audiodev [driver=]driver,id=id[,prop[=value][,...]]\n"
546f0b3d811SKővágó, Zoltán    "                specifies the audio backend to use\n"
547f0b3d811SKővágó, Zoltán    "                id= identifier of the backend\n"
548f0b3d811SKővágó, Zoltán    "                timer-period= timer period in microseconds\n"
5498efac073SKővágó, Zoltán    "                in|out.mixing-engine= use mixing engine to mix streams inside QEMU\n"
550f0b3d811SKővágó, Zoltán    "                in|out.fixed-settings= use fixed settings for host audio\n"
551f0b3d811SKővágó, Zoltán    "                in|out.frequency= frequency to use with fixed settings\n"
552f0b3d811SKővágó, Zoltán    "                in|out.channels= number of channels to use with fixed settings\n"
553f0b3d811SKővágó, Zoltán    "                in|out.format= sample format to use with fixed settings\n"
554f0b3d811SKővágó, Zoltán    "                valid values: s8, s16, s32, u8, u16, u32\n"
555f0b3d811SKővágó, Zoltán    "                in|out.voices= number of voices to use\n"
5568624725bSStefan Hajnoczi    "                in|out.buffer-length= length of buffer in microseconds\n"
557f0b3d811SKővágó, Zoltán    "-audiodev none,id=id,[,prop[=value][,...]]\n"
558f0b3d811SKővágó, Zoltán    "                dummy driver that discards all output\n"
559f0b3d811SKővágó, Zoltán#ifdef CONFIG_AUDIO_ALSA
560f0b3d811SKővágó, Zoltán    "-audiodev alsa,id=id[,prop[=value][,...]]\n"
561f0b3d811SKővágó, Zoltán    "                in|out.dev= name of the audio device to use\n"
562dfc54343SStefan Hajnoczi    "                in|out.period-length= length of period in microseconds\n"
563f0b3d811SKővágó, Zoltán    "                in|out.try-poll= attempt to use poll mode\n"
564f0b3d811SKővágó, Zoltán    "                threshold= threshold (in microseconds) when playback starts\n"
565f0b3d811SKővágó, Zoltán#endif
566f0b3d811SKővágó, Zoltán#ifdef CONFIG_AUDIO_COREAUDIO
567f0b3d811SKővágó, Zoltán    "-audiodev coreaudio,id=id[,prop[=value][,...]]\n"
568f0b3d811SKővágó, Zoltán    "                in|out.buffer-count= number of buffers\n"
569f0b3d811SKővágó, Zoltán#endif
570f0b3d811SKővágó, Zoltán#ifdef CONFIG_AUDIO_DSOUND
571f0b3d811SKővágó, Zoltán    "-audiodev dsound,id=id[,prop[=value][,...]]\n"
572f0b3d811SKővágó, Zoltán    "                latency= add extra latency to playback in microseconds\n"
573f0b3d811SKővágó, Zoltán#endif
574f0b3d811SKővágó, Zoltán#ifdef CONFIG_AUDIO_OSS
575f0b3d811SKővágó, Zoltán    "-audiodev oss,id=id[,prop[=value][,...]]\n"
576f0b3d811SKővágó, Zoltán    "                in|out.dev= path of the audio device to use\n"
577f0b3d811SKővágó, Zoltán    "                in|out.buffer-count= number of buffers\n"
578f0b3d811SKővágó, Zoltán    "                in|out.try-poll= attempt to use poll mode\n"
579f0b3d811SKővágó, Zoltán    "                try-mmap= try using memory mapped access\n"
580f0b3d811SKővágó, Zoltán    "                exclusive= open device in exclusive mode\n"
581f0b3d811SKővágó, Zoltán    "                dsp-policy= set timing policy (0..10), -1 to use fragment mode\n"
582f0b3d811SKővágó, Zoltán#endif
583f0b3d811SKővágó, Zoltán#ifdef CONFIG_AUDIO_PA
584f0b3d811SKővágó, Zoltán    "-audiodev pa,id=id[,prop[=value][,...]]\n"
585f0b3d811SKővágó, Zoltán    "                server= PulseAudio server address\n"
586f0b3d811SKővágó, Zoltán    "                in|out.name= source/sink device name\n"
58714d4f011SStefan Hajnoczi    "                in|out.latency= desired latency in microseconds\n"
588f0b3d811SKővágó, Zoltán#endif
589f0b3d811SKővágó, Zoltán#ifdef CONFIG_AUDIO_SDL
590f0b3d811SKővágó, Zoltán    "-audiodev sdl,id=id[,prop[=value][,...]]\n"
591f0b3d811SKővágó, Zoltán#endif
592f0b3d811SKővágó, Zoltán#ifdef CONFIG_SPICE
593f0b3d811SKővágó, Zoltán    "-audiodev spice,id=id[,prop[=value][,...]]\n"
594f0b3d811SKővágó, Zoltán#endif
595f0b3d811SKővágó, Zoltán    "-audiodev wav,id=id[,prop[=value][,...]]\n"
596f0b3d811SKővágó, Zoltán    "                path= path of wav file to record\n",
597f0b3d811SKővágó, Zoltán    QEMU_ARCH_ALL)
598e2fcbf42SPeter MaydellSRST
599e2fcbf42SPeter Maydell``-audiodev [driver=]driver,id=id[,prop[=value][,...]]``
600e2fcbf42SPeter Maydell    Adds a new audio backend driver identified by id. There are global
601e2fcbf42SPeter Maydell    and driver specific properties. Some values can be set differently
602e2fcbf42SPeter Maydell    for input and output, they're marked with ``in|out.``. You can set
603e2fcbf42SPeter Maydell    the input's property with ``in.prop`` and the output's property with
604e2fcbf42SPeter Maydell    ``out.prop``. For example:
605e2fcbf42SPeter Maydell
606e2fcbf42SPeter Maydell    ::
607e2fcbf42SPeter Maydell
608e2fcbf42SPeter Maydell        -audiodev alsa,id=example,in.frequency=44110,out.frequency=8000
609e2fcbf42SPeter Maydell        -audiodev alsa,id=example,out.channels=1 # leaves in.channels unspecified
610e2fcbf42SPeter Maydell
611e2fcbf42SPeter Maydell    NOTE: parameter validation is known to be incomplete, in many cases
612e2fcbf42SPeter Maydell    specifying an invalid option causes QEMU to print an error message
613e2fcbf42SPeter Maydell    and continue emulation without sound.
614e2fcbf42SPeter Maydell
615e2fcbf42SPeter Maydell    Valid global options are:
616e2fcbf42SPeter Maydell
617e2fcbf42SPeter Maydell    ``id=identifier``
618e2fcbf42SPeter Maydell        Identifies the audio backend.
619e2fcbf42SPeter Maydell
620e2fcbf42SPeter Maydell    ``timer-period=period``
621e2fcbf42SPeter Maydell        Sets the timer period used by the audio subsystem in
622e2fcbf42SPeter Maydell        microseconds. Default is 10000 (10 ms).
623e2fcbf42SPeter Maydell
624e2fcbf42SPeter Maydell    ``in|out.mixing-engine=on|off``
625e2fcbf42SPeter Maydell        Use QEMU's mixing engine to mix all streams inside QEMU and
626e2fcbf42SPeter Maydell        convert audio formats when not supported by the backend. When
627e2fcbf42SPeter Maydell        off, fixed-settings must be off too. Note that disabling this
628e2fcbf42SPeter Maydell        option means that the selected backend must support multiple
629e2fcbf42SPeter Maydell        streams and the audio formats used by the virtual cards,
630e2fcbf42SPeter Maydell        otherwise you'll get no sound. It's not recommended to disable
631e2fcbf42SPeter Maydell        this option unless you want to use 5.1 or 7.1 audio, as mixing
632e2fcbf42SPeter Maydell        engine only supports mono and stereo audio. Default is on.
633e2fcbf42SPeter Maydell
634e2fcbf42SPeter Maydell    ``in|out.fixed-settings=on|off``
635e2fcbf42SPeter Maydell        Use fixed settings for host audio. When off, it will change
636e2fcbf42SPeter Maydell        based on how the guest opens the sound card. In this case you
637e2fcbf42SPeter Maydell        must not specify frequency, channels or format. Default is on.
638e2fcbf42SPeter Maydell
639e2fcbf42SPeter Maydell    ``in|out.frequency=frequency``
640e2fcbf42SPeter Maydell        Specify the frequency to use when using fixed-settings. Default
641e2fcbf42SPeter Maydell        is 44100Hz.
642e2fcbf42SPeter Maydell
643e2fcbf42SPeter Maydell    ``in|out.channels=channels``
644e2fcbf42SPeter Maydell        Specify the number of channels to use when using fixed-settings.
645e2fcbf42SPeter Maydell        Default is 2 (stereo).
646e2fcbf42SPeter Maydell
647e2fcbf42SPeter Maydell    ``in|out.format=format``
648e2fcbf42SPeter Maydell        Specify the sample format to use when using fixed-settings.
649e2fcbf42SPeter Maydell        Valid values are: ``s8``, ``s16``, ``s32``, ``u8``, ``u16``,
650e2fcbf42SPeter Maydell        ``u32``. Default is ``s16``.
651e2fcbf42SPeter Maydell
652e2fcbf42SPeter Maydell    ``in|out.voices=voices``
653e2fcbf42SPeter Maydell        Specify the number of voices to use. Default is 1.
654e2fcbf42SPeter Maydell
655e2fcbf42SPeter Maydell    ``in|out.buffer-length=usecs``
656e2fcbf42SPeter Maydell        Sets the size of the buffer in microseconds.
657e2fcbf42SPeter Maydell
658e2fcbf42SPeter Maydell``-audiodev none,id=id[,prop[=value][,...]]``
659e2fcbf42SPeter Maydell    Creates a dummy backend that discards all outputs. This backend has
660e2fcbf42SPeter Maydell    no backend specific properties.
661e2fcbf42SPeter Maydell
662e2fcbf42SPeter Maydell``-audiodev alsa,id=id[,prop[=value][,...]]``
663e2fcbf42SPeter Maydell    Creates backend using the ALSA. This backend is only available on
664e2fcbf42SPeter Maydell    Linux.
665e2fcbf42SPeter Maydell
666e2fcbf42SPeter Maydell    ALSA specific options are:
667e2fcbf42SPeter Maydell
668e2fcbf42SPeter Maydell    ``in|out.dev=device``
669e2fcbf42SPeter Maydell        Specify the ALSA device to use for input and/or output. Default
670e2fcbf42SPeter Maydell        is ``default``.
671e2fcbf42SPeter Maydell
672e2fcbf42SPeter Maydell    ``in|out.period-length=usecs``
673e2fcbf42SPeter Maydell        Sets the period length in microseconds.
674e2fcbf42SPeter Maydell
675e2fcbf42SPeter Maydell    ``in|out.try-poll=on|off``
676e2fcbf42SPeter Maydell        Attempt to use poll mode with the device. Default is on.
677e2fcbf42SPeter Maydell
678e2fcbf42SPeter Maydell    ``threshold=threshold``
679e2fcbf42SPeter Maydell        Threshold (in microseconds) when playback starts. Default is 0.
680e2fcbf42SPeter Maydell
681e2fcbf42SPeter Maydell``-audiodev coreaudio,id=id[,prop[=value][,...]]``
682e2fcbf42SPeter Maydell    Creates a backend using Apple's Core Audio. This backend is only
683e2fcbf42SPeter Maydell    available on Mac OS and only supports playback.
684e2fcbf42SPeter Maydell
685e2fcbf42SPeter Maydell    Core Audio specific options are:
686e2fcbf42SPeter Maydell
687e2fcbf42SPeter Maydell    ``in|out.buffer-count=count``
688e2fcbf42SPeter Maydell        Sets the count of the buffers.
689e2fcbf42SPeter Maydell
690e2fcbf42SPeter Maydell``-audiodev dsound,id=id[,prop[=value][,...]]``
691e2fcbf42SPeter Maydell    Creates a backend using Microsoft's DirectSound. This backend is
692e2fcbf42SPeter Maydell    only available on Windows and only supports playback.
693e2fcbf42SPeter Maydell
694e2fcbf42SPeter Maydell    DirectSound specific options are:
695e2fcbf42SPeter Maydell
696e2fcbf42SPeter Maydell    ``latency=usecs``
697e2fcbf42SPeter Maydell        Add extra usecs microseconds latency to playback. Default is
698e2fcbf42SPeter Maydell        10000 (10 ms).
699e2fcbf42SPeter Maydell
700e2fcbf42SPeter Maydell``-audiodev oss,id=id[,prop[=value][,...]]``
701e2fcbf42SPeter Maydell    Creates a backend using OSS. This backend is available on most
702e2fcbf42SPeter Maydell    Unix-like systems.
703e2fcbf42SPeter Maydell
704e2fcbf42SPeter Maydell    OSS specific options are:
705e2fcbf42SPeter Maydell
706e2fcbf42SPeter Maydell    ``in|out.dev=device``
707e2fcbf42SPeter Maydell        Specify the file name of the OSS device to use. Default is
708e2fcbf42SPeter Maydell        ``/dev/dsp``.
709e2fcbf42SPeter Maydell
710e2fcbf42SPeter Maydell    ``in|out.buffer-count=count``
711e2fcbf42SPeter Maydell        Sets the count of the buffers.
712e2fcbf42SPeter Maydell
713e2fcbf42SPeter Maydell    ``in|out.try-poll=on|of``
714e2fcbf42SPeter Maydell        Attempt to use poll mode with the device. Default is on.
715e2fcbf42SPeter Maydell
716e2fcbf42SPeter Maydell    ``try-mmap=on|off``
717e2fcbf42SPeter Maydell        Try using memory mapped device access. Default is off.
718e2fcbf42SPeter Maydell
719e2fcbf42SPeter Maydell    ``exclusive=on|off``
720e2fcbf42SPeter Maydell        Open the device in exclusive mode (vmix won't work in this
721e2fcbf42SPeter Maydell        case). Default is off.
722e2fcbf42SPeter Maydell
723e2fcbf42SPeter Maydell    ``dsp-policy=policy``
724e2fcbf42SPeter Maydell        Sets the timing policy (between 0 and 10, where smaller number
725e2fcbf42SPeter Maydell        means smaller latency but higher CPU usage). Use -1 to use
726e2fcbf42SPeter Maydell        buffer sizes specified by ``buffer`` and ``buffer-count``. This
727e2fcbf42SPeter Maydell        option is ignored if you do not have OSS 4. Default is 5.
728e2fcbf42SPeter Maydell
729e2fcbf42SPeter Maydell``-audiodev pa,id=id[,prop[=value][,...]]``
730e2fcbf42SPeter Maydell    Creates a backend using PulseAudio. This backend is available on
731e2fcbf42SPeter Maydell    most systems.
732e2fcbf42SPeter Maydell
733e2fcbf42SPeter Maydell    PulseAudio specific options are:
734e2fcbf42SPeter Maydell
735e2fcbf42SPeter Maydell    ``server=server``
736e2fcbf42SPeter Maydell        Sets the PulseAudio server to connect to.
737e2fcbf42SPeter Maydell
738e2fcbf42SPeter Maydell    ``in|out.name=sink``
739e2fcbf42SPeter Maydell        Use the specified source/sink for recording/playback.
740e2fcbf42SPeter Maydell
741e2fcbf42SPeter Maydell    ``in|out.latency=usecs``
742e2fcbf42SPeter Maydell        Desired latency in microseconds. The PulseAudio server will try
743e2fcbf42SPeter Maydell        to honor this value but actual latencies may be lower or higher.
744e2fcbf42SPeter Maydell
745e2fcbf42SPeter Maydell``-audiodev sdl,id=id[,prop[=value][,...]]``
746e2fcbf42SPeter Maydell    Creates a backend using SDL. This backend is available on most
747e2fcbf42SPeter Maydell    systems, but you should use your platform's native backend if
748e2fcbf42SPeter Maydell    possible. This backend has no backend specific properties.
749e2fcbf42SPeter Maydell
750e2fcbf42SPeter Maydell``-audiodev spice,id=id[,prop[=value][,...]]``
751e2fcbf42SPeter Maydell    Creates a backend that sends audio through SPICE. This backend
752e2fcbf42SPeter Maydell    requires ``-spice`` and automatically selected in that case, so
753e2fcbf42SPeter Maydell    usually you can ignore this option. This backend has no backend
754e2fcbf42SPeter Maydell    specific properties.
755e2fcbf42SPeter Maydell
756e2fcbf42SPeter Maydell``-audiodev wav,id=id[,prop[=value][,...]]``
757e2fcbf42SPeter Maydell    Creates a backend that writes audio to a WAV file.
758e2fcbf42SPeter Maydell
759e2fcbf42SPeter Maydell    Backend specific options are:
760e2fcbf42SPeter Maydell
761e2fcbf42SPeter Maydell    ``path=path``
762e2fcbf42SPeter Maydell        Write recorded audio into the specified file. Default is
763e2fcbf42SPeter Maydell        ``qemu.wav``.
764e2fcbf42SPeter MaydellERST
76510adb8beSMarkus Armbruster
76610adb8beSMarkus ArmbrusterDEF("soundhw", HAS_ARG, QEMU_OPTION_soundhw,
76710adb8beSMarkus Armbruster    "-soundhw c1,... enable audio support\n"
76810adb8beSMarkus Armbruster    "                and only specified sound cards (comma separated list)\n"
76910adb8beSMarkus Armbruster    "                use '-soundhw help' to get the list of supported cards\n"
77010adb8beSMarkus Armbruster    "                use '-soundhw all' to enable all of them\n", QEMU_ARCH_ALL)
771e2fcbf42SPeter MaydellSRST
772e2fcbf42SPeter Maydell``-soundhw card1[,card2,...] or -soundhw all``
773e2fcbf42SPeter Maydell    Enable audio and selected sound hardware. Use 'help' to print all
774e2fcbf42SPeter Maydell    available sound hardware. For example:
775e2fcbf42SPeter Maydell
776e2fcbf42SPeter Maydell    .. parsed-literal::
777e2fcbf42SPeter Maydell
778e2fcbf42SPeter Maydell        |qemu_system_x86| -soundhw sb16,adlib disk.img
779e2fcbf42SPeter Maydell        |qemu_system_x86| -soundhw es1370 disk.img
780e2fcbf42SPeter Maydell        |qemu_system_x86| -soundhw ac97 disk.img
781e2fcbf42SPeter Maydell        |qemu_system_x86| -soundhw hda disk.img
782e2fcbf42SPeter Maydell        |qemu_system_x86| -soundhw all disk.img
783e2fcbf42SPeter Maydell        |qemu_system_x86| -soundhw help
784e2fcbf42SPeter Maydell
785e2fcbf42SPeter Maydell    Note that Linux's i810\_audio OSS kernel (for AC97) module might
786e2fcbf42SPeter Maydell    require manually specifying clocking.
787e2fcbf42SPeter Maydell
788e2fcbf42SPeter Maydell    ::
789e2fcbf42SPeter Maydell
790e2fcbf42SPeter Maydell        modprobe i810_audio clocking=48000
791e2fcbf42SPeter MaydellERST
79210adb8beSMarkus Armbruster
79310adb8beSMarkus ArmbrusterDEF("device", HAS_ARG, QEMU_OPTION_device,
79410adb8beSMarkus Armbruster    "-device driver[,prop[=value][,...]]\n"
79510adb8beSMarkus Armbruster    "                add device (based on driver)\n"
79610adb8beSMarkus Armbruster    "                prop=value,... sets driver properties\n"
79710adb8beSMarkus Armbruster    "                use '-device help' to print all possible drivers\n"
79810adb8beSMarkus Armbruster    "                use '-device driver,help' to print all possible properties\n",
79910adb8beSMarkus Armbruster    QEMU_ARCH_ALL)
800e2fcbf42SPeter MaydellSRST
801e2fcbf42SPeter Maydell``-device driver[,prop[=value][,...]]``
802e2fcbf42SPeter Maydell    Add device driver. prop=value sets driver properties. Valid
803e2fcbf42SPeter Maydell    properties depend on the driver. To get help on possible drivers and
804e2fcbf42SPeter Maydell    properties, use ``-device help`` and ``-device driver,help``.
805e2fcbf42SPeter Maydell
806e2fcbf42SPeter Maydell    Some drivers are:
807e2fcbf42SPeter Maydell
808e2fcbf42SPeter Maydell``-device ipmi-bmc-sim,id=id[,slave_addr=val][,sdrfile=file][,furareasize=val][,furdatafile=file][,guid=uuid]``
809e2fcbf42SPeter Maydell    Add an IPMI BMC. This is a simulation of a hardware management
810e2fcbf42SPeter Maydell    interface processor that normally sits on a system. It provides a
811e2fcbf42SPeter Maydell    watchdog and the ability to reset and power control the system. You
812e2fcbf42SPeter Maydell    need to connect this to an IPMI interface to make it useful
813e2fcbf42SPeter Maydell
814e2fcbf42SPeter Maydell    The IPMI slave address to use for the BMC. The default is 0x20. This
815e2fcbf42SPeter Maydell    address is the BMC's address on the I2C network of management
816e2fcbf42SPeter Maydell    controllers. If you don't know what this means, it is safe to ignore
817e2fcbf42SPeter Maydell    it.
818e2fcbf42SPeter Maydell
819e2fcbf42SPeter Maydell    ``id=id``
820e2fcbf42SPeter Maydell        The BMC id for interfaces to use this device.
821e2fcbf42SPeter Maydell
822e2fcbf42SPeter Maydell    ``slave_addr=val``
823e2fcbf42SPeter Maydell        Define slave address to use for the BMC. The default is 0x20.
824e2fcbf42SPeter Maydell
825e2fcbf42SPeter Maydell    ``sdrfile=file``
826e2fcbf42SPeter Maydell        file containing raw Sensor Data Records (SDR) data. The default
827e2fcbf42SPeter Maydell        is none.
828e2fcbf42SPeter Maydell
829e2fcbf42SPeter Maydell    ``fruareasize=val``
830e2fcbf42SPeter Maydell        size of a Field Replaceable Unit (FRU) area. The default is
831e2fcbf42SPeter Maydell        1024.
832e2fcbf42SPeter Maydell
833e2fcbf42SPeter Maydell    ``frudatafile=file``
834e2fcbf42SPeter Maydell        file containing raw Field Replaceable Unit (FRU) inventory data.
835e2fcbf42SPeter Maydell        The default is none.
836e2fcbf42SPeter Maydell
837e2fcbf42SPeter Maydell    ``guid=uuid``
838e2fcbf42SPeter Maydell        value for the GUID for the BMC, in standard UUID format. If this
839e2fcbf42SPeter Maydell        is set, get "Get GUID" command to the BMC will return it.
840e2fcbf42SPeter Maydell        Otherwise "Get GUID" will return an error.
841e2fcbf42SPeter Maydell
842e2fcbf42SPeter Maydell``-device ipmi-bmc-extern,id=id,chardev=id[,slave_addr=val]``
843e2fcbf42SPeter Maydell    Add a connection to an external IPMI BMC simulator. Instead of
844e2fcbf42SPeter Maydell    locally emulating the BMC like the above item, instead connect to an
845e2fcbf42SPeter Maydell    external entity that provides the IPMI services.
846e2fcbf42SPeter Maydell
847e2fcbf42SPeter Maydell    A connection is made to an external BMC simulator. If you do this,
848e2fcbf42SPeter Maydell    it is strongly recommended that you use the "reconnect=" chardev
849e2fcbf42SPeter Maydell    option to reconnect to the simulator if the connection is lost. Note
850e2fcbf42SPeter Maydell    that if this is not used carefully, it can be a security issue, as
851e2fcbf42SPeter Maydell    the interface has the ability to send resets, NMIs, and power off
852e2fcbf42SPeter Maydell    the VM. It's best if QEMU makes a connection to an external
853e2fcbf42SPeter Maydell    simulator running on a secure port on localhost, so neither the
854e2fcbf42SPeter Maydell    simulator nor QEMU is exposed to any outside network.
855e2fcbf42SPeter Maydell
856e2fcbf42SPeter Maydell    See the "lanserv/README.vm" file in the OpenIPMI library for more
857e2fcbf42SPeter Maydell    details on the external interface.
858e2fcbf42SPeter Maydell
859e2fcbf42SPeter Maydell``-device isa-ipmi-kcs,bmc=id[,ioport=val][,irq=val]``
860e2fcbf42SPeter Maydell    Add a KCS IPMI interafce on the ISA bus. This also adds a
861e2fcbf42SPeter Maydell    corresponding ACPI and SMBIOS entries, if appropriate.
862e2fcbf42SPeter Maydell
863e2fcbf42SPeter Maydell    ``bmc=id``
864e2fcbf42SPeter Maydell        The BMC to connect to, one of ipmi-bmc-sim or ipmi-bmc-extern
865e2fcbf42SPeter Maydell        above.
866e2fcbf42SPeter Maydell
867e2fcbf42SPeter Maydell    ``ioport=val``
868e2fcbf42SPeter Maydell        Define the I/O address of the interface. The default is 0xca0
869e2fcbf42SPeter Maydell        for KCS.
870e2fcbf42SPeter Maydell
871e2fcbf42SPeter Maydell    ``irq=val``
872e2fcbf42SPeter Maydell        Define the interrupt to use. The default is 5. To disable
873e2fcbf42SPeter Maydell        interrupts, set this to 0.
874e2fcbf42SPeter Maydell
875e2fcbf42SPeter Maydell``-device isa-ipmi-bt,bmc=id[,ioport=val][,irq=val]``
876e2fcbf42SPeter Maydell    Like the KCS interface, but defines a BT interface. The default port
877e2fcbf42SPeter Maydell    is 0xe4 and the default interrupt is 5.
878e2fcbf42SPeter MaydellERST
87910adb8beSMarkus Armbruster
88010adb8beSMarkus ArmbrusterDEF("name", HAS_ARG, QEMU_OPTION_name,
8818f480de0SDr. David Alan Gilbert    "-name string1[,process=string2][,debug-threads=on|off]\n"
88210adb8beSMarkus Armbruster    "                set the name of the guest\n"
883479a5747SRoman Bolshakov    "                string1 sets the window title and string2 the process name\n"
884479a5747SRoman Bolshakov    "                When debug-threads is enabled, individual threads are given a separate name\n"
8858f480de0SDr. David Alan Gilbert    "                NOTE: The thread names are for debugging and not a stable API.\n",
88610adb8beSMarkus Armbruster    QEMU_ARCH_ALL)
887e2fcbf42SPeter MaydellSRST
888e2fcbf42SPeter Maydell``-name name``
889e2fcbf42SPeter Maydell    Sets the name of the guest. This name will be displayed in the SDL
890e2fcbf42SPeter Maydell    window caption. The name will also be used for the VNC server. Also
891e2fcbf42SPeter Maydell    optionally set the top visible process name in Linux. Naming of
892e2fcbf42SPeter Maydell    individual threads can also be enabled on Linux to aid debugging.
893e2fcbf42SPeter MaydellERST
89410adb8beSMarkus Armbruster
89510adb8beSMarkus ArmbrusterDEF("uuid", HAS_ARG, QEMU_OPTION_uuid,
89610adb8beSMarkus Armbruster    "-uuid %08x-%04x-%04x-%04x-%012x\n"
89710adb8beSMarkus Armbruster    "                specify machine UUID\n", QEMU_ARCH_ALL)
898e2fcbf42SPeter MaydellSRST
899e2fcbf42SPeter Maydell``-uuid uuid``
900e2fcbf42SPeter Maydell    Set system UUID.
901e2fcbf42SPeter MaydellERST
90210adb8beSMarkus Armbruster
90310adb8beSMarkus ArmbrusterDEFHEADING()
90410adb8beSMarkus Armbruster
905de6b4f90SMarkus ArmbrusterDEFHEADING(Block device options:)
90610adb8beSMarkus Armbruster
9075824d651Sblueswir1DEF("fda", HAS_ARG, QEMU_OPTION_fda,
908ad96090aSBlue Swirl    "-fda/-fdb file  use 'file' as floppy disk 0/1 image\n", QEMU_ARCH_ALL)
909ad96090aSBlue SwirlDEF("fdb", HAS_ARG, QEMU_OPTION_fdb, "", QEMU_ARCH_ALL)
910e2fcbf42SPeter MaydellSRST
91109ce5f2dSPeter Maydell``-fda file``
91209ce5f2dSPeter Maydell  \
91309ce5f2dSPeter Maydell``-fdb file``
914e2fcbf42SPeter Maydell    Use file as floppy disk 0/1 image (see
915e2fcbf42SPeter Maydell    :ref:`disk_005fimages`).
916e2fcbf42SPeter MaydellERST
9175824d651Sblueswir1
9185824d651Sblueswir1DEF("hda", HAS_ARG, QEMU_OPTION_hda,
919ad96090aSBlue Swirl    "-hda/-hdb file  use 'file' as IDE hard disk 0/1 image\n", QEMU_ARCH_ALL)
920ad96090aSBlue SwirlDEF("hdb", HAS_ARG, QEMU_OPTION_hdb, "", QEMU_ARCH_ALL)
9215824d651Sblueswir1DEF("hdc", HAS_ARG, QEMU_OPTION_hdc,
922ad96090aSBlue Swirl    "-hdc/-hdd file  use 'file' as IDE hard disk 2/3 image\n", QEMU_ARCH_ALL)
923ad96090aSBlue SwirlDEF("hdd", HAS_ARG, QEMU_OPTION_hdd, "", QEMU_ARCH_ALL)
924e2fcbf42SPeter MaydellSRST
92509ce5f2dSPeter Maydell``-hda file``
92609ce5f2dSPeter Maydell  \
92709ce5f2dSPeter Maydell``-hdb file``
92809ce5f2dSPeter Maydell  \
92909ce5f2dSPeter Maydell``-hdc file``
93009ce5f2dSPeter Maydell  \
93109ce5f2dSPeter Maydell``-hdd file``
932e2fcbf42SPeter Maydell    Use file as hard disk 0, 1, 2 or 3 image (see
933e2fcbf42SPeter Maydell    :ref:`disk_005fimages`).
934e2fcbf42SPeter MaydellERST
9355824d651Sblueswir1
9365824d651Sblueswir1DEF("cdrom", HAS_ARG, QEMU_OPTION_cdrom,
937ad96090aSBlue Swirl    "-cdrom file     use 'file' as IDE cdrom image (cdrom is ide1 master)\n",
938ad96090aSBlue Swirl    QEMU_ARCH_ALL)
939e2fcbf42SPeter MaydellSRST
940e2fcbf42SPeter Maydell``-cdrom file``
941e2fcbf42SPeter Maydell    Use file as CD-ROM image (you cannot use ``-hdc`` and ``-cdrom`` at
942e2fcbf42SPeter Maydell    the same time). You can use the host CD-ROM by using ``/dev/cdrom``
943e2fcbf42SPeter Maydell    as filename.
944e2fcbf42SPeter MaydellERST
9455824d651Sblueswir1
94642e5f393SMarkus ArmbrusterDEF("blockdev", HAS_ARG, QEMU_OPTION_blockdev,
94742e5f393SMarkus Armbruster    "-blockdev [driver=]driver[,node-name=N][,discard=ignore|unmap]\n"
94842e5f393SMarkus Armbruster    "          [,cache.direct=on|off][,cache.no-flush=on|off]\n"
949c9b749d7SKevin Wolf    "          [,read-only=on|off][,auto-read-only=on|off]\n"
950c9b749d7SKevin Wolf    "          [,force-share=on|off][,detect-zeroes=on|off|unmap]\n"
95142e5f393SMarkus Armbruster    "          [,driver specific parameters...]\n"
95242e5f393SMarkus Armbruster    "                configure a block backend\n", QEMU_ARCH_ALL)
953e2fcbf42SPeter MaydellSRST
954e2fcbf42SPeter Maydell``-blockdev option[,option[,option[,...]]]``
955e2fcbf42SPeter Maydell    Define a new block driver node. Some of the options apply to all
956e2fcbf42SPeter Maydell    block drivers, other options are only accepted for a specific block
957e2fcbf42SPeter Maydell    driver. See below for a list of generic options and options for the
958e2fcbf42SPeter Maydell    most common block drivers.
959e2fcbf42SPeter Maydell
960e2fcbf42SPeter Maydell    Options that expect a reference to another node (e.g. ``file``) can
961e2fcbf42SPeter Maydell    be given in two ways. Either you specify the node name of an already
962e2fcbf42SPeter Maydell    existing node (file=node-name), or you define a new node inline,
963e2fcbf42SPeter Maydell    adding options for the referenced node after a dot
964e2fcbf42SPeter Maydell    (file.filename=path,file.aio=native).
965e2fcbf42SPeter Maydell
966e2fcbf42SPeter Maydell    A block driver node created with ``-blockdev`` can be used for a
967e2fcbf42SPeter Maydell    guest device by specifying its node name for the ``drive`` property
968e2fcbf42SPeter Maydell    in a ``-device`` argument that defines a block device.
969e2fcbf42SPeter Maydell
970e2fcbf42SPeter Maydell    ``Valid options for any block driver node:``
971e2fcbf42SPeter Maydell        ``driver``
972e2fcbf42SPeter Maydell            Specifies the block driver to use for the given node.
973e2fcbf42SPeter Maydell
974e2fcbf42SPeter Maydell        ``node-name``
975e2fcbf42SPeter Maydell            This defines the name of the block driver node by which it
976e2fcbf42SPeter Maydell            will be referenced later. The name must be unique, i.e. it
977e2fcbf42SPeter Maydell            must not match the name of a different block driver node, or
978e2fcbf42SPeter Maydell            (if you use ``-drive`` as well) the ID of a drive.
979e2fcbf42SPeter Maydell
980e2fcbf42SPeter Maydell            If no node name is specified, it is automatically generated.
981e2fcbf42SPeter Maydell            The generated node name is not intended to be predictable
982e2fcbf42SPeter Maydell            and changes between QEMU invocations. For the top level, an
983e2fcbf42SPeter Maydell            explicit node name must be specified.
984e2fcbf42SPeter Maydell
985e2fcbf42SPeter Maydell        ``read-only``
986e2fcbf42SPeter Maydell            Open the node read-only. Guest write attempts will fail.
987e2fcbf42SPeter Maydell
988e2fcbf42SPeter Maydell            Note that some block drivers support only read-only access,
989e2fcbf42SPeter Maydell            either generally or in certain configurations. In this case,
990e2fcbf42SPeter Maydell            the default value ``read-only=off`` does not work and the
991e2fcbf42SPeter Maydell            option must be specified explicitly.
992e2fcbf42SPeter Maydell
993e2fcbf42SPeter Maydell        ``auto-read-only``
994e2fcbf42SPeter Maydell            If ``auto-read-only=on`` is set, QEMU may fall back to
995e2fcbf42SPeter Maydell            read-only usage even when ``read-only=off`` is requested, or
996e2fcbf42SPeter Maydell            even switch between modes as needed, e.g. depending on
997e2fcbf42SPeter Maydell            whether the image file is writable or whether a writing user
998e2fcbf42SPeter Maydell            is attached to the node.
999e2fcbf42SPeter Maydell
1000e2fcbf42SPeter Maydell        ``force-share``
1001e2fcbf42SPeter Maydell            Override the image locking system of QEMU by forcing the
1002e2fcbf42SPeter Maydell            node to utilize weaker shared access for permissions where
1003e2fcbf42SPeter Maydell            it would normally request exclusive access. When there is
1004e2fcbf42SPeter Maydell            the potential for multiple instances to have the same file
1005e2fcbf42SPeter Maydell            open (whether this invocation of QEMU is the first or the
1006e2fcbf42SPeter Maydell            second instance), both instances must permit shared access
1007e2fcbf42SPeter Maydell            for the second instance to succeed at opening the file.
1008e2fcbf42SPeter Maydell
1009e2fcbf42SPeter Maydell            Enabling ``force-share=on`` requires ``read-only=on``.
1010e2fcbf42SPeter Maydell
1011e2fcbf42SPeter Maydell        ``cache.direct``
1012e2fcbf42SPeter Maydell            The host page cache can be avoided with ``cache.direct=on``.
1013e2fcbf42SPeter Maydell            This will attempt to do disk IO directly to the guest's
1014e2fcbf42SPeter Maydell            memory. QEMU may still perform an internal copy of the data.
1015e2fcbf42SPeter Maydell
1016e2fcbf42SPeter Maydell        ``cache.no-flush``
1017e2fcbf42SPeter Maydell            In case you don't care about data integrity over host
1018e2fcbf42SPeter Maydell            failures, you can use ``cache.no-flush=on``. This option
1019e2fcbf42SPeter Maydell            tells QEMU that it never needs to write any data to the disk
1020e2fcbf42SPeter Maydell            but can instead keep things in cache. If anything goes
1021e2fcbf42SPeter Maydell            wrong, like your host losing power, the disk storage getting
1022e2fcbf42SPeter Maydell            disconnected accidentally, etc. your image will most
1023e2fcbf42SPeter Maydell            probably be rendered unusable.
1024e2fcbf42SPeter Maydell
1025e2fcbf42SPeter Maydell        ``discard=discard``
1026e2fcbf42SPeter Maydell            discard is one of "ignore" (or "off") or "unmap" (or "on")
1027e2fcbf42SPeter Maydell            and controls whether ``discard`` (also known as ``trim`` or
1028e2fcbf42SPeter Maydell            ``unmap``) requests are ignored or passed to the filesystem.
1029e2fcbf42SPeter Maydell            Some machine types may not support discard requests.
1030e2fcbf42SPeter Maydell
1031e2fcbf42SPeter Maydell        ``detect-zeroes=detect-zeroes``
1032e2fcbf42SPeter Maydell            detect-zeroes is "off", "on" or "unmap" and enables the
1033e2fcbf42SPeter Maydell            automatic conversion of plain zero writes by the OS to
1034e2fcbf42SPeter Maydell            driver specific optimized zero write commands. You may even
1035e2fcbf42SPeter Maydell            choose "unmap" if discard is set to "unmap" to allow a zero
1036e2fcbf42SPeter Maydell            write to be converted to an ``unmap`` operation.
1037e2fcbf42SPeter Maydell
1038e2fcbf42SPeter Maydell    ``Driver-specific options for file``
1039e2fcbf42SPeter Maydell        This is the protocol-level block driver for accessing regular
1040e2fcbf42SPeter Maydell        files.
1041e2fcbf42SPeter Maydell
1042e2fcbf42SPeter Maydell        ``filename``
1043e2fcbf42SPeter Maydell            The path to the image file in the local filesystem
1044e2fcbf42SPeter Maydell
1045e2fcbf42SPeter Maydell        ``aio``
1046e2fcbf42SPeter Maydell            Specifies the AIO backend (threads/native, default: threads)
1047e2fcbf42SPeter Maydell
1048e2fcbf42SPeter Maydell        ``locking``
1049e2fcbf42SPeter Maydell            Specifies whether the image file is protected with Linux OFD
1050e2fcbf42SPeter Maydell            / POSIX locks. The default is to use the Linux Open File
1051e2fcbf42SPeter Maydell            Descriptor API if available, otherwise no lock is applied.
1052e2fcbf42SPeter Maydell            (auto/on/off, default: auto)
1053e2fcbf42SPeter Maydell
1054e2fcbf42SPeter Maydell        Example:
1055e2fcbf42SPeter Maydell
1056e2fcbf42SPeter Maydell        ::
1057e2fcbf42SPeter Maydell
1058e2fcbf42SPeter Maydell            -blockdev driver=file,node-name=disk,filename=disk.img
1059e2fcbf42SPeter Maydell
1060e2fcbf42SPeter Maydell    ``Driver-specific options for raw``
1061e2fcbf42SPeter Maydell        This is the image format block driver for raw images. It is
1062e2fcbf42SPeter Maydell        usually stacked on top of a protocol level block driver such as
1063e2fcbf42SPeter Maydell        ``file``.
1064e2fcbf42SPeter Maydell
1065e2fcbf42SPeter Maydell        ``file``
1066e2fcbf42SPeter Maydell            Reference to or definition of the data source block driver
1067e2fcbf42SPeter Maydell            node (e.g. a ``file`` driver node)
1068e2fcbf42SPeter Maydell
1069e2fcbf42SPeter Maydell        Example 1:
1070e2fcbf42SPeter Maydell
1071e2fcbf42SPeter Maydell        ::
1072e2fcbf42SPeter Maydell
1073e2fcbf42SPeter Maydell            -blockdev driver=file,node-name=disk_file,filename=disk.img
1074e2fcbf42SPeter Maydell            -blockdev driver=raw,node-name=disk,file=disk_file
1075e2fcbf42SPeter Maydell
1076e2fcbf42SPeter Maydell        Example 2:
1077e2fcbf42SPeter Maydell
1078e2fcbf42SPeter Maydell        ::
1079e2fcbf42SPeter Maydell
1080e2fcbf42SPeter Maydell            -blockdev driver=raw,node-name=disk,file.driver=file,file.filename=disk.img
1081e2fcbf42SPeter Maydell
1082e2fcbf42SPeter Maydell    ``Driver-specific options for qcow2``
1083e2fcbf42SPeter Maydell        This is the image format block driver for qcow2 images. It is
1084e2fcbf42SPeter Maydell        usually stacked on top of a protocol level block driver such as
1085e2fcbf42SPeter Maydell        ``file``.
1086e2fcbf42SPeter Maydell
1087e2fcbf42SPeter Maydell        ``file``
1088e2fcbf42SPeter Maydell            Reference to or definition of the data source block driver
1089e2fcbf42SPeter Maydell            node (e.g. a ``file`` driver node)
1090e2fcbf42SPeter Maydell
1091e2fcbf42SPeter Maydell        ``backing``
1092e2fcbf42SPeter Maydell            Reference to or definition of the backing file block device
1093e2fcbf42SPeter Maydell            (default is taken from the image file). It is allowed to
1094e2fcbf42SPeter Maydell            pass ``null`` here in order to disable the default backing
1095e2fcbf42SPeter Maydell            file.
1096e2fcbf42SPeter Maydell
1097e2fcbf42SPeter Maydell        ``lazy-refcounts``
1098e2fcbf42SPeter Maydell            Whether to enable the lazy refcounts feature (on/off;
1099e2fcbf42SPeter Maydell            default is taken from the image file)
1100e2fcbf42SPeter Maydell
1101e2fcbf42SPeter Maydell        ``cache-size``
1102e2fcbf42SPeter Maydell            The maximum total size of the L2 table and refcount block
1103e2fcbf42SPeter Maydell            caches in bytes (default: the sum of l2-cache-size and
1104e2fcbf42SPeter Maydell            refcount-cache-size)
1105e2fcbf42SPeter Maydell
1106e2fcbf42SPeter Maydell        ``l2-cache-size``
1107e2fcbf42SPeter Maydell            The maximum size of the L2 table cache in bytes (default: if
1108e2fcbf42SPeter Maydell            cache-size is not specified - 32M on Linux platforms, and 8M
1109e2fcbf42SPeter Maydell            on non-Linux platforms; otherwise, as large as possible
1110e2fcbf42SPeter Maydell            within the cache-size, while permitting the requested or the
1111e2fcbf42SPeter Maydell            minimal refcount cache size)
1112e2fcbf42SPeter Maydell
1113e2fcbf42SPeter Maydell        ``refcount-cache-size``
1114e2fcbf42SPeter Maydell            The maximum size of the refcount block cache in bytes
1115e2fcbf42SPeter Maydell            (default: 4 times the cluster size; or if cache-size is
1116e2fcbf42SPeter Maydell            specified, the part of it which is not used for the L2
1117e2fcbf42SPeter Maydell            cache)
1118e2fcbf42SPeter Maydell
1119e2fcbf42SPeter Maydell        ``cache-clean-interval``
1120e2fcbf42SPeter Maydell            Clean unused entries in the L2 and refcount caches. The
1121e2fcbf42SPeter Maydell            interval is in seconds. The default value is 600 on
1122e2fcbf42SPeter Maydell            supporting platforms, and 0 on other platforms. Setting it
1123e2fcbf42SPeter Maydell            to 0 disables this feature.
1124e2fcbf42SPeter Maydell
1125e2fcbf42SPeter Maydell        ``pass-discard-request``
1126e2fcbf42SPeter Maydell            Whether discard requests to the qcow2 device should be
1127e2fcbf42SPeter Maydell            forwarded to the data source (on/off; default: on if
1128e2fcbf42SPeter Maydell            discard=unmap is specified, off otherwise)
1129e2fcbf42SPeter Maydell
1130e2fcbf42SPeter Maydell        ``pass-discard-snapshot``
1131e2fcbf42SPeter Maydell            Whether discard requests for the data source should be
1132e2fcbf42SPeter Maydell            issued when a snapshot operation (e.g. deleting a snapshot)
1133e2fcbf42SPeter Maydell            frees clusters in the qcow2 file (on/off; default: on)
1134e2fcbf42SPeter Maydell
1135e2fcbf42SPeter Maydell        ``pass-discard-other``
1136e2fcbf42SPeter Maydell            Whether discard requests for the data source should be
1137e2fcbf42SPeter Maydell            issued on other occasions where a cluster gets freed
1138e2fcbf42SPeter Maydell            (on/off; default: off)
1139e2fcbf42SPeter Maydell
1140e2fcbf42SPeter Maydell        ``overlap-check``
1141e2fcbf42SPeter Maydell            Which overlap checks to perform for writes to the image
1142e2fcbf42SPeter Maydell            (none/constant/cached/all; default: cached). For details or
1143e2fcbf42SPeter Maydell            finer granularity control refer to the QAPI documentation of
1144e2fcbf42SPeter Maydell            ``blockdev-add``.
1145e2fcbf42SPeter Maydell
1146e2fcbf42SPeter Maydell        Example 1:
1147e2fcbf42SPeter Maydell
1148e2fcbf42SPeter Maydell        ::
1149e2fcbf42SPeter Maydell
1150e2fcbf42SPeter Maydell            -blockdev driver=file,node-name=my_file,filename=/tmp/disk.qcow2
1151e2fcbf42SPeter Maydell            -blockdev driver=qcow2,node-name=hda,file=my_file,overlap-check=none,cache-size=16777216
1152e2fcbf42SPeter Maydell
1153e2fcbf42SPeter Maydell        Example 2:
1154e2fcbf42SPeter Maydell
1155e2fcbf42SPeter Maydell        ::
1156e2fcbf42SPeter Maydell
1157e2fcbf42SPeter Maydell            -blockdev driver=qcow2,node-name=disk,file.driver=http,file.filename=http://example.com/image.qcow2
1158e2fcbf42SPeter Maydell
1159e2fcbf42SPeter Maydell    ``Driver-specific options for other drivers``
1160e2fcbf42SPeter Maydell        Please refer to the QAPI documentation of the ``blockdev-add``
1161e2fcbf42SPeter Maydell        QMP command.
1162e2fcbf42SPeter MaydellERST
116342e5f393SMarkus Armbruster
11645824d651Sblueswir1DEF("drive", HAS_ARG, QEMU_OPTION_drive,
11655824d651Sblueswir1    "-drive [file=file][,if=type][,bus=n][,unit=m][,media=d][,index=i]\n"
116692196b2fSStefan Hajnoczi    "       [,cache=writethrough|writeback|none|directsync|unsafe][,format=f]\n"
1167572023f7SKevin Wolf    "       [,snapshot=on|off][,rerror=ignore|stop|report]\n"
1168d1db760dSStefan Hajnoczi    "       [,werror=ignore|stop|report|enospc][,id=name][,aio=threads|native]\n"
1169fb0490f6SStefan Hajnoczi    "       [,readonly=on|off][,copy-on-read=on|off]\n"
11702f7133b2SPeter Lieven    "       [,discard=ignore|unmap][,detect-zeroes=on|off|unmap]\n"
11713e9fab69SBenoît Canet    "       [[,bps=b]|[[,bps_rd=r][,bps_wr=w]]]\n"
11723e9fab69SBenoît Canet    "       [[,iops=i]|[[,iops_rd=r][,iops_wr=w]]]\n"
11733e9fab69SBenoît Canet    "       [[,bps_max=bm]|[[,bps_rd_max=rm][,bps_wr_max=wm]]]\n"
11743e9fab69SBenoît Canet    "       [[,iops_max=im]|[[,iops_rd_max=irm][,iops_wr_max=iwm]]]\n"
11752024c1dfSBenoît Canet    "       [[,iops_size=is]]\n"
117676f4afb4SAlberto Garcia    "       [[,group=g]]\n"
1177ad96090aSBlue Swirl    "                use 'file' as a drive image\n", QEMU_ARCH_ALL)
1178e2fcbf42SPeter MaydellSRST
1179e2fcbf42SPeter Maydell``-drive option[,option[,option[,...]]]``
1180e2fcbf42SPeter Maydell    Define a new drive. This includes creating a block driver node (the
1181e2fcbf42SPeter Maydell    backend) as well as a guest device, and is mostly a shortcut for
1182e2fcbf42SPeter Maydell    defining the corresponding ``-blockdev`` and ``-device`` options.
1183e2fcbf42SPeter Maydell
1184e2fcbf42SPeter Maydell    ``-drive`` accepts all options that are accepted by ``-blockdev``.
1185e2fcbf42SPeter Maydell    In addition, it knows the following options:
1186e2fcbf42SPeter Maydell
1187e2fcbf42SPeter Maydell    ``file=file``
1188e2fcbf42SPeter Maydell        This option defines which disk image (see
1189e2fcbf42SPeter Maydell        :ref:`disk_005fimages`) to use with this drive. If
1190e2fcbf42SPeter Maydell        the filename contains comma, you must double it (for instance,
1191e2fcbf42SPeter Maydell        "file=my,,file" to use file "my,file").
1192e2fcbf42SPeter Maydell
1193e2fcbf42SPeter Maydell        Special files such as iSCSI devices can be specified using
1194e2fcbf42SPeter Maydell        protocol specific URLs. See the section for "Device URL Syntax"
1195e2fcbf42SPeter Maydell        for more information.
1196e2fcbf42SPeter Maydell
1197e2fcbf42SPeter Maydell    ``if=interface``
1198e2fcbf42SPeter Maydell        This option defines on which type on interface the drive is
1199e2fcbf42SPeter Maydell        connected. Available types are: ide, scsi, sd, mtd, floppy,
1200e2fcbf42SPeter Maydell        pflash, virtio, none.
1201e2fcbf42SPeter Maydell
1202e2fcbf42SPeter Maydell    ``bus=bus,unit=unit``
1203e2fcbf42SPeter Maydell        These options define where is connected the drive by defining
1204e2fcbf42SPeter Maydell        the bus number and the unit id.
1205e2fcbf42SPeter Maydell
1206e2fcbf42SPeter Maydell    ``index=index``
1207e2fcbf42SPeter Maydell        This option defines where is connected the drive by using an
1208e2fcbf42SPeter Maydell        index in the list of available connectors of a given interface
1209e2fcbf42SPeter Maydell        type.
1210e2fcbf42SPeter Maydell
1211e2fcbf42SPeter Maydell    ``media=media``
1212e2fcbf42SPeter Maydell        This option defines the type of the media: disk or cdrom.
1213e2fcbf42SPeter Maydell
1214e2fcbf42SPeter Maydell    ``snapshot=snapshot``
1215e2fcbf42SPeter Maydell        snapshot is "on" or "off" and controls snapshot mode for the
1216e2fcbf42SPeter Maydell        given drive (see ``-snapshot``).
1217e2fcbf42SPeter Maydell
1218e2fcbf42SPeter Maydell    ``cache=cache``
1219e2fcbf42SPeter Maydell        cache is "none", "writeback", "unsafe", "directsync" or
1220e2fcbf42SPeter Maydell        "writethrough" and controls how the host cache is used to access
1221e2fcbf42SPeter Maydell        block data. This is a shortcut that sets the ``cache.direct``
1222e2fcbf42SPeter Maydell        and ``cache.no-flush`` options (as in ``-blockdev``), and
1223e2fcbf42SPeter Maydell        additionally ``cache.writeback``, which provides a default for
1224e2fcbf42SPeter Maydell        the ``write-cache`` option of block guest devices (as in
1225e2fcbf42SPeter Maydell        ``-device``). The modes correspond to the following settings:
1226e2fcbf42SPeter Maydell
122709ce5f2dSPeter Maydell        =============  ===============   ============   ==============
122809ce5f2dSPeter Maydell        \              cache.writeback   cache.direct   cache.no-flush
122909ce5f2dSPeter Maydell        =============  ===============   ============   ==============
123009ce5f2dSPeter Maydell        writeback      on                off            off
123109ce5f2dSPeter Maydell        none           on                on             off
123209ce5f2dSPeter Maydell        writethrough   off               off            off
123309ce5f2dSPeter Maydell        directsync     off               on             off
123409ce5f2dSPeter Maydell        unsafe         on                off            on
123509ce5f2dSPeter Maydell        =============  ===============   ============   ==============
1236e2fcbf42SPeter Maydell
1237e2fcbf42SPeter Maydell        The default mode is ``cache=writeback``.
1238e2fcbf42SPeter Maydell
1239e2fcbf42SPeter Maydell    ``aio=aio``
1240e2fcbf42SPeter Maydell        aio is "threads", or "native" and selects between pthread based
1241e2fcbf42SPeter Maydell        disk I/O and native Linux AIO.
1242e2fcbf42SPeter Maydell
1243e2fcbf42SPeter Maydell    ``format=format``
1244e2fcbf42SPeter Maydell        Specify which disk format will be used rather than detecting the
1245e2fcbf42SPeter Maydell        format. Can be used to specify format=raw to avoid interpreting
1246e2fcbf42SPeter Maydell        an untrusted format header.
1247e2fcbf42SPeter Maydell
1248e2fcbf42SPeter Maydell    ``werror=action,rerror=action``
1249e2fcbf42SPeter Maydell        Specify which action to take on write and read errors. Valid
1250e2fcbf42SPeter Maydell        actions are: "ignore" (ignore the error and try to continue),
1251e2fcbf42SPeter Maydell        "stop" (pause QEMU), "report" (report the error to the guest),
1252e2fcbf42SPeter Maydell        "enospc" (pause QEMU only if the host disk is full; report the
1253e2fcbf42SPeter Maydell        error to the guest otherwise). The default setting is
1254e2fcbf42SPeter Maydell        ``werror=enospc`` and ``rerror=report``.
1255e2fcbf42SPeter Maydell
1256e2fcbf42SPeter Maydell    ``copy-on-read=copy-on-read``
1257e2fcbf42SPeter Maydell        copy-on-read is "on" or "off" and enables whether to copy read
1258e2fcbf42SPeter Maydell        backing file sectors into the image file.
1259e2fcbf42SPeter Maydell
1260e2fcbf42SPeter Maydell    ``bps=b,bps_rd=r,bps_wr=w``
1261e2fcbf42SPeter Maydell        Specify bandwidth throttling limits in bytes per second, either
1262e2fcbf42SPeter Maydell        for all request types or for reads or writes only. Small values
1263e2fcbf42SPeter Maydell        can lead to timeouts or hangs inside the guest. A safe minimum
1264e2fcbf42SPeter Maydell        for disks is 2 MB/s.
1265e2fcbf42SPeter Maydell
1266e2fcbf42SPeter Maydell    ``bps_max=bm,bps_rd_max=rm,bps_wr_max=wm``
1267e2fcbf42SPeter Maydell        Specify bursts in bytes per second, either for all request types
1268e2fcbf42SPeter Maydell        or for reads or writes only. Bursts allow the guest I/O to spike
1269e2fcbf42SPeter Maydell        above the limit temporarily.
1270e2fcbf42SPeter Maydell
1271e2fcbf42SPeter Maydell    ``iops=i,iops_rd=r,iops_wr=w``
1272e2fcbf42SPeter Maydell        Specify request rate limits in requests per second, either for
1273e2fcbf42SPeter Maydell        all request types or for reads or writes only.
1274e2fcbf42SPeter Maydell
1275e2fcbf42SPeter Maydell    ``iops_max=bm,iops_rd_max=rm,iops_wr_max=wm``
1276e2fcbf42SPeter Maydell        Specify bursts in requests per second, either for all request
1277e2fcbf42SPeter Maydell        types or for reads or writes only. Bursts allow the guest I/O to
1278e2fcbf42SPeter Maydell        spike above the limit temporarily.
1279e2fcbf42SPeter Maydell
1280e2fcbf42SPeter Maydell    ``iops_size=is``
1281e2fcbf42SPeter Maydell        Let every is bytes of a request count as a new request for iops
1282e2fcbf42SPeter Maydell        throttling purposes. Use this option to prevent guests from
1283e2fcbf42SPeter Maydell        circumventing iops limits by sending fewer but larger requests.
1284e2fcbf42SPeter Maydell
1285e2fcbf42SPeter Maydell    ``group=g``
1286e2fcbf42SPeter Maydell        Join a throttling quota group with given name g. All drives that
1287e2fcbf42SPeter Maydell        are members of the same group are accounted for together. Use
1288e2fcbf42SPeter Maydell        this option to prevent guests from circumventing throttling
1289e2fcbf42SPeter Maydell        limits by using many small disks instead of a single larger
1290e2fcbf42SPeter Maydell        disk.
1291e2fcbf42SPeter Maydell
1292e2fcbf42SPeter Maydell    By default, the ``cache.writeback=on`` mode is used. It will report
1293e2fcbf42SPeter Maydell    data writes as completed as soon as the data is present in the host
1294e2fcbf42SPeter Maydell    page cache. This is safe as long as your guest OS makes sure to
1295e2fcbf42SPeter Maydell    correctly flush disk caches where needed. If your guest OS does not
1296e2fcbf42SPeter Maydell    handle volatile disk write caches correctly and your host crashes or
1297e2fcbf42SPeter Maydell    loses power, then the guest may experience data corruption.
1298e2fcbf42SPeter Maydell
1299e2fcbf42SPeter Maydell    For such guests, you should consider using ``cache.writeback=off``.
1300e2fcbf42SPeter Maydell    This means that the host page cache will be used to read and write
1301e2fcbf42SPeter Maydell    data, but write notification will be sent to the guest only after
1302e2fcbf42SPeter Maydell    QEMU has made sure to flush each write to the disk. Be aware that
1303e2fcbf42SPeter Maydell    this has a major impact on performance.
1304e2fcbf42SPeter Maydell
1305e2fcbf42SPeter Maydell    When using the ``-snapshot`` option, unsafe caching is always used.
1306e2fcbf42SPeter Maydell
1307e2fcbf42SPeter Maydell    Copy-on-read avoids accessing the same backing file sectors
1308e2fcbf42SPeter Maydell    repeatedly and is useful when the backing file is over a slow
1309e2fcbf42SPeter Maydell    network. By default copy-on-read is off.
1310e2fcbf42SPeter Maydell
1311e2fcbf42SPeter Maydell    Instead of ``-cdrom`` you can use:
1312e2fcbf42SPeter Maydell
1313e2fcbf42SPeter Maydell    .. parsed-literal::
1314e2fcbf42SPeter Maydell
1315e2fcbf42SPeter Maydell        |qemu_system| -drive file=file,index=2,media=cdrom
1316e2fcbf42SPeter Maydell
1317e2fcbf42SPeter Maydell    Instead of ``-hda``, ``-hdb``, ``-hdc``, ``-hdd``, you can use:
1318e2fcbf42SPeter Maydell
1319e2fcbf42SPeter Maydell    .. parsed-literal::
1320e2fcbf42SPeter Maydell
1321e2fcbf42SPeter Maydell        |qemu_system| -drive file=file,index=0,media=disk
1322e2fcbf42SPeter Maydell        |qemu_system| -drive file=file,index=1,media=disk
1323e2fcbf42SPeter Maydell        |qemu_system| -drive file=file,index=2,media=disk
1324e2fcbf42SPeter Maydell        |qemu_system| -drive file=file,index=3,media=disk
1325e2fcbf42SPeter Maydell
1326e2fcbf42SPeter Maydell    You can open an image using pre-opened file descriptors from an fd
1327e2fcbf42SPeter Maydell    set:
1328e2fcbf42SPeter Maydell
1329e2fcbf42SPeter Maydell    .. parsed-literal::
1330e2fcbf42SPeter Maydell
1331e2fcbf42SPeter Maydell        |qemu_system| \
1332e2fcbf42SPeter Maydell         -add-fd fd=3,set=2,opaque="rdwr:/path/to/file" \
1333e2fcbf42SPeter Maydell         -add-fd fd=4,set=2,opaque="rdonly:/path/to/file" \
1334e2fcbf42SPeter Maydell         -drive file=/dev/fdset/2,index=0,media=disk
1335e2fcbf42SPeter Maydell
1336e2fcbf42SPeter Maydell    You can connect a CDROM to the slave of ide0:
1337e2fcbf42SPeter Maydell
1338e2fcbf42SPeter Maydell    .. parsed-literal::
1339e2fcbf42SPeter Maydell
1340e2fcbf42SPeter Maydell        |qemu_system_x86| -drive file=file,if=ide,index=1,media=cdrom
1341e2fcbf42SPeter Maydell
1342e2fcbf42SPeter Maydell    If you don't specify the "file=" argument, you define an empty
1343e2fcbf42SPeter Maydell    drive:
1344e2fcbf42SPeter Maydell
1345e2fcbf42SPeter Maydell    .. parsed-literal::
1346e2fcbf42SPeter Maydell
1347e2fcbf42SPeter Maydell        |qemu_system_x86| -drive if=ide,index=1,media=cdrom
1348e2fcbf42SPeter Maydell
1349e2fcbf42SPeter Maydell    Instead of ``-fda``, ``-fdb``, you can use:
1350e2fcbf42SPeter Maydell
1351e2fcbf42SPeter Maydell    .. parsed-literal::
1352e2fcbf42SPeter Maydell
1353e2fcbf42SPeter Maydell        |qemu_system_x86| -drive file=file,index=0,if=floppy
1354e2fcbf42SPeter Maydell        |qemu_system_x86| -drive file=file,index=1,if=floppy
1355e2fcbf42SPeter Maydell
1356e2fcbf42SPeter Maydell    By default, interface is "ide" and index is automatically
1357e2fcbf42SPeter Maydell    incremented:
1358e2fcbf42SPeter Maydell
1359e2fcbf42SPeter Maydell    .. parsed-literal::
1360e2fcbf42SPeter Maydell
1361e2fcbf42SPeter Maydell        |qemu_system_x86| -drive file=a -drive file=b"
1362e2fcbf42SPeter Maydell
1363e2fcbf42SPeter Maydell    is interpreted like:
1364e2fcbf42SPeter Maydell
1365e2fcbf42SPeter Maydell    .. parsed-literal::
1366e2fcbf42SPeter Maydell
1367e2fcbf42SPeter Maydell        |qemu_system_x86| -hda a -hdb b
1368e2fcbf42SPeter MaydellERST
13695824d651Sblueswir1
13705824d651Sblueswir1DEF("mtdblock", HAS_ARG, QEMU_OPTION_mtdblock,
1371ad96090aSBlue Swirl    "-mtdblock file  use 'file' as on-board Flash memory image\n",
1372ad96090aSBlue Swirl    QEMU_ARCH_ALL)
1373e2fcbf42SPeter MaydellSRST
1374e2fcbf42SPeter Maydell``-mtdblock file``
1375e2fcbf42SPeter Maydell    Use file as on-board Flash memory image.
1376e2fcbf42SPeter MaydellERST
13775824d651Sblueswir1
13785824d651Sblueswir1DEF("sd", HAS_ARG, QEMU_OPTION_sd,
1379ad96090aSBlue Swirl    "-sd file        use 'file' as SecureDigital card image\n", QEMU_ARCH_ALL)
1380e2fcbf42SPeter MaydellSRST
1381e2fcbf42SPeter Maydell``-sd file``
1382e2fcbf42SPeter Maydell    Use file as SecureDigital card image.
1383e2fcbf42SPeter MaydellERST
13845824d651Sblueswir1
13855824d651Sblueswir1DEF("pflash", HAS_ARG, QEMU_OPTION_pflash,
1386ad96090aSBlue Swirl    "-pflash file    use 'file' as a parallel flash image\n", QEMU_ARCH_ALL)
1387e2fcbf42SPeter MaydellSRST
1388e2fcbf42SPeter Maydell``-pflash file``
1389e2fcbf42SPeter Maydell    Use file as a parallel flash image.
1390e2fcbf42SPeter MaydellERST
13915824d651Sblueswir1
13925824d651Sblueswir1DEF("snapshot", 0, QEMU_OPTION_snapshot,
1393ad96090aSBlue Swirl    "-snapshot       write to temporary files instead of disk image files\n",
1394ad96090aSBlue Swirl    QEMU_ARCH_ALL)
1395e2fcbf42SPeter MaydellSRST
1396e2fcbf42SPeter Maydell``-snapshot``
1397e2fcbf42SPeter Maydell    Write to temporary files instead of disk image files. In this case,
1398e2fcbf42SPeter Maydell    the raw disk image you use is not written back. You can however
1399e2fcbf42SPeter Maydell    force the write back by pressing C-a s (see
1400e2fcbf42SPeter Maydell    :ref:`disk_005fimages`).
1401e2fcbf42SPeter MaydellERST
14025824d651Sblueswir1
140374db920cSGautham R ShenoyDEF("fsdev", HAS_ARG, QEMU_OPTION_fsdev,
1404b44a6b09SGreg Kurz    "-fsdev local,id=id,path=path,security_model=mapped-xattr|mapped-file|passthrough|none\n"
1405b44a6b09SGreg Kurz    " [,writeout=immediate][,readonly][,fmode=fmode][,dmode=dmode]\n"
1406b8bbdb88SPradeep Jagadeesh    " [[,throttling.bps-total=b]|[[,throttling.bps-read=r][,throttling.bps-write=w]]]\n"
1407b8bbdb88SPradeep Jagadeesh    " [[,throttling.iops-total=i]|[[,throttling.iops-read=r][,throttling.iops-write=w]]]\n"
1408b8bbdb88SPradeep Jagadeesh    " [[,throttling.bps-total-max=bm]|[[,throttling.bps-read-max=rm][,throttling.bps-write-max=wm]]]\n"
1409b8bbdb88SPradeep Jagadeesh    " [[,throttling.iops-total-max=im]|[[,throttling.iops-read-max=irm][,throttling.iops-write-max=iwm]]]\n"
1410b44a6b09SGreg Kurz    " [[,throttling.iops-size=is]]\n"
1411b44a6b09SGreg Kurz    "-fsdev proxy,id=id,socket=socket[,writeout=immediate][,readonly]\n"
1412b44a6b09SGreg Kurz    "-fsdev proxy,id=id,sock_fd=sock_fd[,writeout=immediate][,readonly]\n"
1413b44a6b09SGreg Kurz    "-fsdev synth,id=id\n",
141474db920cSGautham R Shenoy    QEMU_ARCH_ALL)
141574db920cSGautham R Shenoy
1416e2fcbf42SPeter MaydellSRST
141709ce5f2dSPeter Maydell``-fsdev local,id=id,path=path,security_model=security_model [,writeout=writeout][,readonly][,fmode=fmode][,dmode=dmode] [,throttling.option=value[,throttling.option=value[,...]]]``
141809ce5f2dSPeter Maydell  \
141909ce5f2dSPeter Maydell``-fsdev proxy,id=id,socket=socket[,writeout=writeout][,readonly]``
142009ce5f2dSPeter Maydell  \
142109ce5f2dSPeter Maydell``-fsdev proxy,id=id,sock_fd=sock_fd[,writeout=writeout][,readonly]``
142209ce5f2dSPeter Maydell  \
142309ce5f2dSPeter Maydell``-fsdev synth,id=id[,readonly]``
1424e2fcbf42SPeter Maydell    Define a new file system device. Valid options are:
1425e2fcbf42SPeter Maydell
1426e2fcbf42SPeter Maydell    ``local``
1427e2fcbf42SPeter Maydell        Accesses to the filesystem are done by QEMU.
1428e2fcbf42SPeter Maydell
1429e2fcbf42SPeter Maydell    ``proxy``
1430e2fcbf42SPeter Maydell        Accesses to the filesystem are done by virtfs-proxy-helper(1).
1431e2fcbf42SPeter Maydell
1432e2fcbf42SPeter Maydell    ``synth``
1433e2fcbf42SPeter Maydell        Synthetic filesystem, only used by QTests.
1434e2fcbf42SPeter Maydell
1435e2fcbf42SPeter Maydell    ``id=id``
1436e2fcbf42SPeter Maydell        Specifies identifier for this device.
1437e2fcbf42SPeter Maydell
1438e2fcbf42SPeter Maydell    ``path=path``
1439e2fcbf42SPeter Maydell        Specifies the export path for the file system device. Files
1440e2fcbf42SPeter Maydell        under this path will be available to the 9p client on the guest.
1441e2fcbf42SPeter Maydell
1442e2fcbf42SPeter Maydell    ``security_model=security_model``
1443e2fcbf42SPeter Maydell        Specifies the security model to be used for this export path.
1444e2fcbf42SPeter Maydell        Supported security models are "passthrough", "mapped-xattr",
1445e2fcbf42SPeter Maydell        "mapped-file" and "none". In "passthrough" security model, files
1446e2fcbf42SPeter Maydell        are stored using the same credentials as they are created on the
1447e2fcbf42SPeter Maydell        guest. This requires QEMU to run as root. In "mapped-xattr"
1448e2fcbf42SPeter Maydell        security model, some of the file attributes like uid, gid, mode
1449e2fcbf42SPeter Maydell        bits and link target are stored as file attributes. For
1450e2fcbf42SPeter Maydell        "mapped-file" these attributes are stored in the hidden
1451e2fcbf42SPeter Maydell        .virtfs\_metadata directory. Directories exported by this
1452e2fcbf42SPeter Maydell        security model cannot interact with other unix tools. "none"
1453e2fcbf42SPeter Maydell        security model is same as passthrough except the sever won't
1454e2fcbf42SPeter Maydell        report failures if it fails to set file attributes like
1455e2fcbf42SPeter Maydell        ownership. Security model is mandatory only for local fsdriver.
1456e2fcbf42SPeter Maydell        Other fsdrivers (like proxy) don't take security model as a
1457e2fcbf42SPeter Maydell        parameter.
1458e2fcbf42SPeter Maydell
1459e2fcbf42SPeter Maydell    ``writeout=writeout``
1460e2fcbf42SPeter Maydell        This is an optional argument. The only supported value is
1461e2fcbf42SPeter Maydell        "immediate". This means that host page cache will be used to
1462e2fcbf42SPeter Maydell        read and write data but write notification will be sent to the
1463e2fcbf42SPeter Maydell        guest only when the data has been reported as written by the
1464e2fcbf42SPeter Maydell        storage subsystem.
1465e2fcbf42SPeter Maydell
1466e2fcbf42SPeter Maydell    ``readonly``
1467e2fcbf42SPeter Maydell        Enables exporting 9p share as a readonly mount for guests. By
1468e2fcbf42SPeter Maydell        default read-write access is given.
1469e2fcbf42SPeter Maydell
1470e2fcbf42SPeter Maydell    ``socket=socket``
1471e2fcbf42SPeter Maydell        Enables proxy filesystem driver to use passed socket file for
1472e2fcbf42SPeter Maydell        communicating with virtfs-proxy-helper(1).
1473e2fcbf42SPeter Maydell
1474e2fcbf42SPeter Maydell    ``sock_fd=sock_fd``
1475e2fcbf42SPeter Maydell        Enables proxy filesystem driver to use passed socket descriptor
1476e2fcbf42SPeter Maydell        for communicating with virtfs-proxy-helper(1). Usually a helper
1477e2fcbf42SPeter Maydell        like libvirt will create socketpair and pass one of the fds as
1478e2fcbf42SPeter Maydell        sock\_fd.
1479e2fcbf42SPeter Maydell
1480e2fcbf42SPeter Maydell    ``fmode=fmode``
1481e2fcbf42SPeter Maydell        Specifies the default mode for newly created files on the host.
1482e2fcbf42SPeter Maydell        Works only with security models "mapped-xattr" and
1483e2fcbf42SPeter Maydell        "mapped-file".
1484e2fcbf42SPeter Maydell
1485e2fcbf42SPeter Maydell    ``dmode=dmode``
1486e2fcbf42SPeter Maydell        Specifies the default mode for newly created directories on the
1487e2fcbf42SPeter Maydell        host. Works only with security models "mapped-xattr" and
1488e2fcbf42SPeter Maydell        "mapped-file".
1489e2fcbf42SPeter Maydell
1490e2fcbf42SPeter Maydell    ``throttling.bps-total=b,throttling.bps-read=r,throttling.bps-write=w``
1491e2fcbf42SPeter Maydell        Specify bandwidth throttling limits in bytes per second, either
1492e2fcbf42SPeter Maydell        for all request types or for reads or writes only.
1493e2fcbf42SPeter Maydell
1494e2fcbf42SPeter Maydell    ``throttling.bps-total-max=bm,bps-read-max=rm,bps-write-max=wm``
1495e2fcbf42SPeter Maydell        Specify bursts in bytes per second, either for all request types
1496e2fcbf42SPeter Maydell        or for reads or writes only. Bursts allow the guest I/O to spike
1497e2fcbf42SPeter Maydell        above the limit temporarily.
1498e2fcbf42SPeter Maydell
1499e2fcbf42SPeter Maydell    ``throttling.iops-total=i,throttling.iops-read=r, throttling.iops-write=w``
1500e2fcbf42SPeter Maydell        Specify request rate limits in requests per second, either for
1501e2fcbf42SPeter Maydell        all request types or for reads or writes only.
1502e2fcbf42SPeter Maydell
1503e2fcbf42SPeter Maydell    ``throttling.iops-total-max=im,throttling.iops-read-max=irm, throttling.iops-write-max=iwm``
1504e2fcbf42SPeter Maydell        Specify bursts in requests per second, either for all request
1505e2fcbf42SPeter Maydell        types or for reads or writes only. Bursts allow the guest I/O to
1506e2fcbf42SPeter Maydell        spike above the limit temporarily.
1507e2fcbf42SPeter Maydell
1508e2fcbf42SPeter Maydell    ``throttling.iops-size=is``
1509e2fcbf42SPeter Maydell        Let every is bytes of a request count as a new request for iops
1510e2fcbf42SPeter Maydell        throttling purposes.
1511e2fcbf42SPeter Maydell
1512e2fcbf42SPeter Maydell    -fsdev option is used along with -device driver "virtio-9p-...".
1513e2fcbf42SPeter Maydell
1514e2fcbf42SPeter Maydell``-device virtio-9p-type,fsdev=id,mount_tag=mount_tag``
1515e2fcbf42SPeter Maydell    Options for virtio-9p-... driver are:
1516e2fcbf42SPeter Maydell
1517e2fcbf42SPeter Maydell    ``type``
1518e2fcbf42SPeter Maydell        Specifies the variant to be used. Supported values are "pci",
1519e2fcbf42SPeter Maydell        "ccw" or "device", depending on the machine type.
1520e2fcbf42SPeter Maydell
1521e2fcbf42SPeter Maydell    ``fsdev=id``
1522e2fcbf42SPeter Maydell        Specifies the id value specified along with -fsdev option.
1523e2fcbf42SPeter Maydell
1524e2fcbf42SPeter Maydell    ``mount_tag=mount_tag``
1525e2fcbf42SPeter Maydell        Specifies the tag name to be used by the guest to mount this
1526e2fcbf42SPeter Maydell        export point.
1527e2fcbf42SPeter MaydellERST
152874db920cSGautham R Shenoy
15293d54abc7SGautham R ShenoyDEF("virtfs", HAS_ARG, QEMU_OPTION_virtfs,
1530b44a6b09SGreg Kurz    "-virtfs local,path=path,mount_tag=tag,security_model=mapped-xattr|mapped-file|passthrough|none\n"
15311a6ed33cSAntonios Motakis    "        [,id=id][,writeout=immediate][,readonly][,fmode=fmode][,dmode=dmode][,multidevs=remap|forbid|warn]\n"
1532b44a6b09SGreg Kurz    "-virtfs proxy,mount_tag=tag,socket=socket[,id=id][,writeout=immediate][,readonly]\n"
1533b44a6b09SGreg Kurz    "-virtfs proxy,mount_tag=tag,sock_fd=sock_fd[,id=id][,writeout=immediate][,readonly]\n"
1534b44a6b09SGreg Kurz    "-virtfs synth,mount_tag=tag[,id=id][,readonly]\n",
15353d54abc7SGautham R Shenoy    QEMU_ARCH_ALL)
15363d54abc7SGautham R Shenoy
1537e2fcbf42SPeter MaydellSRST
153809ce5f2dSPeter Maydell``-virtfs local,path=path,mount_tag=mount_tag ,security_model=security_model[,writeout=writeout][,readonly] [,fmode=fmode][,dmode=dmode][,multidevs=multidevs]``
153909ce5f2dSPeter Maydell  \
154009ce5f2dSPeter Maydell``-virtfs proxy,socket=socket,mount_tag=mount_tag [,writeout=writeout][,readonly]``
154109ce5f2dSPeter Maydell  \
154209ce5f2dSPeter Maydell``-virtfs proxy,sock_fd=sock_fd,mount_tag=mount_tag [,writeout=writeout][,readonly]``
154309ce5f2dSPeter Maydell  \
154409ce5f2dSPeter Maydell``-virtfs synth,mount_tag=mount_tag``
1545e2fcbf42SPeter Maydell    Define a new filesystem device and expose it to the guest using a
1546e2fcbf42SPeter Maydell    virtio-9p-device. The general form of a Virtual File system
1547e2fcbf42SPeter Maydell    pass-through options are:
1548e2fcbf42SPeter Maydell
1549e2fcbf42SPeter Maydell    ``local``
1550e2fcbf42SPeter Maydell        Accesses to the filesystem are done by QEMU.
1551e2fcbf42SPeter Maydell
1552e2fcbf42SPeter Maydell    ``proxy``
1553e2fcbf42SPeter Maydell        Accesses to the filesystem are done by virtfs-proxy-helper(1).
1554e2fcbf42SPeter Maydell
1555e2fcbf42SPeter Maydell    ``synth``
1556e2fcbf42SPeter Maydell        Synthetic filesystem, only used by QTests.
1557e2fcbf42SPeter Maydell
1558e2fcbf42SPeter Maydell    ``id=id``
1559e2fcbf42SPeter Maydell        Specifies identifier for the filesystem device
1560e2fcbf42SPeter Maydell
1561e2fcbf42SPeter Maydell    ``path=path``
1562e2fcbf42SPeter Maydell        Specifies the export path for the file system device. Files
1563e2fcbf42SPeter Maydell        under this path will be available to the 9p client on the guest.
1564e2fcbf42SPeter Maydell
1565e2fcbf42SPeter Maydell    ``security_model=security_model``
1566e2fcbf42SPeter Maydell        Specifies the security model to be used for this export path.
1567e2fcbf42SPeter Maydell        Supported security models are "passthrough", "mapped-xattr",
1568e2fcbf42SPeter Maydell        "mapped-file" and "none". In "passthrough" security model, files
1569e2fcbf42SPeter Maydell        are stored using the same credentials as they are created on the
1570e2fcbf42SPeter Maydell        guest. This requires QEMU to run as root. In "mapped-xattr"
1571e2fcbf42SPeter Maydell        security model, some of the file attributes like uid, gid, mode
1572e2fcbf42SPeter Maydell        bits and link target are stored as file attributes. For
1573e2fcbf42SPeter Maydell        "mapped-file" these attributes are stored in the hidden
1574e2fcbf42SPeter Maydell        .virtfs\_metadata directory. Directories exported by this
1575e2fcbf42SPeter Maydell        security model cannot interact with other unix tools. "none"
1576e2fcbf42SPeter Maydell        security model is same as passthrough except the sever won't
1577e2fcbf42SPeter Maydell        report failures if it fails to set file attributes like
1578e2fcbf42SPeter Maydell        ownership. Security model is mandatory only for local fsdriver.
1579e2fcbf42SPeter Maydell        Other fsdrivers (like proxy) don't take security model as a
1580e2fcbf42SPeter Maydell        parameter.
1581e2fcbf42SPeter Maydell
1582e2fcbf42SPeter Maydell    ``writeout=writeout``
1583e2fcbf42SPeter Maydell        This is an optional argument. The only supported value is
1584e2fcbf42SPeter Maydell        "immediate". This means that host page cache will be used to
1585e2fcbf42SPeter Maydell        read and write data but write notification will be sent to the
1586e2fcbf42SPeter Maydell        guest only when the data has been reported as written by the
1587e2fcbf42SPeter Maydell        storage subsystem.
1588e2fcbf42SPeter Maydell
1589e2fcbf42SPeter Maydell    ``readonly``
1590e2fcbf42SPeter Maydell        Enables exporting 9p share as a readonly mount for guests. By
1591e2fcbf42SPeter Maydell        default read-write access is given.
1592e2fcbf42SPeter Maydell
1593e2fcbf42SPeter Maydell    ``socket=socket``
1594e2fcbf42SPeter Maydell        Enables proxy filesystem driver to use passed socket file for
1595e2fcbf42SPeter Maydell        communicating with virtfs-proxy-helper(1). Usually a helper like
1596e2fcbf42SPeter Maydell        libvirt will create socketpair and pass one of the fds as
1597e2fcbf42SPeter Maydell        sock\_fd.
1598e2fcbf42SPeter Maydell
1599e2fcbf42SPeter Maydell    ``sock_fd``
1600e2fcbf42SPeter Maydell        Enables proxy filesystem driver to use passed 'sock\_fd' as the
1601e2fcbf42SPeter Maydell        socket descriptor for interfacing with virtfs-proxy-helper(1).
1602e2fcbf42SPeter Maydell
1603e2fcbf42SPeter Maydell    ``fmode=fmode``
1604e2fcbf42SPeter Maydell        Specifies the default mode for newly created files on the host.
1605e2fcbf42SPeter Maydell        Works only with security models "mapped-xattr" and
1606e2fcbf42SPeter Maydell        "mapped-file".
1607e2fcbf42SPeter Maydell
1608e2fcbf42SPeter Maydell    ``dmode=dmode``
1609e2fcbf42SPeter Maydell        Specifies the default mode for newly created directories on the
1610e2fcbf42SPeter Maydell        host. Works only with security models "mapped-xattr" and
1611e2fcbf42SPeter Maydell        "mapped-file".
1612e2fcbf42SPeter Maydell
1613e2fcbf42SPeter Maydell    ``mount_tag=mount_tag``
1614e2fcbf42SPeter Maydell        Specifies the tag name to be used by the guest to mount this
1615e2fcbf42SPeter Maydell        export point.
1616e2fcbf42SPeter Maydell
1617e2fcbf42SPeter Maydell    ``multidevs=multidevs``
1618e2fcbf42SPeter Maydell        Specifies how to deal with multiple devices being shared with a
1619e2fcbf42SPeter Maydell        9p export. Supported behaviours are either "remap", "forbid" or
1620e2fcbf42SPeter Maydell        "warn". The latter is the default behaviour on which virtfs 9p
1621e2fcbf42SPeter Maydell        expects only one device to be shared with the same export, and
1622e2fcbf42SPeter Maydell        if more than one device is shared and accessed via the same 9p
1623e2fcbf42SPeter Maydell        export then only a warning message is logged (once) by qemu on
1624e2fcbf42SPeter Maydell        host side. In order to avoid file ID collisions on guest you
1625e2fcbf42SPeter Maydell        should either create a separate virtfs export for each device to
1626e2fcbf42SPeter Maydell        be shared with guests (recommended way) or you might use "remap"
1627e2fcbf42SPeter Maydell        instead which allows you to share multiple devices with only one
1628e2fcbf42SPeter Maydell        export instead, which is achieved by remapping the original
1629e2fcbf42SPeter Maydell        inode numbers from host to guest in a way that would prevent
1630e2fcbf42SPeter Maydell        such collisions. Remapping inodes in such use cases is required
1631e2fcbf42SPeter Maydell        because the original device IDs from host are never passed and
1632e2fcbf42SPeter Maydell        exposed on guest. Instead all files of an export shared with
1633e2fcbf42SPeter Maydell        virtfs always share the same device id on guest. So two files
1634e2fcbf42SPeter Maydell        with identical inode numbers but from actually different devices
1635e2fcbf42SPeter Maydell        on host would otherwise cause a file ID collision and hence
1636e2fcbf42SPeter Maydell        potential misbehaviours on guest. "forbid" on the other hand
1637e2fcbf42SPeter Maydell        assumes like "warn" that only one device is shared by the same
1638e2fcbf42SPeter Maydell        export, however it will not only log a warning message but also
1639e2fcbf42SPeter Maydell        deny access to additional devices on guest. Note though that
1640e2fcbf42SPeter Maydell        "forbid" does currently not block all possible file access
1641e2fcbf42SPeter Maydell        operations (e.g. readdir() would still return entries from other
1642e2fcbf42SPeter Maydell        devices).
1643e2fcbf42SPeter MaydellERST
16443d54abc7SGautham R Shenoy
164561d70487SMarkus ArmbrusterDEF("iscsi", HAS_ARG, QEMU_OPTION_iscsi,
164661d70487SMarkus Armbruster    "-iscsi [user=user][,password=password]\n"
164761d70487SMarkus Armbruster    "       [,header-digest=CRC32C|CR32C-NONE|NONE-CRC32C|NONE\n"
164861d70487SMarkus Armbruster    "       [,initiator-name=initiator-iqn][,id=target-iqn]\n"
164961d70487SMarkus Armbruster    "       [,timeout=timeout]\n"
165061d70487SMarkus Armbruster    "                iSCSI session parameters\n", QEMU_ARCH_ALL)
165161d70487SMarkus Armbruster
1652e2fcbf42SPeter MaydellSRST
1653e2fcbf42SPeter Maydell``-iscsi``
1654e2fcbf42SPeter Maydell    Configure iSCSI session parameters.
1655e2fcbf42SPeter MaydellERST
165644743148SMarkus Armbruster
16575824d651Sblueswir1DEFHEADING()
16585824d651Sblueswir1
1659de6b4f90SMarkus ArmbrusterDEFHEADING(USB options:)
166010adb8beSMarkus Armbruster
166110adb8beSMarkus ArmbrusterDEF("usb", 0, QEMU_OPTION_usb,
166273f46fefSStefan Hajnoczi    "-usb            enable on-board USB host controller (if not enabled by default)\n",
166310adb8beSMarkus Armbruster    QEMU_ARCH_ALL)
1664e2fcbf42SPeter MaydellSRST
1665e2fcbf42SPeter Maydell``-usb``
1666e2fcbf42SPeter Maydell    Enable USB emulation on machine types with an on-board USB host
1667e2fcbf42SPeter Maydell    controller (if not enabled by default). Note that on-board USB host
1668e2fcbf42SPeter Maydell    controllers may not support USB 3.0. In this case
1669e2fcbf42SPeter Maydell    ``-device qemu-xhci`` can be used instead on machines with PCI.
1670e2fcbf42SPeter MaydellERST
167110adb8beSMarkus Armbruster
167210adb8beSMarkus ArmbrusterDEF("usbdevice", HAS_ARG, QEMU_OPTION_usbdevice,
167310adb8beSMarkus Armbruster    "-usbdevice name add the host or guest USB device 'name'\n",
167410adb8beSMarkus Armbruster    QEMU_ARCH_ALL)
1675e2fcbf42SPeter MaydellSRST
1676e2fcbf42SPeter Maydell``-usbdevice devname``
1677e2fcbf42SPeter Maydell    Add the USB device devname. Note that this option is deprecated,
1678e2fcbf42SPeter Maydell    please use ``-device usb-...`` instead. See
1679e2fcbf42SPeter Maydell    :ref:`usb_005fdevices`.
1680e2fcbf42SPeter Maydell
1681e2fcbf42SPeter Maydell    ``mouse``
1682e2fcbf42SPeter Maydell        Virtual Mouse. This will override the PS/2 mouse emulation when
1683e2fcbf42SPeter Maydell        activated.
1684e2fcbf42SPeter Maydell
1685e2fcbf42SPeter Maydell    ``tablet``
1686e2fcbf42SPeter Maydell        Pointer device that uses absolute coordinates (like a
1687e2fcbf42SPeter Maydell        touchscreen). This means QEMU is able to report the mouse
1688e2fcbf42SPeter Maydell        position without having to grab the mouse. Also overrides the
1689e2fcbf42SPeter Maydell        PS/2 mouse emulation when activated.
1690e2fcbf42SPeter Maydell
1691e2fcbf42SPeter Maydell    ``braille``
1692e2fcbf42SPeter Maydell        Braille device. This will use BrlAPI to display the braille
1693e2fcbf42SPeter Maydell        output on a real or fake device.
1694e2fcbf42SPeter MaydellERST
169510adb8beSMarkus Armbruster
169610adb8beSMarkus ArmbrusterDEFHEADING()
169710adb8beSMarkus Armbruster
1698de6b4f90SMarkus ArmbrusterDEFHEADING(Display options:)
16995824d651Sblueswir1
17001472a95bSJes SorensenDEF("display", HAS_ARG, QEMU_OPTION_display,
170188b40c68SThomas Huth#if defined(CONFIG_SPICE)
1702d8aec9d9SMarc-André Lureau    "-display spice-app[,gl=on|off]\n"
170388b40c68SThomas Huth#endif
170488b40c68SThomas Huth#if defined(CONFIG_SDL)
170588b40c68SThomas Huth    "-display sdl[,alt_grab=on|off][,ctrl_grab=on|off]\n"
17064867e47cSElie Tournier    "            [,window_close=on|off][,gl=on|core|es|off]\n"
170788b40c68SThomas Huth#endif
170888b40c68SThomas Huth#if defined(CONFIG_GTK)
1709f04ec5afSRobert Ho    "-display gtk[,grab_on_hover=on|off][,gl=on|off]|\n"
171088b40c68SThomas Huth#endif
171188b40c68SThomas Huth#if defined(CONFIG_VNC)
1712f04ec5afSRobert Ho    "-display vnc=<display>[,<optargs>]\n"
171388b40c68SThomas Huth#endif
171488b40c68SThomas Huth#if defined(CONFIG_CURSES)
17152f8b7cd5SSamuel Thibault    "-display curses[,charset=<encoding>]\n"
171688b40c68SThomas Huth#endif
171788b40c68SThomas Huth#if defined(CONFIG_OPENGL)
171888b40c68SThomas Huth    "-display egl-headless[,rendernode=<file>]\n"
171988b40c68SThomas Huth#endif
1720144aaa99SErik Skultety    "-display none\n"
172188b40c68SThomas Huth    "                select display backend type\n"
1722f04ec5afSRobert Ho    "                The default display is equivalent to\n                "
1723f04ec5afSRobert Ho#if defined(CONFIG_GTK)
172488b40c68SThomas Huth            "\"-display gtk\"\n"
1725f04ec5afSRobert Ho#elif defined(CONFIG_SDL)
172688b40c68SThomas Huth            "\"-display sdl\"\n"
1727f04ec5afSRobert Ho#elif defined(CONFIG_COCOA)
172888b40c68SThomas Huth            "\"-display cocoa\"\n"
1729f04ec5afSRobert Ho#elif defined(CONFIG_VNC)
173088b40c68SThomas Huth            "\"-vnc localhost:0,to=99,id=default\"\n"
1731f04ec5afSRobert Ho#else
173288b40c68SThomas Huth            "\"-display none\"\n"
1733f04ec5afSRobert Ho#endif
1734f04ec5afSRobert Ho    , QEMU_ARCH_ALL)
1735e2fcbf42SPeter MaydellSRST
1736e2fcbf42SPeter Maydell``-display type``
1737e2fcbf42SPeter Maydell    Select type of display to use. This option is a replacement for the
1738e2fcbf42SPeter Maydell    old style -sdl/-curses/... options. Use ``-display help`` to list
1739e2fcbf42SPeter Maydell    the available display types. Valid values for type are
1740e2fcbf42SPeter Maydell
1741e2fcbf42SPeter Maydell    ``sdl``
1742e2fcbf42SPeter Maydell        Display video output via SDL (usually in a separate graphics
1743e2fcbf42SPeter Maydell        window; see the SDL documentation for other possibilities).
1744e2fcbf42SPeter Maydell
1745e2fcbf42SPeter Maydell    ``curses``
1746e2fcbf42SPeter Maydell        Display video output via curses. For graphics device models
1747e2fcbf42SPeter Maydell        which support a text mode, QEMU can display this output using a
1748e2fcbf42SPeter Maydell        curses/ncurses interface. Nothing is displayed when the graphics
1749e2fcbf42SPeter Maydell        device is in graphical mode or if the graphics device does not
1750e2fcbf42SPeter Maydell        support a text mode. Generally only the VGA device models
1751e2fcbf42SPeter Maydell        support text mode. The font charset used by the guest can be
1752e2fcbf42SPeter Maydell        specified with the ``charset`` option, for example
1753e2fcbf42SPeter Maydell        ``charset=CP850`` for IBM CP850 encoding. The default is
1754e2fcbf42SPeter Maydell        ``CP437``.
1755e2fcbf42SPeter Maydell
1756e2fcbf42SPeter Maydell    ``none``
1757e2fcbf42SPeter Maydell        Do not display video output. The guest will still see an
1758e2fcbf42SPeter Maydell        emulated graphics card, but its output will not be displayed to
1759e2fcbf42SPeter Maydell        the QEMU user. This option differs from the -nographic option in
1760e2fcbf42SPeter Maydell        that it only affects what is done with video output; -nographic
1761e2fcbf42SPeter Maydell        also changes the destination of the serial and parallel port
1762e2fcbf42SPeter Maydell        data.
1763e2fcbf42SPeter Maydell
1764e2fcbf42SPeter Maydell    ``gtk``
1765e2fcbf42SPeter Maydell        Display video output in a GTK window. This interface provides
1766e2fcbf42SPeter Maydell        drop-down menus and other UI elements to configure and control
1767e2fcbf42SPeter Maydell        the VM during runtime.
1768e2fcbf42SPeter Maydell
1769e2fcbf42SPeter Maydell    ``vnc``
1770e2fcbf42SPeter Maydell        Start a VNC server on display <arg>
1771e2fcbf42SPeter Maydell
1772e2fcbf42SPeter Maydell    ``egl-headless``
1773e2fcbf42SPeter Maydell        Offload all OpenGL operations to a local DRI device. For any
1774e2fcbf42SPeter Maydell        graphical display, this display needs to be paired with either
1775e2fcbf42SPeter Maydell        VNC or SPICE displays.
1776e2fcbf42SPeter Maydell
1777e2fcbf42SPeter Maydell    ``spice-app``
1778e2fcbf42SPeter Maydell        Start QEMU as a Spice server and launch the default Spice client
1779e2fcbf42SPeter Maydell        application. The Spice server will redirect the serial consoles
1780e2fcbf42SPeter Maydell        and QEMU monitors. (Since 4.0)
1781e2fcbf42SPeter MaydellERST
17821472a95bSJes Sorensen
17835824d651Sblueswir1DEF("nographic", 0, QEMU_OPTION_nographic,
1784ad96090aSBlue Swirl    "-nographic      disable graphical output and redirect serial I/Os to console\n",
1785ad96090aSBlue Swirl    QEMU_ARCH_ALL)
1786e2fcbf42SPeter MaydellSRST
1787e2fcbf42SPeter Maydell``-nographic``
1788e2fcbf42SPeter Maydell    Normally, if QEMU is compiled with graphical window support, it
1789e2fcbf42SPeter Maydell    displays output such as guest graphics, guest console, and the QEMU
1790e2fcbf42SPeter Maydell    monitor in a window. With this option, you can totally disable
1791e2fcbf42SPeter Maydell    graphical output so that QEMU is a simple command line application.
1792e2fcbf42SPeter Maydell    The emulated serial port is redirected on the console and muxed with
1793e2fcbf42SPeter Maydell    the monitor (unless redirected elsewhere explicitly). Therefore, you
1794e2fcbf42SPeter Maydell    can still use QEMU to debug a Linux kernel with a serial console.
1795e2fcbf42SPeter Maydell    Use C-a h for help on switching between the console and monitor.
1796e2fcbf42SPeter MaydellERST
17975824d651Sblueswir1
17985824d651Sblueswir1DEF("curses", 0, QEMU_OPTION_curses,
1799f04ec5afSRobert Ho    "-curses         shorthand for -display curses\n",
1800ad96090aSBlue Swirl    QEMU_ARCH_ALL)
1801e2fcbf42SPeter MaydellSRST
1802e2fcbf42SPeter Maydell``-curses``
1803e2fcbf42SPeter Maydell    Normally, if QEMU is compiled with graphical window support, it
1804e2fcbf42SPeter Maydell    displays output such as guest graphics, guest console, and the QEMU
1805e2fcbf42SPeter Maydell    monitor in a window. With this option, QEMU can display the VGA
1806e2fcbf42SPeter Maydell    output when in text mode using a curses/ncurses interface. Nothing
1807e2fcbf42SPeter Maydell    is displayed in graphical mode.
1808e2fcbf42SPeter MaydellERST
18095824d651Sblueswir1
18105824d651Sblueswir1DEF("alt-grab", 0, QEMU_OPTION_alt_grab,
1811ad96090aSBlue Swirl    "-alt-grab       use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt)\n",
1812ad96090aSBlue Swirl    QEMU_ARCH_ALL)
1813e2fcbf42SPeter MaydellSRST
1814e2fcbf42SPeter Maydell``-alt-grab``
1815e2fcbf42SPeter Maydell    Use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt). Note that
1816e2fcbf42SPeter Maydell    this also affects the special keys (for fullscreen, monitor-mode
1817e2fcbf42SPeter Maydell    switching, etc).
1818e2fcbf42SPeter MaydellERST
18195824d651Sblueswir1
18200ca9f8a4SDustin KirklandDEF("ctrl-grab", 0, QEMU_OPTION_ctrl_grab,
1821ad96090aSBlue Swirl    "-ctrl-grab      use Right-Ctrl to grab mouse (instead of Ctrl-Alt)\n",
1822ad96090aSBlue Swirl    QEMU_ARCH_ALL)
1823e2fcbf42SPeter MaydellSRST
1824e2fcbf42SPeter Maydell``-ctrl-grab``
1825e2fcbf42SPeter Maydell    Use Right-Ctrl to grab mouse (instead of Ctrl-Alt). Note that this
1826e2fcbf42SPeter Maydell    also affects the special keys (for fullscreen, monitor-mode
1827e2fcbf42SPeter Maydell    switching, etc).
1828e2fcbf42SPeter MaydellERST
18290ca9f8a4SDustin Kirkland
18305824d651Sblueswir1DEF("no-quit", 0, QEMU_OPTION_no_quit,
1831ad96090aSBlue Swirl    "-no-quit        disable SDL window close capability\n", QEMU_ARCH_ALL)
1832e2fcbf42SPeter MaydellSRST
1833e2fcbf42SPeter Maydell``-no-quit``
1834e2fcbf42SPeter Maydell    Disable SDL window close capability.
1835e2fcbf42SPeter MaydellERST
18365824d651Sblueswir1
18375824d651Sblueswir1DEF("sdl", 0, QEMU_OPTION_sdl,
1838f04ec5afSRobert Ho    "-sdl            shorthand for -display sdl\n", QEMU_ARCH_ALL)
1839e2fcbf42SPeter MaydellSRST
1840e2fcbf42SPeter Maydell``-sdl``
1841e2fcbf42SPeter Maydell    Enable SDL.
1842e2fcbf42SPeter MaydellERST
18435824d651Sblueswir1
184429b0040bSGerd HoffmannDEF("spice", HAS_ARG, QEMU_OPTION_spice,
184527af7788SYonit Halperin    "-spice [port=port][,tls-port=secured-port][,x509-dir=<dir>]\n"
184627af7788SYonit Halperin    "       [,x509-key-file=<file>][,x509-key-password=<file>]\n"
184727af7788SYonit Halperin    "       [,x509-cert-file=<file>][,x509-cacert-file=<file>]\n"
1848fe4831b1SMarc-André Lureau    "       [,x509-dh-key-file=<file>][,addr=addr][,ipv4|ipv6|unix]\n"
184927af7788SYonit Halperin    "       [,tls-ciphers=<list>]\n"
185027af7788SYonit Halperin    "       [,tls-channel=[main|display|cursor|inputs|record|playback]]\n"
185127af7788SYonit Halperin    "       [,plaintext-channel=[main|display|cursor|inputs|record|playback]]\n"
185227af7788SYonit Halperin    "       [,sasl][,password=<secret>][,disable-ticketing]\n"
185327af7788SYonit Halperin    "       [,image-compression=[auto_glz|auto_lz|quic|glz|lz|off]]\n"
185427af7788SYonit Halperin    "       [,jpeg-wan-compression=[auto|never|always]]\n"
185527af7788SYonit Halperin    "       [,zlib-glz-wan-compression=[auto|never|always]]\n"
185627af7788SYonit Halperin    "       [,streaming-video=[off|all|filter]][,disable-copy-paste]\n"
18575ad24e5fSHans de Goede    "       [,disable-agent-file-xfer][,agent-mouse=[on|off]]\n"
18585ad24e5fSHans de Goede    "       [,playback-compression=[on|off]][,seamless-migration=[on|off]]\n"
18597b525508SMarc-André Lureau    "       [,gl=[on|off]][,rendernode=<file>]\n"
186027af7788SYonit Halperin    "   enable spice\n"
186127af7788SYonit Halperin    "   at least one of {port, tls-port} is mandatory\n",
186227af7788SYonit Halperin    QEMU_ARCH_ALL)
1863e2fcbf42SPeter MaydellSRST
1864e2fcbf42SPeter Maydell``-spice option[,option[,...]]``
1865e2fcbf42SPeter Maydell    Enable the spice remote desktop protocol. Valid options are
1866e2fcbf42SPeter Maydell
1867e2fcbf42SPeter Maydell    ``port=<nr>``
1868e2fcbf42SPeter Maydell        Set the TCP port spice is listening on for plaintext channels.
1869e2fcbf42SPeter Maydell
1870e2fcbf42SPeter Maydell    ``addr=<addr>``
1871e2fcbf42SPeter Maydell        Set the IP address spice is listening on. Default is any
1872e2fcbf42SPeter Maydell        address.
1873e2fcbf42SPeter Maydell
1874e2fcbf42SPeter Maydell    ``ipv4``; \ ``ipv6``; \ ``unix``
1875e2fcbf42SPeter Maydell        Force using the specified IP version.
1876e2fcbf42SPeter Maydell
1877e2fcbf42SPeter Maydell    ``password=<secret>``
1878e2fcbf42SPeter Maydell        Set the password you need to authenticate.
1879e2fcbf42SPeter Maydell
1880e2fcbf42SPeter Maydell    ``sasl``
1881e2fcbf42SPeter Maydell        Require that the client use SASL to authenticate with the spice.
1882e2fcbf42SPeter Maydell        The exact choice of authentication method used is controlled
1883e2fcbf42SPeter Maydell        from the system / user's SASL configuration file for the 'qemu'
1884e2fcbf42SPeter Maydell        service. This is typically found in /etc/sasl2/qemu.conf. If
1885e2fcbf42SPeter Maydell        running QEMU as an unprivileged user, an environment variable
1886e2fcbf42SPeter Maydell        SASL\_CONF\_PATH can be used to make it search alternate
1887e2fcbf42SPeter Maydell        locations for the service config. While some SASL auth methods
1888e2fcbf42SPeter Maydell        can also provide data encryption (eg GSSAPI), it is recommended
1889e2fcbf42SPeter Maydell        that SASL always be combined with the 'tls' and 'x509' settings
1890e2fcbf42SPeter Maydell        to enable use of SSL and server certificates. This ensures a
1891e2fcbf42SPeter Maydell        data encryption preventing compromise of authentication
1892e2fcbf42SPeter Maydell        credentials.
1893e2fcbf42SPeter Maydell
1894e2fcbf42SPeter Maydell    ``disable-ticketing``
1895e2fcbf42SPeter Maydell        Allow client connects without authentication.
1896e2fcbf42SPeter Maydell
1897e2fcbf42SPeter Maydell    ``disable-copy-paste``
1898e2fcbf42SPeter Maydell        Disable copy paste between the client and the guest.
1899e2fcbf42SPeter Maydell
1900e2fcbf42SPeter Maydell    ``disable-agent-file-xfer``
1901e2fcbf42SPeter Maydell        Disable spice-vdagent based file-xfer between the client and the
1902e2fcbf42SPeter Maydell        guest.
1903e2fcbf42SPeter Maydell
1904e2fcbf42SPeter Maydell    ``tls-port=<nr>``
1905e2fcbf42SPeter Maydell        Set the TCP port spice is listening on for encrypted channels.
1906e2fcbf42SPeter Maydell
1907e2fcbf42SPeter Maydell    ``x509-dir=<dir>``
1908e2fcbf42SPeter Maydell        Set the x509 file directory. Expects same filenames as -vnc
1909e2fcbf42SPeter Maydell        $display,x509=$dir
1910e2fcbf42SPeter Maydell
1911e2fcbf42SPeter Maydell    ``x509-key-file=<file>``; \ ``x509-key-password=<file>``; \ ``x509-cert-file=<file>``; \ ``x509-cacert-file=<file>``; \ ``x509-dh-key-file=<file>``
1912e2fcbf42SPeter Maydell        The x509 file names can also be configured individually.
1913e2fcbf42SPeter Maydell
1914e2fcbf42SPeter Maydell    ``tls-ciphers=<list>``
1915e2fcbf42SPeter Maydell        Specify which ciphers to use.
1916e2fcbf42SPeter Maydell
1917e2fcbf42SPeter Maydell    ``tls-channel=[main|display|cursor|inputs|record|playback]``; \ ``plaintext-channel=[main|display|cursor|inputs|record|playback]``
1918e2fcbf42SPeter Maydell        Force specific channel to be used with or without TLS
1919e2fcbf42SPeter Maydell        encryption. The options can be specified multiple times to
1920e2fcbf42SPeter Maydell        configure multiple channels. The special name "default" can be
1921e2fcbf42SPeter Maydell        used to set the default mode. For channels which are not
1922e2fcbf42SPeter Maydell        explicitly forced into one mode the spice client is allowed to
1923e2fcbf42SPeter Maydell        pick tls/plaintext as he pleases.
1924e2fcbf42SPeter Maydell
1925e2fcbf42SPeter Maydell    ``image-compression=[auto_glz|auto_lz|quic|glz|lz|off]``
1926e2fcbf42SPeter Maydell        Configure image compression (lossless). Default is auto\_glz.
1927e2fcbf42SPeter Maydell
1928e2fcbf42SPeter Maydell    ``jpeg-wan-compression=[auto|never|always]``; \ ``zlib-glz-wan-compression=[auto|never|always]``
1929e2fcbf42SPeter Maydell        Configure wan image compression (lossy for slow links). Default
1930e2fcbf42SPeter Maydell        is auto.
1931e2fcbf42SPeter Maydell
1932e2fcbf42SPeter Maydell    ``streaming-video=[off|all|filter]``
1933e2fcbf42SPeter Maydell        Configure video stream detection. Default is off.
1934e2fcbf42SPeter Maydell
1935e2fcbf42SPeter Maydell    ``agent-mouse=[on|off]``
1936e2fcbf42SPeter Maydell        Enable/disable passing mouse events via vdagent. Default is on.
1937e2fcbf42SPeter Maydell
1938e2fcbf42SPeter Maydell    ``playback-compression=[on|off]``
1939e2fcbf42SPeter Maydell        Enable/disable audio stream compression (using celt 0.5.1).
1940e2fcbf42SPeter Maydell        Default is on.
1941e2fcbf42SPeter Maydell
1942e2fcbf42SPeter Maydell    ``seamless-migration=[on|off]``
1943e2fcbf42SPeter Maydell        Enable/disable spice seamless migration. Default is off.
1944e2fcbf42SPeter Maydell
1945e2fcbf42SPeter Maydell    ``gl=[on|off]``
1946e2fcbf42SPeter Maydell        Enable/disable OpenGL context. Default is off.
1947e2fcbf42SPeter Maydell
1948e2fcbf42SPeter Maydell    ``rendernode=<file>``
1949e2fcbf42SPeter Maydell        DRM render node for OpenGL rendering. If not specified, it will
1950e2fcbf42SPeter Maydell        pick the first available. (Since 2.9)
1951e2fcbf42SPeter MaydellERST
195229b0040bSGerd Hoffmann
19535824d651Sblueswir1DEF("portrait", 0, QEMU_OPTION_portrait,
1954ad96090aSBlue Swirl    "-portrait       rotate graphical output 90 deg left (only PXA LCD)\n",
1955ad96090aSBlue Swirl    QEMU_ARCH_ALL)
1956e2fcbf42SPeter MaydellSRST
1957e2fcbf42SPeter Maydell``-portrait``
1958e2fcbf42SPeter Maydell    Rotate graphical output 90 deg left (only PXA LCD).
1959e2fcbf42SPeter MaydellERST
19605824d651Sblueswir1
19619312805dSVasily KhoruzhickDEF("rotate", HAS_ARG, QEMU_OPTION_rotate,
19629312805dSVasily Khoruzhick    "-rotate <deg>   rotate graphical output some deg left (only PXA LCD)\n",
19639312805dSVasily Khoruzhick    QEMU_ARCH_ALL)
1964e2fcbf42SPeter MaydellSRST
1965e2fcbf42SPeter Maydell``-rotate deg``
1966e2fcbf42SPeter Maydell    Rotate graphical output some deg left (only PXA LCD).
1967e2fcbf42SPeter MaydellERST
19689312805dSVasily Khoruzhick
19695824d651Sblueswir1DEF("vga", HAS_ARG, QEMU_OPTION_vga,
1970a94f0c5cSGerd Hoffmann    "-vga [std|cirrus|vmware|qxl|xenfb|tcx|cg3|virtio|none]\n"
1971ad96090aSBlue Swirl    "                select video card type\n", QEMU_ARCH_ALL)
1972e2fcbf42SPeter MaydellSRST
1973e2fcbf42SPeter Maydell``-vga type``
1974e2fcbf42SPeter Maydell    Select type of VGA card to emulate. Valid values for type are
1975e2fcbf42SPeter Maydell
1976e2fcbf42SPeter Maydell    ``cirrus``
1977e2fcbf42SPeter Maydell        Cirrus Logic GD5446 Video card. All Windows versions starting
1978e2fcbf42SPeter Maydell        from Windows 95 should recognize and use this graphic card. For
1979e2fcbf42SPeter Maydell        optimal performances, use 16 bit color depth in the guest and
1980e2fcbf42SPeter Maydell        the host OS. (This card was the default before QEMU 2.2)
1981e2fcbf42SPeter Maydell
1982e2fcbf42SPeter Maydell    ``std``
1983e2fcbf42SPeter Maydell        Standard VGA card with Bochs VBE extensions. If your guest OS
1984e2fcbf42SPeter Maydell        supports the VESA 2.0 VBE extensions (e.g. Windows XP) and if
1985e2fcbf42SPeter Maydell        you want to use high resolution modes (>= 1280x1024x16) then you
1986e2fcbf42SPeter Maydell        should use this option. (This card is the default since QEMU
1987e2fcbf42SPeter Maydell        2.2)
1988e2fcbf42SPeter Maydell
1989e2fcbf42SPeter Maydell    ``vmware``
1990e2fcbf42SPeter Maydell        VMWare SVGA-II compatible adapter. Use it if you have
1991e2fcbf42SPeter Maydell        sufficiently recent XFree86/XOrg server or Windows guest with a
1992e2fcbf42SPeter Maydell        driver for this card.
1993e2fcbf42SPeter Maydell
1994e2fcbf42SPeter Maydell    ``qxl``
1995e2fcbf42SPeter Maydell        QXL paravirtual graphic card. It is VGA compatible (including
1996e2fcbf42SPeter Maydell        VESA 2.0 VBE support). Works best with qxl guest drivers
1997e2fcbf42SPeter Maydell        installed though. Recommended choice when using the spice
1998e2fcbf42SPeter Maydell        protocol.
1999e2fcbf42SPeter Maydell
2000e2fcbf42SPeter Maydell    ``tcx``
2001e2fcbf42SPeter Maydell        (sun4m only) Sun TCX framebuffer. This is the default
2002e2fcbf42SPeter Maydell        framebuffer for sun4m machines and offers both 8-bit and 24-bit
2003e2fcbf42SPeter Maydell        colour depths at a fixed resolution of 1024x768.
2004e2fcbf42SPeter Maydell
2005e2fcbf42SPeter Maydell    ``cg3``
2006e2fcbf42SPeter Maydell        (sun4m only) Sun cgthree framebuffer. This is a simple 8-bit
2007e2fcbf42SPeter Maydell        framebuffer for sun4m machines available in both 1024x768
2008e2fcbf42SPeter Maydell        (OpenBIOS) and 1152x900 (OBP) resolutions aimed at people
2009e2fcbf42SPeter Maydell        wishing to run older Solaris versions.
2010e2fcbf42SPeter Maydell
2011e2fcbf42SPeter Maydell    ``virtio``
2012e2fcbf42SPeter Maydell        Virtio VGA card.
2013e2fcbf42SPeter Maydell
2014e2fcbf42SPeter Maydell    ``none``
2015e2fcbf42SPeter Maydell        Disable VGA card.
2016e2fcbf42SPeter MaydellERST
20175824d651Sblueswir1
20185824d651Sblueswir1DEF("full-screen", 0, QEMU_OPTION_full_screen,
2019ad96090aSBlue Swirl    "-full-screen    start in full screen\n", QEMU_ARCH_ALL)
2020e2fcbf42SPeter MaydellSRST
2021e2fcbf42SPeter Maydell``-full-screen``
2022e2fcbf42SPeter Maydell    Start in full screen.
2023e2fcbf42SPeter MaydellERST
20245824d651Sblueswir1
202560f9a4efSJohn SnowDEF("g", HAS_ARG, QEMU_OPTION_g ,
2026ad96090aSBlue Swirl    "-g WxH[xDEPTH]  Set the initial graphical resolution and depth\n",
20278ac919a0SLaurent Vivier    QEMU_ARCH_PPC | QEMU_ARCH_SPARC | QEMU_ARCH_M68K)
2028e2fcbf42SPeter MaydellSRST
202909ce5f2dSPeter Maydell``-g`` *width*\ ``x``\ *height*\ ``[x``\ *depth*\ ``]``
2030e2fcbf42SPeter Maydell    Set the initial graphical resolution and depth (PPC, SPARC only).
2031e2fcbf42SPeter Maydell
2032e2fcbf42SPeter Maydell    For PPC the default is 800x600x32.
2033e2fcbf42SPeter Maydell
2034e2fcbf42SPeter Maydell    For SPARC with the TCX graphics device, the default is 1024x768x8
2035e2fcbf42SPeter Maydell    with the option of 1024x768x24. For cgthree, the default is
2036e2fcbf42SPeter Maydell    1024x768x8 with the option of 1152x900x8 for people who wish to use
2037e2fcbf42SPeter Maydell    OBP.
2038e2fcbf42SPeter MaydellERST
20395824d651Sblueswir1
20405824d651Sblueswir1DEF("vnc", HAS_ARG, QEMU_OPTION_vnc ,
2041f04ec5afSRobert Ho    "-vnc <display>  shorthand for -display vnc=<display>\n", QEMU_ARCH_ALL)
2042e2fcbf42SPeter MaydellSRST
2043e2fcbf42SPeter Maydell``-vnc display[,option[,option[,...]]]``
2044e2fcbf42SPeter Maydell    Normally, if QEMU is compiled with graphical window support, it
2045e2fcbf42SPeter Maydell    displays output such as guest graphics, guest console, and the QEMU
2046e2fcbf42SPeter Maydell    monitor in a window. With this option, you can have QEMU listen on
2047e2fcbf42SPeter Maydell    VNC display display and redirect the VGA display over the VNC
2048e2fcbf42SPeter Maydell    session. It is very useful to enable the usb tablet device when
2049e2fcbf42SPeter Maydell    using this option (option ``-device usb-tablet``). When using the
2050e2fcbf42SPeter Maydell    VNC display, you must use the ``-k`` parameter to set the keyboard
2051e2fcbf42SPeter Maydell    layout if you are not using en-us. Valid syntax for the display is
2052e2fcbf42SPeter Maydell
2053e2fcbf42SPeter Maydell    ``to=L``
2054e2fcbf42SPeter Maydell        With this option, QEMU will try next available VNC displays,
2055e2fcbf42SPeter Maydell        until the number L, if the origianlly defined "-vnc display" is
2056e2fcbf42SPeter Maydell        not available, e.g. port 5900+display is already used by another
2057e2fcbf42SPeter Maydell        application. By default, to=0.
2058e2fcbf42SPeter Maydell
2059e2fcbf42SPeter Maydell    ``host:d``
2060e2fcbf42SPeter Maydell        TCP connections will only be allowed from host on display d. By
2061e2fcbf42SPeter Maydell        convention the TCP port is 5900+d. Optionally, host can be
2062e2fcbf42SPeter Maydell        omitted in which case the server will accept connections from
2063e2fcbf42SPeter Maydell        any host.
2064e2fcbf42SPeter Maydell
2065e2fcbf42SPeter Maydell    ``unix:path``
2066e2fcbf42SPeter Maydell        Connections will be allowed over UNIX domain sockets where path
2067e2fcbf42SPeter Maydell        is the location of a unix socket to listen for connections on.
2068e2fcbf42SPeter Maydell
2069e2fcbf42SPeter Maydell    ``none``
2070e2fcbf42SPeter Maydell        VNC is initialized but not started. The monitor ``change``
2071e2fcbf42SPeter Maydell        command can be used to later start the VNC server.
2072e2fcbf42SPeter Maydell
2073e2fcbf42SPeter Maydell    Following the display value there may be one or more option flags
2074e2fcbf42SPeter Maydell    separated by commas. Valid options are
2075e2fcbf42SPeter Maydell
2076e2fcbf42SPeter Maydell    ``reverse``
2077e2fcbf42SPeter Maydell        Connect to a listening VNC client via a "reverse" connection.
2078e2fcbf42SPeter Maydell        The client is specified by the display. For reverse network
2079e2fcbf42SPeter Maydell        connections (host:d,``reverse``), the d argument is a TCP port
2080e2fcbf42SPeter Maydell        number, not a display number.
2081e2fcbf42SPeter Maydell
2082e2fcbf42SPeter Maydell    ``websocket``
2083e2fcbf42SPeter Maydell        Opens an additional TCP listening port dedicated to VNC
2084e2fcbf42SPeter Maydell        Websocket connections. If a bare websocket option is given, the
2085e2fcbf42SPeter Maydell        Websocket port is 5700+display. An alternative port can be
2086e2fcbf42SPeter Maydell        specified with the syntax ``websocket``\ =port.
2087e2fcbf42SPeter Maydell
2088e2fcbf42SPeter Maydell        If host is specified connections will only be allowed from this
2089e2fcbf42SPeter Maydell        host. It is possible to control the websocket listen address
2090e2fcbf42SPeter Maydell        independently, using the syntax ``websocket``\ =host:port.
2091e2fcbf42SPeter Maydell
2092e2fcbf42SPeter Maydell        If no TLS credentials are provided, the websocket connection
2093e2fcbf42SPeter Maydell        runs in unencrypted mode. If TLS credentials are provided, the
2094e2fcbf42SPeter Maydell        websocket connection requires encrypted client connections.
2095e2fcbf42SPeter Maydell
2096e2fcbf42SPeter Maydell    ``password``
2097e2fcbf42SPeter Maydell        Require that password based authentication is used for client
2098e2fcbf42SPeter Maydell        connections.
2099e2fcbf42SPeter Maydell
2100e2fcbf42SPeter Maydell        The password must be set separately using the ``set_password``
2101e2fcbf42SPeter Maydell        command in the :ref:`pcsys_005fmonitor`. The
2102e2fcbf42SPeter Maydell        syntax to change your password is:
2103e2fcbf42SPeter Maydell        ``set_password <protocol> <password>`` where <protocol> could be
2104e2fcbf42SPeter Maydell        either "vnc" or "spice".
2105e2fcbf42SPeter Maydell
2106e2fcbf42SPeter Maydell        If you would like to change <protocol> password expiration, you
2107e2fcbf42SPeter Maydell        should use ``expire_password <protocol> <expiration-time>``
2108e2fcbf42SPeter Maydell        where expiration time could be one of the following options:
2109e2fcbf42SPeter Maydell        now, never, +seconds or UNIX time of expiration, e.g. +60 to
2110e2fcbf42SPeter Maydell        make password expire in 60 seconds, or 1335196800 to make
2111e2fcbf42SPeter Maydell        password expire on "Mon Apr 23 12:00:00 EDT 2012" (UNIX time for
2112e2fcbf42SPeter Maydell        this date and time).
2113e2fcbf42SPeter Maydell
2114e2fcbf42SPeter Maydell        You can also use keywords "now" or "never" for the expiration
2115e2fcbf42SPeter Maydell        time to allow <protocol> password to expire immediately or never
2116e2fcbf42SPeter Maydell        expire.
2117e2fcbf42SPeter Maydell
2118e2fcbf42SPeter Maydell    ``tls-creds=ID``
2119e2fcbf42SPeter Maydell        Provides the ID of a set of TLS credentials to use to secure the
2120e2fcbf42SPeter Maydell        VNC server. They will apply to both the normal VNC server socket
2121e2fcbf42SPeter Maydell        and the websocket socket (if enabled). Setting TLS credentials
2122e2fcbf42SPeter Maydell        will cause the VNC server socket to enable the VeNCrypt auth
2123e2fcbf42SPeter Maydell        mechanism. The credentials should have been previously created
2124e2fcbf42SPeter Maydell        using the ``-object tls-creds`` argument.
2125e2fcbf42SPeter Maydell
2126e2fcbf42SPeter Maydell    ``tls-authz=ID``
2127e2fcbf42SPeter Maydell        Provides the ID of the QAuthZ authorization object against which
2128e2fcbf42SPeter Maydell        the client's x509 distinguished name will validated. This object
2129e2fcbf42SPeter Maydell        is only resolved at time of use, so can be deleted and recreated
2130e2fcbf42SPeter Maydell        on the fly while the VNC server is active. If missing, it will
2131e2fcbf42SPeter Maydell        default to denying access.
2132e2fcbf42SPeter Maydell
2133e2fcbf42SPeter Maydell    ``sasl``
2134e2fcbf42SPeter Maydell        Require that the client use SASL to authenticate with the VNC
2135e2fcbf42SPeter Maydell        server. The exact choice of authentication method used is
2136e2fcbf42SPeter Maydell        controlled from the system / user's SASL configuration file for
2137e2fcbf42SPeter Maydell        the 'qemu' service. This is typically found in
2138e2fcbf42SPeter Maydell        /etc/sasl2/qemu.conf. If running QEMU as an unprivileged user,
2139e2fcbf42SPeter Maydell        an environment variable SASL\_CONF\_PATH can be used to make it
2140e2fcbf42SPeter Maydell        search alternate locations for the service config. While some
2141e2fcbf42SPeter Maydell        SASL auth methods can also provide data encryption (eg GSSAPI),
2142e2fcbf42SPeter Maydell        it is recommended that SASL always be combined with the 'tls'
2143e2fcbf42SPeter Maydell        and 'x509' settings to enable use of SSL and server
2144e2fcbf42SPeter Maydell        certificates. This ensures a data encryption preventing
2145e2fcbf42SPeter Maydell        compromise of authentication credentials. See the
2146e2fcbf42SPeter Maydell        :ref:`vnc_005fsecurity` section for details on
2147e2fcbf42SPeter Maydell        using SASL authentication.
2148e2fcbf42SPeter Maydell
2149e2fcbf42SPeter Maydell    ``sasl-authz=ID``
2150e2fcbf42SPeter Maydell        Provides the ID of the QAuthZ authorization object against which
2151e2fcbf42SPeter Maydell        the client's SASL username will validated. This object is only
2152e2fcbf42SPeter Maydell        resolved at time of use, so can be deleted and recreated on the
2153e2fcbf42SPeter Maydell        fly while the VNC server is active. If missing, it will default
2154e2fcbf42SPeter Maydell        to denying access.
2155e2fcbf42SPeter Maydell
2156e2fcbf42SPeter Maydell    ``acl``
2157e2fcbf42SPeter Maydell        Legacy method for enabling authorization of clients against the
2158e2fcbf42SPeter Maydell        x509 distinguished name and SASL username. It results in the
2159e2fcbf42SPeter Maydell        creation of two ``authz-list`` objects with IDs of
2160e2fcbf42SPeter Maydell        ``vnc.username`` and ``vnc.x509dname``. The rules for these
2161e2fcbf42SPeter Maydell        objects must be configured with the HMP ACL commands.
2162e2fcbf42SPeter Maydell
2163e2fcbf42SPeter Maydell        This option is deprecated and should no longer be used. The new
2164e2fcbf42SPeter Maydell        ``sasl-authz`` and ``tls-authz`` options are a replacement.
2165e2fcbf42SPeter Maydell
2166e2fcbf42SPeter Maydell    ``lossy``
2167e2fcbf42SPeter Maydell        Enable lossy compression methods (gradient, JPEG, ...). If this
2168e2fcbf42SPeter Maydell        option is set, VNC client may receive lossy framebuffer updates
2169e2fcbf42SPeter Maydell        depending on its encoding settings. Enabling this option can
2170e2fcbf42SPeter Maydell        save a lot of bandwidth at the expense of quality.
2171e2fcbf42SPeter Maydell
2172e2fcbf42SPeter Maydell    ``non-adaptive``
2173e2fcbf42SPeter Maydell        Disable adaptive encodings. Adaptive encodings are enabled by
2174e2fcbf42SPeter Maydell        default. An adaptive encoding will try to detect frequently
2175e2fcbf42SPeter Maydell        updated screen regions, and send updates in these regions using
2176e2fcbf42SPeter Maydell        a lossy encoding (like JPEG). This can be really helpful to save
2177e2fcbf42SPeter Maydell        bandwidth when playing videos. Disabling adaptive encodings
2178e2fcbf42SPeter Maydell        restores the original static behavior of encodings like Tight.
2179e2fcbf42SPeter Maydell
2180e2fcbf42SPeter Maydell    ``share=[allow-exclusive|force-shared|ignore]``
2181e2fcbf42SPeter Maydell        Set display sharing policy. 'allow-exclusive' allows clients to
2182e2fcbf42SPeter Maydell        ask for exclusive access. As suggested by the rfb spec this is
2183e2fcbf42SPeter Maydell        implemented by dropping other connections. Connecting multiple
2184e2fcbf42SPeter Maydell        clients in parallel requires all clients asking for a shared
2185e2fcbf42SPeter Maydell        session (vncviewer: -shared switch). This is the default.
2186e2fcbf42SPeter Maydell        'force-shared' disables exclusive client access. Useful for
2187e2fcbf42SPeter Maydell        shared desktop sessions, where you don't want someone forgetting
2188e2fcbf42SPeter Maydell        specify -shared disconnect everybody else. 'ignore' completely
2189e2fcbf42SPeter Maydell        ignores the shared flag and allows everybody connect
2190e2fcbf42SPeter Maydell        unconditionally. Doesn't conform to the rfb spec but is
2191e2fcbf42SPeter Maydell        traditional QEMU behavior.
2192e2fcbf42SPeter Maydell
2193e2fcbf42SPeter Maydell    ``key-delay-ms``
2194e2fcbf42SPeter Maydell        Set keyboard delay, for key down and key up events, in
2195e2fcbf42SPeter Maydell        milliseconds. Default is 10. Keyboards are low-bandwidth
2196e2fcbf42SPeter Maydell        devices, so this slowdown can help the device and guest to keep
2197e2fcbf42SPeter Maydell        up and not lose events in case events are arriving in bulk.
2198e2fcbf42SPeter Maydell        Possible causes for the latter are flaky network connections, or
2199e2fcbf42SPeter Maydell        scripts for automated testing.
2200e2fcbf42SPeter Maydell
2201e2fcbf42SPeter Maydell    ``audiodev=audiodev``
2202e2fcbf42SPeter Maydell        Use the specified audiodev when the VNC client requests audio
2203e2fcbf42SPeter Maydell        transmission. When not using an -audiodev argument, this option
2204e2fcbf42SPeter Maydell        must be omitted, otherwise is must be present and specify a
2205e2fcbf42SPeter Maydell        valid audiodev.
2206e2fcbf42SPeter MaydellERST
22075824d651Sblueswir1
2208a3adb7adSMichael EllermanARCHHEADING(, QEMU_ARCH_I386)
22095824d651Sblueswir1
2210de6b4f90SMarkus ArmbrusterARCHHEADING(i386 target only:, QEMU_ARCH_I386)
22115824d651Sblueswir1
22125824d651Sblueswir1DEF("win2k-hack", 0, QEMU_OPTION_win2k_hack,
2213ad96090aSBlue Swirl    "-win2k-hack     use it when installing Windows 2000 to avoid a disk full bug\n",
2214ad96090aSBlue Swirl    QEMU_ARCH_I386)
2215e2fcbf42SPeter MaydellSRST
2216e2fcbf42SPeter Maydell``-win2k-hack``
2217e2fcbf42SPeter Maydell    Use it when installing Windows 2000 to avoid a disk full bug. After
2218e2fcbf42SPeter Maydell    Windows 2000 is installed, you no longer need this option (this
2219e2fcbf42SPeter Maydell    option slows down the IDE transfers).
2220e2fcbf42SPeter MaydellERST
22215824d651Sblueswir1
22225824d651Sblueswir1DEF("no-fd-bootchk", 0, QEMU_OPTION_no_fd_bootchk,
2223ad96090aSBlue Swirl    "-no-fd-bootchk  disable boot signature checking for floppy disks\n",
2224ad96090aSBlue Swirl    QEMU_ARCH_I386)
2225e2fcbf42SPeter MaydellSRST
2226e2fcbf42SPeter Maydell``-no-fd-bootchk``
2227e2fcbf42SPeter Maydell    Disable boot signature checking for floppy disks in BIOS. May be
2228e2fcbf42SPeter Maydell    needed to boot from old floppy disks.
2229e2fcbf42SPeter MaydellERST
22305824d651Sblueswir1
22315824d651Sblueswir1DEF("no-acpi", 0, QEMU_OPTION_no_acpi,
2232f5d8c8cdSShannon Zhao           "-no-acpi        disable ACPI\n", QEMU_ARCH_I386 | QEMU_ARCH_ARM)
2233e2fcbf42SPeter MaydellSRST
2234e2fcbf42SPeter Maydell``-no-acpi``
2235e2fcbf42SPeter Maydell    Disable ACPI (Advanced Configuration and Power Interface) support.
2236e2fcbf42SPeter Maydell    Use it if your guest OS complains about ACPI problems (PC target
2237e2fcbf42SPeter Maydell    machine only).
2238e2fcbf42SPeter MaydellERST
22395824d651Sblueswir1
22405824d651Sblueswir1DEF("no-hpet", 0, QEMU_OPTION_no_hpet,
2241ad96090aSBlue Swirl    "-no-hpet        disable HPET\n", QEMU_ARCH_I386)
2242e2fcbf42SPeter MaydellSRST
2243e2fcbf42SPeter Maydell``-no-hpet``
2244e2fcbf42SPeter Maydell    Disable HPET support.
2245e2fcbf42SPeter MaydellERST
22465824d651Sblueswir1
22475824d651Sblueswir1DEF("acpitable", HAS_ARG, QEMU_OPTION_acpitable,
2248104bf02eSMichael Tokarev    "-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"
2249ad96090aSBlue Swirl    "                ACPI table description\n", QEMU_ARCH_I386)
2250e2fcbf42SPeter MaydellSRST
2251e2fcbf42SPeter Maydell``-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]...]``
2252e2fcbf42SPeter Maydell    Add ACPI table with specified header fields and context from
2253e2fcbf42SPeter Maydell    specified files. For file=, take whole ACPI table from the specified
2254e2fcbf42SPeter Maydell    files, including all ACPI headers (possible overridden by other
2255e2fcbf42SPeter Maydell    options). For data=, only data portion of the table is used, all
2256e2fcbf42SPeter Maydell    header information is specified in the command line. If a SLIC table
2257e2fcbf42SPeter Maydell    is supplied to QEMU, then the SLIC's oem\_id and oem\_table\_id
2258e2fcbf42SPeter Maydell    fields will override the same in the RSDT and the FADT (a.k.a.
2259e2fcbf42SPeter Maydell    FACP), in order to ensure the field matches required by the
2260e2fcbf42SPeter Maydell    Microsoft SLIC spec and the ACPI spec.
2261e2fcbf42SPeter MaydellERST
22625824d651Sblueswir1
2263b6f6e3d3SaliguoriDEF("smbios", HAS_ARG, QEMU_OPTION_smbios,
2264b6f6e3d3Saliguori    "-smbios file=binary\n"
2265ca1a8a06SBruce Rogers    "                load SMBIOS entry from binary file\n"
2266b155eb1dSGabriel L. Somlo    "-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]\n"
2267b155eb1dSGabriel L. Somlo    "              [,uefi=on|off]\n"
2268ca1a8a06SBruce Rogers    "                specify SMBIOS type 0 fields\n"
2269b6f6e3d3Saliguori    "-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]\n"
2270b6f6e3d3Saliguori    "              [,uuid=uuid][,sku=str][,family=str]\n"
2271b155eb1dSGabriel L. Somlo    "                specify SMBIOS type 1 fields\n"
2272b155eb1dSGabriel L. Somlo    "-smbios type=2[,manufacturer=str][,product=str][,version=str][,serial=str]\n"
2273b155eb1dSGabriel L. Somlo    "              [,asset=str][,location=str]\n"
2274b155eb1dSGabriel L. Somlo    "                specify SMBIOS type 2 fields\n"
2275b155eb1dSGabriel L. Somlo    "-smbios type=3[,manufacturer=str][,version=str][,serial=str][,asset=str]\n"
2276b155eb1dSGabriel L. Somlo    "              [,sku=str]\n"
2277b155eb1dSGabriel L. Somlo    "                specify SMBIOS type 3 fields\n"
2278b155eb1dSGabriel L. Somlo    "-smbios type=4[,sock_pfx=str][,manufacturer=str][,version=str][,serial=str]\n"
2279b155eb1dSGabriel L. Somlo    "              [,asset=str][,part=str]\n"
2280b155eb1dSGabriel L. Somlo    "                specify SMBIOS type 4 fields\n"
2281b155eb1dSGabriel L. Somlo    "-smbios type=17[,loc_pfx=str][,bank=str][,manufacturer=str][,serial=str]\n"
22823ebd6cc8SGabriel L. Somlo    "               [,asset=str][,part=str][,speed=%d]\n"
2283b155eb1dSGabriel L. Somlo    "                specify SMBIOS type 17 fields\n",
2284c30e1565SWei Huang    QEMU_ARCH_I386 | QEMU_ARCH_ARM)
2285e2fcbf42SPeter MaydellSRST
2286e2fcbf42SPeter Maydell``-smbios file=binary``
2287e2fcbf42SPeter Maydell    Load SMBIOS entry from binary file.
2288e2fcbf42SPeter Maydell
2289e2fcbf42SPeter Maydell``-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d][,uefi=on|off]``
2290e2fcbf42SPeter Maydell    Specify SMBIOS type 0 fields
2291e2fcbf42SPeter Maydell
2292e2fcbf42SPeter Maydell``-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str][,uuid=uuid][,sku=str][,family=str]``
2293e2fcbf42SPeter Maydell    Specify SMBIOS type 1 fields
2294e2fcbf42SPeter Maydell
2295e2fcbf42SPeter Maydell``-smbios type=2[,manufacturer=str][,product=str][,version=str][,serial=str][,asset=str][,location=str]``
2296e2fcbf42SPeter Maydell    Specify SMBIOS type 2 fields
2297e2fcbf42SPeter Maydell
2298e2fcbf42SPeter Maydell``-smbios type=3[,manufacturer=str][,version=str][,serial=str][,asset=str][,sku=str]``
2299e2fcbf42SPeter Maydell    Specify SMBIOS type 3 fields
2300e2fcbf42SPeter Maydell
2301e2fcbf42SPeter Maydell``-smbios type=4[,sock_pfx=str][,manufacturer=str][,version=str][,serial=str][,asset=str][,part=str]``
2302e2fcbf42SPeter Maydell    Specify SMBIOS type 4 fields
2303e2fcbf42SPeter Maydell
2304e2fcbf42SPeter Maydell``-smbios type=17[,loc_pfx=str][,bank=str][,manufacturer=str][,serial=str][,asset=str][,part=str][,speed=%d]``
2305e2fcbf42SPeter Maydell    Specify SMBIOS type 17 fields
2306e2fcbf42SPeter MaydellERST
2307b6f6e3d3Saliguori
2308c70a01e4SMarkus ArmbrusterDEFHEADING()
23095824d651Sblueswir1
2310de6b4f90SMarkus ArmbrusterDEFHEADING(Network options:)
23115824d651Sblueswir1
23126a8b4a5bSThomas HuthDEF("netdev", HAS_ARG, QEMU_OPTION_netdev,
23135824d651Sblueswir1#ifdef CONFIG_SLIRP
23140b11c036SSamuel Thibault    "-netdev user,id=str[,ipv4[=on|off]][,net=addr[/mask]][,host=addr]\n"
23150b11c036SSamuel Thibault    "         [,ipv6[=on|off]][,ipv6-net=addr[/int]][,ipv6-host=addr]\n"
23160b11c036SSamuel Thibault    "         [,restrict=on|off][,hostname=host][,dhcpstart=addr]\n"
2317f18d1375SBenjamin Drung    "         [,dns=addr][,ipv6-dns=addr][,dnssearch=domain][,domainname=domain]\n"
23180fca92b9SFam Zheng    "         [,tftp=dir][,tftp-server-name=name][,bootfile=f][,hostfwd=rule][,guestfwd=rule]"
2319ad196a9dSJan Kiszka#ifndef _WIN32
2320c92ef6a2SJan Kiszka                                             "[,smb=dir[,smbserver=addr]]\n"
2321ad196a9dSJan Kiszka#endif
23226a8b4a5bSThomas Huth    "                configure a user mode network backend with ID 'str',\n"
23236a8b4a5bSThomas Huth    "                its DHCP server and optional services\n"
23245824d651Sblueswir1#endif
23255824d651Sblueswir1#ifdef _WIN32
23266a8b4a5bSThomas Huth    "-netdev tap,id=str,ifname=name\n"
23276a8b4a5bSThomas Huth    "                configure a host TAP network backend with ID 'str'\n"
23285824d651Sblueswir1#else
23296a8b4a5bSThomas Huth    "-netdev tap,id=str[,fd=h][,fds=x:y:...:z][,ifname=name][,script=file][,downscript=dfile]\n"
2330584613eaSAlexey Kardashevskiy    "         [,br=bridge][,helper=helper][,sndbuf=nbytes][,vnet_hdr=on|off][,vhost=on|off]\n"
23316a8b4a5bSThomas Huth    "         [,vhostfd=h][,vhostfds=x:y:...:z][,vhostforce=on|off][,queues=n]\n"
233269e87b32SJason Wang    "         [,poll-us=n]\n"
23336a8b4a5bSThomas Huth    "                configure a host TAP network backend with ID 'str'\n"
2334584613eaSAlexey Kardashevskiy    "                connected to a bridge (default=" DEFAULT_BRIDGE_INTERFACE ")\n"
2335a7c36ee4SCorey Bryant    "                use network scripts 'file' (default=" DEFAULT_NETWORK_SCRIPT ")\n"
2336a7c36ee4SCorey Bryant    "                to configure it and 'dfile' (default=" DEFAULT_NETWORK_DOWN_SCRIPT ")\n"
2337a7c36ee4SCorey Bryant    "                to deconfigure it\n"
2338ca1a8a06SBruce Rogers    "                use '[down]script=no' to disable script execution\n"
2339a7c36ee4SCorey Bryant    "                use network helper 'helper' (default=" DEFAULT_BRIDGE_HELPER ") to\n"
2340a7c36ee4SCorey Bryant    "                configure it\n"
23415824d651Sblueswir1    "                use 'fd=h' to connect to an already opened TAP interface\n"
23422ca81baaSJason Wang    "                use 'fds=x:y:...:z' to connect to already opened multiqueue capable TAP interfaces\n"
2343ca1a8a06SBruce Rogers    "                use 'sndbuf=nbytes' to limit the size of the send buffer (the\n"
2344f157ed20SMichael S. Tsirkin    "                default is disabled 'sndbuf=0' to enable flow control set 'sndbuf=1048576')\n"
2345ca1a8a06SBruce Rogers    "                use vnet_hdr=off to avoid enabling the IFF_VNET_HDR tap flag\n"
2346ca1a8a06SBruce Rogers    "                use vnet_hdr=on to make the lack of IFF_VNET_HDR support an error condition\n"
234782b0d80eSMichael S. Tsirkin    "                use vhost=on to enable experimental in kernel accelerator\n"
23485430a28fSmst@redhat.com    "                    (only has effect for virtio guests which use MSIX)\n"
23495430a28fSmst@redhat.com    "                use vhostforce=on to force vhost on for non-MSIX virtio guests\n"
235082b0d80eSMichael S. Tsirkin    "                use 'vhostfd=h' to connect to an already opened vhost net device\n"
23512ca81baaSJason Wang    "                use 'vhostfds=x:y:...:z to connect to multiple already opened vhost net devices\n"
2352ec396014SJason Wang    "                use 'queues=n' to specify the number of queues to be created for multiqueue TAP\n"
235369e87b32SJason Wang    "                use 'poll-us=n' to speciy the maximum number of microseconds that could be\n"
235469e87b32SJason Wang    "                spent on busy polling for vhost net\n"
23556a8b4a5bSThomas Huth    "-netdev bridge,id=str[,br=bridge][,helper=helper]\n"
23566a8b4a5bSThomas Huth    "                configure a host TAP network backend with ID 'str' that is\n"
23576a8b4a5bSThomas Huth    "                connected to a bridge (default=" DEFAULT_BRIDGE_INTERFACE ")\n"
23586a8b4a5bSThomas Huth    "                using the program 'helper (default=" DEFAULT_BRIDGE_HELPER ")\n"
23590df0ff6dSMark McLoughlin#endif
23603fb69aa1SAnton Ivanov#ifdef __linux__
23616a8b4a5bSThomas Huth    "-netdev l2tpv3,id=str,src=srcaddr,dst=dstaddr[,srcport=srcport][,dstport=dstport]\n"
23626a8b4a5bSThomas Huth    "         [,rxsession=rxsession],txsession=txsession[,ipv6=on/off][,udp=on/off]\n"
23636a8b4a5bSThomas Huth    "         [,cookie64=on/off][,counter][,pincounter][,txcookie=txcookie]\n"
23646a8b4a5bSThomas Huth    "         [,rxcookie=rxcookie][,offset=offset]\n"
23656a8b4a5bSThomas Huth    "                configure a network backend with ID 'str' connected to\n"
23666a8b4a5bSThomas Huth    "                an Ethernet over L2TPv3 pseudowire.\n"
23673fb69aa1SAnton Ivanov    "                Linux kernel 3.3+ as well as most routers can talk\n"
23682f47b403SMichael Tokarev    "                L2TPv3. This transport allows connecting a VM to a VM,\n"
23693fb69aa1SAnton Ivanov    "                VM to a router and even VM to Host. It is a nearly-universal\n"
237021843dc4SStefan Hajnoczi    "                standard (RFC3931). Note - this implementation uses static\n"
23713fb69aa1SAnton Ivanov    "                pre-configured tunnels (same as the Linux kernel).\n"
23723fb69aa1SAnton Ivanov    "                use 'src=' to specify source address\n"
23733fb69aa1SAnton Ivanov    "                use 'dst=' to specify destination address\n"
23743fb69aa1SAnton Ivanov    "                use 'udp=on' to specify udp encapsulation\n"
23753952651aSGonglei    "                use 'srcport=' to specify source udp port\n"
23763fb69aa1SAnton Ivanov    "                use 'dstport=' to specify destination udp port\n"
23773fb69aa1SAnton Ivanov    "                use 'ipv6=on' to force v6\n"
23783fb69aa1SAnton Ivanov    "                L2TPv3 uses cookies to prevent misconfiguration as\n"
23793fb69aa1SAnton Ivanov    "                well as a weak security measure\n"
23803fb69aa1SAnton Ivanov    "                use 'rxcookie=0x012345678' to specify a rxcookie\n"
23813fb69aa1SAnton Ivanov    "                use 'txcookie=0x012345678' to specify a txcookie\n"
23823fb69aa1SAnton Ivanov    "                use 'cookie64=on' to set cookie size to 64 bit, otherwise 32\n"
23833fb69aa1SAnton Ivanov    "                use 'counter=off' to force a 'cut-down' L2TPv3 with no counter\n"
23843fb69aa1SAnton Ivanov    "                use 'pincounter=on' to work around broken counter handling in peer\n"
23853fb69aa1SAnton Ivanov    "                use 'offset=X' to add an extra offset between header and data\n"
23863fb69aa1SAnton Ivanov#endif
23876a8b4a5bSThomas Huth    "-netdev socket,id=str[,fd=h][,listen=[host]:port][,connect=host:port]\n"
23886a8b4a5bSThomas Huth    "                configure a network backend to connect to another network\n"
23896a8b4a5bSThomas Huth    "                using a socket connection\n"
23906a8b4a5bSThomas Huth    "-netdev socket,id=str[,fd=h][,mcast=maddr:port[,localaddr=addr]]\n"
23916a8b4a5bSThomas Huth    "                configure a network backend to connect to a multicast maddr and port\n"
23923a75e74cSMike Ryan    "                use 'localaddr=addr' to specify the host address to send packets from\n"
23936a8b4a5bSThomas Huth    "-netdev socket,id=str[,fd=h][,udp=host:port][,localaddr=host:port]\n"
23946a8b4a5bSThomas Huth    "                configure a network backend to connect to another network\n"
23956a8b4a5bSThomas Huth    "                using an UDP tunnel\n"
23965824d651Sblueswir1#ifdef CONFIG_VDE
23976a8b4a5bSThomas Huth    "-netdev vde,id=str[,sock=socketpath][,port=n][,group=groupname][,mode=octalmode]\n"
23986a8b4a5bSThomas Huth    "                configure a network backend to connect to port 'n' of a vde switch\n"
23996a8b4a5bSThomas Huth    "                running on host and listening for incoming connections on 'socketpath'.\n"
24005824d651Sblueswir1    "                Use group 'groupname' and mode 'octalmode' to change default\n"
24015824d651Sblueswir1    "                ownership and permissions for communication port.\n"
24025824d651Sblueswir1#endif
240358952137SVincenzo Maffione#ifdef CONFIG_NETMAP
24046a8b4a5bSThomas Huth    "-netdev netmap,id=str,ifname=name[,devname=nmname]\n"
240558952137SVincenzo Maffione    "                attach to the existing netmap-enabled network interface 'name', or to a\n"
240658952137SVincenzo Maffione    "                VALE port (created on the fly) called 'name' ('nmname' is name of the \n"
240758952137SVincenzo Maffione    "                netmap device, defaults to '/dev/netmap')\n"
240858952137SVincenzo Maffione#endif
2409253dc14cSThomas Huth#ifdef CONFIG_POSIX
24106a8b4a5bSThomas Huth    "-netdev vhost-user,id=str,chardev=dev[,vhostforce=on|off]\n"
24116a8b4a5bSThomas Huth    "                configure a vhost-user network, backed by a chardev 'dev'\n"
2412253dc14cSThomas Huth#endif
241318d65d22SThomas Huth    "-netdev hubport,id=str,hubid=n[,netdev=nd]\n"
2414af1a5c3eSThomas Huth    "                configure a hub port on the hub with ID 'n'\n", QEMU_ARCH_ALL)
241578cd6f7bSThomas HuthDEF("nic", HAS_ARG, QEMU_OPTION_nic,
2416dfaa7d50SBALATON Zoltan    "-nic [tap|bridge|"
241778cd6f7bSThomas Huth#ifdef CONFIG_SLIRP
241878cd6f7bSThomas Huth    "user|"
241978cd6f7bSThomas Huth#endif
242078cd6f7bSThomas Huth#ifdef __linux__
242178cd6f7bSThomas Huth    "l2tpv3|"
242278cd6f7bSThomas Huth#endif
242378cd6f7bSThomas Huth#ifdef CONFIG_VDE
242478cd6f7bSThomas Huth    "vde|"
242578cd6f7bSThomas Huth#endif
242678cd6f7bSThomas Huth#ifdef CONFIG_NETMAP
242778cd6f7bSThomas Huth    "netmap|"
242878cd6f7bSThomas Huth#endif
242978cd6f7bSThomas Huth#ifdef CONFIG_POSIX
243078cd6f7bSThomas Huth    "vhost-user|"
243178cd6f7bSThomas Huth#endif
243278cd6f7bSThomas Huth    "socket][,option][,...][mac=macaddr]\n"
243378cd6f7bSThomas Huth    "                initialize an on-board / default host NIC (using MAC address\n"
243478cd6f7bSThomas Huth    "                macaddr) and connect it to the given host network backend\n"
2435dfaa7d50SBALATON Zoltan    "-nic none       use it alone to have zero network devices (the default is to\n"
243678cd6f7bSThomas Huth    "                provided a 'user' network connection)\n",
243778cd6f7bSThomas Huth    QEMU_ARCH_ALL)
24386a8b4a5bSThomas HuthDEF("net", HAS_ARG, QEMU_OPTION_net,
2439af1a5c3eSThomas Huth    "-net nic[,macaddr=mac][,model=type][,name=str][,addr=str][,vectors=v]\n"
24400e60a82dSThomas Huth    "                configure or create an on-board (or machine default) NIC and\n"
2441af1a5c3eSThomas Huth    "                connect it to hub 0 (please use -nic unless you need a hub)\n"
24426a8b4a5bSThomas Huth    "-net ["
2443a1ea458fSMark McLoughlin#ifdef CONFIG_SLIRP
2444a1ea458fSMark McLoughlin    "user|"
2445a1ea458fSMark McLoughlin#endif
2446a1ea458fSMark McLoughlin    "tap|"
2447a7c36ee4SCorey Bryant    "bridge|"
2448a1ea458fSMark McLoughlin#ifdef CONFIG_VDE
2449a1ea458fSMark McLoughlin    "vde|"
2450a1ea458fSMark McLoughlin#endif
245158952137SVincenzo Maffione#ifdef CONFIG_NETMAP
245258952137SVincenzo Maffione    "netmap|"
245358952137SVincenzo Maffione#endif
2454af1a5c3eSThomas Huth    "socket][,option][,option][,...]\n"
24556a8b4a5bSThomas Huth    "                old way to initialize a host network interface\n"
24566a8b4a5bSThomas Huth    "                (use the -netdev option if possible instead)\n", QEMU_ARCH_ALL)
2457e2fcbf42SPeter MaydellSRST
2458e2fcbf42SPeter Maydell``-nic [tap|bridge|user|l2tpv3|vde|netmap|vhost-user|socket][,...][,mac=macaddr][,model=mn]``
2459e2fcbf42SPeter Maydell    This option is a shortcut for configuring both the on-board
2460e2fcbf42SPeter Maydell    (default) guest NIC hardware and the host network backend in one go.
2461e2fcbf42SPeter Maydell    The host backend options are the same as with the corresponding
2462e2fcbf42SPeter Maydell    ``-netdev`` options below. The guest NIC model can be set with
2463e2fcbf42SPeter Maydell    ``model=modelname``. Use ``model=help`` to list the available device
2464e2fcbf42SPeter Maydell    types. The hardware MAC address can be set with ``mac=macaddr``.
2465e2fcbf42SPeter Maydell
2466e2fcbf42SPeter Maydell    The following two example do exactly the same, to show how ``-nic``
2467e2fcbf42SPeter Maydell    can be used to shorten the command line length:
2468e2fcbf42SPeter Maydell
2469e2fcbf42SPeter Maydell    .. parsed-literal::
2470e2fcbf42SPeter Maydell
2471e2fcbf42SPeter Maydell        |qemu_system| -netdev user,id=n1,ipv6=off -device e1000,netdev=n1,mac=52:54:98:76:54:32
2472e2fcbf42SPeter Maydell        |qemu_system| -nic user,ipv6=off,model=e1000,mac=52:54:98:76:54:32
2473e2fcbf42SPeter Maydell
2474e2fcbf42SPeter Maydell``-nic none``
2475e2fcbf42SPeter Maydell    Indicate that no network devices should be configured. It is used to
2476e2fcbf42SPeter Maydell    override the default configuration (default NIC with "user" host
2477e2fcbf42SPeter Maydell    network backend) which is activated if no other networking options
2478e2fcbf42SPeter Maydell    are provided.
2479e2fcbf42SPeter Maydell
2480e2fcbf42SPeter Maydell``-netdev user,id=id[,option][,option][,...]``
2481e2fcbf42SPeter Maydell    Configure user mode host network backend which requires no
2482e2fcbf42SPeter Maydell    administrator privilege to run. Valid options are:
2483e2fcbf42SPeter Maydell
2484e2fcbf42SPeter Maydell    ``id=id``
2485e2fcbf42SPeter Maydell        Assign symbolic name for use in monitor commands.
2486e2fcbf42SPeter Maydell
2487e2fcbf42SPeter Maydell    ``ipv4=on|off and ipv6=on|off``
2488e2fcbf42SPeter Maydell        Specify that either IPv4 or IPv6 must be enabled. If neither is
2489e2fcbf42SPeter Maydell        specified both protocols are enabled.
2490e2fcbf42SPeter Maydell
2491e2fcbf42SPeter Maydell    ``net=addr[/mask]``
2492e2fcbf42SPeter Maydell        Set IP network address the guest will see. Optionally specify
2493e2fcbf42SPeter Maydell        the netmask, either in the form a.b.c.d or as number of valid
2494e2fcbf42SPeter Maydell        top-most bits. Default is 10.0.2.0/24.
2495e2fcbf42SPeter Maydell
2496e2fcbf42SPeter Maydell    ``host=addr``
2497e2fcbf42SPeter Maydell        Specify the guest-visible address of the host. Default is the
2498e2fcbf42SPeter Maydell        2nd IP in the guest network, i.e. x.x.x.2.
2499e2fcbf42SPeter Maydell
2500e2fcbf42SPeter Maydell    ``ipv6-net=addr[/int]``
2501e2fcbf42SPeter Maydell        Set IPv6 network address the guest will see (default is
2502e2fcbf42SPeter Maydell        fec0::/64). The network prefix is given in the usual hexadecimal
2503e2fcbf42SPeter Maydell        IPv6 address notation. The prefix size is optional, and is given
2504e2fcbf42SPeter Maydell        as the number of valid top-most bits (default is 64).
2505e2fcbf42SPeter Maydell
2506e2fcbf42SPeter Maydell    ``ipv6-host=addr``
2507e2fcbf42SPeter Maydell        Specify the guest-visible IPv6 address of the host. Default is
2508e2fcbf42SPeter Maydell        the 2nd IPv6 in the guest network, i.e. xxxx::2.
2509e2fcbf42SPeter Maydell
2510e2fcbf42SPeter Maydell    ``restrict=on|off``
2511e2fcbf42SPeter Maydell        If this option is enabled, the guest will be isolated, i.e. it
2512e2fcbf42SPeter Maydell        will not be able to contact the host and no guest IP packets
2513e2fcbf42SPeter Maydell        will be routed over the host to the outside. This option does
2514e2fcbf42SPeter Maydell        not affect any explicitly set forwarding rules.
2515e2fcbf42SPeter Maydell
2516e2fcbf42SPeter Maydell    ``hostname=name``
2517e2fcbf42SPeter Maydell        Specifies the client hostname reported by the built-in DHCP
2518e2fcbf42SPeter Maydell        server.
2519e2fcbf42SPeter Maydell
2520e2fcbf42SPeter Maydell    ``dhcpstart=addr``
2521e2fcbf42SPeter Maydell        Specify the first of the 16 IPs the built-in DHCP server can
2522e2fcbf42SPeter Maydell        assign. Default is the 15th to 31st IP in the guest network,
2523e2fcbf42SPeter Maydell        i.e. x.x.x.15 to x.x.x.31.
2524e2fcbf42SPeter Maydell
2525e2fcbf42SPeter Maydell    ``dns=addr``
2526e2fcbf42SPeter Maydell        Specify the guest-visible address of the virtual nameserver. The
2527e2fcbf42SPeter Maydell        address must be different from the host address. Default is the
2528e2fcbf42SPeter Maydell        3rd IP in the guest network, i.e. x.x.x.3.
2529e2fcbf42SPeter Maydell
2530e2fcbf42SPeter Maydell    ``ipv6-dns=addr``
2531e2fcbf42SPeter Maydell        Specify the guest-visible address of the IPv6 virtual
2532e2fcbf42SPeter Maydell        nameserver. The address must be different from the host address.
2533e2fcbf42SPeter Maydell        Default is the 3rd IP in the guest network, i.e. xxxx::3.
2534e2fcbf42SPeter Maydell
2535e2fcbf42SPeter Maydell    ``dnssearch=domain``
2536e2fcbf42SPeter Maydell        Provides an entry for the domain-search list sent by the
2537e2fcbf42SPeter Maydell        built-in DHCP server. More than one domain suffix can be
2538e2fcbf42SPeter Maydell        transmitted by specifying this option multiple times. If
2539e2fcbf42SPeter Maydell        supported, this will cause the guest to automatically try to
2540e2fcbf42SPeter Maydell        append the given domain suffix(es) in case a domain name can not
2541e2fcbf42SPeter Maydell        be resolved.
2542e2fcbf42SPeter Maydell
2543e2fcbf42SPeter Maydell        Example:
2544e2fcbf42SPeter Maydell
2545e2fcbf42SPeter Maydell        .. parsed-literal::
2546e2fcbf42SPeter Maydell
2547e2fcbf42SPeter Maydell            |qemu_system| -nic user,dnssearch=mgmt.example.org,dnssearch=example.org
2548e2fcbf42SPeter Maydell
2549e2fcbf42SPeter Maydell    ``domainname=domain``
2550e2fcbf42SPeter Maydell        Specifies the client domain name reported by the built-in DHCP
2551e2fcbf42SPeter Maydell        server.
2552e2fcbf42SPeter Maydell
2553e2fcbf42SPeter Maydell    ``tftp=dir``
2554e2fcbf42SPeter Maydell        When using the user mode network stack, activate a built-in TFTP
2555e2fcbf42SPeter Maydell        server. The files in dir will be exposed as the root of a TFTP
2556e2fcbf42SPeter Maydell        server. The TFTP client on the guest must be configured in
2557e2fcbf42SPeter Maydell        binary mode (use the command ``bin`` of the Unix TFTP client).
2558e2fcbf42SPeter Maydell
2559e2fcbf42SPeter Maydell    ``tftp-server-name=name``
2560e2fcbf42SPeter Maydell        In BOOTP reply, broadcast name as the "TFTP server name"
2561e2fcbf42SPeter Maydell        (RFC2132 option 66). This can be used to advise the guest to
2562e2fcbf42SPeter Maydell        load boot files or configurations from a different server than
2563e2fcbf42SPeter Maydell        the host address.
2564e2fcbf42SPeter Maydell
2565e2fcbf42SPeter Maydell    ``bootfile=file``
2566e2fcbf42SPeter Maydell        When using the user mode network stack, broadcast file as the
2567e2fcbf42SPeter Maydell        BOOTP filename. In conjunction with ``tftp``, this can be used
2568e2fcbf42SPeter Maydell        to network boot a guest from a local directory.
2569e2fcbf42SPeter Maydell
2570e2fcbf42SPeter Maydell        Example (using pxelinux):
2571e2fcbf42SPeter Maydell
2572e2fcbf42SPeter Maydell        .. parsed-literal::
2573e2fcbf42SPeter Maydell
2574e2fcbf42SPeter Maydell            |qemu_system| -hda linux.img -boot n -device e1000,netdev=n1 \
2575e2fcbf42SPeter Maydell                -netdev user,id=n1,tftp=/path/to/tftp/files,bootfile=/pxelinux.0
2576e2fcbf42SPeter Maydell
2577e2fcbf42SPeter Maydell    ``smb=dir[,smbserver=addr]``
2578e2fcbf42SPeter Maydell        When using the user mode network stack, activate a built-in SMB
2579e2fcbf42SPeter Maydell        server so that Windows OSes can access to the host files in
2580e2fcbf42SPeter Maydell        ``dir`` transparently. The IP address of the SMB server can be
2581e2fcbf42SPeter Maydell        set to addr. By default the 4th IP in the guest network is used,
2582e2fcbf42SPeter Maydell        i.e. x.x.x.4.
2583e2fcbf42SPeter Maydell
2584e2fcbf42SPeter Maydell        In the guest Windows OS, the line:
2585e2fcbf42SPeter Maydell
2586e2fcbf42SPeter Maydell        ::
2587e2fcbf42SPeter Maydell
2588e2fcbf42SPeter Maydell            10.0.2.4 smbserver
2589e2fcbf42SPeter Maydell
2590e2fcbf42SPeter Maydell        must be added in the file ``C:\WINDOWS\LMHOSTS`` (for windows
2591e2fcbf42SPeter Maydell        9x/Me) or ``C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS`` (Windows
2592e2fcbf42SPeter Maydell        NT/2000).
2593e2fcbf42SPeter Maydell
2594e2fcbf42SPeter Maydell        Then ``dir`` can be accessed in ``\\smbserver\qemu``.
2595e2fcbf42SPeter Maydell
2596e2fcbf42SPeter Maydell        Note that a SAMBA server must be installed on the host OS.
2597e2fcbf42SPeter Maydell
2598e2fcbf42SPeter Maydell    ``hostfwd=[tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport``
2599e2fcbf42SPeter Maydell        Redirect incoming TCP or UDP connections to the host port
2600e2fcbf42SPeter Maydell        hostport to the guest IP address guestaddr on guest port
2601e2fcbf42SPeter Maydell        guestport. If guestaddr is not specified, its value is x.x.x.15
2602e2fcbf42SPeter Maydell        (default first address given by the built-in DHCP server). By
2603e2fcbf42SPeter Maydell        specifying hostaddr, the rule can be bound to a specific host
2604e2fcbf42SPeter Maydell        interface. If no connection type is set, TCP is used. This
2605e2fcbf42SPeter Maydell        option can be given multiple times.
2606e2fcbf42SPeter Maydell
2607e2fcbf42SPeter Maydell        For example, to redirect host X11 connection from screen 1 to
2608e2fcbf42SPeter Maydell        guest screen 0, use the following:
2609e2fcbf42SPeter Maydell
261009ce5f2dSPeter Maydell        .. parsed-literal::
2611e2fcbf42SPeter Maydell
2612e2fcbf42SPeter Maydell            # on the host
2613e2fcbf42SPeter Maydell            |qemu_system| -nic user,hostfwd=tcp:127.0.0.1:6001-:6000
2614e2fcbf42SPeter Maydell            # this host xterm should open in the guest X11 server
2615e2fcbf42SPeter Maydell            xterm -display :1
2616e2fcbf42SPeter Maydell
2617e2fcbf42SPeter Maydell        To redirect telnet connections from host port 5555 to telnet
2618e2fcbf42SPeter Maydell        port on the guest, use the following:
2619e2fcbf42SPeter Maydell
262009ce5f2dSPeter Maydell        .. parsed-literal::
2621e2fcbf42SPeter Maydell
2622e2fcbf42SPeter Maydell            # on the host
2623e2fcbf42SPeter Maydell            |qemu_system| -nic user,hostfwd=tcp::5555-:23
2624e2fcbf42SPeter Maydell            telnet localhost 5555
2625e2fcbf42SPeter Maydell
2626e2fcbf42SPeter Maydell        Then when you use on the host ``telnet localhost 5555``, you
2627e2fcbf42SPeter Maydell        connect to the guest telnet server.
2628e2fcbf42SPeter Maydell
2629e2fcbf42SPeter Maydell    ``guestfwd=[tcp]:server:port-dev``; \ ``guestfwd=[tcp]:server:port-cmd:command``
2630e2fcbf42SPeter Maydell        Forward guest TCP connections to the IP address server on port
2631e2fcbf42SPeter Maydell        port to the character device dev or to a program executed by
2632e2fcbf42SPeter Maydell        cmd:command which gets spawned for each connection. This option
2633e2fcbf42SPeter Maydell        can be given multiple times.
2634e2fcbf42SPeter Maydell
2635e2fcbf42SPeter Maydell        You can either use a chardev directly and have that one used
2636e2fcbf42SPeter Maydell        throughout QEMU's lifetime, like in the following example:
2637e2fcbf42SPeter Maydell
263809ce5f2dSPeter Maydell        .. parsed-literal::
2639e2fcbf42SPeter Maydell
2640e2fcbf42SPeter Maydell            # open 10.10.1.1:4321 on bootup, connect 10.0.2.100:1234 to it whenever
2641e2fcbf42SPeter Maydell            # the guest accesses it
2642e2fcbf42SPeter Maydell            |qemu_system| -nic user,guestfwd=tcp:10.0.2.100:1234-tcp:10.10.1.1:4321
2643e2fcbf42SPeter Maydell
2644e2fcbf42SPeter Maydell        Or you can execute a command on every TCP connection established
2645e2fcbf42SPeter Maydell        by the guest, so that QEMU behaves similar to an inetd process
2646e2fcbf42SPeter Maydell        for that virtual server:
2647e2fcbf42SPeter Maydell
264809ce5f2dSPeter Maydell        .. parsed-literal::
2649e2fcbf42SPeter Maydell
2650e2fcbf42SPeter Maydell            # call "netcat 10.10.1.1 4321" on every TCP connection to 10.0.2.100:1234
2651e2fcbf42SPeter Maydell            # and connect the TCP stream to its stdin/stdout
2652e2fcbf42SPeter Maydell            |qemu_system| -nic  'user,id=n1,guestfwd=tcp:10.0.2.100:1234-cmd:netcat 10.10.1.1 4321'
2653e2fcbf42SPeter Maydell
2654e2fcbf42SPeter Maydell``-netdev tap,id=id[,fd=h][,ifname=name][,script=file][,downscript=dfile][,br=bridge][,helper=helper]``
2655e2fcbf42SPeter Maydell    Configure a host TAP network backend with ID id.
2656e2fcbf42SPeter Maydell
2657e2fcbf42SPeter Maydell    Use the network script file to configure it and the network script
2658e2fcbf42SPeter Maydell    dfile to deconfigure it. If name is not provided, the OS
2659e2fcbf42SPeter Maydell    automatically provides one. The default network configure script is
2660e2fcbf42SPeter Maydell    ``/etc/qemu-ifup`` and the default network deconfigure script is
2661e2fcbf42SPeter Maydell    ``/etc/qemu-ifdown``. Use ``script=no`` or ``downscript=no`` to
2662e2fcbf42SPeter Maydell    disable script execution.
2663e2fcbf42SPeter Maydell
2664e2fcbf42SPeter Maydell    If running QEMU as an unprivileged user, use the network helper
2665e2fcbf42SPeter Maydell    helper to configure the TAP interface and attach it to the bridge.
2666e2fcbf42SPeter Maydell    The default network helper executable is
2667e2fcbf42SPeter Maydell    ``/path/to/qemu-bridge-helper`` and the default bridge device is
2668e2fcbf42SPeter Maydell    ``br0``.
2669e2fcbf42SPeter Maydell
2670e2fcbf42SPeter Maydell    ``fd``\ =h can be used to specify the handle of an already opened
2671e2fcbf42SPeter Maydell    host TAP interface.
2672e2fcbf42SPeter Maydell
2673e2fcbf42SPeter Maydell    Examples:
2674e2fcbf42SPeter Maydell
267509ce5f2dSPeter Maydell    .. parsed-literal::
2676e2fcbf42SPeter Maydell
2677e2fcbf42SPeter Maydell        #launch a QEMU instance with the default network script
2678e2fcbf42SPeter Maydell        |qemu_system| linux.img -nic tap
2679e2fcbf42SPeter Maydell
268009ce5f2dSPeter Maydell    .. parsed-literal::
2681e2fcbf42SPeter Maydell
2682e2fcbf42SPeter Maydell        #launch a QEMU instance with two NICs, each one connected
2683e2fcbf42SPeter Maydell        #to a TAP device
2684e2fcbf42SPeter Maydell        |qemu_system| linux.img \
2685e2fcbf42SPeter Maydell                -netdev tap,id=nd0,ifname=tap0 -device e1000,netdev=nd0 \
2686e2fcbf42SPeter Maydell                -netdev tap,id=nd1,ifname=tap1 -device rtl8139,netdev=nd1
2687e2fcbf42SPeter Maydell
268809ce5f2dSPeter Maydell    .. parsed-literal::
2689e2fcbf42SPeter Maydell
2690e2fcbf42SPeter Maydell        #launch a QEMU instance with the default network helper to
2691e2fcbf42SPeter Maydell        #connect a TAP device to bridge br0
2692e2fcbf42SPeter Maydell        |qemu_system| linux.img -device virtio-net-pci,netdev=n1 \
2693e2fcbf42SPeter Maydell                -netdev tap,id=n1,"helper=/path/to/qemu-bridge-helper"
2694e2fcbf42SPeter Maydell
2695e2fcbf42SPeter Maydell``-netdev bridge,id=id[,br=bridge][,helper=helper]``
2696e2fcbf42SPeter Maydell    Connect a host TAP network interface to a host bridge device.
2697e2fcbf42SPeter Maydell
2698e2fcbf42SPeter Maydell    Use the network helper helper to configure the TAP interface and
2699e2fcbf42SPeter Maydell    attach it to the bridge. The default network helper executable is
2700e2fcbf42SPeter Maydell    ``/path/to/qemu-bridge-helper`` and the default bridge device is
2701e2fcbf42SPeter Maydell    ``br0``.
2702e2fcbf42SPeter Maydell
2703e2fcbf42SPeter Maydell    Examples:
2704e2fcbf42SPeter Maydell
270509ce5f2dSPeter Maydell    .. parsed-literal::
2706e2fcbf42SPeter Maydell
2707e2fcbf42SPeter Maydell        #launch a QEMU instance with the default network helper to
2708e2fcbf42SPeter Maydell        #connect a TAP device to bridge br0
2709e2fcbf42SPeter Maydell        |qemu_system| linux.img -netdev bridge,id=n1 -device virtio-net,netdev=n1
2710e2fcbf42SPeter Maydell
271109ce5f2dSPeter Maydell    .. parsed-literal::
2712e2fcbf42SPeter Maydell
2713e2fcbf42SPeter Maydell        #launch a QEMU instance with the default network helper to
2714e2fcbf42SPeter Maydell        #connect a TAP device to bridge qemubr0
2715e2fcbf42SPeter Maydell        |qemu_system| linux.img -netdev bridge,br=qemubr0,id=n1 -device virtio-net,netdev=n1
2716e2fcbf42SPeter Maydell
2717e2fcbf42SPeter Maydell``-netdev socket,id=id[,fd=h][,listen=[host]:port][,connect=host:port]``
2718e2fcbf42SPeter Maydell    This host network backend can be used to connect the guest's network
2719e2fcbf42SPeter Maydell    to another QEMU virtual machine using a TCP socket connection. If
2720e2fcbf42SPeter Maydell    ``listen`` is specified, QEMU waits for incoming connections on port
2721e2fcbf42SPeter Maydell    (host is optional). ``connect`` is used to connect to another QEMU
2722e2fcbf42SPeter Maydell    instance using the ``listen`` option. ``fd``\ =h specifies an
2723e2fcbf42SPeter Maydell    already opened TCP socket.
2724e2fcbf42SPeter Maydell
2725e2fcbf42SPeter Maydell    Example:
2726e2fcbf42SPeter Maydell
272709ce5f2dSPeter Maydell    .. parsed-literal::
2728e2fcbf42SPeter Maydell
2729e2fcbf42SPeter Maydell        # launch a first QEMU instance
2730e2fcbf42SPeter Maydell        |qemu_system| linux.img \
2731e2fcbf42SPeter Maydell                         -device e1000,netdev=n1,mac=52:54:00:12:34:56 \
2732e2fcbf42SPeter Maydell                         -netdev socket,id=n1,listen=:1234
2733e2fcbf42SPeter Maydell        # connect the network of this instance to the network of the first instance
2734e2fcbf42SPeter Maydell        |qemu_system| linux.img \
2735e2fcbf42SPeter Maydell                         -device e1000,netdev=n2,mac=52:54:00:12:34:57 \
2736e2fcbf42SPeter Maydell                         -netdev socket,id=n2,connect=127.0.0.1:1234
2737e2fcbf42SPeter Maydell
2738e2fcbf42SPeter Maydell``-netdev socket,id=id[,fd=h][,mcast=maddr:port[,localaddr=addr]]``
2739e2fcbf42SPeter Maydell    Configure a socket host network backend to share the guest's network
2740e2fcbf42SPeter Maydell    traffic with another QEMU virtual machines using a UDP multicast
2741e2fcbf42SPeter Maydell    socket, effectively making a bus for every QEMU with same multicast
2742e2fcbf42SPeter Maydell    address maddr and port. NOTES:
2743e2fcbf42SPeter Maydell
2744e2fcbf42SPeter Maydell    1. Several QEMU can be running on different hosts and share same bus
2745e2fcbf42SPeter Maydell       (assuming correct multicast setup for these hosts).
2746e2fcbf42SPeter Maydell
2747e2fcbf42SPeter Maydell    2. mcast support is compatible with User Mode Linux (argument
2748e2fcbf42SPeter Maydell       ``ethN=mcast``), see http://user-mode-linux.sf.net.
2749e2fcbf42SPeter Maydell
2750e2fcbf42SPeter Maydell    3. Use ``fd=h`` to specify an already opened UDP multicast socket.
2751e2fcbf42SPeter Maydell
2752e2fcbf42SPeter Maydell    Example:
2753e2fcbf42SPeter Maydell
275409ce5f2dSPeter Maydell    .. parsed-literal::
2755e2fcbf42SPeter Maydell
2756e2fcbf42SPeter Maydell        # launch one QEMU instance
2757e2fcbf42SPeter Maydell        |qemu_system| linux.img \
2758e2fcbf42SPeter Maydell                         -device e1000,netdev=n1,mac=52:54:00:12:34:56 \
2759e2fcbf42SPeter Maydell                         -netdev socket,id=n1,mcast=230.0.0.1:1234
2760e2fcbf42SPeter Maydell        # launch another QEMU instance on same "bus"
2761e2fcbf42SPeter Maydell        |qemu_system| linux.img \
2762e2fcbf42SPeter Maydell                         -device e1000,netdev=n2,mac=52:54:00:12:34:57 \
2763e2fcbf42SPeter Maydell                         -netdev socket,id=n2,mcast=230.0.0.1:1234
2764e2fcbf42SPeter Maydell        # launch yet another QEMU instance on same "bus"
2765e2fcbf42SPeter Maydell        |qemu_system| linux.img \
2766e2fcbf42SPeter Maydell                         -device e1000,netdev=n3,mac=52:54:00:12:34:58 \
2767e2fcbf42SPeter Maydell                         -netdev socket,id=n3,mcast=230.0.0.1:1234
2768e2fcbf42SPeter Maydell
2769e2fcbf42SPeter Maydell    Example (User Mode Linux compat.):
2770e2fcbf42SPeter Maydell
277109ce5f2dSPeter Maydell    .. parsed-literal::
2772e2fcbf42SPeter Maydell
2773e2fcbf42SPeter Maydell        # launch QEMU instance (note mcast address selected is UML's default)
2774e2fcbf42SPeter Maydell        |qemu_system| linux.img \
2775e2fcbf42SPeter Maydell                         -device e1000,netdev=n1,mac=52:54:00:12:34:56 \
2776e2fcbf42SPeter Maydell                         -netdev socket,id=n1,mcast=239.192.168.1:1102
2777e2fcbf42SPeter Maydell        # launch UML
2778e2fcbf42SPeter Maydell        /path/to/linux ubd0=/path/to/root_fs eth0=mcast
2779e2fcbf42SPeter Maydell
2780e2fcbf42SPeter Maydell    Example (send packets from host's 1.2.3.4):
2781e2fcbf42SPeter Maydell
2782e2fcbf42SPeter Maydell    .. parsed-literal::
2783e2fcbf42SPeter Maydell
2784e2fcbf42SPeter Maydell        |qemu_system| linux.img \
2785e2fcbf42SPeter Maydell                         -device e1000,netdev=n1,mac=52:54:00:12:34:56 \
2786e2fcbf42SPeter Maydell                         -netdev socket,id=n1,mcast=239.192.168.1:1102,localaddr=1.2.3.4
2787e2fcbf42SPeter Maydell
2788e2fcbf42SPeter Maydell``-netdev l2tpv3,id=id,src=srcaddr,dst=dstaddr[,srcport=srcport][,dstport=dstport],txsession=txsession[,rxsession=rxsession][,ipv6][,udp][,cookie64][,counter][,pincounter][,txcookie=txcookie][,rxcookie=rxcookie][,offset=offset]``
2789e2fcbf42SPeter Maydell    Configure a L2TPv3 pseudowire host network backend. L2TPv3 (RFC3931)
2790e2fcbf42SPeter Maydell    is a popular protocol to transport Ethernet (and other Layer 2) data
2791e2fcbf42SPeter Maydell    frames between two systems. It is present in routers, firewalls and
2792e2fcbf42SPeter Maydell    the Linux kernel (from version 3.3 onwards).
2793e2fcbf42SPeter Maydell
2794e2fcbf42SPeter Maydell    This transport allows a VM to communicate to another VM, router or
2795e2fcbf42SPeter Maydell    firewall directly.
2796e2fcbf42SPeter Maydell
2797e2fcbf42SPeter Maydell    ``src=srcaddr``
2798e2fcbf42SPeter Maydell        source address (mandatory)
2799e2fcbf42SPeter Maydell
2800e2fcbf42SPeter Maydell    ``dst=dstaddr``
2801e2fcbf42SPeter Maydell        destination address (mandatory)
2802e2fcbf42SPeter Maydell
2803e2fcbf42SPeter Maydell    ``udp``
2804e2fcbf42SPeter Maydell        select udp encapsulation (default is ip).
2805e2fcbf42SPeter Maydell
2806e2fcbf42SPeter Maydell    ``srcport=srcport``
2807e2fcbf42SPeter Maydell        source udp port.
2808e2fcbf42SPeter Maydell
2809e2fcbf42SPeter Maydell    ``dstport=dstport``
2810e2fcbf42SPeter Maydell        destination udp port.
2811e2fcbf42SPeter Maydell
2812e2fcbf42SPeter Maydell    ``ipv6``
2813e2fcbf42SPeter Maydell        force v6, otherwise defaults to v4.
2814e2fcbf42SPeter Maydell
2815e2fcbf42SPeter Maydell    ``rxcookie=rxcookie``; \ ``txcookie=txcookie``
2816e2fcbf42SPeter Maydell        Cookies are a weak form of security in the l2tpv3 specification.
2817e2fcbf42SPeter Maydell        Their function is mostly to prevent misconfiguration. By default
2818e2fcbf42SPeter Maydell        they are 32 bit.
2819e2fcbf42SPeter Maydell
2820e2fcbf42SPeter Maydell    ``cookie64``
2821e2fcbf42SPeter Maydell        Set cookie size to 64 bit instead of the default 32
2822e2fcbf42SPeter Maydell
2823e2fcbf42SPeter Maydell    ``counter=off``
2824e2fcbf42SPeter Maydell        Force a 'cut-down' L2TPv3 with no counter as in
2825e2fcbf42SPeter Maydell        draft-mkonstan-l2tpext-keyed-ipv6-tunnel-00
2826e2fcbf42SPeter Maydell
2827e2fcbf42SPeter Maydell    ``pincounter=on``
2828e2fcbf42SPeter Maydell        Work around broken counter handling in peer. This may also help
2829e2fcbf42SPeter Maydell        on networks which have packet reorder.
2830e2fcbf42SPeter Maydell
2831e2fcbf42SPeter Maydell    ``offset=offset``
2832e2fcbf42SPeter Maydell        Add an extra offset between header and data
2833e2fcbf42SPeter Maydell
2834e2fcbf42SPeter Maydell    For example, to attach a VM running on host 4.3.2.1 via L2TPv3 to
2835e2fcbf42SPeter Maydell    the bridge br-lan on the remote Linux host 1.2.3.4:
2836e2fcbf42SPeter Maydell
283709ce5f2dSPeter Maydell    .. parsed-literal::
2838e2fcbf42SPeter Maydell
2839e2fcbf42SPeter Maydell        # Setup tunnel on linux host using raw ip as encapsulation
2840e2fcbf42SPeter Maydell        # on 1.2.3.4
2841e2fcbf42SPeter Maydell        ip l2tp add tunnel remote 4.3.2.1 local 1.2.3.4 tunnel_id 1 peer_tunnel_id 1 \
2842e2fcbf42SPeter Maydell            encap udp udp_sport 16384 udp_dport 16384
2843e2fcbf42SPeter Maydell        ip l2tp add session tunnel_id 1 name vmtunnel0 session_id \
2844e2fcbf42SPeter Maydell            0xFFFFFFFF peer_session_id 0xFFFFFFFF
2845e2fcbf42SPeter Maydell        ifconfig vmtunnel0 mtu 1500
2846e2fcbf42SPeter Maydell        ifconfig vmtunnel0 up
2847e2fcbf42SPeter Maydell        brctl addif br-lan vmtunnel0
2848e2fcbf42SPeter Maydell
2849e2fcbf42SPeter Maydell
2850e2fcbf42SPeter Maydell        # on 4.3.2.1
2851e2fcbf42SPeter Maydell        # launch QEMU instance - if your network has reorder or is very lossy add ,pincounter
2852e2fcbf42SPeter Maydell
2853e2fcbf42SPeter Maydell        |qemu_system| linux.img -device e1000,netdev=n1 \
2854e2fcbf42SPeter Maydell            -netdev l2tpv3,id=n1,src=4.2.3.1,dst=1.2.3.4,udp,srcport=16384,dstport=16384,rxsession=0xffffffff,txsession=0xffffffff,counter
2855e2fcbf42SPeter Maydell
2856e2fcbf42SPeter Maydell``-netdev vde,id=id[,sock=socketpath][,port=n][,group=groupname][,mode=octalmode]``
2857e2fcbf42SPeter Maydell    Configure VDE backend to connect to PORT n of a vde switch running
2858e2fcbf42SPeter Maydell    on host and listening for incoming connections on socketpath. Use
2859e2fcbf42SPeter Maydell    GROUP groupname and MODE octalmode to change default ownership and
2860e2fcbf42SPeter Maydell    permissions for communication port. This option is only available if
2861e2fcbf42SPeter Maydell    QEMU has been compiled with vde support enabled.
2862e2fcbf42SPeter Maydell
2863e2fcbf42SPeter Maydell    Example:
2864e2fcbf42SPeter Maydell
286509ce5f2dSPeter Maydell    .. parsed-literal::
2866e2fcbf42SPeter Maydell
2867e2fcbf42SPeter Maydell        # launch vde switch
2868e2fcbf42SPeter Maydell        vde_switch -F -sock /tmp/myswitch
2869e2fcbf42SPeter Maydell        # launch QEMU instance
2870e2fcbf42SPeter Maydell        |qemu_system| linux.img -nic vde,sock=/tmp/myswitch
2871e2fcbf42SPeter Maydell
2872e2fcbf42SPeter Maydell``-netdev vhost-user,chardev=id[,vhostforce=on|off][,queues=n]``
2873e2fcbf42SPeter Maydell    Establish a vhost-user netdev, backed by a chardev id. The chardev
2874e2fcbf42SPeter Maydell    should be a unix domain socket backed one. The vhost-user uses a
2875e2fcbf42SPeter Maydell    specifically defined protocol to pass vhost ioctl replacement
2876e2fcbf42SPeter Maydell    messages to an application on the other end of the socket. On
2877e2fcbf42SPeter Maydell    non-MSIX guests, the feature can be forced with vhostforce. Use
2878e2fcbf42SPeter Maydell    'queues=n' to specify the number of queues to be created for
2879e2fcbf42SPeter Maydell    multiqueue vhost-user.
2880e2fcbf42SPeter Maydell
2881e2fcbf42SPeter Maydell    Example:
2882e2fcbf42SPeter Maydell
2883e2fcbf42SPeter Maydell    ::
2884e2fcbf42SPeter Maydell
2885e2fcbf42SPeter Maydell        qemu -m 512 -object memory-backend-file,id=mem,size=512M,mem-path=/hugetlbfs,share=on \
2886e2fcbf42SPeter Maydell             -numa node,memdev=mem \
2887e2fcbf42SPeter Maydell             -chardev socket,id=chr0,path=/path/to/socket \
2888e2fcbf42SPeter Maydell             -netdev type=vhost-user,id=net0,chardev=chr0 \
2889e2fcbf42SPeter Maydell             -device virtio-net-pci,netdev=net0
2890e2fcbf42SPeter Maydell
2891e2fcbf42SPeter Maydell``-netdev hubport,id=id,hubid=hubid[,netdev=nd]``
2892e2fcbf42SPeter Maydell    Create a hub port on the emulated hub with ID hubid.
2893e2fcbf42SPeter Maydell
2894e2fcbf42SPeter Maydell    The hubport netdev lets you connect a NIC to a QEMU emulated hub
2895e2fcbf42SPeter Maydell    instead of a single netdev. Alternatively, you can also connect the
2896e2fcbf42SPeter Maydell    hubport to another netdev with ID nd by using the ``netdev=nd``
2897e2fcbf42SPeter Maydell    option.
2898e2fcbf42SPeter Maydell
2899e2fcbf42SPeter Maydell``-net nic[,netdev=nd][,macaddr=mac][,model=type] [,name=name][,addr=addr][,vectors=v]``
2900e2fcbf42SPeter Maydell    Legacy option to configure or create an on-board (or machine
2901e2fcbf42SPeter Maydell    default) Network Interface Card(NIC) and connect it either to the
2902e2fcbf42SPeter Maydell    emulated hub with ID 0 (i.e. the default hub), or to the netdev nd.
2903e2fcbf42SPeter Maydell    If model is omitted, then the default NIC model associated with the
2904e2fcbf42SPeter Maydell    machine type is used. Note that the default NIC model may change in
2905e2fcbf42SPeter Maydell    future QEMU releases, so it is highly recommended to always specify
2906e2fcbf42SPeter Maydell    a model. Optionally, the MAC address can be changed to mac, the
2907e2fcbf42SPeter Maydell    device address set to addr (PCI cards only), and a name can be
2908e2fcbf42SPeter Maydell    assigned for use in monitor commands. Optionally, for PCI cards, you
2909e2fcbf42SPeter Maydell    can specify the number v of MSI-X vectors that the card should have;
2910e2fcbf42SPeter Maydell    this option currently only affects virtio cards; set v = 0 to
2911e2fcbf42SPeter Maydell    disable MSI-X. If no ``-net`` option is specified, a single NIC is
2912e2fcbf42SPeter Maydell    created. QEMU can emulate several different models of network card.
2913e2fcbf42SPeter Maydell    Use ``-net nic,model=help`` for a list of available devices for your
2914e2fcbf42SPeter Maydell    target.
2915e2fcbf42SPeter Maydell
2916e2fcbf42SPeter Maydell``-net user|tap|bridge|socket|l2tpv3|vde[,...][,name=name]``
2917e2fcbf42SPeter Maydell    Configure a host network backend (with the options corresponding to
2918e2fcbf42SPeter Maydell    the same ``-netdev`` option) and connect it to the emulated hub 0
2919e2fcbf42SPeter Maydell    (the default hub). Use name to specify the name of the hub port.
2920e2fcbf42SPeter MaydellERST
29215824d651Sblueswir1
29227273a2dbSMatthew BoothDEFHEADING()
29237273a2dbSMatthew Booth
2924de6b4f90SMarkus ArmbrusterDEFHEADING(Character device options:)
29257273a2dbSMatthew Booth
29267273a2dbSMatthew BoothDEF("chardev", HAS_ARG, QEMU_OPTION_chardev,
2927517b3d40SLin Ma    "-chardev help\n"
2928d0d7708bSDaniel P. Berrange    "-chardev null,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
29295dd1f02bSCorey Minyard    "-chardev socket,id=id[,host=host],port=port[,to=to][,ipv4][,ipv6][,nodelay][,reconnect=seconds]\n"
2930981b06e7SJulia Suvorova    "         [,server][,nowait][,telnet][,websocket][,reconnect=seconds][,mux=on|off]\n"
2931fd4a5fd4SDaniel P. Berrange    "         [,logfile=PATH][,logappend=on|off][,tls-creds=ID][,tls-authz=ID] (tcp)\n"
2932981b06e7SJulia Suvorova    "-chardev socket,id=id,path=path[,server][,nowait][,telnet][,websocket][,reconnect=seconds]\n"
2933d0d7708bSDaniel P. Berrange    "         [,mux=on|off][,logfile=PATH][,logappend=on|off] (unix)\n"
29347273a2dbSMatthew Booth    "-chardev udp,id=id[,host=host],port=port[,localaddr=localaddr]\n"
293597331287SJan Kiszka    "         [,localport=localport][,ipv4][,ipv6][,mux=on|off]\n"
2936d0d7708bSDaniel P. Berrange    "         [,logfile=PATH][,logappend=on|off]\n"
2937d0d7708bSDaniel P. Berrange    "-chardev msmouse,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
29387273a2dbSMatthew Booth    "-chardev vc,id=id[[,width=width][,height=height]][[,cols=cols][,rows=rows]]\n"
2939d0d7708bSDaniel P. Berrange    "         [,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
2940d0d7708bSDaniel P. Berrange    "-chardev ringbuf,id=id[,size=size][,logfile=PATH][,logappend=on|off]\n"
2941d0d7708bSDaniel P. Berrange    "-chardev file,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
2942d0d7708bSDaniel P. Berrange    "-chardev pipe,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
29437273a2dbSMatthew Booth#ifdef _WIN32
2944d0d7708bSDaniel P. Berrange    "-chardev console,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
2945d0d7708bSDaniel P. Berrange    "-chardev serial,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
29467273a2dbSMatthew Booth#else
2947d0d7708bSDaniel P. Berrange    "-chardev pty,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
2948d0d7708bSDaniel P. Berrange    "-chardev stdio,id=id[,mux=on|off][,signal=on|off][,logfile=PATH][,logappend=on|off]\n"
29497273a2dbSMatthew Booth#endif
29507273a2dbSMatthew Booth#ifdef CONFIG_BRLAPI
2951d0d7708bSDaniel P. Berrange    "-chardev braille,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
29527273a2dbSMatthew Booth#endif
29537273a2dbSMatthew Booth#if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \
29547273a2dbSMatthew Booth        || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
2955d0d7708bSDaniel P. Berrange    "-chardev serial,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
2956d0d7708bSDaniel P. Berrange    "-chardev tty,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
29577273a2dbSMatthew Booth#endif
29587273a2dbSMatthew Booth#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__)
2959d0d7708bSDaniel P. Berrange    "-chardev parallel,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
2960d0d7708bSDaniel P. Berrange    "-chardev parport,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
29617273a2dbSMatthew Booth#endif
2962cbcc6336SAlon Levy#if defined(CONFIG_SPICE)
2963d0d7708bSDaniel P. Berrange    "-chardev spicevmc,id=id,name=name[,debug=debug][,logfile=PATH][,logappend=on|off]\n"
2964d0d7708bSDaniel P. Berrange    "-chardev spiceport,id=id,name=name[,debug=debug][,logfile=PATH][,logappend=on|off]\n"
2965cbcc6336SAlon Levy#endif
2966ad96090aSBlue Swirl    , QEMU_ARCH_ALL
29677273a2dbSMatthew Booth)
29687273a2dbSMatthew Booth
2969e2fcbf42SPeter MaydellSRST
2970e2fcbf42SPeter MaydellThe general form of a character device option is:
2971e2fcbf42SPeter Maydell
2972e2fcbf42SPeter Maydell``-chardev backend,id=id[,mux=on|off][,options]``
2973e2fcbf42SPeter Maydell    Backend is one of: ``null``, ``socket``, ``udp``, ``msmouse``,
2974e2fcbf42SPeter Maydell    ``vc``, ``ringbuf``, ``file``, ``pipe``, ``console``, ``serial``,
2975e2fcbf42SPeter Maydell    ``pty``, ``stdio``, ``braille``, ``tty``, ``parallel``, ``parport``,
2976e2fcbf42SPeter Maydell    ``spicevmc``, ``spiceport``. The specific backend will determine the
2977e2fcbf42SPeter Maydell    applicable options.
2978e2fcbf42SPeter Maydell
2979e2fcbf42SPeter Maydell    Use ``-chardev help`` to print all available chardev backend types.
2980e2fcbf42SPeter Maydell
2981e2fcbf42SPeter Maydell    All devices must have an id, which can be any string up to 127
2982e2fcbf42SPeter Maydell    characters long. It is used to uniquely identify this device in
2983e2fcbf42SPeter Maydell    other command line directives.
2984e2fcbf42SPeter Maydell
2985e2fcbf42SPeter Maydell    A character device may be used in multiplexing mode by multiple
2986e2fcbf42SPeter Maydell    front-ends. Specify ``mux=on`` to enable this mode. A multiplexer is
2987e2fcbf42SPeter Maydell    a "1:N" device, and here the "1" end is your specified chardev
2988e2fcbf42SPeter Maydell    backend, and the "N" end is the various parts of QEMU that can talk
2989e2fcbf42SPeter Maydell    to a chardev. If you create a chardev with ``id=myid`` and
2990e2fcbf42SPeter Maydell    ``mux=on``, QEMU will create a multiplexer with your specified ID,
2991e2fcbf42SPeter Maydell    and you can then configure multiple front ends to use that chardev
2992e2fcbf42SPeter Maydell    ID for their input/output. Up to four different front ends can be
2993e2fcbf42SPeter Maydell    connected to a single multiplexed chardev. (Without multiplexing
2994e2fcbf42SPeter Maydell    enabled, a chardev can only be used by a single front end.) For
2995e2fcbf42SPeter Maydell    instance you could use this to allow a single stdio chardev to be
2996e2fcbf42SPeter Maydell    used by two serial ports and the QEMU monitor:
2997e2fcbf42SPeter Maydell
2998e2fcbf42SPeter Maydell    ::
2999e2fcbf42SPeter Maydell
3000e2fcbf42SPeter Maydell        -chardev stdio,mux=on,id=char0 \
3001e2fcbf42SPeter Maydell        -mon chardev=char0,mode=readline \
3002e2fcbf42SPeter Maydell        -serial chardev:char0 \
3003e2fcbf42SPeter Maydell        -serial chardev:char0
3004e2fcbf42SPeter Maydell
3005e2fcbf42SPeter Maydell    You can have more than one multiplexer in a system configuration;
3006e2fcbf42SPeter Maydell    for instance you could have a TCP port multiplexed between UART 0
3007e2fcbf42SPeter Maydell    and UART 1, and stdio multiplexed between the QEMU monitor and a
3008e2fcbf42SPeter Maydell    parallel port:
3009e2fcbf42SPeter Maydell
3010e2fcbf42SPeter Maydell    ::
3011e2fcbf42SPeter Maydell
3012e2fcbf42SPeter Maydell        -chardev stdio,mux=on,id=char0 \
3013e2fcbf42SPeter Maydell        -mon chardev=char0,mode=readline \
3014e2fcbf42SPeter Maydell        -parallel chardev:char0 \
3015e2fcbf42SPeter Maydell        -chardev tcp,...,mux=on,id=char1 \
3016e2fcbf42SPeter Maydell        -serial chardev:char1 \
3017e2fcbf42SPeter Maydell        -serial chardev:char1
3018e2fcbf42SPeter Maydell
3019e2fcbf42SPeter Maydell    When you're using a multiplexed character device, some escape
3020e2fcbf42SPeter Maydell    sequences are interpreted in the input. See :ref:`mux_005fkeys`.
3021e2fcbf42SPeter Maydell
3022e2fcbf42SPeter Maydell    Note that some other command line options may implicitly create
3023e2fcbf42SPeter Maydell    multiplexed character backends; for instance ``-serial mon:stdio``
3024e2fcbf42SPeter Maydell    creates a multiplexed stdio backend connected to the serial port and
3025e2fcbf42SPeter Maydell    the QEMU monitor, and ``-nographic`` also multiplexes the console
3026e2fcbf42SPeter Maydell    and the monitor to stdio.
3027e2fcbf42SPeter Maydell
3028e2fcbf42SPeter Maydell    There is currently no support for multiplexing in the other
3029e2fcbf42SPeter Maydell    direction (where a single QEMU front end takes input and output from
3030e2fcbf42SPeter Maydell    multiple chardevs).
3031e2fcbf42SPeter Maydell
3032e2fcbf42SPeter Maydell    Every backend supports the ``logfile`` option, which supplies the
3033e2fcbf42SPeter Maydell    path to a file to record all data transmitted via the backend. The
3034e2fcbf42SPeter Maydell    ``logappend`` option controls whether the log file will be truncated
3035e2fcbf42SPeter Maydell    or appended to when opened.
3036e2fcbf42SPeter Maydell
3037e2fcbf42SPeter MaydellThe available backends are:
3038e2fcbf42SPeter Maydell
3039e2fcbf42SPeter Maydell``-chardev null,id=id``
3040e2fcbf42SPeter Maydell    A void device. This device will not emit any data, and will drop any
3041e2fcbf42SPeter Maydell    data it receives. The null backend does not take any options.
3042e2fcbf42SPeter Maydell
3043e2fcbf42SPeter Maydell``-chardev socket,id=id[,TCP options or unix options][,server][,nowait][,telnet][,websocket][,reconnect=seconds][,tls-creds=id][,tls-authz=id]``
3044e2fcbf42SPeter Maydell    Create a two-way stream socket, which can be either a TCP or a unix
3045e2fcbf42SPeter Maydell    socket. A unix socket will be created if ``path`` is specified.
3046e2fcbf42SPeter Maydell    Behaviour is undefined if TCP options are specified for a unix
3047e2fcbf42SPeter Maydell    socket.
3048e2fcbf42SPeter Maydell
3049e2fcbf42SPeter Maydell    ``server`` specifies that the socket shall be a listening socket.
3050e2fcbf42SPeter Maydell
3051e2fcbf42SPeter Maydell    ``nowait`` specifies that QEMU should not block waiting for a client
3052e2fcbf42SPeter Maydell    to connect to a listening socket.
3053e2fcbf42SPeter Maydell
3054e2fcbf42SPeter Maydell    ``telnet`` specifies that traffic on the socket should interpret
3055e2fcbf42SPeter Maydell    telnet escape sequences.
3056e2fcbf42SPeter Maydell
3057e2fcbf42SPeter Maydell    ``websocket`` specifies that the socket uses WebSocket protocol for
3058e2fcbf42SPeter Maydell    communication.
3059e2fcbf42SPeter Maydell
3060e2fcbf42SPeter Maydell    ``reconnect`` sets the timeout for reconnecting on non-server
3061e2fcbf42SPeter Maydell    sockets when the remote end goes away. qemu will delay this many
3062e2fcbf42SPeter Maydell    seconds and then attempt to reconnect. Zero disables reconnecting,
3063e2fcbf42SPeter Maydell    and is the default.
3064e2fcbf42SPeter Maydell
3065e2fcbf42SPeter Maydell    ``tls-creds`` requests enablement of the TLS protocol for
3066e2fcbf42SPeter Maydell    encryption, and specifies the id of the TLS credentials to use for
3067e2fcbf42SPeter Maydell    the handshake. The credentials must be previously created with the
3068e2fcbf42SPeter Maydell    ``-object tls-creds`` argument.
3069e2fcbf42SPeter Maydell
3070e2fcbf42SPeter Maydell    ``tls-auth`` provides the ID of the QAuthZ authorization object
3071e2fcbf42SPeter Maydell    against which the client's x509 distinguished name will be
3072e2fcbf42SPeter Maydell    validated. This object is only resolved at time of use, so can be
3073e2fcbf42SPeter Maydell    deleted and recreated on the fly while the chardev server is active.
3074e2fcbf42SPeter Maydell    If missing, it will default to denying access.
3075e2fcbf42SPeter Maydell
3076e2fcbf42SPeter Maydell    TCP and unix socket options are given below:
3077e2fcbf42SPeter Maydell
3078e2fcbf42SPeter Maydell    ``TCP options: port=port[,host=host][,to=to][,ipv4][,ipv6][,nodelay]``
3079e2fcbf42SPeter Maydell        ``host`` for a listening socket specifies the local address to
3080e2fcbf42SPeter Maydell        be bound. For a connecting socket species the remote host to
3081e2fcbf42SPeter Maydell        connect to. ``host`` is optional for listening sockets. If not
3082e2fcbf42SPeter Maydell        specified it defaults to ``0.0.0.0``.
3083e2fcbf42SPeter Maydell
3084e2fcbf42SPeter Maydell        ``port`` for a listening socket specifies the local port to be
3085e2fcbf42SPeter Maydell        bound. For a connecting socket specifies the port on the remote
3086e2fcbf42SPeter Maydell        host to connect to. ``port`` can be given as either a port
3087e2fcbf42SPeter Maydell        number or a service name. ``port`` is required.
3088e2fcbf42SPeter Maydell
3089e2fcbf42SPeter Maydell        ``to`` is only relevant to listening sockets. If it is
3090e2fcbf42SPeter Maydell        specified, and ``port`` cannot be bound, QEMU will attempt to
3091e2fcbf42SPeter Maydell        bind to subsequent ports up to and including ``to`` until it
3092e2fcbf42SPeter Maydell        succeeds. ``to`` must be specified as a port number.
3093e2fcbf42SPeter Maydell
3094e2fcbf42SPeter Maydell        ``ipv4`` and ``ipv6`` specify that either IPv4 or IPv6 must be
3095e2fcbf42SPeter Maydell        used. If neither is specified the socket may use either
3096e2fcbf42SPeter Maydell        protocol.
3097e2fcbf42SPeter Maydell
3098e2fcbf42SPeter Maydell        ``nodelay`` disables the Nagle algorithm.
3099e2fcbf42SPeter Maydell
3100e2fcbf42SPeter Maydell    ``unix options: path=path``
3101e2fcbf42SPeter Maydell        ``path`` specifies the local path of the unix socket. ``path``
3102e2fcbf42SPeter Maydell        is required.
3103e2fcbf42SPeter Maydell
3104e2fcbf42SPeter Maydell``-chardev udp,id=id[,host=host],port=port[,localaddr=localaddr][,localport=localport][,ipv4][,ipv6]``
3105e2fcbf42SPeter Maydell    Sends all traffic from the guest to a remote host over UDP.
3106e2fcbf42SPeter Maydell
3107e2fcbf42SPeter Maydell    ``host`` specifies the remote host to connect to. If not specified
3108e2fcbf42SPeter Maydell    it defaults to ``localhost``.
3109e2fcbf42SPeter Maydell
3110e2fcbf42SPeter Maydell    ``port`` specifies the port on the remote host to connect to.
3111e2fcbf42SPeter Maydell    ``port`` is required.
3112e2fcbf42SPeter Maydell
3113e2fcbf42SPeter Maydell    ``localaddr`` specifies the local address to bind to. If not
3114e2fcbf42SPeter Maydell    specified it defaults to ``0.0.0.0``.
3115e2fcbf42SPeter Maydell
3116e2fcbf42SPeter Maydell    ``localport`` specifies the local port to bind to. If not specified
3117e2fcbf42SPeter Maydell    any available local port will be used.
3118e2fcbf42SPeter Maydell
3119e2fcbf42SPeter Maydell    ``ipv4`` and ``ipv6`` specify that either IPv4 or IPv6 must be used.
3120e2fcbf42SPeter Maydell    If neither is specified the device may use either protocol.
3121e2fcbf42SPeter Maydell
3122e2fcbf42SPeter Maydell``-chardev msmouse,id=id``
3123e2fcbf42SPeter Maydell    Forward QEMU's emulated msmouse events to the guest. ``msmouse``
3124e2fcbf42SPeter Maydell    does not take any options.
3125e2fcbf42SPeter Maydell
3126e2fcbf42SPeter Maydell``-chardev vc,id=id[[,width=width][,height=height]][[,cols=cols][,rows=rows]]``
3127e2fcbf42SPeter Maydell    Connect to a QEMU text console. ``vc`` may optionally be given a
3128e2fcbf42SPeter Maydell    specific size.
3129e2fcbf42SPeter Maydell
3130e2fcbf42SPeter Maydell    ``width`` and ``height`` specify the width and height respectively
3131e2fcbf42SPeter Maydell    of the console, in pixels.
3132e2fcbf42SPeter Maydell
3133e2fcbf42SPeter Maydell    ``cols`` and ``rows`` specify that the console be sized to fit a
3134e2fcbf42SPeter Maydell    text console with the given dimensions.
3135e2fcbf42SPeter Maydell
3136e2fcbf42SPeter Maydell``-chardev ringbuf,id=id[,size=size]``
3137e2fcbf42SPeter Maydell    Create a ring buffer with fixed size ``size``. size must be a power
3138e2fcbf42SPeter Maydell    of two and defaults to ``64K``.
3139e2fcbf42SPeter Maydell
3140e2fcbf42SPeter Maydell``-chardev file,id=id,path=path``
3141e2fcbf42SPeter Maydell    Log all traffic received from the guest to a file.
3142e2fcbf42SPeter Maydell
3143e2fcbf42SPeter Maydell    ``path`` specifies the path of the file to be opened. This file will
3144e2fcbf42SPeter Maydell    be created if it does not already exist, and overwritten if it does.
3145e2fcbf42SPeter Maydell    ``path`` is required.
3146e2fcbf42SPeter Maydell
3147e2fcbf42SPeter Maydell``-chardev pipe,id=id,path=path``
3148e2fcbf42SPeter Maydell    Create a two-way connection to the guest. The behaviour differs
3149e2fcbf42SPeter Maydell    slightly between Windows hosts and other hosts:
3150e2fcbf42SPeter Maydell
3151e2fcbf42SPeter Maydell    On Windows, a single duplex pipe will be created at
3152e2fcbf42SPeter Maydell    ``\\.pipe\path``.
3153e2fcbf42SPeter Maydell
3154e2fcbf42SPeter Maydell    On other hosts, 2 pipes will be created called ``path.in`` and
3155e2fcbf42SPeter Maydell    ``path.out``. Data written to ``path.in`` will be received by the
3156e2fcbf42SPeter Maydell    guest. Data written by the guest can be read from ``path.out``. QEMU
3157e2fcbf42SPeter Maydell    will not create these fifos, and requires them to be present.
3158e2fcbf42SPeter Maydell
3159e2fcbf42SPeter Maydell    ``path`` forms part of the pipe path as described above. ``path`` is
3160e2fcbf42SPeter Maydell    required.
3161e2fcbf42SPeter Maydell
3162e2fcbf42SPeter Maydell``-chardev console,id=id``
3163e2fcbf42SPeter Maydell    Send traffic from the guest to QEMU's standard output. ``console``
3164e2fcbf42SPeter Maydell    does not take any options.
3165e2fcbf42SPeter Maydell
3166e2fcbf42SPeter Maydell    ``console`` is only available on Windows hosts.
3167e2fcbf42SPeter Maydell
3168e2fcbf42SPeter Maydell``-chardev serial,id=id,path=path``
3169e2fcbf42SPeter Maydell    Send traffic from the guest to a serial device on the host.
3170e2fcbf42SPeter Maydell
3171e2fcbf42SPeter Maydell    On Unix hosts serial will actually accept any tty device, not only
3172e2fcbf42SPeter Maydell    serial lines.
3173e2fcbf42SPeter Maydell
3174e2fcbf42SPeter Maydell    ``path`` specifies the name of the serial device to open.
3175e2fcbf42SPeter Maydell
3176e2fcbf42SPeter Maydell``-chardev pty,id=id``
3177e2fcbf42SPeter Maydell    Create a new pseudo-terminal on the host and connect to it. ``pty``
3178e2fcbf42SPeter Maydell    does not take any options.
3179e2fcbf42SPeter Maydell
3180e2fcbf42SPeter Maydell    ``pty`` is not available on Windows hosts.
3181e2fcbf42SPeter Maydell
3182e2fcbf42SPeter Maydell``-chardev stdio,id=id[,signal=on|off]``
3183e2fcbf42SPeter Maydell    Connect to standard input and standard output of the QEMU process.
3184e2fcbf42SPeter Maydell
3185e2fcbf42SPeter Maydell    ``signal`` controls if signals are enabled on the terminal, that
3186e2fcbf42SPeter Maydell    includes exiting QEMU with the key sequence Control-c. This option
3187e2fcbf42SPeter Maydell    is enabled by default, use ``signal=off`` to disable it.
3188e2fcbf42SPeter Maydell
3189e2fcbf42SPeter Maydell``-chardev braille,id=id``
3190e2fcbf42SPeter Maydell    Connect to a local BrlAPI server. ``braille`` does not take any
3191e2fcbf42SPeter Maydell    options.
3192e2fcbf42SPeter Maydell
3193e2fcbf42SPeter Maydell``-chardev tty,id=id,path=path``
3194e2fcbf42SPeter Maydell    ``tty`` is only available on Linux, Sun, FreeBSD, NetBSD, OpenBSD
3195e2fcbf42SPeter Maydell    and DragonFlyBSD hosts. It is an alias for ``serial``.
3196e2fcbf42SPeter Maydell
3197e2fcbf42SPeter Maydell    ``path`` specifies the path to the tty. ``path`` is required.
3198e2fcbf42SPeter Maydell
319909ce5f2dSPeter Maydell``-chardev parallel,id=id,path=path``
320009ce5f2dSPeter Maydell  \
320109ce5f2dSPeter Maydell``-chardev parport,id=id,path=path``
3202e2fcbf42SPeter Maydell    ``parallel`` is only available on Linux, FreeBSD and DragonFlyBSD
3203e2fcbf42SPeter Maydell    hosts.
3204e2fcbf42SPeter Maydell
3205e2fcbf42SPeter Maydell    Connect to a local parallel port.
3206e2fcbf42SPeter Maydell
3207e2fcbf42SPeter Maydell    ``path`` specifies the path to the parallel port device. ``path`` is
3208e2fcbf42SPeter Maydell    required.
3209e2fcbf42SPeter Maydell
3210e2fcbf42SPeter Maydell``-chardev spicevmc,id=id,debug=debug,name=name``
3211e2fcbf42SPeter Maydell    ``spicevmc`` is only available when spice support is built in.
3212e2fcbf42SPeter Maydell
3213e2fcbf42SPeter Maydell    ``debug`` debug level for spicevmc
3214e2fcbf42SPeter Maydell
3215e2fcbf42SPeter Maydell    ``name`` name of spice channel to connect to
3216e2fcbf42SPeter Maydell
3217e2fcbf42SPeter Maydell    Connect to a spice virtual machine channel, such as vdiport.
3218e2fcbf42SPeter Maydell
3219e2fcbf42SPeter Maydell``-chardev spiceport,id=id,debug=debug,name=name``
3220e2fcbf42SPeter Maydell    ``spiceport`` is only available when spice support is built in.
3221e2fcbf42SPeter Maydell
3222e2fcbf42SPeter Maydell    ``debug`` debug level for spicevmc
3223e2fcbf42SPeter Maydell
3224e2fcbf42SPeter Maydell    ``name`` name of spice port to connect to
3225e2fcbf42SPeter Maydell
3226e2fcbf42SPeter Maydell    Connect to a spice port, allowing a Spice client to handle the
3227e2fcbf42SPeter Maydell    traffic identified by a name (preferably a fqdn).
3228e2fcbf42SPeter MaydellERST
32297273a2dbSMatthew Booth
32307273a2dbSMatthew BoothDEFHEADING()
32317273a2dbSMatthew Booth
3232d1a0cf73SStefan Berger#ifdef CONFIG_TPM
3233de6b4f90SMarkus ArmbrusterDEFHEADING(TPM device options:)
3234d1a0cf73SStefan Berger
3235d1a0cf73SStefan BergerDEF("tpmdev", HAS_ARG, QEMU_OPTION_tpmdev, \
323692dcc234SStefan Berger    "-tpmdev passthrough,id=id[,path=path][,cancel-path=path]\n"
323792dcc234SStefan Berger    "                use path to provide path to a character device; default is /dev/tpm0\n"
323892dcc234SStefan Berger    "                use cancel-path to provide path to TPM's cancel sysfs entry; if\n"
3239f4ede81eSAmarnath Valluri    "                not provided it will be searched for in /sys/class/misc/tpm?/device\n"
3240f4ede81eSAmarnath Valluri    "-tpmdev emulator,id=id,chardev=dev\n"
3241f4ede81eSAmarnath Valluri    "                configure the TPM device using chardev backend\n",
3242d1a0cf73SStefan Berger    QEMU_ARCH_ALL)
3243e2fcbf42SPeter MaydellSRST
3244e2fcbf42SPeter MaydellThe general form of a TPM device option is:
3245e2fcbf42SPeter Maydell
3246e2fcbf42SPeter Maydell``-tpmdev backend,id=id[,options]``
3247e2fcbf42SPeter Maydell    The specific backend type will determine the applicable options. The
3248e2fcbf42SPeter Maydell    ``-tpmdev`` option creates the TPM backend and requires a
3249e2fcbf42SPeter Maydell    ``-device`` option that specifies the TPM frontend interface model.
3250e2fcbf42SPeter Maydell
3251e2fcbf42SPeter Maydell    Use ``-tpmdev help`` to print all available TPM backend types.
3252e2fcbf42SPeter Maydell
3253e2fcbf42SPeter MaydellThe available backends are:
3254e2fcbf42SPeter Maydell
3255e2fcbf42SPeter Maydell``-tpmdev passthrough,id=id,path=path,cancel-path=cancel-path``
3256e2fcbf42SPeter Maydell    (Linux-host only) Enable access to the host's TPM using the
3257e2fcbf42SPeter Maydell    passthrough driver.
3258e2fcbf42SPeter Maydell
3259e2fcbf42SPeter Maydell    ``path`` specifies the path to the host's TPM device, i.e., on a
3260e2fcbf42SPeter Maydell    Linux host this would be ``/dev/tpm0``. ``path`` is optional and by
3261e2fcbf42SPeter Maydell    default ``/dev/tpm0`` is used.
3262e2fcbf42SPeter Maydell
3263e2fcbf42SPeter Maydell    ``cancel-path`` specifies the path to the host TPM device's sysfs
3264e2fcbf42SPeter Maydell    entry allowing for cancellation of an ongoing TPM command.
3265e2fcbf42SPeter Maydell    ``cancel-path`` is optional and by default QEMU will search for the
3266e2fcbf42SPeter Maydell    sysfs entry to use.
3267e2fcbf42SPeter Maydell
3268e2fcbf42SPeter Maydell    Some notes about using the host's TPM with the passthrough driver:
3269e2fcbf42SPeter Maydell
3270e2fcbf42SPeter Maydell    The TPM device accessed by the passthrough driver must not be used
3271e2fcbf42SPeter Maydell    by any other application on the host.
3272e2fcbf42SPeter Maydell
3273e2fcbf42SPeter Maydell    Since the host's firmware (BIOS/UEFI) has already initialized the
3274e2fcbf42SPeter Maydell    TPM, the VM's firmware (BIOS/UEFI) will not be able to initialize
3275e2fcbf42SPeter Maydell    the TPM again and may therefore not show a TPM-specific menu that
3276e2fcbf42SPeter Maydell    would otherwise allow the user to configure the TPM, e.g., allow the
3277e2fcbf42SPeter Maydell    user to enable/disable or activate/deactivate the TPM. Further, if
3278e2fcbf42SPeter Maydell    TPM ownership is released from within a VM then the host's TPM will
3279e2fcbf42SPeter Maydell    get disabled and deactivated. To enable and activate the TPM again
3280e2fcbf42SPeter Maydell    afterwards, the host has to be rebooted and the user is required to
3281e2fcbf42SPeter Maydell    enter the firmware's menu to enable and activate the TPM. If the TPM
3282e2fcbf42SPeter Maydell    is left disabled and/or deactivated most TPM commands will fail.
3283e2fcbf42SPeter Maydell
3284e2fcbf42SPeter Maydell    To create a passthrough TPM use the following two options:
3285e2fcbf42SPeter Maydell
3286e2fcbf42SPeter Maydell    ::
3287e2fcbf42SPeter Maydell
3288e2fcbf42SPeter Maydell        -tpmdev passthrough,id=tpm0 -device tpm-tis,tpmdev=tpm0
3289e2fcbf42SPeter Maydell
3290e2fcbf42SPeter Maydell    Note that the ``-tpmdev`` id is ``tpm0`` and is referenced by
3291e2fcbf42SPeter Maydell    ``tpmdev=tpm0`` in the device option.
3292e2fcbf42SPeter Maydell
3293e2fcbf42SPeter Maydell``-tpmdev emulator,id=id,chardev=dev``
3294e2fcbf42SPeter Maydell    (Linux-host only) Enable access to a TPM emulator using Unix domain
3295e2fcbf42SPeter Maydell    socket based chardev backend.
3296e2fcbf42SPeter Maydell
3297e2fcbf42SPeter Maydell    ``chardev`` specifies the unique ID of a character device backend
3298e2fcbf42SPeter Maydell    that provides connection to the software TPM server.
3299e2fcbf42SPeter Maydell
3300e2fcbf42SPeter Maydell    To create a TPM emulator backend device with chardev socket backend:
3301e2fcbf42SPeter Maydell
3302e2fcbf42SPeter Maydell    ::
3303e2fcbf42SPeter Maydell
3304e2fcbf42SPeter Maydell        -chardev socket,id=chrtpm,path=/tmp/swtpm-sock -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis,tpmdev=tpm0
3305e2fcbf42SPeter MaydellERST
3306d1a0cf73SStefan Berger
3307d1a0cf73SStefan BergerDEFHEADING()
3308d1a0cf73SStefan Berger
3309d1a0cf73SStefan Berger#endif
3310d1a0cf73SStefan Berger
3311de6b4f90SMarkus ArmbrusterDEFHEADING(Linux/Multiboot boot specific:)
3312e2fcbf42SPeter MaydellSRST
3313e2fcbf42SPeter MaydellWhen using these options, you can use a given Linux or Multiboot kernel
3314e2fcbf42SPeter Maydellwithout installing it in the disk image. It can be useful for easier
3315e2fcbf42SPeter Maydelltesting of various kernels.
3316e2fcbf42SPeter Maydell
3317e2fcbf42SPeter Maydell
3318e2fcbf42SPeter MaydellERST
33195824d651Sblueswir1
33205824d651Sblueswir1DEF("kernel", HAS_ARG, QEMU_OPTION_kernel, \
3321ad96090aSBlue Swirl    "-kernel bzImage use 'bzImage' as kernel image\n", QEMU_ARCH_ALL)
3322e2fcbf42SPeter MaydellSRST
3323e2fcbf42SPeter Maydell``-kernel bzImage``
3324e2fcbf42SPeter Maydell    Use bzImage as kernel image. The kernel can be either a Linux kernel
3325e2fcbf42SPeter Maydell    or in multiboot format.
3326e2fcbf42SPeter MaydellERST
33275824d651Sblueswir1
33285824d651Sblueswir1DEF("append", HAS_ARG, QEMU_OPTION_append, \
3329ad96090aSBlue Swirl    "-append cmdline use 'cmdline' as kernel command line\n", QEMU_ARCH_ALL)
3330e2fcbf42SPeter MaydellSRST
3331e2fcbf42SPeter Maydell``-append cmdline``
3332e2fcbf42SPeter Maydell    Use cmdline as kernel command line
3333e2fcbf42SPeter MaydellERST
33345824d651Sblueswir1
33355824d651Sblueswir1DEF("initrd", HAS_ARG, QEMU_OPTION_initrd, \
3336ad96090aSBlue Swirl           "-initrd file    use 'file' as initial ram disk\n", QEMU_ARCH_ALL)
3337e2fcbf42SPeter MaydellSRST
3338e2fcbf42SPeter Maydell``-initrd file``
3339e2fcbf42SPeter Maydell    Use file as initial ram disk.
3340e2fcbf42SPeter Maydell
3341e2fcbf42SPeter Maydell``-initrd "file1 arg=foo,file2"``
3342e2fcbf42SPeter Maydell    This syntax is only available with multiboot.
3343e2fcbf42SPeter Maydell
3344e2fcbf42SPeter Maydell    Use file1 and file2 as modules and pass arg=foo as parameter to the
3345e2fcbf42SPeter Maydell    first module.
3346e2fcbf42SPeter MaydellERST
33475824d651Sblueswir1
3348412beee6SGrant LikelyDEF("dtb", HAS_ARG, QEMU_OPTION_dtb, \
3349379b5c7cSPeter A. G. Crosthwaite    "-dtb    file    use 'file' as device tree image\n", QEMU_ARCH_ALL)
3350e2fcbf42SPeter MaydellSRST
3351e2fcbf42SPeter Maydell``-dtb file``
3352e2fcbf42SPeter Maydell    Use file as a device tree binary (dtb) image and pass it to the
3353e2fcbf42SPeter Maydell    kernel on boot.
3354e2fcbf42SPeter MaydellERST
3355412beee6SGrant Likely
33565824d651Sblueswir1DEFHEADING()
33575824d651Sblueswir1
3358de6b4f90SMarkus ArmbrusterDEFHEADING(Debug/Expert options:)
33595824d651Sblueswir1
336081b2b810SGabriel L. SomloDEF("fw_cfg", HAS_ARG, QEMU_OPTION_fwcfg,
336181b2b810SGabriel L. Somlo    "-fw_cfg [name=]<name>,file=<file>\n"
336263d3145aSMarkus Armbruster    "                add named fw_cfg entry with contents from file\n"
33636407d76eSGabriel L. Somlo    "-fw_cfg [name=]<name>,string=<str>\n"
336463d3145aSMarkus Armbruster    "                add named fw_cfg entry with contents from string\n",
336581b2b810SGabriel L. Somlo    QEMU_ARCH_ALL)
3366e2fcbf42SPeter MaydellSRST
3367e2fcbf42SPeter Maydell``-fw_cfg [name=]name,file=file``
3368e2fcbf42SPeter Maydell    Add named fw\_cfg entry with contents from file file.
3369e2fcbf42SPeter Maydell
3370e2fcbf42SPeter Maydell``-fw_cfg [name=]name,string=str``
3371e2fcbf42SPeter Maydell    Add named fw\_cfg entry with contents from string str.
3372e2fcbf42SPeter Maydell
3373e2fcbf42SPeter Maydell    The terminating NUL character of the contents of str will not be
3374e2fcbf42SPeter Maydell    included as part of the fw\_cfg item data. To insert contents with
3375e2fcbf42SPeter Maydell    embedded NUL characters, you have to use the file parameter.
3376e2fcbf42SPeter Maydell
3377e2fcbf42SPeter Maydell    The fw\_cfg entries are passed by QEMU through to the guest.
3378e2fcbf42SPeter Maydell
3379e2fcbf42SPeter Maydell    Example:
3380e2fcbf42SPeter Maydell
3381e2fcbf42SPeter Maydell    ::
3382e2fcbf42SPeter Maydell
3383e2fcbf42SPeter Maydell            -fw_cfg name=opt/com.mycompany/blob,file=./my_blob.bin
3384e2fcbf42SPeter Maydell
3385e2fcbf42SPeter Maydell    creates an fw\_cfg entry named opt/com.mycompany/blob with contents
3386e2fcbf42SPeter Maydell    from ./my\_blob.bin.
3387e2fcbf42SPeter MaydellERST
338881b2b810SGabriel L. Somlo
33895824d651Sblueswir1DEF("serial", HAS_ARG, QEMU_OPTION_serial, \
3390ad96090aSBlue Swirl    "-serial dev     redirect the serial port to char device 'dev'\n",
3391ad96090aSBlue Swirl    QEMU_ARCH_ALL)
3392e2fcbf42SPeter MaydellSRST
3393e2fcbf42SPeter Maydell``-serial dev``
3394e2fcbf42SPeter Maydell    Redirect the virtual serial port to host character device dev. The
3395e2fcbf42SPeter Maydell    default device is ``vc`` in graphical mode and ``stdio`` in non
3396e2fcbf42SPeter Maydell    graphical mode.
3397e2fcbf42SPeter Maydell
3398e2fcbf42SPeter Maydell    This option can be used several times to simulate up to 4 serial
3399e2fcbf42SPeter Maydell    ports.
3400e2fcbf42SPeter Maydell
3401e2fcbf42SPeter Maydell    Use ``-serial none`` to disable all serial ports.
3402e2fcbf42SPeter Maydell
3403e2fcbf42SPeter Maydell    Available character devices are:
3404e2fcbf42SPeter Maydell
3405e2fcbf42SPeter Maydell    ``vc[:WxH]``
3406e2fcbf42SPeter Maydell        Virtual console. Optionally, a width and height can be given in
3407e2fcbf42SPeter Maydell        pixel with
3408e2fcbf42SPeter Maydell
3409e2fcbf42SPeter Maydell        ::
3410e2fcbf42SPeter Maydell
3411e2fcbf42SPeter Maydell            vc:800x600
3412e2fcbf42SPeter Maydell
3413e2fcbf42SPeter Maydell        It is also possible to specify width or height in characters:
3414e2fcbf42SPeter Maydell
3415e2fcbf42SPeter Maydell        ::
3416e2fcbf42SPeter Maydell
3417e2fcbf42SPeter Maydell            vc:80Cx24C
3418e2fcbf42SPeter Maydell
3419e2fcbf42SPeter Maydell    ``pty``
3420e2fcbf42SPeter Maydell        [Linux only] Pseudo TTY (a new PTY is automatically allocated)
3421e2fcbf42SPeter Maydell
3422e2fcbf42SPeter Maydell    ``none``
3423e2fcbf42SPeter Maydell        No device is allocated.
3424e2fcbf42SPeter Maydell
3425e2fcbf42SPeter Maydell    ``null``
3426e2fcbf42SPeter Maydell        void device
3427e2fcbf42SPeter Maydell
3428e2fcbf42SPeter Maydell    ``chardev:id``
3429e2fcbf42SPeter Maydell        Use a named character device defined with the ``-chardev``
3430e2fcbf42SPeter Maydell        option.
3431e2fcbf42SPeter Maydell
3432e2fcbf42SPeter Maydell    ``/dev/XXX``
3433e2fcbf42SPeter Maydell        [Linux only] Use host tty, e.g. ``/dev/ttyS0``. The host serial
3434e2fcbf42SPeter Maydell        port parameters are set according to the emulated ones.
3435e2fcbf42SPeter Maydell
3436e2fcbf42SPeter Maydell    ``/dev/parportN``
3437e2fcbf42SPeter Maydell        [Linux only, parallel port only] Use host parallel port N.
3438e2fcbf42SPeter Maydell        Currently SPP and EPP parallel port features can be used.
3439e2fcbf42SPeter Maydell
3440e2fcbf42SPeter Maydell    ``file:filename``
3441e2fcbf42SPeter Maydell        Write output to filename. No character can be read.
3442e2fcbf42SPeter Maydell
3443e2fcbf42SPeter Maydell    ``stdio``
3444e2fcbf42SPeter Maydell        [Unix only] standard input/output
3445e2fcbf42SPeter Maydell
3446e2fcbf42SPeter Maydell    ``pipe:filename``
3447e2fcbf42SPeter Maydell        name pipe filename
3448e2fcbf42SPeter Maydell
3449e2fcbf42SPeter Maydell    ``COMn``
3450e2fcbf42SPeter Maydell        [Windows only] Use host serial port n
3451e2fcbf42SPeter Maydell
3452e2fcbf42SPeter Maydell    ``udp:[remote_host]:remote_port[@[src_ip]:src_port]``
3453e2fcbf42SPeter Maydell        This implements UDP Net Console. When remote\_host or src\_ip
3454e2fcbf42SPeter Maydell        are not specified they default to ``0.0.0.0``. When not using a
3455e2fcbf42SPeter Maydell        specified src\_port a random port is automatically chosen.
3456e2fcbf42SPeter Maydell
3457e2fcbf42SPeter Maydell        If you just want a simple readonly console you can use
3458e2fcbf42SPeter Maydell        ``netcat`` or ``nc``, by starting QEMU with:
3459e2fcbf42SPeter Maydell        ``-serial udp::4555`` and nc as: ``nc -u -l -p 4555``. Any time
3460e2fcbf42SPeter Maydell        QEMU writes something to that port it will appear in the
3461e2fcbf42SPeter Maydell        netconsole session.
3462e2fcbf42SPeter Maydell
3463e2fcbf42SPeter Maydell        If you plan to send characters back via netconsole or you want
3464e2fcbf42SPeter Maydell        to stop and start QEMU a lot of times, you should have QEMU use
3465e2fcbf42SPeter Maydell        the same source port each time by using something like ``-serial
3466e2fcbf42SPeter Maydell        udp::4555@:4556`` to QEMU. Another approach is to use a patched
3467e2fcbf42SPeter Maydell        version of netcat which can listen to a TCP port and send and
3468e2fcbf42SPeter Maydell        receive characters via udp. If you have a patched version of
3469e2fcbf42SPeter Maydell        netcat which activates telnet remote echo and single char
3470e2fcbf42SPeter Maydell        transfer, then you can use the following options to set up a
3471e2fcbf42SPeter Maydell        netcat redirector to allow telnet on port 5555 to access the
3472e2fcbf42SPeter Maydell        QEMU port.
3473e2fcbf42SPeter Maydell
3474e2fcbf42SPeter Maydell        ``QEMU Options:``
3475e2fcbf42SPeter Maydell            -serial udp::4555@:4556
3476e2fcbf42SPeter Maydell
3477e2fcbf42SPeter Maydell        ``netcat options:``
3478e2fcbf42SPeter Maydell            -u -P 4555 -L 0.0.0.0:4556 -t -p 5555 -I -T
3479e2fcbf42SPeter Maydell
3480e2fcbf42SPeter Maydell        ``telnet options:``
3481e2fcbf42SPeter Maydell            localhost 5555
3482e2fcbf42SPeter Maydell
3483e2fcbf42SPeter Maydell    ``tcp:[host]:port[,server][,nowait][,nodelay][,reconnect=seconds]``
3484e2fcbf42SPeter Maydell        The TCP Net Console has two modes of operation. It can send the
3485e2fcbf42SPeter Maydell        serial I/O to a location or wait for a connection from a
3486e2fcbf42SPeter Maydell        location. By default the TCP Net Console is sent to host at the
3487e2fcbf42SPeter Maydell        port. If you use the server option QEMU will wait for a client
3488e2fcbf42SPeter Maydell        socket application to connect to the port before continuing,
3489e2fcbf42SPeter Maydell        unless the ``nowait`` option was specified. The ``nodelay``
3490e2fcbf42SPeter Maydell        option disables the Nagle buffering algorithm. The ``reconnect``
3491e2fcbf42SPeter Maydell        option only applies if noserver is set, if the connection goes
3492e2fcbf42SPeter Maydell        down it will attempt to reconnect at the given interval. If host
3493e2fcbf42SPeter Maydell        is omitted, 0.0.0.0 is assumed. Only one TCP connection at a
3494e2fcbf42SPeter Maydell        time is accepted. You can use ``telnet`` to connect to the
3495e2fcbf42SPeter Maydell        corresponding character device.
3496e2fcbf42SPeter Maydell
3497e2fcbf42SPeter Maydell        ``Example to send tcp console to 192.168.0.2 port 4444``
3498e2fcbf42SPeter Maydell            -serial tcp:192.168.0.2:4444
3499e2fcbf42SPeter Maydell
3500e2fcbf42SPeter Maydell        ``Example to listen and wait on port 4444 for connection``
3501e2fcbf42SPeter Maydell            -serial tcp::4444,server
3502e2fcbf42SPeter Maydell
3503e2fcbf42SPeter Maydell        ``Example to not wait and listen on ip 192.168.0.100 port 4444``
3504e2fcbf42SPeter Maydell            -serial tcp:192.168.0.100:4444,server,nowait
3505e2fcbf42SPeter Maydell
3506e2fcbf42SPeter Maydell    ``telnet:host:port[,server][,nowait][,nodelay]``
3507e2fcbf42SPeter Maydell        The telnet protocol is used instead of raw tcp sockets. The
3508e2fcbf42SPeter Maydell        options work the same as if you had specified ``-serial tcp``.
3509e2fcbf42SPeter Maydell        The difference is that the port acts like a telnet server or
3510e2fcbf42SPeter Maydell        client using telnet option negotiation. This will also allow you
3511e2fcbf42SPeter Maydell        to send the MAGIC\_SYSRQ sequence if you use a telnet that
3512e2fcbf42SPeter Maydell        supports sending the break sequence. Typically in unix telnet
3513e2fcbf42SPeter Maydell        you do it with Control-] and then type "send break" followed by
3514e2fcbf42SPeter Maydell        pressing the enter key.
3515e2fcbf42SPeter Maydell
3516e2fcbf42SPeter Maydell    ``websocket:host:port,server[,nowait][,nodelay]``
3517e2fcbf42SPeter Maydell        The WebSocket protocol is used instead of raw tcp socket. The
3518e2fcbf42SPeter Maydell        port acts as a WebSocket server. Client mode is not supported.
3519e2fcbf42SPeter Maydell
3520e2fcbf42SPeter Maydell    ``unix:path[,server][,nowait][,reconnect=seconds]``
3521e2fcbf42SPeter Maydell        A unix domain socket is used instead of a tcp socket. The option
3522e2fcbf42SPeter Maydell        works the same as if you had specified ``-serial tcp`` except
3523e2fcbf42SPeter Maydell        the unix domain socket path is used for connections.
3524e2fcbf42SPeter Maydell
3525e2fcbf42SPeter Maydell    ``mon:dev_string``
3526e2fcbf42SPeter Maydell        This is a special option to allow the monitor to be multiplexed
3527e2fcbf42SPeter Maydell        onto another serial port. The monitor is accessed with key
3528e2fcbf42SPeter Maydell        sequence of Control-a and then pressing c. dev\_string should be
3529e2fcbf42SPeter Maydell        any one of the serial devices specified above. An example to
3530e2fcbf42SPeter Maydell        multiplex the monitor onto a telnet server listening on port
3531e2fcbf42SPeter Maydell        4444 would be:
3532e2fcbf42SPeter Maydell
3533e2fcbf42SPeter Maydell        ``-serial mon:telnet::4444,server,nowait``
3534e2fcbf42SPeter Maydell
3535e2fcbf42SPeter Maydell        When the monitor is multiplexed to stdio in this way, Ctrl+C
3536e2fcbf42SPeter Maydell        will not terminate QEMU any more but will be passed to the guest
3537e2fcbf42SPeter Maydell        instead.
3538e2fcbf42SPeter Maydell
3539e2fcbf42SPeter Maydell    ``braille``
3540e2fcbf42SPeter Maydell        Braille device. This will use BrlAPI to display the braille
3541e2fcbf42SPeter Maydell        output on a real or fake device.
3542e2fcbf42SPeter Maydell
3543e2fcbf42SPeter Maydell    ``msmouse``
3544e2fcbf42SPeter Maydell        Three button serial mouse. Configure the guest to use Microsoft
3545e2fcbf42SPeter Maydell        protocol.
3546e2fcbf42SPeter MaydellERST
35475824d651Sblueswir1
35485824d651Sblueswir1DEF("parallel", HAS_ARG, QEMU_OPTION_parallel, \
3549ad96090aSBlue Swirl    "-parallel dev   redirect the parallel port to char device 'dev'\n",
3550ad96090aSBlue Swirl    QEMU_ARCH_ALL)
3551e2fcbf42SPeter MaydellSRST
3552e2fcbf42SPeter Maydell``-parallel dev``
3553e2fcbf42SPeter Maydell    Redirect the virtual parallel port to host device dev (same devices
3554e2fcbf42SPeter Maydell    as the serial port). On Linux hosts, ``/dev/parportN`` can be used
3555e2fcbf42SPeter Maydell    to use hardware devices connected on the corresponding host parallel
3556e2fcbf42SPeter Maydell    port.
3557e2fcbf42SPeter Maydell
3558e2fcbf42SPeter Maydell    This option can be used several times to simulate up to 3 parallel
3559e2fcbf42SPeter Maydell    ports.
3560e2fcbf42SPeter Maydell
3561e2fcbf42SPeter Maydell    Use ``-parallel none`` to disable all parallel ports.
3562e2fcbf42SPeter MaydellERST
35635824d651Sblueswir1
35645824d651Sblueswir1DEF("monitor", HAS_ARG, QEMU_OPTION_monitor, \
3565ad96090aSBlue Swirl    "-monitor dev    redirect the monitor to char device 'dev'\n",
3566ad96090aSBlue Swirl    QEMU_ARCH_ALL)
3567e2fcbf42SPeter MaydellSRST
3568e2fcbf42SPeter Maydell``-monitor dev``
3569e2fcbf42SPeter Maydell    Redirect the monitor to host device dev (same devices as the serial
3570e2fcbf42SPeter Maydell    port). The default device is ``vc`` in graphical mode and ``stdio``
3571e2fcbf42SPeter Maydell    in non graphical mode. Use ``-monitor none`` to disable the default
3572e2fcbf42SPeter Maydell    monitor.
3573e2fcbf42SPeter MaydellERST
35746ca5582dSGerd HoffmannDEF("qmp", HAS_ARG, QEMU_OPTION_qmp, \
3575ad96090aSBlue Swirl    "-qmp dev        like -monitor but opens in 'control' mode\n",
3576ad96090aSBlue Swirl    QEMU_ARCH_ALL)
3577e2fcbf42SPeter MaydellSRST
3578e2fcbf42SPeter Maydell``-qmp dev``
3579e2fcbf42SPeter Maydell    Like -monitor but opens in 'control' mode.
3580e2fcbf42SPeter MaydellERST
35814821cd4cSMax ReitzDEF("qmp-pretty", HAS_ARG, QEMU_OPTION_qmp_pretty, \
35824821cd4cSMax Reitz    "-qmp-pretty dev like -qmp but uses pretty JSON formatting\n",
35834821cd4cSMax Reitz    QEMU_ARCH_ALL)
3584e2fcbf42SPeter MaydellSRST
3585e2fcbf42SPeter Maydell``-qmp-pretty dev``
3586e2fcbf42SPeter Maydell    Like -qmp but uses pretty JSON formatting.
3587e2fcbf42SPeter MaydellERST
35885824d651Sblueswir1
358922a0e04bSGerd HoffmannDEF("mon", HAS_ARG, QEMU_OPTION_mon, \
3590ef670726SVicente Jimenez Aguilar    "-mon [chardev=]name[,mode=readline|control][,pretty[=on|off]]\n", QEMU_ARCH_ALL)
3591e2fcbf42SPeter MaydellSRST
3592e2fcbf42SPeter Maydell``-mon [chardev=]name[,mode=readline|control][,pretty[=on|off]]``
3593e2fcbf42SPeter Maydell    Setup monitor on chardev name. ``pretty`` turns on JSON pretty
3594e2fcbf42SPeter Maydell    printing easing human reading and debugging.
3595e2fcbf42SPeter MaydellERST
359622a0e04bSGerd Hoffmann
3597c9f398e5SH. Peter AnvinDEF("debugcon", HAS_ARG, QEMU_OPTION_debugcon, \
3598ad96090aSBlue Swirl    "-debugcon dev   redirect the debug console to char device 'dev'\n",
3599ad96090aSBlue Swirl    QEMU_ARCH_ALL)
3600e2fcbf42SPeter MaydellSRST
3601e2fcbf42SPeter Maydell``-debugcon dev``
3602e2fcbf42SPeter Maydell    Redirect the debug console to host device dev (same devices as the
3603e2fcbf42SPeter Maydell    serial port). The debug console is an I/O port which is typically
3604e2fcbf42SPeter Maydell    port 0xe9; writing to that I/O port sends output to this device. The
3605e2fcbf42SPeter Maydell    default device is ``vc`` in graphical mode and ``stdio`` in non
3606e2fcbf42SPeter Maydell    graphical mode.
3607e2fcbf42SPeter MaydellERST
3608c9f398e5SH. Peter Anvin
36095824d651Sblueswir1DEF("pidfile", HAS_ARG, QEMU_OPTION_pidfile, \
3610ad96090aSBlue Swirl    "-pidfile file   write PID to 'file'\n", QEMU_ARCH_ALL)
3611e2fcbf42SPeter MaydellSRST
3612e2fcbf42SPeter Maydell``-pidfile file``
3613e2fcbf42SPeter Maydell    Store the QEMU process PID in file. It is useful if you launch QEMU
3614e2fcbf42SPeter Maydell    from a script.
3615e2fcbf42SPeter MaydellERST
36165824d651Sblueswir1
36171b530a6dSaurel32DEF("singlestep", 0, QEMU_OPTION_singlestep, \
3618ad96090aSBlue Swirl    "-singlestep     always run in singlestep mode\n", QEMU_ARCH_ALL)
3619e2fcbf42SPeter MaydellSRST
3620e2fcbf42SPeter Maydell``-singlestep``
3621e2fcbf42SPeter Maydell    Run the emulation in single step mode.
3622e2fcbf42SPeter MaydellERST
36231b530a6dSaurel32
3624047f7038SIgor MammedovDEF("preconfig", 0, QEMU_OPTION_preconfig, \
3625361ac948SMarkus Armbruster    "--preconfig     pause QEMU before machine is initialized (experimental)\n",
3626047f7038SIgor Mammedov    QEMU_ARCH_ALL)
3627e2fcbf42SPeter MaydellSRST
3628e2fcbf42SPeter Maydell``--preconfig``
3629e2fcbf42SPeter Maydell    Pause QEMU for interactive configuration before the machine is
3630e2fcbf42SPeter Maydell    created, which allows querying and configuring properties that will
3631e2fcbf42SPeter Maydell    affect machine initialization. Use QMP command 'x-exit-preconfig' to
3632e2fcbf42SPeter Maydell    exit the preconfig state and move to the next state (i.e. run guest
3633e2fcbf42SPeter Maydell    if -S isn't used or pause the second time if -S is used). This
3634e2fcbf42SPeter Maydell    option is experimental.
3635e2fcbf42SPeter MaydellERST
3636047f7038SIgor Mammedov
36375824d651Sblueswir1DEF("S", 0, QEMU_OPTION_S, \
3638ad96090aSBlue Swirl    "-S              freeze CPU at startup (use 'c' to start execution)\n",
3639ad96090aSBlue Swirl    QEMU_ARCH_ALL)
3640e2fcbf42SPeter MaydellSRST
3641e2fcbf42SPeter Maydell``-S``
3642e2fcbf42SPeter Maydell    Do not start CPU at startup (you must type 'c' in the monitor).
3643e2fcbf42SPeter MaydellERST
36445824d651Sblueswir1
3645888a6bc6SSatoru MoriyaDEF("realtime", HAS_ARG, QEMU_OPTION_realtime,
3646888a6bc6SSatoru Moriya    "-realtime [mlock=on|off]\n"
3647888a6bc6SSatoru Moriya    "                run qemu with realtime features\n"
3648888a6bc6SSatoru Moriya    "                mlock=on|off controls mlock support (default: on)\n",
3649888a6bc6SSatoru Moriya    QEMU_ARCH_ALL)
3650e2fcbf42SPeter MaydellSRST
3651e2fcbf42SPeter Maydell``-realtime mlock=on|off``
3652e2fcbf42SPeter Maydell    Run qemu with realtime features. mlocking qemu and guest memory can
3653e2fcbf42SPeter Maydell    be enabled via ``mlock=on`` (enabled by default).
3654e2fcbf42SPeter MaydellERST
3655888a6bc6SSatoru Moriya
36566f131f13SMichael S. TsirkinDEF("overcommit", HAS_ARG, QEMU_OPTION_overcommit,
3657dfaa7d50SBALATON Zoltan    "-overcommit [mem-lock=on|off][cpu-pm=on|off]\n"
36586f131f13SMichael S. Tsirkin    "                run qemu with overcommit hints\n"
36596f131f13SMichael S. Tsirkin    "                mem-lock=on|off controls memory lock support (default: off)\n"
36606f131f13SMichael S. Tsirkin    "                cpu-pm=on|off controls cpu power management (default: off)\n",
36616f131f13SMichael S. Tsirkin    QEMU_ARCH_ALL)
3662e2fcbf42SPeter MaydellSRST
3663e2fcbf42SPeter Maydell``-overcommit mem-lock=on|off``
366409ce5f2dSPeter Maydell  \
3665e2fcbf42SPeter Maydell``-overcommit cpu-pm=on|off``
3666e2fcbf42SPeter Maydell    Run qemu with hints about host resource overcommit. The default is
3667e2fcbf42SPeter Maydell    to assume that host overcommits all resources.
3668e2fcbf42SPeter Maydell
3669e2fcbf42SPeter Maydell    Locking qemu and guest memory can be enabled via ``mem-lock=on``
3670e2fcbf42SPeter Maydell    (disabled by default). This works when host memory is not
3671e2fcbf42SPeter Maydell    overcommitted and reduces the worst-case latency for guest. This is
3672e2fcbf42SPeter Maydell    equivalent to ``realtime``.
3673e2fcbf42SPeter Maydell
3674e2fcbf42SPeter Maydell    Guest ability to manage power state of host cpus (increasing latency
3675e2fcbf42SPeter Maydell    for other processes on the same host cpu, but decreasing latency for
3676e2fcbf42SPeter Maydell    guest) can be enabled via ``cpu-pm=on`` (disabled by default). This
3677e2fcbf42SPeter Maydell    works best when host CPU is not overcommitted. When used, host
3678e2fcbf42SPeter Maydell    estimates of CPU cycle and power utilization will be incorrect, not
3679e2fcbf42SPeter Maydell    taking into account guest idle time.
3680e2fcbf42SPeter MaydellERST
36816f131f13SMichael S. Tsirkin
368259030a8cSaliguoriDEF("gdb", HAS_ARG, QEMU_OPTION_gdb, \
3683ad96090aSBlue Swirl    "-gdb dev        wait for gdb connection on 'dev'\n", QEMU_ARCH_ALL)
3684e2fcbf42SPeter MaydellSRST
3685e2fcbf42SPeter Maydell``-gdb dev``
3686e2fcbf42SPeter Maydell    Wait for gdb connection on device dev (see
3687e2fcbf42SPeter Maydell    :ref:`gdb_005fusage`). Typical connections will likely be
3688e2fcbf42SPeter Maydell    TCP-based, but also UDP, pseudo TTY, or even stdio are reasonable
3689e2fcbf42SPeter Maydell    use case. The latter is allowing to start QEMU from within gdb and
3690e2fcbf42SPeter Maydell    establish the connection via a pipe:
3691e2fcbf42SPeter Maydell
369209ce5f2dSPeter Maydell    .. parsed-literal::
3693e2fcbf42SPeter Maydell
3694e2fcbf42SPeter Maydell        (gdb) target remote | exec |qemu_system| -gdb stdio ...
3695e2fcbf42SPeter MaydellERST
36965824d651Sblueswir1
369759030a8cSaliguoriDEF("s", 0, QEMU_OPTION_s, \
3698ad96090aSBlue Swirl    "-s              shorthand for -gdb tcp::" DEFAULT_GDBSTUB_PORT "\n",
3699ad96090aSBlue Swirl    QEMU_ARCH_ALL)
3700e2fcbf42SPeter MaydellSRST
3701e2fcbf42SPeter Maydell``-s``
3702e2fcbf42SPeter Maydell    Shorthand for -gdb tcp::1234, i.e. open a gdbserver on TCP port 1234
3703e2fcbf42SPeter Maydell    (see :ref:`gdb_005fusage`).
3704e2fcbf42SPeter MaydellERST
37055824d651Sblueswir1
37065824d651Sblueswir1DEF("d", HAS_ARG, QEMU_OPTION_d, \
3707989b697dSPeter Maydell    "-d item1,...    enable logging of specified items (use '-d help' for a list of log items)\n",
3708ad96090aSBlue Swirl    QEMU_ARCH_ALL)
3709e2fcbf42SPeter MaydellSRST
3710e2fcbf42SPeter Maydell``-d item1[,...]``
3711e2fcbf42SPeter Maydell    Enable logging of specified items. Use '-d help' for a list of log
3712e2fcbf42SPeter Maydell    items.
3713e2fcbf42SPeter MaydellERST
37145824d651Sblueswir1
3715c235d738SMatthew FernandezDEF("D", HAS_ARG, QEMU_OPTION_D, \
3716989b697dSPeter Maydell    "-D logfile      output log to logfile (default stderr)\n",
3717c235d738SMatthew Fernandez    QEMU_ARCH_ALL)
3718e2fcbf42SPeter MaydellSRST
3719e2fcbf42SPeter Maydell``-D logfile``
3720e2fcbf42SPeter Maydell    Output log in logfile instead of to stderr
3721e2fcbf42SPeter MaydellERST
3722c235d738SMatthew Fernandez
37233514552eSAlex BennéeDEF("dfilter", HAS_ARG, QEMU_OPTION_DFILTER, \
37243514552eSAlex Bennée    "-dfilter range,..  filter debug output to range of addresses (useful for -d cpu,exec,etc..)\n",
37253514552eSAlex Bennée    QEMU_ARCH_ALL)
3726e2fcbf42SPeter MaydellSRST
3727e2fcbf42SPeter Maydell``-dfilter range1[,...]``
3728e2fcbf42SPeter Maydell    Filter debug output to that relevant to a range of target addresses.
3729e2fcbf42SPeter Maydell    The filter spec can be either start+size, start-size or start..end
3730e2fcbf42SPeter Maydell    where start end and size are the addresses and sizes required. For
3731e2fcbf42SPeter Maydell    example:
3732e2fcbf42SPeter Maydell
3733e2fcbf42SPeter Maydell    ::
3734e2fcbf42SPeter Maydell
3735e2fcbf42SPeter Maydell            -dfilter 0x8000..0x8fff,0xffffffc000080000+0x200,0xffffffc000060000-0x1000
3736e2fcbf42SPeter Maydell
3737e2fcbf42SPeter Maydell    Will dump output for any code in the 0x1000 sized block starting at
3738e2fcbf42SPeter Maydell    0x8000 and the 0x200 sized block starting at 0xffffffc000080000 and
3739e2fcbf42SPeter Maydell    another 0x1000 sized block starting at 0xffffffc00005f000.
3740e2fcbf42SPeter MaydellERST
37413514552eSAlex Bennée
37429c09a251SRichard HendersonDEF("seed", HAS_ARG, QEMU_OPTION_seed, \
37439c09a251SRichard Henderson    "-seed number       seed the pseudo-random number generator\n",
37449c09a251SRichard Henderson    QEMU_ARCH_ALL)
3745e2fcbf42SPeter MaydellSRST
3746e2fcbf42SPeter Maydell``-seed number``
3747e2fcbf42SPeter Maydell    Force the guest to use a deterministic pseudo-random number
3748e2fcbf42SPeter Maydell    generator, seeded with number. This does not affect crypto routines
3749e2fcbf42SPeter Maydell    within the host.
3750e2fcbf42SPeter MaydellERST
37519c09a251SRichard Henderson
37525824d651Sblueswir1DEF("L", HAS_ARG, QEMU_OPTION_L, \
3753ad96090aSBlue Swirl    "-L path         set the directory for the BIOS, VGA BIOS and keymaps\n",
3754ad96090aSBlue Swirl    QEMU_ARCH_ALL)
3755e2fcbf42SPeter MaydellSRST
3756e2fcbf42SPeter Maydell``-L  path``
3757e2fcbf42SPeter Maydell    Set the directory for the BIOS, VGA BIOS and keymaps.
3758e2fcbf42SPeter Maydell
3759e2fcbf42SPeter Maydell    To list all the data directories, use ``-L help``.
3760e2fcbf42SPeter MaydellERST
37615824d651Sblueswir1
37625824d651Sblueswir1DEF("bios", HAS_ARG, QEMU_OPTION_bios, \
3763ad96090aSBlue Swirl    "-bios file      set the filename for the BIOS\n", QEMU_ARCH_ALL)
3764e2fcbf42SPeter MaydellSRST
3765e2fcbf42SPeter Maydell``-bios file``
3766e2fcbf42SPeter Maydell    Set the filename for the BIOS.
3767e2fcbf42SPeter MaydellERST
37685824d651Sblueswir1
37695824d651Sblueswir1DEF("enable-kvm", 0, QEMU_OPTION_enable_kvm, \
3770ad96090aSBlue Swirl    "-enable-kvm     enable KVM full virtualization support\n", QEMU_ARCH_ALL)
3771e2fcbf42SPeter MaydellSRST
3772e2fcbf42SPeter Maydell``-enable-kvm``
3773e2fcbf42SPeter Maydell    Enable KVM full virtualization support. This option is only
3774e2fcbf42SPeter Maydell    available if KVM support is enabled when compiling.
3775e2fcbf42SPeter MaydellERST
37765824d651Sblueswir1
3777e37630caSaliguoriDEF("xen-domid", HAS_ARG, QEMU_OPTION_xen_domid,
3778ad96090aSBlue Swirl    "-xen-domid id   specify xen guest domain id\n", QEMU_ARCH_ALL)
3779e37630caSaliguoriDEF("xen-attach", 0, QEMU_OPTION_xen_attach,
3780e37630caSaliguori    "-xen-attach     attach to existing xen domain\n"
37811077bcacSAnthony PERARD    "                libxl will use this when starting QEMU\n",
3782ad96090aSBlue Swirl    QEMU_ARCH_ALL)
37831c599472SPaul DurrantDEF("xen-domid-restrict", 0, QEMU_OPTION_xen_domid_restrict,
37841c599472SPaul Durrant    "-xen-domid-restrict     restrict set of available xen operations\n"
37851c599472SPaul Durrant    "                        to specified domain id. (Does not affect\n"
37861c599472SPaul Durrant    "                        xenpv machine type).\n",
37871c599472SPaul Durrant    QEMU_ARCH_ALL)
3788e2fcbf42SPeter MaydellSRST
3789e2fcbf42SPeter Maydell``-xen-domid id``
3790e2fcbf42SPeter Maydell    Specify xen guest domain id (XEN only).
3791e2fcbf42SPeter Maydell
3792e2fcbf42SPeter Maydell``-xen-attach``
3793e2fcbf42SPeter Maydell    Attach to existing xen domain. libxl will use this when starting
3794e2fcbf42SPeter Maydell    QEMU (XEN only). Restrict set of available xen operations to
3795e2fcbf42SPeter Maydell    specified domain id (XEN only).
3796e2fcbf42SPeter MaydellERST
3797e37630caSaliguori
37985824d651Sblueswir1DEF("no-reboot", 0, QEMU_OPTION_no_reboot, \
3799ad96090aSBlue Swirl    "-no-reboot      exit instead of rebooting\n", QEMU_ARCH_ALL)
3800e2fcbf42SPeter MaydellSRST
3801e2fcbf42SPeter Maydell``-no-reboot``
3802e2fcbf42SPeter Maydell    Exit instead of rebooting.
3803e2fcbf42SPeter MaydellERST
38045824d651Sblueswir1
38055824d651Sblueswir1DEF("no-shutdown", 0, QEMU_OPTION_no_shutdown, \
3806ad96090aSBlue Swirl    "-no-shutdown    stop before shutdown\n", QEMU_ARCH_ALL)
3807e2fcbf42SPeter MaydellSRST
3808e2fcbf42SPeter Maydell``-no-shutdown``
3809e2fcbf42SPeter Maydell    Don't exit QEMU on guest shutdown, but instead only stop the
3810e2fcbf42SPeter Maydell    emulation. This allows for instance switching to monitor to commit
3811e2fcbf42SPeter Maydell    changes to the disk image.
3812e2fcbf42SPeter MaydellERST
38135824d651Sblueswir1
38145824d651Sblueswir1DEF("loadvm", HAS_ARG, QEMU_OPTION_loadvm, \
38155824d651Sblueswir1    "-loadvm [tag|id]\n" \
3816ad96090aSBlue Swirl    "                start right away with a saved state (loadvm in monitor)\n",
3817ad96090aSBlue Swirl    QEMU_ARCH_ALL)
3818e2fcbf42SPeter MaydellSRST
3819e2fcbf42SPeter Maydell``-loadvm file``
3820e2fcbf42SPeter Maydell    Start right away with a saved state (``loadvm`` in monitor)
3821e2fcbf42SPeter MaydellERST
38225824d651Sblueswir1
38235824d651Sblueswir1#ifndef _WIN32
38245824d651Sblueswir1DEF("daemonize", 0, QEMU_OPTION_daemonize, \
3825ad96090aSBlue Swirl    "-daemonize      daemonize QEMU after initializing\n", QEMU_ARCH_ALL)
38265824d651Sblueswir1#endif
3827e2fcbf42SPeter MaydellSRST
3828e2fcbf42SPeter Maydell``-daemonize``
3829e2fcbf42SPeter Maydell    Daemonize the QEMU process after initialization. QEMU will not
3830e2fcbf42SPeter Maydell    detach from standard IO until it is ready to receive connections on
3831e2fcbf42SPeter Maydell    any of its devices. This option is a useful way for external
3832e2fcbf42SPeter Maydell    programs to launch QEMU without having to cope with initialization
3833e2fcbf42SPeter Maydell    race conditions.
3834e2fcbf42SPeter MaydellERST
38355824d651Sblueswir1
38365824d651Sblueswir1DEF("option-rom", HAS_ARG, QEMU_OPTION_option_rom, \
3837ad96090aSBlue Swirl    "-option-rom rom load a file, rom, into the option ROM space\n",
3838ad96090aSBlue Swirl    QEMU_ARCH_ALL)
3839e2fcbf42SPeter MaydellSRST
3840e2fcbf42SPeter Maydell``-option-rom file``
3841e2fcbf42SPeter Maydell    Load the contents of file as an option ROM. This option is useful to
3842e2fcbf42SPeter Maydell    load things like EtherBoot.
3843e2fcbf42SPeter MaydellERST
38445824d651Sblueswir1
38451ed2fc1fSJan KiszkaDEF("rtc", HAS_ARG, QEMU_OPTION_rtc, \
3846238d1240SArtem Pisarenko    "-rtc [base=utc|localtime|<datetime>][,clock=host|rt|vm][,driftfix=none|slew]\n" \
3847ad96090aSBlue Swirl    "                set the RTC base and clock, enable drift fix for clock ticks (x86 only)\n",
3848ad96090aSBlue Swirl    QEMU_ARCH_ALL)
38491ed2fc1fSJan Kiszka
3850e2fcbf42SPeter MaydellSRST
3851e2fcbf42SPeter Maydell``-rtc [base=utc|localtime|datetime][,clock=host|rt|vm][,driftfix=none|slew]``
3852e2fcbf42SPeter Maydell    Specify ``base`` as ``utc`` or ``localtime`` to let the RTC start at
3853e2fcbf42SPeter Maydell    the current UTC or local time, respectively. ``localtime`` is
3854e2fcbf42SPeter Maydell    required for correct date in MS-DOS or Windows. To start at a
3855e2fcbf42SPeter Maydell    specific point in time, provide datetime in the format
3856e2fcbf42SPeter Maydell    ``2006-06-17T16:01:21`` or ``2006-06-17``. The default base is UTC.
3857e2fcbf42SPeter Maydell
3858e2fcbf42SPeter Maydell    By default the RTC is driven by the host system time. This allows
3859e2fcbf42SPeter Maydell    using of the RTC as accurate reference clock inside the guest,
3860e2fcbf42SPeter Maydell    specifically if the host time is smoothly following an accurate
3861e2fcbf42SPeter Maydell    external reference clock, e.g. via NTP. If you want to isolate the
3862e2fcbf42SPeter Maydell    guest time from the host, you can set ``clock`` to ``rt`` instead,
3863e2fcbf42SPeter Maydell    which provides a host monotonic clock if host support it. To even
3864e2fcbf42SPeter Maydell    prevent the RTC from progressing during suspension, you can set
3865e2fcbf42SPeter Maydell    ``clock`` to ``vm`` (virtual clock). '\ ``clock=vm``\ ' is
3866e2fcbf42SPeter Maydell    recommended especially in icount mode in order to preserve
3867e2fcbf42SPeter Maydell    determinism; however, note that in icount mode the speed of the
3868e2fcbf42SPeter Maydell    virtual clock is variable and can in general differ from the host
3869e2fcbf42SPeter Maydell    clock.
3870e2fcbf42SPeter Maydell
3871e2fcbf42SPeter Maydell    Enable ``driftfix`` (i386 targets only) if you experience time drift
3872e2fcbf42SPeter Maydell    problems, specifically with Windows' ACPI HAL. This option will try
3873e2fcbf42SPeter Maydell    to figure out how many timer interrupts were not processed by the
3874e2fcbf42SPeter Maydell    Windows guest and will re-inject them.
3875e2fcbf42SPeter MaydellERST
38765824d651Sblueswir1
38775824d651Sblueswir1DEF("icount", HAS_ARG, QEMU_OPTION_icount, \
38789c2037d0SPavel Dovgalyuk    "-icount [shift=N|auto][,align=on|off][,sleep=on|off,rr=record|replay,rrfile=<filename>,rrsnapshot=<snapshot>]\n" \
3879bc14ca24Saliguori    "                enable virtual instruction counter with 2^N clock ticks per\n" \
3880f1f4b57eSVictor CLEMENT    "                instruction, enable aligning the host and virtual clocks\n" \
3881f1f4b57eSVictor CLEMENT    "                or disable real time cpu sleeping\n", QEMU_ARCH_ALL)
3882e2fcbf42SPeter MaydellSRST
3883e2fcbf42SPeter Maydell``-icount [shift=N|auto][,rr=record|replay,rrfile=filename,rrsnapshot=snapshot]``
3884e2fcbf42SPeter Maydell    Enable virtual instruction counter. The virtual cpu will execute one
3885e2fcbf42SPeter Maydell    instruction every 2^N ns of virtual time. If ``auto`` is specified
3886e2fcbf42SPeter Maydell    then the virtual cpu speed will be automatically adjusted to keep
3887e2fcbf42SPeter Maydell    virtual time within a few seconds of real time.
3888e2fcbf42SPeter Maydell
3889e2fcbf42SPeter Maydell    When the virtual cpu is sleeping, the virtual time will advance at
3890e2fcbf42SPeter Maydell    default speed unless ``sleep=on|off`` is specified. With
3891e2fcbf42SPeter Maydell    ``sleep=on|off``, the virtual time will jump to the next timer
3892e2fcbf42SPeter Maydell    deadline instantly whenever the virtual cpu goes to sleep mode and
3893e2fcbf42SPeter Maydell    will not advance if no timer is enabled. This behavior give
3894e2fcbf42SPeter Maydell    deterministic execution times from the guest point of view.
3895e2fcbf42SPeter Maydell
3896e2fcbf42SPeter Maydell    Note that while this option can give deterministic behavior, it does
3897e2fcbf42SPeter Maydell    not provide cycle accurate emulation. Modern CPUs contain
3898e2fcbf42SPeter Maydell    superscalar out of order cores with complex cache hierarchies. The
3899e2fcbf42SPeter Maydell    number of instructions executed often has little or no correlation
3900e2fcbf42SPeter Maydell    with actual performance.
3901e2fcbf42SPeter Maydell
3902e2fcbf42SPeter Maydell    ``align=on`` will activate the delay algorithm which will try to
3903e2fcbf42SPeter Maydell    synchronise the host clock and the virtual clock. The goal is to
3904e2fcbf42SPeter Maydell    have a guest running at the real frequency imposed by the shift
3905e2fcbf42SPeter Maydell    option. Whenever the guest clock is behind the host clock and if
3906e2fcbf42SPeter Maydell    ``align=on`` is specified then we print a message to the user to
3907e2fcbf42SPeter Maydell    inform about the delay. Currently this option does not work when
3908e2fcbf42SPeter Maydell    ``shift`` is ``auto``. Note: The sync algorithm will work for those
3909e2fcbf42SPeter Maydell    shift values for which the guest clock runs ahead of the host clock.
3910e2fcbf42SPeter Maydell    Typically this happens when the shift value is high (how high
3911e2fcbf42SPeter Maydell    depends on the host machine).
3912e2fcbf42SPeter Maydell
3913e2fcbf42SPeter Maydell    When ``rr`` option is specified deterministic record/replay is
3914e2fcbf42SPeter Maydell    enabled. Replay log is written into filename file in record mode and
3915e2fcbf42SPeter Maydell    read from this file in replay mode.
3916e2fcbf42SPeter Maydell
3917e2fcbf42SPeter Maydell    Option rrsnapshot is used to create new vm snapshot named snapshot
3918e2fcbf42SPeter Maydell    at the start of execution recording. In replay mode this option is
3919e2fcbf42SPeter Maydell    used to load the initial VM state.
3920e2fcbf42SPeter MaydellERST
39215824d651Sblueswir1
39229dd986ccSRichard W.M. JonesDEF("watchdog", HAS_ARG, QEMU_OPTION_watchdog, \
3923d7933ef3SXu Wang    "-watchdog model\n" \
3924ad96090aSBlue Swirl    "                enable virtual hardware watchdog [default=none]\n",
3925ad96090aSBlue Swirl    QEMU_ARCH_ALL)
3926e2fcbf42SPeter MaydellSRST
3927e2fcbf42SPeter Maydell``-watchdog model``
3928e2fcbf42SPeter Maydell    Create a virtual hardware watchdog device. Once enabled (by a guest
3929e2fcbf42SPeter Maydell    action), the watchdog must be periodically polled by an agent inside
3930e2fcbf42SPeter Maydell    the guest or else the guest will be restarted. Choose a model for
3931e2fcbf42SPeter Maydell    which your guest has drivers.
3932e2fcbf42SPeter Maydell
3933e2fcbf42SPeter Maydell    The model is the model of hardware watchdog to emulate. Use
3934e2fcbf42SPeter Maydell    ``-watchdog help`` to list available hardware models. Only one
3935e2fcbf42SPeter Maydell    watchdog can be enabled for a guest.
3936e2fcbf42SPeter Maydell
3937e2fcbf42SPeter Maydell    The following models may be available:
3938e2fcbf42SPeter Maydell
3939e2fcbf42SPeter Maydell    ``ib700``
3940e2fcbf42SPeter Maydell        iBASE 700 is a very simple ISA watchdog with a single timer.
3941e2fcbf42SPeter Maydell
3942e2fcbf42SPeter Maydell    ``i6300esb``
3943e2fcbf42SPeter Maydell        Intel 6300ESB I/O controller hub is a much more featureful
3944e2fcbf42SPeter Maydell        PCI-based dual-timer watchdog.
3945e2fcbf42SPeter Maydell
3946e2fcbf42SPeter Maydell    ``diag288``
3947e2fcbf42SPeter Maydell        A virtual watchdog for s390x backed by the diagnose 288
3948e2fcbf42SPeter Maydell        hypercall (currently KVM only).
3949e2fcbf42SPeter MaydellERST
39509dd986ccSRichard W.M. Jones
39519dd986ccSRichard W.M. JonesDEF("watchdog-action", HAS_ARG, QEMU_OPTION_watchdog_action, \
39527ad9270eSMarkus Armbruster    "-watchdog-action reset|shutdown|poweroff|inject-nmi|pause|debug|none\n" \
3953ad96090aSBlue Swirl    "                action when watchdog fires [default=reset]\n",
3954ad96090aSBlue Swirl    QEMU_ARCH_ALL)
3955e2fcbf42SPeter MaydellSRST
3956e2fcbf42SPeter Maydell``-watchdog-action action``
3957e2fcbf42SPeter Maydell    The action controls what QEMU will do when the watchdog timer
3958e2fcbf42SPeter Maydell    expires. The default is ``reset`` (forcefully reset the guest).
3959e2fcbf42SPeter Maydell    Other possible actions are: ``shutdown`` (attempt to gracefully
3960e2fcbf42SPeter Maydell    shutdown the guest), ``poweroff`` (forcefully poweroff the guest),
3961e2fcbf42SPeter Maydell    ``inject-nmi`` (inject a NMI into the guest), ``pause`` (pause the
3962e2fcbf42SPeter Maydell    guest), ``debug`` (print a debug message and continue), or ``none``
3963e2fcbf42SPeter Maydell    (do nothing).
3964e2fcbf42SPeter Maydell
3965e2fcbf42SPeter Maydell    Note that the ``shutdown`` action requires that the guest responds
3966e2fcbf42SPeter Maydell    to ACPI signals, which it may not be able to do in the sort of
3967e2fcbf42SPeter Maydell    situations where the watchdog would have expired, and thus
3968e2fcbf42SPeter Maydell    ``-watchdog-action shutdown`` is not recommended for production use.
3969e2fcbf42SPeter Maydell
3970e2fcbf42SPeter Maydell    Examples:
3971e2fcbf42SPeter Maydell
3972e2fcbf42SPeter Maydell    ``-watchdog i6300esb -watchdog-action pause``; \ ``-watchdog ib700``
3973e2fcbf42SPeter Maydell
3974e2fcbf42SPeter MaydellERST
39759dd986ccSRichard W.M. Jones
39765824d651Sblueswir1DEF("echr", HAS_ARG, QEMU_OPTION_echr, \
3977ad96090aSBlue Swirl    "-echr chr       set terminal escape character instead of ctrl-a\n",
3978ad96090aSBlue Swirl    QEMU_ARCH_ALL)
3979e2fcbf42SPeter MaydellSRST
3980e2fcbf42SPeter Maydell``-echr numeric_ascii_value``
3981e2fcbf42SPeter Maydell    Change the escape character used for switching to the monitor when
3982e2fcbf42SPeter Maydell    using monitor and serial sharing. The default is ``0x01`` when using
3983e2fcbf42SPeter Maydell    the ``-nographic`` option. ``0x01`` is equal to pressing
3984e2fcbf42SPeter Maydell    ``Control-a``. You can select a different character from the ascii
3985e2fcbf42SPeter Maydell    control keys where 1 through 26 map to Control-a through Control-z.
3986e2fcbf42SPeter Maydell    For instance you could use the either of the following to change the
3987e2fcbf42SPeter Maydell    escape character to Control-t.
3988e2fcbf42SPeter Maydell
3989e2fcbf42SPeter Maydell    ``-echr 0x14``; \ ``-echr 20``
3990e2fcbf42SPeter Maydell
3991e2fcbf42SPeter MaydellERST
39925824d651Sblueswir1
39935824d651Sblueswir1DEF("show-cursor", 0, QEMU_OPTION_show_cursor, \
3994ad96090aSBlue Swirl    "-show-cursor    show cursor\n", QEMU_ARCH_ALL)
3995e2fcbf42SPeter MaydellSRST
3996e2fcbf42SPeter Maydell``-show-cursor``
3997e2fcbf42SPeter Maydell    Show cursor.
3998e2fcbf42SPeter MaydellERST
39995824d651Sblueswir1
40005824d651Sblueswir1DEF("tb-size", HAS_ARG, QEMU_OPTION_tb_size, \
4001ad96090aSBlue Swirl    "-tb-size n      set TB size\n", QEMU_ARCH_ALL)
4002e2fcbf42SPeter MaydellSRST
4003e2fcbf42SPeter Maydell``-tb-size n``
4004e2fcbf42SPeter Maydell    Set TCG translation block cache size. Deprecated, use
4005e2fcbf42SPeter Maydell    '\ ``-accel tcg,tb-size=n``\ ' instead.
4006e2fcbf42SPeter MaydellERST
40075824d651Sblueswir1
40085824d651Sblueswir1DEF("incoming", HAS_ARG, QEMU_OPTION_incoming, \
40097c601803SMichael Tokarev    "-incoming tcp:[host]:port[,to=maxport][,ipv4][,ipv6]\n" \
40107c601803SMichael Tokarev    "-incoming rdma:host:port[,ipv4][,ipv6]\n" \
40117c601803SMichael Tokarev    "-incoming unix:socketpath\n" \
40127c601803SMichael Tokarev    "                prepare for incoming migration, listen on\n" \
40137c601803SMichael Tokarev    "                specified protocol and socket address\n" \
40147c601803SMichael Tokarev    "-incoming fd:fd\n" \
40157c601803SMichael Tokarev    "-incoming exec:cmdline\n" \
40167c601803SMichael Tokarev    "                accept incoming migration on given file descriptor\n" \
40171597051bSDr. David Alan Gilbert    "                or from given external command\n" \
40181597051bSDr. David Alan Gilbert    "-incoming defer\n" \
40191597051bSDr. David Alan Gilbert    "                wait for the URI to be specified via migrate_incoming\n",
4020ad96090aSBlue Swirl    QEMU_ARCH_ALL)
4021e2fcbf42SPeter MaydellSRST
402209ce5f2dSPeter Maydell``-incoming tcp:[host]:port[,to=maxport][,ipv4][,ipv6]``
402309ce5f2dSPeter Maydell  \
402409ce5f2dSPeter Maydell``-incoming rdma:host:port[,ipv4][,ipv6]``
4025e2fcbf42SPeter Maydell    Prepare for incoming migration, listen on a given tcp port.
4026e2fcbf42SPeter Maydell
4027e2fcbf42SPeter Maydell``-incoming unix:socketpath``
4028e2fcbf42SPeter Maydell    Prepare for incoming migration, listen on a given unix socket.
4029e2fcbf42SPeter Maydell
4030e2fcbf42SPeter Maydell``-incoming fd:fd``
4031e2fcbf42SPeter Maydell    Accept incoming migration from a given filedescriptor.
4032e2fcbf42SPeter Maydell
4033e2fcbf42SPeter Maydell``-incoming exec:cmdline``
4034e2fcbf42SPeter Maydell    Accept incoming migration as an output from specified external
4035e2fcbf42SPeter Maydell    command.
4036e2fcbf42SPeter Maydell
4037e2fcbf42SPeter Maydell``-incoming defer``
4038e2fcbf42SPeter Maydell    Wait for the URI to be specified via migrate\_incoming. The monitor
4039e2fcbf42SPeter Maydell    can be used to change settings (such as migration parameters) prior
4040e2fcbf42SPeter Maydell    to issuing the migrate\_incoming to allow the migration to begin.
4041e2fcbf42SPeter MaydellERST
40425824d651Sblueswir1
4043d15c05fcSAshijeet AcharyaDEF("only-migratable", 0, QEMU_OPTION_only_migratable, \
4044d15c05fcSAshijeet Acharya    "-only-migratable     allow only migratable devices\n", QEMU_ARCH_ALL)
4045e2fcbf42SPeter MaydellSRST
4046e2fcbf42SPeter Maydell``-only-migratable``
4047e2fcbf42SPeter Maydell    Only allow migratable devices. Devices will not be allowed to enter
4048e2fcbf42SPeter Maydell    an unmigratable state.
4049e2fcbf42SPeter MaydellERST
4050d15c05fcSAshijeet Acharya
4051d8c208ddSGerd HoffmannDEF("nodefaults", 0, QEMU_OPTION_nodefaults, \
4052ad96090aSBlue Swirl    "-nodefaults     don't create default devices\n", QEMU_ARCH_ALL)
4053e2fcbf42SPeter MaydellSRST
4054e2fcbf42SPeter Maydell``-nodefaults``
4055e2fcbf42SPeter Maydell    Don't create default devices. Normally, QEMU sets the default
4056e2fcbf42SPeter Maydell    devices like serial port, parallel port, virtual console, monitor
4057e2fcbf42SPeter Maydell    device, VGA adapter, floppy and CD-ROM drive and others. The
4058e2fcbf42SPeter Maydell    ``-nodefaults`` option will disable all those default devices.
4059e2fcbf42SPeter MaydellERST
4060d8c208ddSGerd Hoffmann
40615824d651Sblueswir1#ifndef _WIN32
40625824d651Sblueswir1DEF("chroot", HAS_ARG, QEMU_OPTION_chroot, \
4063ad96090aSBlue Swirl    "-chroot dir     chroot to dir just before starting the VM\n",
4064ad96090aSBlue Swirl    QEMU_ARCH_ALL)
40655824d651Sblueswir1#endif
4066e2fcbf42SPeter MaydellSRST
4067e2fcbf42SPeter Maydell``-chroot dir``
4068e2fcbf42SPeter Maydell    Immediately before starting guest execution, chroot to the specified
4069e2fcbf42SPeter Maydell    directory. Especially useful in combination with -runas.
4070e2fcbf42SPeter MaydellERST
40715824d651Sblueswir1
40725824d651Sblueswir1#ifndef _WIN32
40735824d651Sblueswir1DEF("runas", HAS_ARG, QEMU_OPTION_runas, \
40742c42f1e8SIan Jackson    "-runas user     change to user id user just before starting the VM\n" \
40752c42f1e8SIan Jackson    "                user can be numeric uid:gid instead\n",
4076ad96090aSBlue Swirl    QEMU_ARCH_ALL)
40775824d651Sblueswir1#endif
4078e2fcbf42SPeter MaydellSRST
4079e2fcbf42SPeter Maydell``-runas user``
4080e2fcbf42SPeter Maydell    Immediately before starting guest execution, drop root privileges,
4081e2fcbf42SPeter Maydell    switching to the specified user.
4082e2fcbf42SPeter MaydellERST
40835824d651Sblueswir1
40845824d651Sblueswir1DEF("prom-env", HAS_ARG, QEMU_OPTION_prom_env,
40855824d651Sblueswir1    "-prom-env variable=value\n"
4086ad96090aSBlue Swirl    "                set OpenBIOS nvram variables\n",
4087ad96090aSBlue Swirl    QEMU_ARCH_PPC | QEMU_ARCH_SPARC)
4088e2fcbf42SPeter MaydellSRST
4089e2fcbf42SPeter Maydell``-prom-env variable=value``
4090e2fcbf42SPeter Maydell    Set OpenBIOS nvram variable to given value (PPC, SPARC only).
4091e2fcbf42SPeter Maydell
4092e2fcbf42SPeter Maydell    ::
4093e2fcbf42SPeter Maydell
4094e2fcbf42SPeter Maydell        qemu-system-sparc -prom-env 'auto-boot?=false' \
4095e2fcbf42SPeter Maydell         -prom-env 'boot-device=sd(0,2,0):d' -prom-env 'boot-args=linux single'
4096e2fcbf42SPeter Maydell
4097e2fcbf42SPeter Maydell    ::
4098e2fcbf42SPeter Maydell
4099e2fcbf42SPeter Maydell        qemu-system-ppc -prom-env 'auto-boot?=false' \
4100e2fcbf42SPeter Maydell         -prom-env 'boot-device=hd:2,\yaboot' \
4101e2fcbf42SPeter Maydell         -prom-env 'boot-args=conf=hd:2,\yaboot.conf'
4102e2fcbf42SPeter MaydellERST
41035824d651Sblueswir1DEF("semihosting", 0, QEMU_OPTION_semihosting,
4104f7bbcfb5SMichael Walle    "-semihosting    semihosting mode\n",
41053b3c1694SLeon Alrae    QEMU_ARCH_ARM | QEMU_ARCH_M68K | QEMU_ARCH_XTENSA | QEMU_ARCH_LM32 |
4106413a99a9SSandra Loosemore    QEMU_ARCH_MIPS | QEMU_ARCH_NIOS2)
4107e2fcbf42SPeter MaydellSRST
4108e2fcbf42SPeter Maydell``-semihosting``
4109e2fcbf42SPeter Maydell    Enable semihosting mode (ARM, M68K, Xtensa, MIPS, Nios II only).
4110e2fcbf42SPeter Maydell
4111e2fcbf42SPeter Maydell    Note that this allows guest direct access to the host filesystem, so
4112e2fcbf42SPeter Maydell    should only be used with a trusted guest OS.
4113e2fcbf42SPeter Maydell
4114e2fcbf42SPeter Maydell    See the -semihosting-config option documentation for further
4115e2fcbf42SPeter Maydell    information about the facilities this enables.
4116e2fcbf42SPeter MaydellERST
4117a38bb079SLiviu IonescuDEF("semihosting-config", HAS_ARG, QEMU_OPTION_semihosting_config,
41184e7f9032SAlex Bennée    "-semihosting-config [enable=on|off][,target=native|gdb|auto][,chardev=id][,arg=str[,...]]\n" \
4119a59d31a1SLeon Alrae    "                semihosting configuration\n",
41203b3c1694SLeon AlraeQEMU_ARCH_ARM | QEMU_ARCH_M68K | QEMU_ARCH_XTENSA | QEMU_ARCH_LM32 |
4121413a99a9SSandra LoosemoreQEMU_ARCH_MIPS | QEMU_ARCH_NIOS2)
4122e2fcbf42SPeter MaydellSRST
4123e2fcbf42SPeter Maydell``-semihosting-config [enable=on|off][,target=native|gdb|auto][,chardev=id][,arg=str[,...]]``
4124e2fcbf42SPeter Maydell    Enable and configure semihosting (ARM, M68K, Xtensa, MIPS, Nios II
4125e2fcbf42SPeter Maydell    only).
4126e2fcbf42SPeter Maydell
4127e2fcbf42SPeter Maydell    Note that this allows guest direct access to the host filesystem, so
4128e2fcbf42SPeter Maydell    should only be used with a trusted guest OS.
4129e2fcbf42SPeter Maydell
4130e2fcbf42SPeter Maydell    On Arm this implements the standard semihosting API, version 2.0.
4131e2fcbf42SPeter Maydell
4132e2fcbf42SPeter Maydell    On M68K this implements the "ColdFire GDB" interface used by
4133e2fcbf42SPeter Maydell    libgloss.
4134e2fcbf42SPeter Maydell
4135e2fcbf42SPeter Maydell    Xtensa semihosting provides basic file IO calls, such as
4136e2fcbf42SPeter Maydell    open/read/write/seek/select. Tensilica baremetal libc for ISS and
4137e2fcbf42SPeter Maydell    linux platform "sim" use this interface.
4138e2fcbf42SPeter Maydell
4139e2fcbf42SPeter Maydell    ``target=native|gdb|auto``
4140e2fcbf42SPeter Maydell        Defines where the semihosting calls will be addressed, to QEMU
4141e2fcbf42SPeter Maydell        (``native``) or to GDB (``gdb``). The default is ``auto``, which
4142e2fcbf42SPeter Maydell        means ``gdb`` during debug sessions and ``native`` otherwise.
4143e2fcbf42SPeter Maydell
4144e2fcbf42SPeter Maydell    ``chardev=str1``
4145e2fcbf42SPeter Maydell        Send the output to a chardev backend output for native or auto
4146e2fcbf42SPeter Maydell        output when not in gdb
4147e2fcbf42SPeter Maydell
4148e2fcbf42SPeter Maydell    ``arg=str1,arg=str2,...``
4149e2fcbf42SPeter Maydell        Allows the user to pass input arguments, and can be used
4150e2fcbf42SPeter Maydell        multiple times to build up a list. The old-style
4151e2fcbf42SPeter Maydell        ``-kernel``/``-append`` method of passing a command line is
4152e2fcbf42SPeter Maydell        still supported for backward compatibility. If both the
4153e2fcbf42SPeter Maydell        ``--semihosting-config arg`` and the ``-kernel``/``-append`` are
4154e2fcbf42SPeter Maydell        specified, the former is passed to semihosting as it always
4155e2fcbf42SPeter Maydell        takes precedence.
4156e2fcbf42SPeter MaydellERST
41575824d651Sblueswir1DEF("old-param", 0, QEMU_OPTION_old_param,
4158ad96090aSBlue Swirl    "-old-param      old param mode\n", QEMU_ARCH_ARM)
4159e2fcbf42SPeter MaydellSRST
4160e2fcbf42SPeter Maydell``-old-param``
4161e2fcbf42SPeter Maydell    Old param mode (ARM only).
4162e2fcbf42SPeter MaydellERST
416395d5f08bSStefan Weil
41647d76ad4fSEduardo OtuboDEF("sandbox", HAS_ARG, QEMU_OPTION_sandbox, \
416573a1e647SEduardo Otubo    "-sandbox on[,obsolete=allow|deny][,elevateprivileges=allow|deny|children]\n" \
416624f8cdc5SEduardo Otubo    "          [,spawn=allow|deny][,resourcecontrol=allow|deny]\n" \
41672b716fa6SEduardo Otubo    "                Enable seccomp mode 2 system call filter (default 'off').\n" \
41682b716fa6SEduardo Otubo    "                use 'obsolete' to allow obsolete system calls that are provided\n" \
41692b716fa6SEduardo Otubo    "                    by the kernel, but typically no longer used by modern\n" \
417073a1e647SEduardo Otubo    "                    C library implementations.\n" \
417173a1e647SEduardo Otubo    "                use 'elevateprivileges' to allow or deny QEMU process to elevate\n" \
417273a1e647SEduardo Otubo    "                    its privileges by blacklisting all set*uid|gid system calls.\n" \
417373a1e647SEduardo Otubo    "                    The value 'children' will deny set*uid|gid system calls for\n" \
4174995a226fSEduardo Otubo    "                    main QEMU process but will allow forks and execves to run unprivileged\n" \
4175995a226fSEduardo Otubo    "                use 'spawn' to avoid QEMU to spawn new threads or processes by\n" \
417624f8cdc5SEduardo Otubo    "                     blacklisting *fork and execve\n" \
417724f8cdc5SEduardo Otubo    "                use 'resourcecontrol' to disable process affinity and schedular priority\n",
41787d76ad4fSEduardo Otubo    QEMU_ARCH_ALL)
4179e2fcbf42SPeter MaydellSRST
4180e2fcbf42SPeter Maydell``-sandbox arg[,obsolete=string][,elevateprivileges=string][,spawn=string][,resourcecontrol=string]``
4181e2fcbf42SPeter Maydell    Enable Seccomp mode 2 system call filter. 'on' will enable syscall
4182e2fcbf42SPeter Maydell    filtering and 'off' will disable it. The default is 'off'.
4183e2fcbf42SPeter Maydell
4184e2fcbf42SPeter Maydell    ``obsolete=string``
4185e2fcbf42SPeter Maydell        Enable Obsolete system calls
4186e2fcbf42SPeter Maydell
4187e2fcbf42SPeter Maydell    ``elevateprivileges=string``
4188e2fcbf42SPeter Maydell        Disable set\*uid\|gid system calls
4189e2fcbf42SPeter Maydell
4190e2fcbf42SPeter Maydell    ``spawn=string``
4191e2fcbf42SPeter Maydell        Disable \*fork and execve
4192e2fcbf42SPeter Maydell
4193e2fcbf42SPeter Maydell    ``resourcecontrol=string``
4194e2fcbf42SPeter Maydell        Disable process affinity and schedular priority
4195e2fcbf42SPeter MaydellERST
41967d76ad4fSEduardo Otubo
4197715a664aSGerd HoffmannDEF("readconfig", HAS_ARG, QEMU_OPTION_readconfig,
4198ad96090aSBlue Swirl    "-readconfig <file>\n", QEMU_ARCH_ALL)
4199e2fcbf42SPeter MaydellSRST
4200e2fcbf42SPeter Maydell``-readconfig file``
4201e2fcbf42SPeter Maydell    Read device configuration from file. This approach is useful when
4202e2fcbf42SPeter Maydell    you want to spawn QEMU process with many command line options but
4203e2fcbf42SPeter Maydell    you don't want to exceed the command line character limit.
4204e2fcbf42SPeter MaydellERST
4205715a664aSGerd HoffmannDEF("writeconfig", HAS_ARG, QEMU_OPTION_writeconfig,
4206715a664aSGerd Hoffmann    "-writeconfig <file>\n"
4207ad96090aSBlue Swirl    "                read/write config file\n", QEMU_ARCH_ALL)
4208e2fcbf42SPeter MaydellSRST
4209e2fcbf42SPeter Maydell``-writeconfig file``
4210e2fcbf42SPeter Maydell    Write device configuration to file. The file can be either filename
4211e2fcbf42SPeter Maydell    to save command line and device configuration into file or dash
4212e2fcbf42SPeter Maydell    ``-``) character to print the output to stdout. This can be later
4213e2fcbf42SPeter Maydell    used as input file for ``-readconfig`` option.
4214e2fcbf42SPeter MaydellERST
42152feac451SThomas Huth
4216f29a5614SEduardo HabkostDEF("no-user-config", 0, QEMU_OPTION_nouserconfig,
4217f29a5614SEduardo Habkost    "-no-user-config\n"
42183478eae9SEduardo Habkost    "                do not load default user-provided config files at startup\n",
4219f29a5614SEduardo Habkost    QEMU_ARCH_ALL)
4220e2fcbf42SPeter MaydellSRST
4221e2fcbf42SPeter Maydell``-no-user-config``
4222e2fcbf42SPeter Maydell    The ``-no-user-config`` option makes QEMU not load any of the
4223e2fcbf42SPeter Maydell    user-provided config files on sysconfdir.
4224e2fcbf42SPeter MaydellERST
42252feac451SThomas Huth
4226ab6540d5SPrerna SaxenaDEF("trace", HAS_ARG, QEMU_OPTION_trace,
422710578a25SPaolo Bonzini    "-trace [[enable=]<pattern>][,events=<file>][,file=<file>]\n"
422823d15e86SLluís    "                specify tracing options\n",
4229ab6540d5SPrerna Saxena    QEMU_ARCH_ALL)
4230e2fcbf42SPeter MaydellSRST
4231e2fcbf42SPeter Maydell``-trace [[enable=]pattern][,events=file][,file=file]``
423209ce5f2dSPeter Maydell  .. include:: ../qemu-option-trace.rst.inc
4233e2fcbf42SPeter Maydell
4234e2fcbf42SPeter MaydellERST
423542229a75SLluís VilanovaDEF("plugin", HAS_ARG, QEMU_OPTION_plugin,
423642229a75SLluís Vilanova    "-plugin [file=]<file>[,arg=<string>]\n"
423742229a75SLluís Vilanova    "                load a plugin\n",
423842229a75SLluís Vilanova    QEMU_ARCH_ALL)
4239e2fcbf42SPeter MaydellSRST
4240e2fcbf42SPeter Maydell``-plugin file=file[,arg=string]``
4241e2fcbf42SPeter Maydell    Load a plugin.
4242e2fcbf42SPeter Maydell
4243e2fcbf42SPeter Maydell    ``file=file``
4244e2fcbf42SPeter Maydell        Load the given plugin from a shared library file.
4245e2fcbf42SPeter Maydell
4246e2fcbf42SPeter Maydell    ``arg=string``
4247e2fcbf42SPeter Maydell        Argument string passed to the plugin. (Can be given multiple
4248e2fcbf42SPeter Maydell        times.)
4249e2fcbf42SPeter MaydellERST
42503dbf2c7fSStefan Weil
425131e70d6cSMarkus ArmbrusterHXCOMM Internal use
425231e70d6cSMarkus ArmbrusterDEF("qtest", HAS_ARG, QEMU_OPTION_qtest, "", QEMU_ARCH_ALL)
425331e70d6cSMarkus ArmbrusterDEF("qtest-log", HAS_ARG, QEMU_OPTION_qtest_log, "", QEMU_ARCH_ALL)
4254c7f0f3b1SAnthony Liguori
42550f66998fSPaul Moore#ifdef __linux__
42560f66998fSPaul MooreDEF("enable-fips", 0, QEMU_OPTION_enablefips,
42570f66998fSPaul Moore    "-enable-fips    enable FIPS 140-2 compliance\n",
42580f66998fSPaul Moore    QEMU_ARCH_ALL)
42590f66998fSPaul Moore#endif
4260e2fcbf42SPeter MaydellSRST
4261e2fcbf42SPeter Maydell``-enable-fips``
4262e2fcbf42SPeter Maydell    Enable FIPS 140-2 compliance mode.
4263e2fcbf42SPeter MaydellERST
42640f66998fSPaul Moore
4265976e8c54SThomas HuthHXCOMM Deprecated by -accel tcg
4266c6e88b3bSBruce RogersDEF("no-kvm", 0, QEMU_OPTION_no_kvm, "", QEMU_ARCH_I386)
4267a0dac021SJan Kiszka
42685e2ac519SSeiji AguchiDEF("msg", HAS_ARG, QEMU_OPTION_msg,
42695e2ac519SSeiji Aguchi    "-msg timestamp[=on|off]\n"
4270deda497bSMarkus Armbruster    "                control error message format\n"
4271deda497bSMarkus Armbruster    "                timestamp=on enables timestamps (default: off)\n",
42725e2ac519SSeiji Aguchi    QEMU_ARCH_ALL)
4273e2fcbf42SPeter MaydellSRST
4274e2fcbf42SPeter Maydell``-msg timestamp[=on|off]``
4275e2fcbf42SPeter Maydell    Control error message format.
4276e2fcbf42SPeter Maydell
4277e2fcbf42SPeter Maydell    ``timestamp=on|off``
4278e2fcbf42SPeter Maydell        Prefix messages with a timestamp. Default is off.
4279e2fcbf42SPeter MaydellERST
42805e2ac519SSeiji Aguchi
4281abfd9ce3SAmit ShahDEF("dump-vmstate", HAS_ARG, QEMU_OPTION_dump_vmstate,
4282abfd9ce3SAmit Shah    "-dump-vmstate <file>\n"
4283abfd9ce3SAmit Shah    "                Output vmstate information in JSON format to file.\n"
4284abfd9ce3SAmit Shah    "                Use the scripts/vmstate-static-checker.py file to\n"
4285abfd9ce3SAmit Shah    "                check for possible regressions in migration code\n"
42862382053fSLaurent Vivier    "                by comparing two such vmstate dumps.\n",
4287abfd9ce3SAmit Shah    QEMU_ARCH_ALL)
4288e2fcbf42SPeter MaydellSRST
4289e2fcbf42SPeter Maydell``-dump-vmstate file``
4290e2fcbf42SPeter Maydell    Dump json-encoded vmstate information for current machine type to
4291e2fcbf42SPeter Maydell    file in file
4292e2fcbf42SPeter MaydellERST
4293abfd9ce3SAmit Shah
429412df189dSEmilio G. CotaDEF("enable-sync-profile", 0, QEMU_OPTION_enable_sync_profile,
429512df189dSEmilio G. Cota    "-enable-sync-profile\n"
429612df189dSEmilio G. Cota    "                enable synchronization profiling\n",
429712df189dSEmilio G. Cota    QEMU_ARCH_ALL)
4298e2fcbf42SPeter MaydellSRST
4299e2fcbf42SPeter Maydell``-enable-sync-profile``
4300e2fcbf42SPeter Maydell    Enable synchronization profiling.
4301e2fcbf42SPeter MaydellERST
430212df189dSEmilio G. Cota
430343f187a5SPaolo BonziniDEFHEADING()
4304de6b4f90SMarkus Armbruster
4305de6b4f90SMarkus ArmbrusterDEFHEADING(Generic object creation:)
4306b9174d4fSDaniel P. Berrange
4307b9174d4fSDaniel P. BerrangeDEF("object", HAS_ARG, QEMU_OPTION_object,
4308b9174d4fSDaniel P. Berrange    "-object TYPENAME[,PROP1=VALUE1,...]\n"
4309b9174d4fSDaniel P. Berrange    "                create a new object of type TYPENAME setting properties\n"
4310b9174d4fSDaniel P. Berrange    "                in the order they are specified.  Note that the 'id'\n"
4311b9174d4fSDaniel P. Berrange    "                property must be set.  These objects are placed in the\n"
4312b9174d4fSDaniel P. Berrange    "                '/objects' path.\n",
4313b9174d4fSDaniel P. Berrange    QEMU_ARCH_ALL)
4314e2fcbf42SPeter MaydellSRST
4315e2fcbf42SPeter Maydell``-object typename[,prop1=value1,...]``
4316e2fcbf42SPeter Maydell    Create a new object of type typename setting properties in the order
4317e2fcbf42SPeter Maydell    they are specified. Note that the 'id' property must be set. These
4318e2fcbf42SPeter Maydell    objects are placed in the '/objects' path.
4319e2fcbf42SPeter Maydell
4320e2fcbf42SPeter Maydell    ``-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``
4321e2fcbf42SPeter Maydell        Creates a memory file backend object, which can be used to back
4322e2fcbf42SPeter Maydell        the guest RAM with huge pages.
4323e2fcbf42SPeter Maydell
4324e2fcbf42SPeter Maydell        The ``id`` parameter is a unique ID that will be used to
4325e2fcbf42SPeter Maydell        reference this memory region when configuring the ``-numa``
4326e2fcbf42SPeter Maydell        argument.
4327e2fcbf42SPeter Maydell
4328e2fcbf42SPeter Maydell        The ``size`` option provides the size of the memory region, and
4329e2fcbf42SPeter Maydell        accepts common suffixes, eg ``500M``.
4330e2fcbf42SPeter Maydell
4331e2fcbf42SPeter Maydell        The ``mem-path`` provides the path to either a shared memory or
4332e2fcbf42SPeter Maydell        huge page filesystem mount.
4333e2fcbf42SPeter Maydell
4334e2fcbf42SPeter Maydell        The ``share`` boolean option determines whether the memory
4335e2fcbf42SPeter Maydell        region is marked as private to QEMU, or shared. The latter
4336e2fcbf42SPeter Maydell        allows a co-operating external process to access the QEMU memory
4337e2fcbf42SPeter Maydell        region.
4338e2fcbf42SPeter Maydell
4339e2fcbf42SPeter Maydell        The ``share`` is also required for pvrdma devices due to
4340e2fcbf42SPeter Maydell        limitations in the RDMA API provided by Linux.
4341e2fcbf42SPeter Maydell
4342e2fcbf42SPeter Maydell        Setting share=on might affect the ability to configure NUMA
4343e2fcbf42SPeter Maydell        bindings for the memory backend under some circumstances, see
4344e2fcbf42SPeter Maydell        Documentation/vm/numa\_memory\_policy.txt on the Linux kernel
4345e2fcbf42SPeter Maydell        source tree for additional details.
4346e2fcbf42SPeter Maydell
4347e2fcbf42SPeter Maydell        Setting the ``discard-data`` boolean option to on indicates that
4348e2fcbf42SPeter Maydell        file contents can be destroyed when QEMU exits, to avoid
4349e2fcbf42SPeter Maydell        unnecessarily flushing data to the backing file. Note that
4350e2fcbf42SPeter Maydell        ``discard-data`` is only an optimization, and QEMU might not
4351e2fcbf42SPeter Maydell        discard file contents if it aborts unexpectedly or is terminated
4352e2fcbf42SPeter Maydell        using SIGKILL.
4353e2fcbf42SPeter Maydell
4354e2fcbf42SPeter Maydell        The ``merge`` boolean option enables memory merge, also known as
4355e2fcbf42SPeter Maydell        MADV\_MERGEABLE, so that Kernel Samepage Merging will consider
4356e2fcbf42SPeter Maydell        the pages for memory deduplication.
4357e2fcbf42SPeter Maydell
4358e2fcbf42SPeter Maydell        Setting the ``dump`` boolean option to off excludes the memory
4359e2fcbf42SPeter Maydell        from core dumps. This feature is also known as MADV\_DONTDUMP.
4360e2fcbf42SPeter Maydell
4361e2fcbf42SPeter Maydell        The ``prealloc`` boolean option enables memory preallocation.
4362e2fcbf42SPeter Maydell
4363e2fcbf42SPeter Maydell        The ``host-nodes`` option binds the memory range to a list of
4364e2fcbf42SPeter Maydell        NUMA host nodes.
4365e2fcbf42SPeter Maydell
4366e2fcbf42SPeter Maydell        The ``policy`` option sets the NUMA policy to one of the
4367e2fcbf42SPeter Maydell        following values:
4368e2fcbf42SPeter Maydell
4369e2fcbf42SPeter Maydell        ``default``
4370e2fcbf42SPeter Maydell            default host policy
4371e2fcbf42SPeter Maydell
4372e2fcbf42SPeter Maydell        ``preferred``
4373e2fcbf42SPeter Maydell            prefer the given host node list for allocation
4374e2fcbf42SPeter Maydell
4375e2fcbf42SPeter Maydell        ``bind``
4376e2fcbf42SPeter Maydell            restrict memory allocation to the given host node list
4377e2fcbf42SPeter Maydell
4378e2fcbf42SPeter Maydell        ``interleave``
4379e2fcbf42SPeter Maydell            interleave memory allocations across the given host node
4380e2fcbf42SPeter Maydell            list
4381e2fcbf42SPeter Maydell
4382e2fcbf42SPeter Maydell        The ``align`` option specifies the base address alignment when
4383e2fcbf42SPeter Maydell        QEMU mmap(2) ``mem-path``, and accepts common suffixes, eg
4384e2fcbf42SPeter Maydell        ``2M``. Some backend store specified by ``mem-path`` requires an
4385e2fcbf42SPeter Maydell        alignment different than the default one used by QEMU, eg the
4386e2fcbf42SPeter Maydell        device DAX /dev/dax0.0 requires 2M alignment rather than 4K. In
4387e2fcbf42SPeter Maydell        such cases, users can specify the required alignment via this
4388e2fcbf42SPeter Maydell        option.
4389e2fcbf42SPeter Maydell
4390e2fcbf42SPeter Maydell        The ``pmem`` option specifies whether the backing file specified
4391e2fcbf42SPeter Maydell        by ``mem-path`` is in host persistent memory that can be
4392e2fcbf42SPeter Maydell        accessed using the SNIA NVM programming model (e.g. Intel
4393e2fcbf42SPeter Maydell        NVDIMM). If ``pmem`` is set to 'on', QEMU will take necessary
4394e2fcbf42SPeter Maydell        operations to guarantee the persistence of its own writes to
4395e2fcbf42SPeter Maydell        ``mem-path`` (e.g. in vNVDIMM label emulation and live
4396e2fcbf42SPeter Maydell        migration). Also, we will map the backend-file with MAP\_SYNC
4397e2fcbf42SPeter Maydell        flag, which ensures the file metadata is in sync for
4398e2fcbf42SPeter Maydell        ``mem-path`` in case of host crash or a power failure. MAP\_SYNC
4399e2fcbf42SPeter Maydell        requires support from both the host kernel (since Linux kernel
4400e2fcbf42SPeter Maydell        4.15) and the filesystem of ``mem-path`` mounted with DAX
4401e2fcbf42SPeter Maydell        option.
4402e2fcbf42SPeter Maydell
4403e2fcbf42SPeter Maydell    ``-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``
4404e2fcbf42SPeter Maydell        Creates a memory backend object, which can be used to back the
4405e2fcbf42SPeter Maydell        guest RAM. Memory backend objects offer more control than the
4406e2fcbf42SPeter Maydell        ``-m`` option that is traditionally used to define guest RAM.
4407e2fcbf42SPeter Maydell        Please refer to ``memory-backend-file`` for a description of the
4408e2fcbf42SPeter Maydell        options.
4409e2fcbf42SPeter Maydell
4410e2fcbf42SPeter Maydell    ``-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``
4411e2fcbf42SPeter Maydell        Creates an anonymous memory file backend object, which allows
4412e2fcbf42SPeter Maydell        QEMU to share the memory with an external process (e.g. when
4413e2fcbf42SPeter Maydell        using vhost-user). The memory is allocated with memfd and
4414e2fcbf42SPeter Maydell        optional sealing. (Linux only)
4415e2fcbf42SPeter Maydell
4416e2fcbf42SPeter Maydell        The ``seal`` option creates a sealed-file, that will block
4417e2fcbf42SPeter Maydell        further resizing the memory ('on' by default).
4418e2fcbf42SPeter Maydell
4419e2fcbf42SPeter Maydell        The ``hugetlb`` option specify the file to be created resides in
4420e2fcbf42SPeter Maydell        the hugetlbfs filesystem (since Linux 4.14). Used in conjunction
4421e2fcbf42SPeter Maydell        with the ``hugetlb`` option, the ``hugetlbsize`` option specify
4422e2fcbf42SPeter Maydell        the hugetlb page size on systems that support multiple hugetlb
4423e2fcbf42SPeter Maydell        page sizes (it must be a power of 2 value supported by the
4424e2fcbf42SPeter Maydell        system).
4425e2fcbf42SPeter Maydell
4426e2fcbf42SPeter Maydell        In some versions of Linux, the ``hugetlb`` option is
4427e2fcbf42SPeter Maydell        incompatible with the ``seal`` option (requires at least Linux
4428e2fcbf42SPeter Maydell        4.16).
4429e2fcbf42SPeter Maydell
4430e2fcbf42SPeter Maydell        Please refer to ``memory-backend-file`` for a description of the
4431e2fcbf42SPeter Maydell        other options.
4432e2fcbf42SPeter Maydell
4433e2fcbf42SPeter Maydell        The ``share`` boolean option is on by default with memfd.
4434e2fcbf42SPeter Maydell
4435e2fcbf42SPeter Maydell    ``-object rng-builtin,id=id``
4436e2fcbf42SPeter Maydell        Creates a random number generator backend which obtains entropy
4437e2fcbf42SPeter Maydell        from QEMU builtin functions. The ``id`` parameter is a unique ID
4438e2fcbf42SPeter Maydell        that will be used to reference this entropy backend from the
4439e2fcbf42SPeter Maydell        ``virtio-rng`` device. By default, the ``virtio-rng`` device
4440e2fcbf42SPeter Maydell        uses this RNG backend.
4441e2fcbf42SPeter Maydell
4442e2fcbf42SPeter Maydell    ``-object rng-random,id=id,filename=/dev/random``
4443e2fcbf42SPeter Maydell        Creates a random number generator backend which obtains entropy
4444e2fcbf42SPeter Maydell        from a device on the host. The ``id`` parameter is a unique ID
4445e2fcbf42SPeter Maydell        that will be used to reference this entropy backend from the
4446e2fcbf42SPeter Maydell        ``virtio-rng`` device. The ``filename`` parameter specifies
4447e2fcbf42SPeter Maydell        which file to obtain entropy from and if omitted defaults to
4448e2fcbf42SPeter Maydell        ``/dev/urandom``.
4449e2fcbf42SPeter Maydell
4450e2fcbf42SPeter Maydell    ``-object rng-egd,id=id,chardev=chardevid``
4451e2fcbf42SPeter Maydell        Creates a random number generator backend which obtains entropy
4452e2fcbf42SPeter Maydell        from an external daemon running on the host. The ``id``
4453e2fcbf42SPeter Maydell        parameter is a unique ID that will be used to reference this
4454e2fcbf42SPeter Maydell        entropy backend from the ``virtio-rng`` device. The ``chardev``
4455e2fcbf42SPeter Maydell        parameter is the unique ID of a character device backend that
4456e2fcbf42SPeter Maydell        provides the connection to the RNG daemon.
4457e2fcbf42SPeter Maydell
4458e2fcbf42SPeter Maydell    ``-object tls-creds-anon,id=id,endpoint=endpoint,dir=/path/to/cred/dir,verify-peer=on|off``
4459e2fcbf42SPeter Maydell        Creates a TLS anonymous credentials object, which can be used to
4460e2fcbf42SPeter Maydell        provide TLS support on network backends. The ``id`` parameter is
4461e2fcbf42SPeter Maydell        a unique ID which network backends will use to access the
4462e2fcbf42SPeter Maydell        credentials. The ``endpoint`` is either ``server`` or ``client``
4463e2fcbf42SPeter Maydell        depending on whether the QEMU network backend that uses the
4464e2fcbf42SPeter Maydell        credentials will be acting as a client or as a server. If
4465e2fcbf42SPeter Maydell        ``verify-peer`` is enabled (the default) then once the handshake
4466e2fcbf42SPeter Maydell        is completed, the peer credentials will be verified, though this
4467e2fcbf42SPeter Maydell        is a no-op for anonymous credentials.
4468e2fcbf42SPeter Maydell
4469e2fcbf42SPeter Maydell        The dir parameter tells QEMU where to find the credential files.
4470e2fcbf42SPeter Maydell        For server endpoints, this directory may contain a file
4471e2fcbf42SPeter Maydell        dh-params.pem providing diffie-hellman parameters to use for the
4472e2fcbf42SPeter Maydell        TLS server. If the file is missing, QEMU will generate a set of
4473e2fcbf42SPeter Maydell        DH parameters at startup. This is a computationally expensive
4474e2fcbf42SPeter Maydell        operation that consumes random pool entropy, so it is
4475e2fcbf42SPeter Maydell        recommended that a persistent set of parameters be generated
4476e2fcbf42SPeter Maydell        upfront and saved.
4477e2fcbf42SPeter Maydell
4478e2fcbf42SPeter Maydell    ``-object tls-creds-psk,id=id,endpoint=endpoint,dir=/path/to/keys/dir[,username=username]``
4479e2fcbf42SPeter Maydell        Creates a TLS Pre-Shared Keys (PSK) credentials object, which
4480e2fcbf42SPeter Maydell        can be used to provide TLS support on network backends. The
4481e2fcbf42SPeter Maydell        ``id`` parameter is a unique ID which network backends will use
4482e2fcbf42SPeter Maydell        to access the credentials. The ``endpoint`` is either ``server``
4483e2fcbf42SPeter Maydell        or ``client`` depending on whether the QEMU network backend that
4484e2fcbf42SPeter Maydell        uses the credentials will be acting as a client or as a server.
4485e2fcbf42SPeter Maydell        For clients only, ``username`` is the username which will be
4486e2fcbf42SPeter Maydell        sent to the server. If omitted it defaults to "qemu".
4487e2fcbf42SPeter Maydell
4488e2fcbf42SPeter Maydell        The dir parameter tells QEMU where to find the keys file. It is
4489e2fcbf42SPeter Maydell        called "dir/keys.psk" and contains "username:key" pairs. This
4490e2fcbf42SPeter Maydell        file can most easily be created using the GnuTLS ``psktool``
4491e2fcbf42SPeter Maydell        program.
4492e2fcbf42SPeter Maydell
4493e2fcbf42SPeter Maydell        For server endpoints, dir may also contain a file dh-params.pem
4494e2fcbf42SPeter Maydell        providing diffie-hellman parameters to use for the TLS server.
4495e2fcbf42SPeter Maydell        If the file is missing, QEMU will generate a set of DH
4496e2fcbf42SPeter Maydell        parameters at startup. This is a computationally expensive
4497e2fcbf42SPeter Maydell        operation that consumes random pool entropy, so it is
4498e2fcbf42SPeter Maydell        recommended that a persistent set of parameters be generated up
4499e2fcbf42SPeter Maydell        front and saved.
4500e2fcbf42SPeter Maydell
4501e2fcbf42SPeter Maydell    ``-object tls-creds-x509,id=id,endpoint=endpoint,dir=/path/to/cred/dir,priority=priority,verify-peer=on|off,passwordid=id``
4502e2fcbf42SPeter Maydell        Creates a TLS anonymous credentials object, which can be used to
4503e2fcbf42SPeter Maydell        provide TLS support on network backends. The ``id`` parameter is
4504e2fcbf42SPeter Maydell        a unique ID which network backends will use to access the
4505e2fcbf42SPeter Maydell        credentials. The ``endpoint`` is either ``server`` or ``client``
4506e2fcbf42SPeter Maydell        depending on whether the QEMU network backend that uses the
4507e2fcbf42SPeter Maydell        credentials will be acting as a client or as a server. If
4508e2fcbf42SPeter Maydell        ``verify-peer`` is enabled (the default) then once the handshake
4509e2fcbf42SPeter Maydell        is completed, the peer credentials will be verified. With x509
4510e2fcbf42SPeter Maydell        certificates, this implies that the clients must be provided
4511e2fcbf42SPeter Maydell        with valid client certificates too.
4512e2fcbf42SPeter Maydell
4513e2fcbf42SPeter Maydell        The dir parameter tells QEMU where to find the credential files.
4514e2fcbf42SPeter Maydell        For server endpoints, this directory may contain a file
4515e2fcbf42SPeter Maydell        dh-params.pem providing diffie-hellman parameters to use for the
4516e2fcbf42SPeter Maydell        TLS server. If the file is missing, QEMU will generate a set of
4517e2fcbf42SPeter Maydell        DH parameters at startup. This is a computationally expensive
4518e2fcbf42SPeter Maydell        operation that consumes random pool entropy, so it is
4519e2fcbf42SPeter Maydell        recommended that a persistent set of parameters be generated
4520e2fcbf42SPeter Maydell        upfront and saved.
4521e2fcbf42SPeter Maydell
4522e2fcbf42SPeter Maydell        For x509 certificate credentials the directory will contain
4523e2fcbf42SPeter Maydell        further files providing the x509 certificates. The certificates
4524e2fcbf42SPeter Maydell        must be stored in PEM format, in filenames ca-cert.pem,
4525e2fcbf42SPeter Maydell        ca-crl.pem (optional), server-cert.pem (only servers),
4526e2fcbf42SPeter Maydell        server-key.pem (only servers), client-cert.pem (only clients),
4527e2fcbf42SPeter Maydell        and client-key.pem (only clients).
4528e2fcbf42SPeter Maydell
4529e2fcbf42SPeter Maydell        For the server-key.pem and client-key.pem files which contain
4530e2fcbf42SPeter Maydell        sensitive private keys, it is possible to use an encrypted
4531e2fcbf42SPeter Maydell        version by providing the passwordid parameter. This provides the
4532e2fcbf42SPeter Maydell        ID of a previously created ``secret`` object containing the
4533e2fcbf42SPeter Maydell        password for decryption.
4534e2fcbf42SPeter Maydell
4535e2fcbf42SPeter Maydell        The priority parameter allows to override the global default
4536e2fcbf42SPeter Maydell        priority used by gnutls. This can be useful if the system
4537e2fcbf42SPeter Maydell        administrator needs to use a weaker set of crypto priorities for
4538e2fcbf42SPeter Maydell        QEMU without potentially forcing the weakness onto all
4539e2fcbf42SPeter Maydell        applications. Or conversely if one wants wants a stronger
4540e2fcbf42SPeter Maydell        default for QEMU than for all other applications, they can do
4541e2fcbf42SPeter Maydell        this through this parameter. Its format is a gnutls priority
4542e2fcbf42SPeter Maydell        string as described at
4543e2fcbf42SPeter Maydell        https://gnutls.org/manual/html_node/Priority-Strings.html.
4544e2fcbf42SPeter Maydell
4545e2fcbf42SPeter Maydell    ``-object filter-buffer,id=id,netdev=netdevid,interval=t[,queue=all|rx|tx][,status=on|off][,position=head|tail|id=<id>][,insert=behind|before]``
4546e2fcbf42SPeter Maydell        Interval t can't be 0, this filter batches the packet delivery:
4547e2fcbf42SPeter Maydell        all packets arriving in a given interval on netdev netdevid are
4548e2fcbf42SPeter Maydell        delayed until the end of the interval. Interval is in
4549e2fcbf42SPeter Maydell        microseconds. ``status`` is optional that indicate whether the
4550e2fcbf42SPeter Maydell        netfilter is on (enabled) or off (disabled), the default status
4551e2fcbf42SPeter Maydell        for netfilter will be 'on'.
4552e2fcbf42SPeter Maydell
4553e2fcbf42SPeter Maydell        queue all\|rx\|tx is an option that can be applied to any
4554e2fcbf42SPeter Maydell        netfilter.
4555e2fcbf42SPeter Maydell
4556e2fcbf42SPeter Maydell        ``all``: the filter is attached both to the receive and the
4557e2fcbf42SPeter Maydell        transmit queue of the netdev (default).
4558e2fcbf42SPeter Maydell
4559e2fcbf42SPeter Maydell        ``rx``: the filter is attached to the receive queue of the
4560e2fcbf42SPeter Maydell        netdev, where it will receive packets sent to the netdev.
4561e2fcbf42SPeter Maydell
4562e2fcbf42SPeter Maydell        ``tx``: the filter is attached to the transmit queue of the
4563e2fcbf42SPeter Maydell        netdev, where it will receive packets sent by the netdev.
4564e2fcbf42SPeter Maydell
4565e2fcbf42SPeter Maydell        position head\|tail\|id=<id> is an option to specify where the
4566e2fcbf42SPeter Maydell        filter should be inserted in the filter list. It can be applied
4567e2fcbf42SPeter Maydell        to any netfilter.
4568e2fcbf42SPeter Maydell
4569e2fcbf42SPeter Maydell        ``head``: the filter is inserted at the head of the filter list,
4570e2fcbf42SPeter Maydell        before any existing filters.
4571e2fcbf42SPeter Maydell
4572e2fcbf42SPeter Maydell        ``tail``: the filter is inserted at the tail of the filter list,
4573e2fcbf42SPeter Maydell        behind any existing filters (default).
4574e2fcbf42SPeter Maydell
4575e2fcbf42SPeter Maydell        ``id=<id>``: the filter is inserted before or behind the filter
4576e2fcbf42SPeter Maydell        specified by <id>, see the insert option below.
4577e2fcbf42SPeter Maydell
4578e2fcbf42SPeter Maydell        insert behind\|before is an option to specify where to insert
4579e2fcbf42SPeter Maydell        the new filter relative to the one specified with
4580e2fcbf42SPeter Maydell        position=id=<id>. It can be applied to any netfilter.
4581e2fcbf42SPeter Maydell
4582e2fcbf42SPeter Maydell        ``before``: insert before the specified filter.
4583e2fcbf42SPeter Maydell
4584e2fcbf42SPeter Maydell        ``behind``: insert behind the specified filter (default).
4585e2fcbf42SPeter Maydell
4586e2fcbf42SPeter Maydell    ``-object filter-mirror,id=id,netdev=netdevid,outdev=chardevid,queue=all|rx|tx[,vnet_hdr_support][,position=head|tail|id=<id>][,insert=behind|before]``
4587e2fcbf42SPeter Maydell        filter-mirror on netdev netdevid,mirror net packet to
4588e2fcbf42SPeter Maydell        chardevchardevid, if it has the vnet\_hdr\_support flag,
4589e2fcbf42SPeter Maydell        filter-mirror will mirror packet with vnet\_hdr\_len.
4590e2fcbf42SPeter Maydell
4591e2fcbf42SPeter Maydell    ``-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]``
4592e2fcbf42SPeter Maydell        filter-redirector on netdev netdevid,redirect filter's net
4593e2fcbf42SPeter Maydell        packet to chardev chardevid,and redirect indev's packet to
4594e2fcbf42SPeter Maydell        filter.if it has the vnet\_hdr\_support flag, filter-redirector
4595e2fcbf42SPeter Maydell        will redirect packet with vnet\_hdr\_len. Create a
4596e2fcbf42SPeter Maydell        filter-redirector we need to differ outdev id from indev id, id
4597e2fcbf42SPeter Maydell        can not be the same. we can just use indev or outdev, but at
4598e2fcbf42SPeter Maydell        least one of indev or outdev need to be specified.
4599e2fcbf42SPeter Maydell
4600e2fcbf42SPeter Maydell    ``-object filter-rewriter,id=id,netdev=netdevid,queue=all|rx|tx,[vnet_hdr_support][,position=head|tail|id=<id>][,insert=behind|before]``
4601e2fcbf42SPeter Maydell        Filter-rewriter is a part of COLO project.It will rewrite tcp
4602e2fcbf42SPeter Maydell        packet to secondary from primary to keep secondary tcp
4603e2fcbf42SPeter Maydell        connection,and rewrite tcp packet to primary from secondary make
4604e2fcbf42SPeter Maydell        tcp packet can be handled by client.if it has the
4605e2fcbf42SPeter Maydell        vnet\_hdr\_support flag, we can parse packet with vnet header.
4606e2fcbf42SPeter Maydell
4607e2fcbf42SPeter Maydell        usage: colo secondary: -object
4608e2fcbf42SPeter Maydell        filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0 -object
4609e2fcbf42SPeter Maydell        filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1 -object
4610e2fcbf42SPeter Maydell        filter-rewriter,id=rew0,netdev=hn0,queue=all
4611e2fcbf42SPeter Maydell
4612e2fcbf42SPeter Maydell    ``-object filter-dump,id=id,netdev=dev[,file=filename][,maxlen=len][,position=head|tail|id=<id>][,insert=behind|before]``
4613e2fcbf42SPeter Maydell        Dump the network traffic on netdev dev to the file specified by
4614e2fcbf42SPeter Maydell        filename. At most len bytes (64k by default) per packet are
4615e2fcbf42SPeter Maydell        stored. The file format is libpcap, so it can be analyzed with
4616e2fcbf42SPeter Maydell        tools such as tcpdump or Wireshark.
4617e2fcbf42SPeter Maydell
4618e2fcbf42SPeter Maydell    ``-object colo-compare,id=id,primary_in=chardevid,secondary_in=chardevid,outdev=chardevid,iothread=id[,vnet_hdr_support][,notify_dev=id]``
4619e2fcbf42SPeter Maydell        Colo-compare gets packet from primary\_inchardevid and
4620e2fcbf42SPeter Maydell        secondary\_inchardevid, than compare primary packet with
4621e2fcbf42SPeter Maydell        secondary packet. If the packets are same, we will output
4622e2fcbf42SPeter Maydell        primary packet to outdevchardevid, else we will notify
4623e2fcbf42SPeter Maydell        colo-frame do checkpoint and send primary packet to
4624e2fcbf42SPeter Maydell        outdevchardevid. In order to improve efficiency, we need to put
4625e2fcbf42SPeter Maydell        the task of comparison in another thread. If it has the
4626e2fcbf42SPeter Maydell        vnet\_hdr\_support flag, colo compare will send/recv packet with
4627e2fcbf42SPeter Maydell        vnet\_hdr\_len. If you want to use Xen COLO, will need the
4628e2fcbf42SPeter Maydell        notify\_dev to notify Xen colo-frame to do checkpoint.
4629e2fcbf42SPeter Maydell
4630e2fcbf42SPeter Maydell        we must use it with the help of filter-mirror and
4631e2fcbf42SPeter Maydell        filter-redirector.
4632e2fcbf42SPeter Maydell
4633e2fcbf42SPeter Maydell        ::
4634e2fcbf42SPeter Maydell
4635e2fcbf42SPeter Maydell            KVM COLO
4636e2fcbf42SPeter Maydell
4637e2fcbf42SPeter Maydell            primary:
4638e2fcbf42SPeter Maydell            -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
4639e2fcbf42SPeter Maydell            -device e1000,id=e0,netdev=hn0,mac=52:a4:00:12:78:66
4640e2fcbf42SPeter Maydell            -chardev socket,id=mirror0,host=3.3.3.3,port=9003,server,nowait
4641e2fcbf42SPeter Maydell            -chardev socket,id=compare1,host=3.3.3.3,port=9004,server,nowait
4642e2fcbf42SPeter Maydell            -chardev socket,id=compare0,host=3.3.3.3,port=9001,server,nowait
4643e2fcbf42SPeter Maydell            -chardev socket,id=compare0-0,host=3.3.3.3,port=9001
4644e2fcbf42SPeter Maydell            -chardev socket,id=compare_out,host=3.3.3.3,port=9005,server,nowait
4645e2fcbf42SPeter Maydell            -chardev socket,id=compare_out0,host=3.3.3.3,port=9005
4646e2fcbf42SPeter Maydell            -object iothread,id=iothread1
4647e2fcbf42SPeter Maydell            -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0
4648e2fcbf42SPeter Maydell            -object filter-redirector,netdev=hn0,id=redire0,queue=rx,indev=compare_out
4649e2fcbf42SPeter Maydell            -object filter-redirector,netdev=hn0,id=redire1,queue=rx,outdev=compare0
4650e2fcbf42SPeter Maydell            -object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0,iothread=iothread1
4651e2fcbf42SPeter Maydell
4652e2fcbf42SPeter Maydell            secondary:
4653e2fcbf42SPeter Maydell            -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,down script=/etc/qemu-ifdown
4654e2fcbf42SPeter Maydell            -device e1000,netdev=hn0,mac=52:a4:00:12:78:66
4655e2fcbf42SPeter Maydell            -chardev socket,id=red0,host=3.3.3.3,port=9003
4656e2fcbf42SPeter Maydell            -chardev socket,id=red1,host=3.3.3.3,port=9004
4657e2fcbf42SPeter Maydell            -object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0
4658e2fcbf42SPeter Maydell            -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1
4659e2fcbf42SPeter Maydell
4660e2fcbf42SPeter Maydell
4661e2fcbf42SPeter Maydell            Xen COLO
4662e2fcbf42SPeter Maydell
4663e2fcbf42SPeter Maydell            primary:
4664e2fcbf42SPeter Maydell            -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
4665e2fcbf42SPeter Maydell            -device e1000,id=e0,netdev=hn0,mac=52:a4:00:12:78:66
4666e2fcbf42SPeter Maydell            -chardev socket,id=mirror0,host=3.3.3.3,port=9003,server,nowait
4667e2fcbf42SPeter Maydell            -chardev socket,id=compare1,host=3.3.3.3,port=9004,server,nowait
4668e2fcbf42SPeter Maydell            -chardev socket,id=compare0,host=3.3.3.3,port=9001,server,nowait
4669e2fcbf42SPeter Maydell            -chardev socket,id=compare0-0,host=3.3.3.3,port=9001
4670e2fcbf42SPeter Maydell            -chardev socket,id=compare_out,host=3.3.3.3,port=9005,server,nowait
4671e2fcbf42SPeter Maydell            -chardev socket,id=compare_out0,host=3.3.3.3,port=9005
4672e2fcbf42SPeter Maydell            -chardev socket,id=notify_way,host=3.3.3.3,port=9009,server,nowait
4673e2fcbf42SPeter Maydell            -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0
4674e2fcbf42SPeter Maydell            -object filter-redirector,netdev=hn0,id=redire0,queue=rx,indev=compare_out
4675e2fcbf42SPeter Maydell            -object filter-redirector,netdev=hn0,id=redire1,queue=rx,outdev=compare0
4676e2fcbf42SPeter Maydell            -object iothread,id=iothread1
4677e2fcbf42SPeter Maydell            -object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0,notify_dev=nofity_way,iothread=iothread1
4678e2fcbf42SPeter Maydell
4679e2fcbf42SPeter Maydell            secondary:
4680e2fcbf42SPeter Maydell            -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,down script=/etc/qemu-ifdown
4681e2fcbf42SPeter Maydell            -device e1000,netdev=hn0,mac=52:a4:00:12:78:66
4682e2fcbf42SPeter Maydell            -chardev socket,id=red0,host=3.3.3.3,port=9003
4683e2fcbf42SPeter Maydell            -chardev socket,id=red1,host=3.3.3.3,port=9004
4684e2fcbf42SPeter Maydell            -object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0
4685e2fcbf42SPeter Maydell            -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1
4686e2fcbf42SPeter Maydell
4687e2fcbf42SPeter Maydell        If you want to know the detail of above command line, you can
4688e2fcbf42SPeter Maydell        read the colo-compare git log.
4689e2fcbf42SPeter Maydell
4690e2fcbf42SPeter Maydell    ``-object cryptodev-backend-builtin,id=id[,queues=queues]``
4691e2fcbf42SPeter Maydell        Creates a cryptodev backend which executes crypto opreation from
4692e2fcbf42SPeter Maydell        the QEMU cipher APIS. The id parameter is a unique ID that will
4693e2fcbf42SPeter Maydell        be used to reference this cryptodev backend from the
4694e2fcbf42SPeter Maydell        ``virtio-crypto`` device. The queues parameter is optional,
4695e2fcbf42SPeter Maydell        which specify the queue number of cryptodev backend, the default
4696e2fcbf42SPeter Maydell        of queues is 1.
4697e2fcbf42SPeter Maydell
469809ce5f2dSPeter Maydell        .. parsed-literal::
4699e2fcbf42SPeter Maydell
4700e2fcbf42SPeter Maydell             # |qemu_system| \
4701e2fcbf42SPeter Maydell               [...] \
4702e2fcbf42SPeter Maydell                   -object cryptodev-backend-builtin,id=cryptodev0 \
4703e2fcbf42SPeter Maydell                   -device virtio-crypto-pci,id=crypto0,cryptodev=cryptodev0 \
4704e2fcbf42SPeter Maydell               [...]
4705e2fcbf42SPeter Maydell
4706e2fcbf42SPeter Maydell    ``-object cryptodev-vhost-user,id=id,chardev=chardevid[,queues=queues]``
4707e2fcbf42SPeter Maydell        Creates a vhost-user cryptodev backend, backed by a chardev
4708e2fcbf42SPeter Maydell        chardevid. The id parameter is a unique ID that will be used to
4709e2fcbf42SPeter Maydell        reference this cryptodev backend from the ``virtio-crypto``
4710e2fcbf42SPeter Maydell        device. The chardev should be a unix domain socket backed one.
4711e2fcbf42SPeter Maydell        The vhost-user uses a specifically defined protocol to pass
4712e2fcbf42SPeter Maydell        vhost ioctl replacement messages to an application on the other
4713e2fcbf42SPeter Maydell        end of the socket. The queues parameter is optional, which
4714e2fcbf42SPeter Maydell        specify the queue number of cryptodev backend for multiqueue
4715e2fcbf42SPeter Maydell        vhost-user, the default of queues is 1.
4716e2fcbf42SPeter Maydell
471709ce5f2dSPeter Maydell        .. parsed-literal::
4718e2fcbf42SPeter Maydell
4719e2fcbf42SPeter Maydell             # |qemu_system| \
4720e2fcbf42SPeter Maydell               [...] \
4721e2fcbf42SPeter Maydell                   -chardev socket,id=chardev0,path=/path/to/socket \
4722e2fcbf42SPeter Maydell                   -object cryptodev-vhost-user,id=cryptodev0,chardev=chardev0 \
4723e2fcbf42SPeter Maydell                   -device virtio-crypto-pci,id=crypto0,cryptodev=cryptodev0 \
4724e2fcbf42SPeter Maydell               [...]
4725e2fcbf42SPeter Maydell
4726e2fcbf42SPeter Maydell    ``-object secret,id=id,data=string,format=raw|base64[,keyid=secretid,iv=string]``
472709ce5f2dSPeter Maydell      \
4728e2fcbf42SPeter Maydell    ``-object secret,id=id,file=filename,format=raw|base64[,keyid=secretid,iv=string]``
4729e2fcbf42SPeter Maydell        Defines a secret to store a password, encryption key, or some
4730e2fcbf42SPeter Maydell        other sensitive data. The sensitive data can either be passed
4731e2fcbf42SPeter Maydell        directly via the data parameter, or indirectly via the file
4732e2fcbf42SPeter Maydell        parameter. Using the data parameter is insecure unless the
4733e2fcbf42SPeter Maydell        sensitive data is encrypted.
4734e2fcbf42SPeter Maydell
4735e2fcbf42SPeter Maydell        The sensitive data can be provided in raw format (the default),
4736e2fcbf42SPeter Maydell        or base64. When encoded as JSON, the raw format only supports
4737e2fcbf42SPeter Maydell        valid UTF-8 characters, so base64 is recommended for sending
4738e2fcbf42SPeter Maydell        binary data. QEMU will convert from which ever format is
4739e2fcbf42SPeter Maydell        provided to the format it needs internally. eg, an RBD password
4740e2fcbf42SPeter Maydell        can be provided in raw format, even though it will be base64
4741e2fcbf42SPeter Maydell        encoded when passed onto the RBD sever.
4742e2fcbf42SPeter Maydell
4743e2fcbf42SPeter Maydell        For added protection, it is possible to encrypt the data
4744e2fcbf42SPeter Maydell        associated with a secret using the AES-256-CBC cipher. Use of
4745e2fcbf42SPeter Maydell        encryption is indicated by providing the keyid and iv
4746e2fcbf42SPeter Maydell        parameters. The keyid parameter provides the ID of a previously
4747e2fcbf42SPeter Maydell        defined secret that contains the AES-256 decryption key. This
4748e2fcbf42SPeter Maydell        key should be 32-bytes long and be base64 encoded. The iv
4749e2fcbf42SPeter Maydell        parameter provides the random initialization vector used for
4750e2fcbf42SPeter Maydell        encryption of this particular secret and should be a base64
4751e2fcbf42SPeter Maydell        encrypted string of the 16-byte IV.
4752e2fcbf42SPeter Maydell
4753e2fcbf42SPeter Maydell        The simplest (insecure) usage is to provide the secret inline
4754e2fcbf42SPeter Maydell
475509ce5f2dSPeter Maydell        .. parsed-literal::
4756e2fcbf42SPeter Maydell
4757e2fcbf42SPeter Maydell             # |qemu_system| -object secret,id=sec0,data=letmein,format=raw
4758e2fcbf42SPeter Maydell
4759e2fcbf42SPeter Maydell        The simplest secure usage is to provide the secret via a file
4760e2fcbf42SPeter Maydell
4761e2fcbf42SPeter Maydell        # printf "letmein" > mypasswd.txt # QEMU\_SYSTEM\_MACRO -object
4762e2fcbf42SPeter Maydell        secret,id=sec0,file=mypasswd.txt,format=raw
4763e2fcbf42SPeter Maydell
4764e2fcbf42SPeter Maydell        For greater security, AES-256-CBC should be used. To illustrate
4765e2fcbf42SPeter Maydell        usage, consider the openssl command line tool which can encrypt
4766e2fcbf42SPeter Maydell        the data. Note that when encrypting, the plaintext must be
4767e2fcbf42SPeter Maydell        padded to the cipher block size (32 bytes) using the standard
4768e2fcbf42SPeter Maydell        PKCS#5/6 compatible padding algorithm.
4769e2fcbf42SPeter Maydell
4770e2fcbf42SPeter Maydell        First a master key needs to be created in base64 encoding:
4771e2fcbf42SPeter Maydell
4772e2fcbf42SPeter Maydell        ::
4773e2fcbf42SPeter Maydell
4774e2fcbf42SPeter Maydell             # openssl rand -base64 32 > key.b64
4775e2fcbf42SPeter Maydell             # KEY=$(base64 -d key.b64 | hexdump  -v -e '/1 "%02X"')
4776e2fcbf42SPeter Maydell
4777e2fcbf42SPeter Maydell        Each secret to be encrypted needs to have a random
4778e2fcbf42SPeter Maydell        initialization vector generated. These do not need to be kept
4779e2fcbf42SPeter Maydell        secret
4780e2fcbf42SPeter Maydell
4781e2fcbf42SPeter Maydell        ::
4782e2fcbf42SPeter Maydell
4783e2fcbf42SPeter Maydell             # openssl rand -base64 16 > iv.b64
4784e2fcbf42SPeter Maydell             # IV=$(base64 -d iv.b64 | hexdump  -v -e '/1 "%02X"')
4785e2fcbf42SPeter Maydell
4786e2fcbf42SPeter Maydell        The secret to be defined can now be encrypted, in this case
4787e2fcbf42SPeter Maydell        we're telling openssl to base64 encode the result, but it could
4788e2fcbf42SPeter Maydell        be left as raw bytes if desired.
4789e2fcbf42SPeter Maydell
4790e2fcbf42SPeter Maydell        ::
4791e2fcbf42SPeter Maydell
4792e2fcbf42SPeter Maydell             # SECRET=$(printf "letmein" |
4793e2fcbf42SPeter Maydell                        openssl enc -aes-256-cbc -a -K $KEY -iv $IV)
4794e2fcbf42SPeter Maydell
4795e2fcbf42SPeter Maydell        When launching QEMU, create a master secret pointing to
4796e2fcbf42SPeter Maydell        ``key.b64`` and specify that to be used to decrypt the user
4797e2fcbf42SPeter Maydell        password. Pass the contents of ``iv.b64`` to the second secret
4798e2fcbf42SPeter Maydell
479909ce5f2dSPeter Maydell        .. parsed-literal::
4800e2fcbf42SPeter Maydell
4801e2fcbf42SPeter Maydell             # |qemu_system| \
4802e2fcbf42SPeter Maydell                 -object secret,id=secmaster0,format=base64,file=key.b64 \
4803e2fcbf42SPeter Maydell                 -object secret,id=sec0,keyid=secmaster0,format=base64,\
4804e2fcbf42SPeter Maydell                     data=$SECRET,iv=$(<iv.b64)
4805e2fcbf42SPeter Maydell
4806e2fcbf42SPeter Maydell    ``-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]``
4807e2fcbf42SPeter Maydell        Create a Secure Encrypted Virtualization (SEV) guest object,
4808e2fcbf42SPeter Maydell        which can be used to provide the guest memory encryption support
4809e2fcbf42SPeter Maydell        on AMD processors.
4810e2fcbf42SPeter Maydell
4811e2fcbf42SPeter Maydell        When memory encryption is enabled, one of the physical address
4812e2fcbf42SPeter Maydell        bit (aka the C-bit) is utilized to mark if a memory page is
4813e2fcbf42SPeter Maydell        protected. The ``cbitpos`` is used to provide the C-bit
4814e2fcbf42SPeter Maydell        position. The C-bit position is Host family dependent hence user
4815e2fcbf42SPeter Maydell        must provide this value. On EPYC, the value should be 47.
4816e2fcbf42SPeter Maydell
4817e2fcbf42SPeter Maydell        When memory encryption is enabled, we loose certain bits in
4818e2fcbf42SPeter Maydell        physical address space. The ``reduced-phys-bits`` is used to
4819e2fcbf42SPeter Maydell        provide the number of bits we loose in physical address space.
4820e2fcbf42SPeter Maydell        Similar to C-bit, the value is Host family dependent. On EPYC,
4821e2fcbf42SPeter Maydell        the value should be 5.
4822e2fcbf42SPeter Maydell
4823e2fcbf42SPeter Maydell        The ``sev-device`` provides the device file to use for
4824e2fcbf42SPeter Maydell        communicating with the SEV firmware running inside AMD Secure
4825e2fcbf42SPeter Maydell        Processor. The default device is '/dev/sev'. If hardware
4826e2fcbf42SPeter Maydell        supports memory encryption then /dev/sev devices are created by
4827e2fcbf42SPeter Maydell        CCP driver.
4828e2fcbf42SPeter Maydell
4829e2fcbf42SPeter Maydell        The ``policy`` provides the guest policy to be enforced by the
4830e2fcbf42SPeter Maydell        SEV firmware and restrict what configuration and operational
4831e2fcbf42SPeter Maydell        commands can be performed on this guest by the hypervisor. The
4832e2fcbf42SPeter Maydell        policy should be provided by the guest owner and is bound to the
4833e2fcbf42SPeter Maydell        guest and cannot be changed throughout the lifetime of the
4834e2fcbf42SPeter Maydell        guest. The default is 0.
4835e2fcbf42SPeter Maydell
4836e2fcbf42SPeter Maydell        If guest ``policy`` allows sharing the key with another SEV
4837e2fcbf42SPeter Maydell        guest then ``handle`` can be use to provide handle of the guest
4838e2fcbf42SPeter Maydell        from which to share the key.
4839e2fcbf42SPeter Maydell
4840e2fcbf42SPeter Maydell        The ``dh-cert-file`` and ``session-file`` provides the guest
4841e2fcbf42SPeter Maydell        owner's Public Diffie-Hillman key defined in SEV spec. The PDH
4842e2fcbf42SPeter Maydell        and session parameters are used for establishing a cryptographic
4843e2fcbf42SPeter Maydell        session with the guest owner to negotiate keys used for
4844e2fcbf42SPeter Maydell        attestation. The file must be encoded in base64.
4845e2fcbf42SPeter Maydell
4846e2fcbf42SPeter Maydell        e.g to launch a SEV guest
4847e2fcbf42SPeter Maydell
484809ce5f2dSPeter Maydell        .. parsed-literal::
4849e2fcbf42SPeter Maydell
4850e2fcbf42SPeter Maydell             # |qemu_system_x86| \
4851e2fcbf42SPeter Maydell                 ......
4852e2fcbf42SPeter Maydell                 -object sev-guest,id=sev0,cbitpos=47,reduced-phys-bits=5 \
4853e2fcbf42SPeter Maydell                 -machine ...,memory-encryption=sev0
4854e2fcbf42SPeter Maydell                 .....
4855e2fcbf42SPeter Maydell
4856e2fcbf42SPeter Maydell    ``-object authz-simple,id=id,identity=string``
4857e2fcbf42SPeter Maydell        Create an authorization object that will control access to
4858e2fcbf42SPeter Maydell        network services.
4859e2fcbf42SPeter Maydell
4860e2fcbf42SPeter Maydell        The ``identity`` parameter is identifies the user and its format
4861e2fcbf42SPeter Maydell        depends on the network service that authorization object is
4862e2fcbf42SPeter Maydell        associated with. For authorizing based on TLS x509 certificates,
4863e2fcbf42SPeter Maydell        the identity must be the x509 distinguished name. Note that care
4864e2fcbf42SPeter Maydell        must be taken to escape any commas in the distinguished name.
4865e2fcbf42SPeter Maydell
4866e2fcbf42SPeter Maydell        An example authorization object to validate a x509 distinguished
4867e2fcbf42SPeter Maydell        name would look like:
4868e2fcbf42SPeter Maydell
486909ce5f2dSPeter Maydell        .. parsed-literal::
4870e2fcbf42SPeter Maydell
4871e2fcbf42SPeter Maydell             # |qemu_system| \
4872e2fcbf42SPeter Maydell                 ...
4873e2fcbf42SPeter Maydell                 -object 'authz-simple,id=auth0,identity=CN=laptop.example.com,,O=Example Org,,L=London,,ST=London,,C=GB' \
4874e2fcbf42SPeter Maydell                 ...
4875e2fcbf42SPeter Maydell
4876e2fcbf42SPeter Maydell        Note the use of quotes due to the x509 distinguished name
4877e2fcbf42SPeter Maydell        containing whitespace, and escaping of ','.
4878e2fcbf42SPeter Maydell
4879e2fcbf42SPeter Maydell    ``-object authz-listfile,id=id,filename=path,refresh=yes|no``
4880e2fcbf42SPeter Maydell        Create an authorization object that will control access to
4881e2fcbf42SPeter Maydell        network services.
4882e2fcbf42SPeter Maydell
4883e2fcbf42SPeter Maydell        The ``filename`` parameter is the fully qualified path to a file
4884e2fcbf42SPeter Maydell        containing the access control list rules in JSON format.
4885e2fcbf42SPeter Maydell
4886e2fcbf42SPeter Maydell        An example set of rules that match against SASL usernames might
4887e2fcbf42SPeter Maydell        look like:
4888e2fcbf42SPeter Maydell
4889e2fcbf42SPeter Maydell        ::
4890e2fcbf42SPeter Maydell
4891e2fcbf42SPeter Maydell              {
4892e2fcbf42SPeter Maydell                "rules": [
4893e2fcbf42SPeter Maydell                   { "match": "fred", "policy": "allow", "format": "exact" },
4894e2fcbf42SPeter Maydell                   { "match": "bob", "policy": "allow", "format": "exact" },
4895e2fcbf42SPeter Maydell                   { "match": "danb", "policy": "deny", "format": "glob" },
4896e2fcbf42SPeter Maydell                   { "match": "dan*", "policy": "allow", "format": "exact" },
4897e2fcbf42SPeter Maydell                ],
4898e2fcbf42SPeter Maydell                "policy": "deny"
4899e2fcbf42SPeter Maydell              }
4900e2fcbf42SPeter Maydell
4901e2fcbf42SPeter Maydell        When checking access the object will iterate over all the rules
4902e2fcbf42SPeter Maydell        and the first rule to match will have its ``policy`` value
4903e2fcbf42SPeter Maydell        returned as the result. If no rules match, then the default
4904e2fcbf42SPeter Maydell        ``policy`` value is returned.
4905e2fcbf42SPeter Maydell
4906e2fcbf42SPeter Maydell        The rules can either be an exact string match, or they can use
4907e2fcbf42SPeter Maydell        the simple UNIX glob pattern matching to allow wildcards to be
4908e2fcbf42SPeter Maydell        used.
4909e2fcbf42SPeter Maydell
4910e2fcbf42SPeter Maydell        If ``refresh`` is set to true the file will be monitored and
4911e2fcbf42SPeter Maydell        automatically reloaded whenever its content changes.
4912e2fcbf42SPeter Maydell
4913e2fcbf42SPeter Maydell        As with the ``authz-simple`` object, the format of the identity
4914e2fcbf42SPeter Maydell        strings being matched depends on the network service, but is
4915e2fcbf42SPeter Maydell        usually a TLS x509 distinguished name, or a SASL username.
4916e2fcbf42SPeter Maydell
4917e2fcbf42SPeter Maydell        An example authorization object to validate a SASL username
4918e2fcbf42SPeter Maydell        would look like:
4919e2fcbf42SPeter Maydell
492009ce5f2dSPeter Maydell        .. parsed-literal::
4921e2fcbf42SPeter Maydell
4922e2fcbf42SPeter Maydell             # |qemu_system| \
4923e2fcbf42SPeter Maydell                 ...
4924e2fcbf42SPeter Maydell                 -object authz-simple,id=auth0,filename=/etc/qemu/vnc-sasl.acl,refresh=yes
4925e2fcbf42SPeter Maydell                 ...
4926e2fcbf42SPeter Maydell
4927e2fcbf42SPeter Maydell    ``-object authz-pam,id=id,service=string``
4928e2fcbf42SPeter Maydell        Create an authorization object that will control access to
4929e2fcbf42SPeter Maydell        network services.
4930e2fcbf42SPeter Maydell
4931e2fcbf42SPeter Maydell        The ``service`` parameter provides the name of a PAM service to
4932e2fcbf42SPeter Maydell        use for authorization. It requires that a file
4933e2fcbf42SPeter Maydell        ``/etc/pam.d/service`` exist to provide the configuration for
4934e2fcbf42SPeter Maydell        the ``account`` subsystem.
4935e2fcbf42SPeter Maydell
4936e2fcbf42SPeter Maydell        An example authorization object to validate a TLS x509
4937e2fcbf42SPeter Maydell        distinguished name would look like:
4938e2fcbf42SPeter Maydell
493909ce5f2dSPeter Maydell        .. parsed-literal::
4940e2fcbf42SPeter Maydell
4941e2fcbf42SPeter Maydell             # |qemu_system| \
4942e2fcbf42SPeter Maydell                 ...
4943e2fcbf42SPeter Maydell                 -object authz-pam,id=auth0,service=qemu-vnc
4944e2fcbf42SPeter Maydell                 ...
4945e2fcbf42SPeter Maydell
4946e2fcbf42SPeter Maydell        There would then be a corresponding config file for PAM at
4947e2fcbf42SPeter Maydell        ``/etc/pam.d/qemu-vnc`` that contains:
4948e2fcbf42SPeter Maydell
4949e2fcbf42SPeter Maydell        ::
4950e2fcbf42SPeter Maydell
4951e2fcbf42SPeter Maydell            account requisite  pam_listfile.so item=user sense=allow \
4952e2fcbf42SPeter Maydell                       file=/etc/qemu/vnc.allow
4953e2fcbf42SPeter Maydell
4954e2fcbf42SPeter Maydell        Finally the ``/etc/qemu/vnc.allow`` file would contain the list
4955e2fcbf42SPeter Maydell        of x509 distingished names that are permitted access
4956e2fcbf42SPeter Maydell
4957e2fcbf42SPeter Maydell        ::
4958e2fcbf42SPeter Maydell
4959e2fcbf42SPeter Maydell            CN=laptop.example.com,O=Example Home,L=London,ST=London,C=GB
4960e2fcbf42SPeter Maydell
4961e2fcbf42SPeter Maydell    ``-object iothread,id=id,poll-max-ns=poll-max-ns,poll-grow=poll-grow,poll-shrink=poll-shrink``
4962e2fcbf42SPeter Maydell        Creates a dedicated event loop thread that devices can be
4963e2fcbf42SPeter Maydell        assigned to. This is known as an IOThread. By default device
4964e2fcbf42SPeter Maydell        emulation happens in vCPU threads or the main event loop thread.
4965e2fcbf42SPeter Maydell        This can become a scalability bottleneck. IOThreads allow device
4966e2fcbf42SPeter Maydell        emulation and I/O to run on other host CPUs.
4967e2fcbf42SPeter Maydell
4968e2fcbf42SPeter Maydell        The ``id`` parameter is a unique ID that will be used to
4969e2fcbf42SPeter Maydell        reference this IOThread from ``-device ...,iothread=id``.
4970e2fcbf42SPeter Maydell        Multiple devices can be assigned to an IOThread. Note that not
4971e2fcbf42SPeter Maydell        all devices support an ``iothread`` parameter.
4972e2fcbf42SPeter Maydell
4973e2fcbf42SPeter Maydell        The ``query-iothreads`` QMP command lists IOThreads and reports
4974e2fcbf42SPeter Maydell        their thread IDs so that the user can configure host CPU
4975e2fcbf42SPeter Maydell        pinning/affinity.
4976e2fcbf42SPeter Maydell
4977e2fcbf42SPeter Maydell        IOThreads use an adaptive polling algorithm to reduce event loop
4978e2fcbf42SPeter Maydell        latency. Instead of entering a blocking system call to monitor
4979e2fcbf42SPeter Maydell        file descriptors and then pay the cost of being woken up when an
4980e2fcbf42SPeter Maydell        event occurs, the polling algorithm spins waiting for events for
4981e2fcbf42SPeter Maydell        a short time. The algorithm's default parameters are suitable
4982e2fcbf42SPeter Maydell        for many cases but can be adjusted based on knowledge of the
4983e2fcbf42SPeter Maydell        workload and/or host device latency.
4984e2fcbf42SPeter Maydell
4985e2fcbf42SPeter Maydell        The ``poll-max-ns`` parameter is the maximum number of
4986e2fcbf42SPeter Maydell        nanoseconds to busy wait for events. Polling can be disabled by
4987e2fcbf42SPeter Maydell        setting this value to 0.
4988e2fcbf42SPeter Maydell
4989e2fcbf42SPeter Maydell        The ``poll-grow`` parameter is the multiplier used to increase
4990e2fcbf42SPeter Maydell        the polling time when the algorithm detects it is missing events
4991e2fcbf42SPeter Maydell        due to not polling long enough.
4992e2fcbf42SPeter Maydell
4993e2fcbf42SPeter Maydell        The ``poll-shrink`` parameter is the divisor used to decrease
4994e2fcbf42SPeter Maydell        the polling time when the algorithm detects it is spending too
4995e2fcbf42SPeter Maydell        long polling without encountering events.
4996e2fcbf42SPeter Maydell
4997e2fcbf42SPeter Maydell        The polling parameters can be modified at run-time using the
4998e2fcbf42SPeter Maydell        ``qom-set`` command (where ``iothread1`` is the IOThread's
4999e2fcbf42SPeter Maydell        ``id``):
5000e2fcbf42SPeter Maydell
5001e2fcbf42SPeter Maydell        ::
5002e2fcbf42SPeter Maydell
5003e2fcbf42SPeter Maydell            (qemu) qom-set /objects/iothread1 poll-max-ns 100000
5004e2fcbf42SPeter MaydellERST
5005b9174d4fSDaniel P. Berrange
5006b9174d4fSDaniel P. Berrange
50073dbf2c7fSStefan WeilHXCOMM This is the last statement. Insert new options before this line!
5008