xref: /openbmc/qemu/qemu-options.hx (revision 5ee5993001cf32addb86a92e2ae8cb090fbc1462)
1HXCOMM Use DEFHEADING() to define headings in both help text and texi
2HXCOMM Text between STEXI and ETEXI are copied to texi version and
3HXCOMM discarded from C version
4HXCOMM DEF(option, HAS_ARG/0, opt_enum, opt_help, arch_mask) is used to
5HXCOMM construct option structures, enums and help message for specified
6HXCOMM architectures.
7HXCOMM HXCOMM can be used for comments, discarded from both texi and C
8
9DEFHEADING(Standard options)
10STEXI
11@table @option
12ETEXI
13
14DEF("help", 0, QEMU_OPTION_h,
15    "-h or -help     display this help and exit\n", QEMU_ARCH_ALL)
16STEXI
17@item -h
18@findex -h
19Display help and exit
20ETEXI
21
22DEF("version", 0, QEMU_OPTION_version,
23    "-version        display version information and exit\n", QEMU_ARCH_ALL)
24STEXI
25@item -version
26@findex -version
27Display version information and exit
28ETEXI
29
30DEF("machine", HAS_ARG, QEMU_OPTION_machine, \
31    "-machine [type=]name[,prop[=value][,...]]\n"
32    "                selects emulated machine ('-machine help' for list)\n"
33    "                property accel=accel1[:accel2[:...]] selects accelerator\n"
34    "                supported accelerators are kvm, xen, tcg (default: tcg)\n"
35    "                kernel_irqchip=on|off|split controls accelerated irqchip support (default=off)\n"
36    "                vmport=on|off|auto controls emulation of vmport (default: auto)\n"
37    "                kvm_shadow_mem=size of KVM shadow MMU in bytes\n"
38    "                dump-guest-core=on|off include guest memory in a core dump (default=on)\n"
39    "                mem-merge=on|off controls memory merge support (default: on)\n"
40    "                igd-passthru=on|off controls IGD GFX passthrough support (default=off)\n"
41    "                aes-key-wrap=on|off controls support for AES key wrapping (default=on)\n"
42    "                dea-key-wrap=on|off controls support for DEA key wrapping (default=on)\n"
43    "                suppress-vmdesc=on|off disables self-describing migration (default=off)\n"
44    "                nvdimm=on|off controls NVDIMM support (default=off)\n"
45    "                enforce-config-section=on|off enforce configuration section migration (default=off)\n",
46    QEMU_ARCH_ALL)
47STEXI
48@item -machine [type=]@var{name}[,prop=@var{value}[,...]]
49@findex -machine
50Select the emulated machine by @var{name}. Use @code{-machine help} to list
51available machines. Supported machine properties are:
52@table @option
53@item accel=@var{accels1}[:@var{accels2}[:...]]
54This is used to enable an accelerator. Depending on the target architecture,
55kvm, xen, or tcg can be available. By default, tcg is used. If there is more
56than one accelerator specified, the next one is used if the previous one fails
57to initialize.
58@item kernel_irqchip=on|off
59Controls in-kernel irqchip support for the chosen accelerator when available.
60@item gfx_passthru=on|off
61Enables IGD GFX passthrough support for the chosen machine when available.
62@item vmport=on|off|auto
63Enables emulation of VMWare IO port, for vmmouse etc. auto says to select the
64value based on accel. For accel=xen the default is off otherwise the default
65is on.
66@item kvm_shadow_mem=size
67Defines the size of the KVM shadow MMU.
68@item dump-guest-core=on|off
69Include guest memory in a core dump. The default is on.
70@item mem-merge=on|off
71Enables or disables memory merge support. This feature, when supported by
72the host, de-duplicates identical memory pages among VMs instances
73(enabled by default).
74@item aes-key-wrap=on|off
75Enables or disables AES key wrapping support on s390-ccw hosts. This feature
76controls whether AES wrapping keys will be created to allow
77execution of AES cryptographic functions.  The default is on.
78@item dea-key-wrap=on|off
79Enables or disables DEA key wrapping support on s390-ccw hosts. This feature
80controls whether DEA wrapping keys will be created to allow
81execution of DEA cryptographic functions.  The default is on.
82@item nvdimm=on|off
83Enables or disables NVDIMM support. The default is off.
84@end table
85ETEXI
86
87HXCOMM Deprecated by -machine
88DEF("M", HAS_ARG, QEMU_OPTION_M, "", QEMU_ARCH_ALL)
89
90DEF("cpu", HAS_ARG, QEMU_OPTION_cpu,
91    "-cpu cpu        select CPU ('-cpu help' for list)\n", QEMU_ARCH_ALL)
92STEXI
93@item -cpu @var{model}
94@findex -cpu
95Select CPU model (@code{-cpu help} for list and additional feature selection)
96ETEXI
97
98DEF("accel", HAS_ARG, QEMU_OPTION_accel,
99    "-accel [accel=]accelerator[,thread=single|multi]\n"
100    "               select accelerator ('-accel help for list')\n"
101    "               thread=single|multi (enable multi-threaded TCG)", QEMU_ARCH_ALL)
102STEXI
103@item -accel @var{name}[,prop=@var{value}[,...]]
104@findex -accel
105This is used to enable an accelerator. Depending on the target architecture,
106kvm, xen, or tcg can be available. By default, tcg is used. If there is more
107than one accelerator specified, the next one is used if the previous one fails
108to initialize.
109@table @option
110@item thread=single|multi
111Controls number of TCG threads. When the TCG is multi-threaded there will be one
112thread per vCPU therefor taking advantage of additional host cores. The default
113is to enable multi-threading where both the back-end and front-ends support it and
114no incompatible TCG features have been enabled (e.g. icount/replay).
115@end table
116ETEXI
117
118DEF("smp", HAS_ARG, QEMU_OPTION_smp,
119    "-smp [cpus=]n[,maxcpus=cpus][,cores=cores][,threads=threads][,sockets=sockets]\n"
120    "                set the number of CPUs to 'n' [default=1]\n"
121    "                maxcpus= maximum number of total cpus, including\n"
122    "                offline CPUs for hotplug, etc\n"
123    "                cores= number of CPU cores on one socket\n"
124    "                threads= number of threads on one CPU core\n"
125    "                sockets= number of discrete sockets in the system\n",
126        QEMU_ARCH_ALL)
127STEXI
128@item -smp [cpus=]@var{n}[,cores=@var{cores}][,threads=@var{threads}][,sockets=@var{sockets}][,maxcpus=@var{maxcpus}]
129@findex -smp
130Simulate an SMP system with @var{n} CPUs. On the PC target, up to 255
131CPUs are supported. On Sparc32 target, Linux limits the number of usable CPUs
132to 4.
133For the PC target, the number of @var{cores} per socket, the number
134of @var{threads} per cores and the total number of @var{sockets} can be
135specified. Missing values will be computed. If any on the three values is
136given, the total number of CPUs @var{n} can be omitted. @var{maxcpus}
137specifies the maximum number of hotpluggable CPUs.
138ETEXI
139
140DEF("numa", HAS_ARG, QEMU_OPTION_numa,
141    "-numa node[,mem=size][,cpus=firstcpu[-lastcpu]][,nodeid=node]\n"
142    "-numa node[,memdev=id][,cpus=firstcpu[-lastcpu]][,nodeid=node]\n", QEMU_ARCH_ALL)
143STEXI
144@item -numa node[,mem=@var{size}][,cpus=@var{firstcpu}[-@var{lastcpu}]][,nodeid=@var{node}]
145@itemx -numa node[,memdev=@var{id}][,cpus=@var{firstcpu}[-@var{lastcpu}]][,nodeid=@var{node}]
146@findex -numa
147Define a NUMA node and assign RAM and VCPUs to it.
148
149@var{firstcpu} and @var{lastcpu} are CPU indexes. Each
150@samp{cpus} option represent a contiguous range of CPU indexes
151(or a single VCPU if @var{lastcpu} is omitted). A non-contiguous
152set of VCPUs can be represented by providing multiple @samp{cpus}
153options. If @samp{cpus} is omitted on all nodes, VCPUs are automatically
154split between them.
155
156For example, the following option assigns VCPUs 0, 1, 2 and 5 to
157a NUMA node:
158@example
159-numa node,cpus=0-2,cpus=5
160@end example
161
162@samp{mem} assigns a given RAM amount to a node. @samp{memdev}
163assigns RAM from a given memory backend device to a node. If
164@samp{mem} and @samp{memdev} are omitted in all nodes, RAM is
165split equally between them.
166
167@samp{mem} and @samp{memdev} are mutually exclusive. Furthermore,
168if one node uses @samp{memdev}, all of them have to use it.
169
170Note that the -@option{numa} option doesn't allocate any of the
171specified resources, it just assigns existing resources to NUMA
172nodes. This means that one still has to use the @option{-m},
173@option{-smp} options to allocate RAM and VCPUs respectively.
174
175ETEXI
176
177DEF("add-fd", HAS_ARG, QEMU_OPTION_add_fd,
178    "-add-fd fd=fd,set=set[,opaque=opaque]\n"
179    "                Add 'fd' to fd 'set'\n", QEMU_ARCH_ALL)
180STEXI
181@item -add-fd fd=@var{fd},set=@var{set}[,opaque=@var{opaque}]
182@findex -add-fd
183
184Add a file descriptor to an fd set.  Valid options are:
185
186@table @option
187@item fd=@var{fd}
188This option defines the file descriptor of which a duplicate is added to fd set.
189The file descriptor cannot be stdin, stdout, or stderr.
190@item set=@var{set}
191This option defines the ID of the fd set to add the file descriptor to.
192@item opaque=@var{opaque}
193This option defines a free-form string that can be used to describe @var{fd}.
194@end table
195
196You can open an image using pre-opened file descriptors from an fd set:
197@example
198qemu-system-i386
199-add-fd fd=3,set=2,opaque="rdwr:/path/to/file"
200-add-fd fd=4,set=2,opaque="rdonly:/path/to/file"
201-drive file=/dev/fdset/2,index=0,media=disk
202@end example
203ETEXI
204
205DEF("set", HAS_ARG, QEMU_OPTION_set,
206    "-set group.id.arg=value\n"
207    "                set <arg> parameter for item <id> of type <group>\n"
208    "                i.e. -set drive.$id.file=/path/to/image\n", QEMU_ARCH_ALL)
209STEXI
210@item -set @var{group}.@var{id}.@var{arg}=@var{value}
211@findex -set
212Set parameter @var{arg} for item @var{id} of type @var{group}
213ETEXI
214
215DEF("global", HAS_ARG, QEMU_OPTION_global,
216    "-global driver.property=value\n"
217    "-global driver=driver,property=property,value=value\n"
218    "                set a global default for a driver property\n",
219    QEMU_ARCH_ALL)
220STEXI
221@item -global @var{driver}.@var{prop}=@var{value}
222@itemx -global driver=@var{driver},property=@var{property},value=@var{value}
223@findex -global
224Set default value of @var{driver}'s property @var{prop} to @var{value}, e.g.:
225
226@example
227qemu-system-i386 -global ide-drive.physical_block_size=4096 -drive file=file,if=ide,index=0,media=disk
228@end example
229
230In particular, you can use this to set driver properties for devices which are
231created automatically by the machine model. To create a device which is not
232created automatically and set properties on it, use -@option{device}.
233
234-global @var{driver}.@var{prop}=@var{value} is shorthand for -global
235driver=@var{driver},property=@var{prop},value=@var{value}.  The
236longhand syntax works even when @var{driver} contains a dot.
237ETEXI
238
239DEF("boot", HAS_ARG, QEMU_OPTION_boot,
240    "-boot [order=drives][,once=drives][,menu=on|off]\n"
241    "      [,splash=sp_name][,splash-time=sp_time][,reboot-timeout=rb_time][,strict=on|off]\n"
242    "                'drives': floppy (a), hard disk (c), CD-ROM (d), network (n)\n"
243    "                'sp_name': the file's name that would be passed to bios as logo picture, if menu=on\n"
244    "                'sp_time': the period that splash picture last if menu=on, unit is ms\n"
245    "                'rb_timeout': the timeout before guest reboot when boot failed, unit is ms\n",
246    QEMU_ARCH_ALL)
247STEXI
248@item -boot [order=@var{drives}][,once=@var{drives}][,menu=on|off][,splash=@var{sp_name}][,splash-time=@var{sp_time}][,reboot-timeout=@var{rb_timeout}][,strict=on|off]
249@findex -boot
250Specify boot order @var{drives} as a string of drive letters. Valid
251drive letters depend on the target architecture. The x86 PC uses: a, b
252(floppy 1 and 2), c (first hard disk), d (first CD-ROM), n-p (Etherboot
253from network adapter 1-4), hard disk boot is the default. To apply a
254particular boot order only on the first startup, specify it via
255@option{once}.
256
257Interactive boot menus/prompts can be enabled via @option{menu=on} as far
258as firmware/BIOS supports them. The default is non-interactive boot.
259
260A splash picture could be passed to bios, enabling user to show it as logo,
261when option splash=@var{sp_name} is given and menu=on, If firmware/BIOS
262supports them. Currently Seabios for X86 system support it.
263limitation: The splash file could be a jpeg file or a BMP file in 24 BPP
264format(true color). The resolution should be supported by the SVGA mode, so
265the recommended is 320x240, 640x480, 800x640.
266
267A timeout could be passed to bios, guest will pause for @var{rb_timeout} ms
268when boot failed, then reboot. If @var{rb_timeout} is '-1', guest will not
269reboot, qemu passes '-1' to bios by default. Currently Seabios for X86
270system support it.
271
272Do strict boot via @option{strict=on} as far as firmware/BIOS
273supports it. This only effects when boot priority is changed by
274bootindex options. The default is non-strict boot.
275
276@example
277# try to boot from network first, then from hard disk
278qemu-system-i386 -boot order=nc
279# boot from CD-ROM first, switch back to default order after reboot
280qemu-system-i386 -boot once=d
281# boot with a splash picture for 5 seconds.
282qemu-system-i386 -boot menu=on,splash=/root/boot.bmp,splash-time=5000
283@end example
284
285Note: The legacy format '-boot @var{drives}' is still supported but its
286use is discouraged as it may be removed from future versions.
287ETEXI
288
289DEF("m", HAS_ARG, QEMU_OPTION_m,
290    "-m [size=]megs[,slots=n,maxmem=size]\n"
291    "                configure guest RAM\n"
292    "                size: initial amount of guest memory\n"
293    "                slots: number of hotplug slots (default: none)\n"
294    "                maxmem: maximum amount of guest memory (default: none)\n"
295    "NOTE: Some architectures might enforce a specific granularity\n",
296    QEMU_ARCH_ALL)
297STEXI
298@item -m [size=]@var{megs}[,slots=n,maxmem=size]
299@findex -m
300Sets guest startup RAM size to @var{megs} megabytes. Default is 128 MiB.
301Optionally, a suffix of ``M'' or ``G'' can be used to signify a value in
302megabytes or gigabytes respectively. Optional pair @var{slots}, @var{maxmem}
303could be used to set amount of hotpluggable memory slots and maximum amount of
304memory. Note that @var{maxmem} must be aligned to the page size.
305
306For example, the following command-line sets the guest startup RAM size to
3071GB, creates 3 slots to hotplug additional memory and sets the maximum
308memory the guest can reach to 4GB:
309
310@example
311qemu-system-x86_64 -m 1G,slots=3,maxmem=4G
312@end example
313
314If @var{slots} and @var{maxmem} are not specified, memory hotplug won't
315be enabled and the guest startup RAM will never increase.
316ETEXI
317
318DEF("mem-path", HAS_ARG, QEMU_OPTION_mempath,
319    "-mem-path FILE  provide backing storage for guest RAM\n", QEMU_ARCH_ALL)
320STEXI
321@item -mem-path @var{path}
322@findex -mem-path
323Allocate guest RAM from a temporarily created file in @var{path}.
324ETEXI
325
326DEF("mem-prealloc", 0, QEMU_OPTION_mem_prealloc,
327    "-mem-prealloc   preallocate guest memory (use with -mem-path)\n",
328    QEMU_ARCH_ALL)
329STEXI
330@item -mem-prealloc
331@findex -mem-prealloc
332Preallocate memory when using -mem-path.
333ETEXI
334
335DEF("k", HAS_ARG, QEMU_OPTION_k,
336    "-k language     use keyboard layout (for example 'fr' for French)\n",
337    QEMU_ARCH_ALL)
338STEXI
339@item -k @var{language}
340@findex -k
341Use keyboard layout @var{language} (for example @code{fr} for
342French). This option is only needed where it is not easy to get raw PC
343keycodes (e.g. on Macs, with some X11 servers or with a VNC or curses
344display). You don't normally need to use it on PC/Linux or PC/Windows
345hosts.
346
347The available layouts are:
348@example
349ar  de-ch  es  fo     fr-ca  hu  ja  mk     no  pt-br  sv
350da  en-gb  et  fr     fr-ch  is  lt  nl     pl  ru     th
351de  en-us  fi  fr-be  hr     it  lv  nl-be  pt  sl     tr
352@end example
353
354The default is @code{en-us}.
355ETEXI
356
357
358DEF("audio-help", 0, QEMU_OPTION_audio_help,
359    "-audio-help     print list of audio drivers and their options\n",
360    QEMU_ARCH_ALL)
361STEXI
362@item -audio-help
363@findex -audio-help
364Will show the audio subsystem help: list of drivers, tunable
365parameters.
366ETEXI
367
368DEF("soundhw", HAS_ARG, QEMU_OPTION_soundhw,
369    "-soundhw c1,... enable audio support\n"
370    "                and only specified sound cards (comma separated list)\n"
371    "                use '-soundhw help' to get the list of supported cards\n"
372    "                use '-soundhw all' to enable all of them\n", QEMU_ARCH_ALL)
373STEXI
374@item -soundhw @var{card1}[,@var{card2},...] or -soundhw all
375@findex -soundhw
376Enable audio and selected sound hardware. Use 'help' to print all
377available sound hardware.
378
379@example
380qemu-system-i386 -soundhw sb16,adlib disk.img
381qemu-system-i386 -soundhw es1370 disk.img
382qemu-system-i386 -soundhw ac97 disk.img
383qemu-system-i386 -soundhw hda disk.img
384qemu-system-i386 -soundhw all disk.img
385qemu-system-i386 -soundhw help
386@end example
387
388Note that Linux's i810_audio OSS kernel (for AC97) module might
389require manually specifying clocking.
390
391@example
392modprobe i810_audio clocking=48000
393@end example
394ETEXI
395
396DEF("balloon", HAS_ARG, QEMU_OPTION_balloon,
397    "-balloon none   disable balloon device\n"
398    "-balloon virtio[,addr=str]\n"
399    "                enable virtio balloon device (default)\n", QEMU_ARCH_ALL)
400STEXI
401@item -balloon none
402@findex -balloon
403Disable balloon device.
404@item -balloon virtio[,addr=@var{addr}]
405Enable virtio balloon device (default), optionally with PCI address
406@var{addr}.
407ETEXI
408
409DEF("device", HAS_ARG, QEMU_OPTION_device,
410    "-device driver[,prop[=value][,...]]\n"
411    "                add device (based on driver)\n"
412    "                prop=value,... sets driver properties\n"
413    "                use '-device help' to print all possible drivers\n"
414    "                use '-device driver,help' to print all possible properties\n",
415    QEMU_ARCH_ALL)
416STEXI
417@item -device @var{driver}[,@var{prop}[=@var{value}][,...]]
418@findex -device
419Add device @var{driver}.  @var{prop}=@var{value} sets driver
420properties.  Valid properties depend on the driver.  To get help on
421possible drivers and properties, use @code{-device help} and
422@code{-device @var{driver},help}.
423
424Some drivers are:
425@item -device ipmi-bmc-sim,id=@var{id}[,slave_addr=@var{val}]
426
427Add an IPMI BMC.  This is a simulation of a hardware management
428interface processor that normally sits on a system.  It provides
429a watchdog and the ability to reset and power control the system.
430You need to connect this to an IPMI interface to make it useful
431
432The IPMI slave address to use for the BMC.  The default is 0x20.
433This address is the BMC's address on the I2C network of management
434controllers.  If you don't know what this means, it is safe to ignore
435it.
436
437@item -device ipmi-bmc-extern,id=@var{id},chardev=@var{id}[,slave_addr=@var{val}]
438
439Add a connection to an external IPMI BMC simulator.  Instead of
440locally emulating the BMC like the above item, instead connect
441to an external entity that provides the IPMI services.
442
443A connection is made to an external BMC simulator.  If you do this, it
444is strongly recommended that you use the "reconnect=" chardev option
445to reconnect to the simulator if the connection is lost.  Note that if
446this is not used carefully, it can be a security issue, as the
447interface has the ability to send resets, NMIs, and power off the VM.
448It's best if QEMU makes a connection to an external simulator running
449on a secure port on localhost, so neither the simulator nor QEMU is
450exposed to any outside network.
451
452See the "lanserv/README.vm" file in the OpenIPMI library for more
453details on the external interface.
454
455@item -device isa-ipmi-kcs,bmc=@var{id}[,ioport=@var{val}][,irq=@var{val}]
456
457Add a KCS IPMI interafce on the ISA bus.  This also adds a
458corresponding ACPI and SMBIOS entries, if appropriate.
459
460@table @option
461@item bmc=@var{id}
462The BMC to connect to, one of ipmi-bmc-sim or ipmi-bmc-extern above.
463@item ioport=@var{val}
464Define the I/O address of the interface.  The default is 0xca0 for KCS.
465@item irq=@var{val}
466Define the interrupt to use.  The default is 5.  To disable interrupts,
467set this to 0.
468@end table
469
470@item -device isa-ipmi-bt,bmc=@var{id}[,ioport=@var{val}][,irq=@var{val}]
471
472Like the KCS interface, but defines a BT interface.  The default port is
4730xe4 and the default interrupt is 5.
474
475ETEXI
476
477DEF("name", HAS_ARG, QEMU_OPTION_name,
478    "-name string1[,process=string2][,debug-threads=on|off]\n"
479    "                set the name of the guest\n"
480    "                string1 sets the window title and string2 the process name (on Linux)\n"
481    "                When debug-threads is enabled, individual threads are given a separate name (on Linux)\n"
482    "                NOTE: The thread names are for debugging and not a stable API.\n",
483    QEMU_ARCH_ALL)
484STEXI
485@item -name @var{name}
486@findex -name
487Sets the @var{name} of the guest.
488This name will be displayed in the SDL window caption.
489The @var{name} will also be used for the VNC server.
490Also optionally set the top visible process name in Linux.
491Naming of individual threads can also be enabled on Linux to aid debugging.
492ETEXI
493
494DEF("uuid", HAS_ARG, QEMU_OPTION_uuid,
495    "-uuid %08x-%04x-%04x-%04x-%012x\n"
496    "                specify machine UUID\n", QEMU_ARCH_ALL)
497STEXI
498@item -uuid @var{uuid}
499@findex -uuid
500Set system UUID.
501ETEXI
502
503STEXI
504@end table
505ETEXI
506DEFHEADING()
507
508DEFHEADING(Block device options)
509STEXI
510@table @option
511ETEXI
512
513DEF("fda", HAS_ARG, QEMU_OPTION_fda,
514    "-fda/-fdb file  use 'file' as floppy disk 0/1 image\n", QEMU_ARCH_ALL)
515DEF("fdb", HAS_ARG, QEMU_OPTION_fdb, "", QEMU_ARCH_ALL)
516STEXI
517@item -fda @var{file}
518@itemx -fdb @var{file}
519@findex -fda
520@findex -fdb
521Use @var{file} as floppy disk 0/1 image (@pxref{disk_images}).
522ETEXI
523
524DEF("hda", HAS_ARG, QEMU_OPTION_hda,
525    "-hda/-hdb file  use 'file' as IDE hard disk 0/1 image\n", QEMU_ARCH_ALL)
526DEF("hdb", HAS_ARG, QEMU_OPTION_hdb, "", QEMU_ARCH_ALL)
527DEF("hdc", HAS_ARG, QEMU_OPTION_hdc,
528    "-hdc/-hdd file  use 'file' as IDE hard disk 2/3 image\n", QEMU_ARCH_ALL)
529DEF("hdd", HAS_ARG, QEMU_OPTION_hdd, "", QEMU_ARCH_ALL)
530STEXI
531@item -hda @var{file}
532@itemx -hdb @var{file}
533@itemx -hdc @var{file}
534@itemx -hdd @var{file}
535@findex -hda
536@findex -hdb
537@findex -hdc
538@findex -hdd
539Use @var{file} as hard disk 0, 1, 2 or 3 image (@pxref{disk_images}).
540ETEXI
541
542DEF("cdrom", HAS_ARG, QEMU_OPTION_cdrom,
543    "-cdrom file     use 'file' as IDE cdrom image (cdrom is ide1 master)\n",
544    QEMU_ARCH_ALL)
545STEXI
546@item -cdrom @var{file}
547@findex -cdrom
548Use @var{file} as CD-ROM image (you cannot use @option{-hdc} and
549@option{-cdrom} at the same time). You can use the host CD-ROM by
550using @file{/dev/cdrom} as filename (@pxref{host_drives}).
551ETEXI
552
553DEF("blockdev", HAS_ARG, QEMU_OPTION_blockdev,
554    "-blockdev [driver=]driver[,node-name=N][,discard=ignore|unmap]\n"
555    "          [,cache.direct=on|off][,cache.no-flush=on|off]\n"
556    "          [,read-only=on|off][,detect-zeroes=on|off|unmap]\n"
557    "          [,driver specific parameters...]\n"
558    "                configure a block backend\n", QEMU_ARCH_ALL)
559
560DEF("drive", HAS_ARG, QEMU_OPTION_drive,
561    "-drive [file=file][,if=type][,bus=n][,unit=m][,media=d][,index=i]\n"
562    "       [,cyls=c,heads=h,secs=s[,trans=t]][,snapshot=on|off]\n"
563    "       [,cache=writethrough|writeback|none|directsync|unsafe][,format=f]\n"
564    "       [,serial=s][,addr=A][,rerror=ignore|stop|report]\n"
565    "       [,werror=ignore|stop|report|enospc][,id=name][,aio=threads|native]\n"
566    "       [,readonly=on|off][,copy-on-read=on|off]\n"
567    "       [,discard=ignore|unmap][,detect-zeroes=on|off|unmap]\n"
568    "       [[,bps=b]|[[,bps_rd=r][,bps_wr=w]]]\n"
569    "       [[,iops=i]|[[,iops_rd=r][,iops_wr=w]]]\n"
570    "       [[,bps_max=bm]|[[,bps_rd_max=rm][,bps_wr_max=wm]]]\n"
571    "       [[,iops_max=im]|[[,iops_rd_max=irm][,iops_wr_max=iwm]]]\n"
572    "       [[,iops_size=is]]\n"
573    "       [[,group=g]]\n"
574    "                use 'file' as a drive image\n", QEMU_ARCH_ALL)
575STEXI
576@item -drive @var{option}[,@var{option}[,@var{option}[,...]]]
577@findex -drive
578
579Define a new drive. Valid options are:
580
581@table @option
582@item file=@var{file}
583This option defines which disk image (@pxref{disk_images}) to use with
584this drive. If the filename contains comma, you must double it
585(for instance, "file=my,,file" to use file "my,file").
586
587Special files such as iSCSI devices can be specified using protocol
588specific URLs. See the section for "Device URL Syntax" for more information.
589@item if=@var{interface}
590This option defines on which type on interface the drive is connected.
591Available types are: ide, scsi, sd, mtd, floppy, pflash, virtio.
592@item bus=@var{bus},unit=@var{unit}
593These options define where is connected the drive by defining the bus number and
594the unit id.
595@item index=@var{index}
596This option defines where is connected the drive by using an index in the list
597of available connectors of a given interface type.
598@item media=@var{media}
599This option defines the type of the media: disk or cdrom.
600@item cyls=@var{c},heads=@var{h},secs=@var{s}[,trans=@var{t}]
601These options have the same definition as they have in @option{-hdachs}.
602@item snapshot=@var{snapshot}
603@var{snapshot} is "on" or "off" and controls snapshot mode for the given drive
604(see @option{-snapshot}).
605@item cache=@var{cache}
606@var{cache} is "none", "writeback", "unsafe", "directsync" or "writethrough" and controls how the host cache is used to access block data.
607@item aio=@var{aio}
608@var{aio} is "threads", or "native" and selects between pthread based disk I/O and native Linux AIO.
609@item discard=@var{discard}
610@var{discard} is one of "ignore" (or "off") or "unmap" (or "on") and controls whether @dfn{discard} (also known as @dfn{trim} or @dfn{unmap}) requests are ignored or passed to the filesystem.  Some machine types may not support discard requests.
611@item format=@var{format}
612Specify which disk @var{format} will be used rather than detecting
613the format.  Can be used to specify format=raw to avoid interpreting
614an untrusted format header.
615@item serial=@var{serial}
616This option specifies the serial number to assign to the device.
617@item addr=@var{addr}
618Specify the controller's PCI address (if=virtio only).
619@item werror=@var{action},rerror=@var{action}
620Specify which @var{action} to take on write and read errors. Valid actions are:
621"ignore" (ignore the error and try to continue), "stop" (pause QEMU),
622"report" (report the error to the guest), "enospc" (pause QEMU only if the
623host disk is full; report the error to the guest otherwise).
624The default setting is @option{werror=enospc} and @option{rerror=report}.
625@item readonly
626Open drive @option{file} as read-only. Guest write attempts will fail.
627@item copy-on-read=@var{copy-on-read}
628@var{copy-on-read} is "on" or "off" and enables whether to copy read backing
629file sectors into the image file.
630@item detect-zeroes=@var{detect-zeroes}
631@var{detect-zeroes} is "off", "on" or "unmap" and enables the automatic
632conversion of plain zero writes by the OS to driver specific optimized
633zero write commands. You may even choose "unmap" if @var{discard} is set
634to "unmap" to allow a zero write to be converted to an UNMAP operation.
635@end table
636
637By default, the @option{cache=writeback} mode is used. It will report data
638writes as completed as soon as the data is present in the host page cache.
639This is safe as long as your guest OS makes sure to correctly flush disk caches
640where needed. If your guest OS does not handle volatile disk write caches
641correctly and your host crashes or loses power, then the guest may experience
642data corruption.
643
644For such guests, you should consider using @option{cache=writethrough}. This
645means that the host page cache will be used to read and write data, but write
646notification will be sent to the guest only after QEMU has made sure to flush
647each write to the disk. Be aware that this has a major impact on performance.
648
649The host page cache can be avoided entirely with @option{cache=none}.  This will
650attempt to do disk IO directly to the guest's memory.  QEMU may still perform
651an internal copy of the data. Note that this is considered a writeback mode and
652the guest OS must handle the disk write cache correctly in order to avoid data
653corruption on host crashes.
654
655The host page cache can be avoided while only sending write notifications to
656the guest when the data has been flushed to the disk using
657@option{cache=directsync}.
658
659In case you don't care about data integrity over host failures, use
660@option{cache=unsafe}. This option tells QEMU that it never needs to write any
661data to the disk but can instead keep things in cache. If anything goes wrong,
662like your host losing power, the disk storage getting disconnected accidentally,
663etc. your image will most probably be rendered unusable.   When using
664the @option{-snapshot} option, unsafe caching is always used.
665
666Copy-on-read avoids accessing the same backing file sectors repeatedly and is
667useful when the backing file is over a slow network.  By default copy-on-read
668is off.
669
670Instead of @option{-cdrom} you can use:
671@example
672qemu-system-i386 -drive file=file,index=2,media=cdrom
673@end example
674
675Instead of @option{-hda}, @option{-hdb}, @option{-hdc}, @option{-hdd}, you can
676use:
677@example
678qemu-system-i386 -drive file=file,index=0,media=disk
679qemu-system-i386 -drive file=file,index=1,media=disk
680qemu-system-i386 -drive file=file,index=2,media=disk
681qemu-system-i386 -drive file=file,index=3,media=disk
682@end example
683
684You can open an image using pre-opened file descriptors from an fd set:
685@example
686qemu-system-i386
687-add-fd fd=3,set=2,opaque="rdwr:/path/to/file"
688-add-fd fd=4,set=2,opaque="rdonly:/path/to/file"
689-drive file=/dev/fdset/2,index=0,media=disk
690@end example
691
692You can connect a CDROM to the slave of ide0:
693@example
694qemu-system-i386 -drive file=file,if=ide,index=1,media=cdrom
695@end example
696
697If you don't specify the "file=" argument, you define an empty drive:
698@example
699qemu-system-i386 -drive if=ide,index=1,media=cdrom
700@end example
701
702Instead of @option{-fda}, @option{-fdb}, you can use:
703@example
704qemu-system-i386 -drive file=file,index=0,if=floppy
705qemu-system-i386 -drive file=file,index=1,if=floppy
706@end example
707
708By default, @var{interface} is "ide" and @var{index} is automatically
709incremented:
710@example
711qemu-system-i386 -drive file=a -drive file=b"
712@end example
713is interpreted like:
714@example
715qemu-system-i386 -hda a -hdb b
716@end example
717ETEXI
718
719DEF("mtdblock", HAS_ARG, QEMU_OPTION_mtdblock,
720    "-mtdblock file  use 'file' as on-board Flash memory image\n",
721    QEMU_ARCH_ALL)
722STEXI
723@item -mtdblock @var{file}
724@findex -mtdblock
725Use @var{file} as on-board Flash memory image.
726ETEXI
727
728DEF("sd", HAS_ARG, QEMU_OPTION_sd,
729    "-sd file        use 'file' as SecureDigital card image\n", QEMU_ARCH_ALL)
730STEXI
731@item -sd @var{file}
732@findex -sd
733Use @var{file} as SecureDigital card image.
734ETEXI
735
736DEF("pflash", HAS_ARG, QEMU_OPTION_pflash,
737    "-pflash file    use 'file' as a parallel flash image\n", QEMU_ARCH_ALL)
738STEXI
739@item -pflash @var{file}
740@findex -pflash
741Use @var{file} as a parallel flash image.
742ETEXI
743
744DEF("snapshot", 0, QEMU_OPTION_snapshot,
745    "-snapshot       write to temporary files instead of disk image files\n",
746    QEMU_ARCH_ALL)
747STEXI
748@item -snapshot
749@findex -snapshot
750Write to temporary files instead of disk image files. In this case,
751the raw disk image you use is not written back. You can however force
752the write back by pressing @key{C-a s} (@pxref{disk_images}).
753ETEXI
754
755DEF("hdachs", HAS_ARG, QEMU_OPTION_hdachs, \
756    "-hdachs c,h,s[,t]\n" \
757    "                force hard disk 0 physical geometry and the optional BIOS\n" \
758    "                translation (t=none or lba) (usually QEMU can guess them)\n",
759    QEMU_ARCH_ALL)
760STEXI
761@item -hdachs @var{c},@var{h},@var{s},[,@var{t}]
762@findex -hdachs
763Force hard disk 0 physical geometry (1 <= @var{c} <= 16383, 1 <=
764@var{h} <= 16, 1 <= @var{s} <= 63) and optionally force the BIOS
765translation mode (@var{t}=none, lba or auto). Usually QEMU can guess
766all those parameters. This option is useful for old MS-DOS disk
767images.
768ETEXI
769
770DEF("fsdev", HAS_ARG, QEMU_OPTION_fsdev,
771    "-fsdev fsdriver,id=id[,path=path,][security_model={mapped-xattr|mapped-file|passthrough|none}]\n"
772    " [,writeout=immediate][,readonly][,socket=socket|sock_fd=sock_fd]\n"
773    " [[,throttling.bps-total=b]|[[,throttling.bps-read=r][,throttling.bps-write=w]]]\n"
774    " [[,throttling.iops-total=i]|[[,throttling.iops-read=r][,throttling.iops-write=w]]]\n"
775    " [[,throttling.bps-total-max=bm]|[[,throttling.bps-read-max=rm][,throttling.bps-write-max=wm]]]\n"
776    " [[,throttling.iops-total-max=im]|[[,throttling.iops-read-max=irm][,throttling.iops-write-max=iwm]]]\n"
777    " [[,throttling.iops-size=is]]\n",
778    QEMU_ARCH_ALL)
779
780STEXI
781
782@item -fsdev @var{fsdriver},id=@var{id},path=@var{path},[security_model=@var{security_model}][,writeout=@var{writeout}][,readonly][,socket=@var{socket}|sock_fd=@var{sock_fd}]
783@findex -fsdev
784Define a new file system device. Valid options are:
785@table @option
786@item @var{fsdriver}
787This option specifies the fs driver backend to use.
788Currently "local", "handle" and "proxy" file system drivers are supported.
789@item id=@var{id}
790Specifies identifier for this device
791@item path=@var{path}
792Specifies the export path for the file system device. Files under
793this path will be available to the 9p client on the guest.
794@item security_model=@var{security_model}
795Specifies the security model to be used for this export path.
796Supported security models are "passthrough", "mapped-xattr", "mapped-file" and "none".
797In "passthrough" security model, files are stored using the same
798credentials as they are created on the guest. This requires QEMU
799to run as root. In "mapped-xattr" security model, some of the file
800attributes like uid, gid, mode bits and link target are stored as
801file attributes. For "mapped-file" these attributes are stored in the
802hidden .virtfs_metadata directory. Directories exported by this security model cannot
803interact with other unix tools. "none" security model is same as
804passthrough except the sever won't report failures if it fails to
805set file attributes like ownership. Security model is mandatory
806only for local fsdriver. Other fsdrivers (like handle, proxy) don't take
807security model as a parameter.
808@item writeout=@var{writeout}
809This is an optional argument. The only supported value is "immediate".
810This means that host page cache will be used to read and write data but
811write notification will be sent to the guest only when the data has been
812reported as written by the storage subsystem.
813@item readonly
814Enables exporting 9p share as a readonly mount for guests. By default
815read-write access is given.
816@item socket=@var{socket}
817Enables proxy filesystem driver to use passed socket file for communicating
818with virtfs-proxy-helper
819@item sock_fd=@var{sock_fd}
820Enables proxy filesystem driver to use passed socket descriptor for
821communicating with virtfs-proxy-helper. Usually a helper like libvirt
822will create socketpair and pass one of the fds as sock_fd
823@end table
824
825-fsdev option is used along with -device driver "virtio-9p-pci".
826@item -device virtio-9p-pci,fsdev=@var{id},mount_tag=@var{mount_tag}
827Options for virtio-9p-pci driver are:
828@table @option
829@item fsdev=@var{id}
830Specifies the id value specified along with -fsdev option
831@item mount_tag=@var{mount_tag}
832Specifies the tag name to be used by the guest to mount this export point
833@end table
834
835ETEXI
836
837DEF("virtfs", HAS_ARG, QEMU_OPTION_virtfs,
838    "-virtfs local,path=path,mount_tag=tag,security_model=[mapped-xattr|mapped-file|passthrough|none]\n"
839    "        [,writeout=immediate][,readonly][,socket=socket|sock_fd=sock_fd]\n",
840    QEMU_ARCH_ALL)
841
842STEXI
843
844@item -virtfs @var{fsdriver}[,path=@var{path}],mount_tag=@var{mount_tag}[,security_model=@var{security_model}][,writeout=@var{writeout}][,readonly][,socket=@var{socket}|sock_fd=@var{sock_fd}]
845@findex -virtfs
846
847The general form of a Virtual File system pass-through options are:
848@table @option
849@item @var{fsdriver}
850This option specifies the fs driver backend to use.
851Currently "local", "handle" and "proxy" file system drivers are supported.
852@item id=@var{id}
853Specifies identifier for this device
854@item path=@var{path}
855Specifies the export path for the file system device. Files under
856this path will be available to the 9p client on the guest.
857@item security_model=@var{security_model}
858Specifies the security model to be used for this export path.
859Supported security models are "passthrough", "mapped-xattr", "mapped-file" and "none".
860In "passthrough" security model, files are stored using the same
861credentials as they are created on the guest. This requires QEMU
862to run as root. In "mapped-xattr" security model, some of the file
863attributes like uid, gid, mode bits and link target are stored as
864file attributes. For "mapped-file" these attributes are stored in the
865hidden .virtfs_metadata directory. Directories exported by this security model cannot
866interact with other unix tools. "none" security model is same as
867passthrough except the sever won't report failures if it fails to
868set file attributes like ownership. Security model is mandatory only
869for local fsdriver. Other fsdrivers (like handle, proxy) don't take security
870model as a parameter.
871@item writeout=@var{writeout}
872This is an optional argument. The only supported value is "immediate".
873This means that host page cache will be used to read and write data but
874write notification will be sent to the guest only when the data has been
875reported as written by the storage subsystem.
876@item readonly
877Enables exporting 9p share as a readonly mount for guests. By default
878read-write access is given.
879@item socket=@var{socket}
880Enables proxy filesystem driver to use passed socket file for
881communicating with virtfs-proxy-helper. Usually a helper like libvirt
882will create socketpair and pass one of the fds as sock_fd
883@item sock_fd
884Enables proxy filesystem driver to use passed 'sock_fd' as the socket
885descriptor for interfacing with virtfs-proxy-helper
886@end table
887ETEXI
888
889DEF("virtfs_synth", 0, QEMU_OPTION_virtfs_synth,
890    "-virtfs_synth Create synthetic file system image\n",
891    QEMU_ARCH_ALL)
892STEXI
893@item -virtfs_synth
894@findex -virtfs_synth
895Create synthetic file system image
896ETEXI
897
898STEXI
899@end table
900ETEXI
901DEFHEADING()
902
903DEFHEADING(USB options)
904STEXI
905@table @option
906ETEXI
907
908DEF("usb", 0, QEMU_OPTION_usb,
909    "-usb            enable the USB driver (will be the default soon)\n",
910    QEMU_ARCH_ALL)
911STEXI
912@item -usb
913@findex -usb
914Enable the USB driver (will be the default soon)
915ETEXI
916
917DEF("usbdevice", HAS_ARG, QEMU_OPTION_usbdevice,
918    "-usbdevice name add the host or guest USB device 'name'\n",
919    QEMU_ARCH_ALL)
920STEXI
921
922@item -usbdevice @var{devname}
923@findex -usbdevice
924Add the USB device @var{devname}. @xref{usb_devices}.
925
926@table @option
927
928@item mouse
929Virtual Mouse. This will override the PS/2 mouse emulation when activated.
930
931@item tablet
932Pointer device that uses absolute coordinates (like a touchscreen). This
933means QEMU is able to report the mouse position without having to grab the
934mouse. Also overrides the PS/2 mouse emulation when activated.
935
936@item disk:[format=@var{format}]:@var{file}
937Mass storage device based on file. The optional @var{format} argument
938will be used rather than detecting the format. Can be used to specify
939@code{format=raw} to avoid interpreting an untrusted format header.
940
941@item host:@var{bus}.@var{addr}
942Pass through the host device identified by @var{bus}.@var{addr} (Linux only).
943
944@item host:@var{vendor_id}:@var{product_id}
945Pass through the host device identified by @var{vendor_id}:@var{product_id}
946(Linux only).
947
948@item serial:[vendorid=@var{vendor_id}][,productid=@var{product_id}]:@var{dev}
949Serial converter to host character device @var{dev}, see @code{-serial} for the
950available devices.
951
952@item braille
953Braille device.  This will use BrlAPI to display the braille output on a real
954or fake device.
955
956@item net:@var{options}
957Network adapter that supports CDC ethernet and RNDIS protocols.
958
959@end table
960ETEXI
961
962STEXI
963@end table
964ETEXI
965DEFHEADING()
966
967DEFHEADING(Display options)
968STEXI
969@table @option
970ETEXI
971
972DEF("display", HAS_ARG, QEMU_OPTION_display,
973    "-display sdl[,frame=on|off][,alt_grab=on|off][,ctrl_grab=on|off]\n"
974    "            [,window_close=on|off][,gl=on|off]\n"
975    "-display gtk[,grab_on_hover=on|off][,gl=on|off]|\n"
976    "-display vnc=<display>[,<optargs>]\n"
977    "-display curses\n"
978    "-display none"
979    "                select display type\n"
980    "The default display is equivalent to\n"
981#if defined(CONFIG_GTK)
982            "\t\"-display gtk\"\n"
983#elif defined(CONFIG_SDL)
984            "\t\"-display sdl\"\n"
985#elif defined(CONFIG_COCOA)
986            "\t\"-display cocoa\"\n"
987#elif defined(CONFIG_VNC)
988            "\t\"-vnc localhost:0,to=99,id=default\"\n"
989#else
990            "\t\"-display none\"\n"
991#endif
992    , QEMU_ARCH_ALL)
993STEXI
994@item -display @var{type}
995@findex -display
996Select type of display to use. This option is a replacement for the
997old style -sdl/-curses/... options. Valid values for @var{type} are
998@table @option
999@item sdl
1000Display video output via SDL (usually in a separate graphics
1001window; see the SDL documentation for other possibilities).
1002@item curses
1003Display video output via curses. For graphics device models which
1004support a text mode, QEMU can display this output using a
1005curses/ncurses interface. Nothing is displayed when the graphics
1006device is in graphical mode or if the graphics device does not support
1007a text mode. Generally only the VGA device models support text mode.
1008@item none
1009Do not display video output. The guest will still see an emulated
1010graphics card, but its output will not be displayed to the QEMU
1011user. This option differs from the -nographic option in that it
1012only affects what is done with video output; -nographic also changes
1013the destination of the serial and parallel port data.
1014@item gtk
1015Display video output in a GTK window. This interface provides drop-down
1016menus and other UI elements to configure and control the VM during
1017runtime.
1018@item vnc
1019Start a VNC server on display <arg>
1020@end table
1021ETEXI
1022
1023DEF("nographic", 0, QEMU_OPTION_nographic,
1024    "-nographic      disable graphical output and redirect serial I/Os to console\n",
1025    QEMU_ARCH_ALL)
1026STEXI
1027@item -nographic
1028@findex -nographic
1029Normally, if QEMU is compiled with graphical window support, it displays
1030output such as guest graphics, guest console, and the QEMU monitor in a
1031window. With this option, you can totally disable graphical output so
1032that QEMU is a simple command line application. The emulated serial port
1033is redirected on the console and muxed with the monitor (unless
1034redirected elsewhere explicitly). Therefore, you can still use QEMU to
1035debug a Linux kernel with a serial console. Use @key{C-a h} for help on
1036switching between the console and monitor.
1037ETEXI
1038
1039DEF("curses", 0, QEMU_OPTION_curses,
1040    "-curses         shorthand for -display curses\n",
1041    QEMU_ARCH_ALL)
1042STEXI
1043@item -curses
1044@findex -curses
1045Normally, if QEMU is compiled with graphical window support, it displays
1046output such as guest graphics, guest console, and the QEMU monitor in a
1047window. With this option, QEMU can display the VGA output when in text
1048mode using a curses/ncurses interface. Nothing is displayed in graphical
1049mode.
1050ETEXI
1051
1052DEF("no-frame", 0, QEMU_OPTION_no_frame,
1053    "-no-frame       open SDL window without a frame and window decorations\n",
1054    QEMU_ARCH_ALL)
1055STEXI
1056@item -no-frame
1057@findex -no-frame
1058Do not use decorations for SDL windows and start them using the whole
1059available screen space. This makes the using QEMU in a dedicated desktop
1060workspace more convenient.
1061ETEXI
1062
1063DEF("alt-grab", 0, QEMU_OPTION_alt_grab,
1064    "-alt-grab       use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt)\n",
1065    QEMU_ARCH_ALL)
1066STEXI
1067@item -alt-grab
1068@findex -alt-grab
1069Use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt). Note that this also
1070affects the special keys (for fullscreen, monitor-mode switching, etc).
1071ETEXI
1072
1073DEF("ctrl-grab", 0, QEMU_OPTION_ctrl_grab,
1074    "-ctrl-grab      use Right-Ctrl to grab mouse (instead of Ctrl-Alt)\n",
1075    QEMU_ARCH_ALL)
1076STEXI
1077@item -ctrl-grab
1078@findex -ctrl-grab
1079Use Right-Ctrl to grab mouse (instead of Ctrl-Alt). Note that this also
1080affects the special keys (for fullscreen, monitor-mode switching, etc).
1081ETEXI
1082
1083DEF("no-quit", 0, QEMU_OPTION_no_quit,
1084    "-no-quit        disable SDL window close capability\n", QEMU_ARCH_ALL)
1085STEXI
1086@item -no-quit
1087@findex -no-quit
1088Disable SDL window close capability.
1089ETEXI
1090
1091DEF("sdl", 0, QEMU_OPTION_sdl,
1092    "-sdl            shorthand for -display sdl\n", QEMU_ARCH_ALL)
1093STEXI
1094@item -sdl
1095@findex -sdl
1096Enable SDL.
1097ETEXI
1098
1099DEF("spice", HAS_ARG, QEMU_OPTION_spice,
1100    "-spice [port=port][,tls-port=secured-port][,x509-dir=<dir>]\n"
1101    "       [,x509-key-file=<file>][,x509-key-password=<file>]\n"
1102    "       [,x509-cert-file=<file>][,x509-cacert-file=<file>]\n"
1103    "       [,x509-dh-key-file=<file>][,addr=addr][,ipv4|ipv6|unix]\n"
1104    "       [,tls-ciphers=<list>]\n"
1105    "       [,tls-channel=[main|display|cursor|inputs|record|playback]]\n"
1106    "       [,plaintext-channel=[main|display|cursor|inputs|record|playback]]\n"
1107    "       [,sasl][,password=<secret>][,disable-ticketing]\n"
1108    "       [,image-compression=[auto_glz|auto_lz|quic|glz|lz|off]]\n"
1109    "       [,jpeg-wan-compression=[auto|never|always]]\n"
1110    "       [,zlib-glz-wan-compression=[auto|never|always]]\n"
1111    "       [,streaming-video=[off|all|filter]][,disable-copy-paste]\n"
1112    "       [,disable-agent-file-xfer][,agent-mouse=[on|off]]\n"
1113    "       [,playback-compression=[on|off]][,seamless-migration=[on|off]]\n"
1114    "       [,gl=[on|off]][,rendernode=<file>]\n"
1115    "   enable spice\n"
1116    "   at least one of {port, tls-port} is mandatory\n",
1117    QEMU_ARCH_ALL)
1118STEXI
1119@item -spice @var{option}[,@var{option}[,...]]
1120@findex -spice
1121Enable the spice remote desktop protocol. Valid options are
1122
1123@table @option
1124
1125@item port=<nr>
1126Set the TCP port spice is listening on for plaintext channels.
1127
1128@item addr=<addr>
1129Set the IP address spice is listening on.  Default is any address.
1130
1131@item ipv4
1132@itemx ipv6
1133@itemx unix
1134Force using the specified IP version.
1135
1136@item password=<secret>
1137Set the password you need to authenticate.
1138
1139@item sasl
1140Require that the client use SASL to authenticate with the spice.
1141The exact choice of authentication method used is controlled from the
1142system / user's SASL configuration file for the 'qemu' service. This
1143is typically found in /etc/sasl2/qemu.conf. If running QEMU as an
1144unprivileged user, an environment variable SASL_CONF_PATH can be used
1145to make it search alternate locations for the service config.
1146While some SASL auth methods can also provide data encryption (eg GSSAPI),
1147it is recommended that SASL always be combined with the 'tls' and
1148'x509' settings to enable use of SSL and server certificates. This
1149ensures a data encryption preventing compromise of authentication
1150credentials.
1151
1152@item disable-ticketing
1153Allow client connects without authentication.
1154
1155@item disable-copy-paste
1156Disable copy paste between the client and the guest.
1157
1158@item disable-agent-file-xfer
1159Disable spice-vdagent based file-xfer between the client and the guest.
1160
1161@item tls-port=<nr>
1162Set the TCP port spice is listening on for encrypted channels.
1163
1164@item x509-dir=<dir>
1165Set the x509 file directory. Expects same filenames as -vnc $display,x509=$dir
1166
1167@item x509-key-file=<file>
1168@itemx x509-key-password=<file>
1169@itemx x509-cert-file=<file>
1170@itemx x509-cacert-file=<file>
1171@itemx x509-dh-key-file=<file>
1172The x509 file names can also be configured individually.
1173
1174@item tls-ciphers=<list>
1175Specify which ciphers to use.
1176
1177@item tls-channel=[main|display|cursor|inputs|record|playback]
1178@itemx plaintext-channel=[main|display|cursor|inputs|record|playback]
1179Force specific channel to be used with or without TLS encryption.  The
1180options can be specified multiple times to configure multiple
1181channels.  The special name "default" can be used to set the default
1182mode.  For channels which are not explicitly forced into one mode the
1183spice client is allowed to pick tls/plaintext as he pleases.
1184
1185@item image-compression=[auto_glz|auto_lz|quic|glz|lz|off]
1186Configure image compression (lossless).
1187Default is auto_glz.
1188
1189@item jpeg-wan-compression=[auto|never|always]
1190@itemx zlib-glz-wan-compression=[auto|never|always]
1191Configure wan image compression (lossy for slow links).
1192Default is auto.
1193
1194@item streaming-video=[off|all|filter]
1195Configure video stream detection.  Default is off.
1196
1197@item agent-mouse=[on|off]
1198Enable/disable passing mouse events via vdagent.  Default is on.
1199
1200@item playback-compression=[on|off]
1201Enable/disable audio stream compression (using celt 0.5.1).  Default is on.
1202
1203@item seamless-migration=[on|off]
1204Enable/disable spice seamless migration. Default is off.
1205
1206@item gl=[on|off]
1207Enable/disable OpenGL context. Default is off.
1208
1209@item rendernode=<file>
1210DRM render node for OpenGL rendering. If not specified, it will pick
1211the first available. (Since 2.9)
1212
1213@end table
1214ETEXI
1215
1216DEF("portrait", 0, QEMU_OPTION_portrait,
1217    "-portrait       rotate graphical output 90 deg left (only PXA LCD)\n",
1218    QEMU_ARCH_ALL)
1219STEXI
1220@item -portrait
1221@findex -portrait
1222Rotate graphical output 90 deg left (only PXA LCD).
1223ETEXI
1224
1225DEF("rotate", HAS_ARG, QEMU_OPTION_rotate,
1226    "-rotate <deg>   rotate graphical output some deg left (only PXA LCD)\n",
1227    QEMU_ARCH_ALL)
1228STEXI
1229@item -rotate @var{deg}
1230@findex -rotate
1231Rotate graphical output some deg left (only PXA LCD).
1232ETEXI
1233
1234DEF("vga", HAS_ARG, QEMU_OPTION_vga,
1235    "-vga [std|cirrus|vmware|qxl|xenfb|tcx|cg3|virtio|none]\n"
1236    "                select video card type\n", QEMU_ARCH_ALL)
1237STEXI
1238@item -vga @var{type}
1239@findex -vga
1240Select type of VGA card to emulate. Valid values for @var{type} are
1241@table @option
1242@item cirrus
1243Cirrus Logic GD5446 Video card. All Windows versions starting from
1244Windows 95 should recognize and use this graphic card. For optimal
1245performances, use 16 bit color depth in the guest and the host OS.
1246(This card was the default before QEMU 2.2)
1247@item std
1248Standard VGA card with Bochs VBE extensions.  If your guest OS
1249supports the VESA 2.0 VBE extensions (e.g. Windows XP) and if you want
1250to use high resolution modes (>= 1280x1024x16) then you should use
1251this option. (This card is the default since QEMU 2.2)
1252@item vmware
1253VMWare SVGA-II compatible adapter. Use it if you have sufficiently
1254recent XFree86/XOrg server or Windows guest with a driver for this
1255card.
1256@item qxl
1257QXL paravirtual graphic card.  It is VGA compatible (including VESA
12582.0 VBE support).  Works best with qxl guest drivers installed though.
1259Recommended choice when using the spice protocol.
1260@item tcx
1261(sun4m only) Sun TCX framebuffer. This is the default framebuffer for
1262sun4m machines and offers both 8-bit and 24-bit colour depths at a
1263fixed resolution of 1024x768.
1264@item cg3
1265(sun4m only) Sun cgthree framebuffer. This is a simple 8-bit framebuffer
1266for sun4m machines available in both 1024x768 (OpenBIOS) and 1152x900 (OBP)
1267resolutions aimed at people wishing to run older Solaris versions.
1268@item virtio
1269Virtio VGA card.
1270@item none
1271Disable VGA card.
1272@end table
1273ETEXI
1274
1275DEF("full-screen", 0, QEMU_OPTION_full_screen,
1276    "-full-screen    start in full screen\n", QEMU_ARCH_ALL)
1277STEXI
1278@item -full-screen
1279@findex -full-screen
1280Start in full screen.
1281ETEXI
1282
1283DEF("g", 1, QEMU_OPTION_g ,
1284    "-g WxH[xDEPTH]  Set the initial graphical resolution and depth\n",
1285    QEMU_ARCH_PPC | QEMU_ARCH_SPARC)
1286STEXI
1287@item -g @var{width}x@var{height}[x@var{depth}]
1288@findex -g
1289Set the initial graphical resolution and depth (PPC, SPARC only).
1290ETEXI
1291
1292DEF("vnc", HAS_ARG, QEMU_OPTION_vnc ,
1293    "-vnc <display>  shorthand for -display vnc=<display>\n", QEMU_ARCH_ALL)
1294STEXI
1295@item -vnc @var{display}[,@var{option}[,@var{option}[,...]]]
1296@findex -vnc
1297Normally, if QEMU is compiled with graphical window support, it displays
1298output such as guest graphics, guest console, and the QEMU monitor in a
1299window. With this option, you can have QEMU listen on VNC display
1300@var{display} and redirect the VGA display over the VNC session. It is
1301very useful to enable the usb tablet device when using this option
1302(option @option{-usbdevice tablet}). When using the VNC display, you
1303must use the @option{-k} parameter to set the keyboard layout if you are
1304not using en-us. Valid syntax for the @var{display} is
1305
1306@table @option
1307
1308@item to=@var{L}
1309
1310With this option, QEMU will try next available VNC @var{display}s, until the
1311number @var{L}, if the origianlly defined "-vnc @var{display}" is not
1312available, e.g. port 5900+@var{display} is already used by another
1313application. By default, to=0.
1314
1315@item @var{host}:@var{d}
1316
1317TCP connections will only be allowed from @var{host} on display @var{d}.
1318By convention the TCP port is 5900+@var{d}. Optionally, @var{host} can
1319be omitted in which case the server will accept connections from any host.
1320
1321@item unix:@var{path}
1322
1323Connections will be allowed over UNIX domain sockets where @var{path} is the
1324location of a unix socket to listen for connections on.
1325
1326@item none
1327
1328VNC is initialized but not started. The monitor @code{change} command
1329can be used to later start the VNC server.
1330
1331@end table
1332
1333Following the @var{display} value there may be one or more @var{option} flags
1334separated by commas. Valid options are
1335
1336@table @option
1337
1338@item reverse
1339
1340Connect to a listening VNC client via a ``reverse'' connection. The
1341client is specified by the @var{display}. For reverse network
1342connections (@var{host}:@var{d},@code{reverse}), the @var{d} argument
1343is a TCP port number, not a display number.
1344
1345@item websocket
1346
1347Opens an additional TCP listening port dedicated to VNC Websocket connections.
1348If a bare @var{websocket} option is given, the Websocket port is
13495700+@var{display}. An alternative port can be specified with the
1350syntax @code{websocket}=@var{port}.
1351
1352If @var{host} is specified connections will only be allowed from this host.
1353It is possible to control the websocket listen address independently, using
1354the syntax @code{websocket}=@var{host}:@var{port}.
1355
1356If no TLS credentials are provided, the websocket connection runs in
1357unencrypted mode. If TLS credentials are provided, the websocket connection
1358requires encrypted client connections.
1359
1360@item password
1361
1362Require that password based authentication is used for client connections.
1363
1364The password must be set separately using the @code{set_password} command in
1365the @ref{pcsys_monitor}. The syntax to change your password is:
1366@code{set_password <protocol> <password>} where <protocol> could be either
1367"vnc" or "spice".
1368
1369If you would like to change <protocol> password expiration, you should use
1370@code{expire_password <protocol> <expiration-time>} where expiration time could
1371be one of the following options: now, never, +seconds or UNIX time of
1372expiration, e.g. +60 to make password expire in 60 seconds, or 1335196800
1373to make password expire on "Mon Apr 23 12:00:00 EDT 2012" (UNIX time for this
1374date and time).
1375
1376You can also use keywords "now" or "never" for the expiration time to
1377allow <protocol> password to expire immediately or never expire.
1378
1379@item tls-creds=@var{ID}
1380
1381Provides the ID of a set of TLS credentials to use to secure the
1382VNC server. They will apply to both the normal VNC server socket
1383and the websocket socket (if enabled). Setting TLS credentials
1384will cause the VNC server socket to enable the VeNCrypt auth
1385mechanism.  The credentials should have been previously created
1386using the @option{-object tls-creds} argument.
1387
1388The @option{tls-creds} parameter obsoletes the @option{tls},
1389@option{x509}, and @option{x509verify} options, and as such
1390it is not permitted to set both new and old type options at
1391the same time.
1392
1393@item tls
1394
1395Require that client use TLS when communicating with the VNC server. This
1396uses anonymous TLS credentials so is susceptible to a man-in-the-middle
1397attack. It is recommended that this option be combined with either the
1398@option{x509} or @option{x509verify} options.
1399
1400This option is now deprecated in favor of using the @option{tls-creds}
1401argument.
1402
1403@item x509=@var{/path/to/certificate/dir}
1404
1405Valid if @option{tls} is specified. Require that x509 credentials are used
1406for negotiating the TLS session. The server will send its x509 certificate
1407to the client. It is recommended that a password be set on the VNC server
1408to provide authentication of the client when this is used. The path following
1409this option specifies where the x509 certificates are to be loaded from.
1410See the @ref{vnc_security} section for details on generating certificates.
1411
1412This option is now deprecated in favour of using the @option{tls-creds}
1413argument.
1414
1415@item x509verify=@var{/path/to/certificate/dir}
1416
1417Valid if @option{tls} is specified. Require that x509 credentials are used
1418for negotiating the TLS session. The server will send its x509 certificate
1419to the client, and request that the client send its own x509 certificate.
1420The server will validate the client's certificate against the CA certificate,
1421and reject clients when validation fails. If the certificate authority is
1422trusted, this is a sufficient authentication mechanism. You may still wish
1423to set a password on the VNC server as a second authentication layer. The
1424path following this option specifies where the x509 certificates are to
1425be loaded from. See the @ref{vnc_security} section for details on generating
1426certificates.
1427
1428This option is now deprecated in favour of using the @option{tls-creds}
1429argument.
1430
1431@item sasl
1432
1433Require that the client use SASL to authenticate with the VNC server.
1434The exact choice of authentication method used is controlled from the
1435system / user's SASL configuration file for the 'qemu' service. This
1436is typically found in /etc/sasl2/qemu.conf. If running QEMU as an
1437unprivileged user, an environment variable SASL_CONF_PATH can be used
1438to make it search alternate locations for the service config.
1439While some SASL auth methods can also provide data encryption (eg GSSAPI),
1440it is recommended that SASL always be combined with the 'tls' and
1441'x509' settings to enable use of SSL and server certificates. This
1442ensures a data encryption preventing compromise of authentication
1443credentials. See the @ref{vnc_security} section for details on using
1444SASL authentication.
1445
1446@item acl
1447
1448Turn on access control lists for checking of the x509 client certificate
1449and SASL party. For x509 certs, the ACL check is made against the
1450certificate's distinguished name. This is something that looks like
1451@code{C=GB,O=ACME,L=Boston,CN=bob}. For SASL party, the ACL check is
1452made against the username, which depending on the SASL plugin, may
1453include a realm component, eg @code{bob} or @code{bob@@EXAMPLE.COM}.
1454When the @option{acl} flag is set, the initial access list will be
1455empty, with a @code{deny} policy. Thus no one will be allowed to
1456use the VNC server until the ACLs have been loaded. This can be
1457achieved using the @code{acl} monitor command.
1458
1459@item lossy
1460
1461Enable lossy compression methods (gradient, JPEG, ...). If this
1462option is set, VNC client may receive lossy framebuffer updates
1463depending on its encoding settings. Enabling this option can save
1464a lot of bandwidth at the expense of quality.
1465
1466@item non-adaptive
1467
1468Disable adaptive encodings. Adaptive encodings are enabled by default.
1469An adaptive encoding will try to detect frequently updated screen regions,
1470and send updates in these regions using a lossy encoding (like JPEG).
1471This can be really helpful to save bandwidth when playing videos. Disabling
1472adaptive encodings restores the original static behavior of encodings
1473like Tight.
1474
1475@item share=[allow-exclusive|force-shared|ignore]
1476
1477Set display sharing policy.  'allow-exclusive' allows clients to ask
1478for exclusive access.  As suggested by the rfb spec this is
1479implemented by dropping other connections.  Connecting multiple
1480clients in parallel requires all clients asking for a shared session
1481(vncviewer: -shared switch).  This is the default.  'force-shared'
1482disables exclusive client access.  Useful for shared desktop sessions,
1483where you don't want someone forgetting specify -shared disconnect
1484everybody else.  'ignore' completely ignores the shared flag and
1485allows everybody connect unconditionally.  Doesn't conform to the rfb
1486spec but is traditional QEMU behavior.
1487
1488@item key-delay-ms
1489
1490Set keyboard delay, for key down and key up events, in milliseconds.
1491Default is 1.  Keyboards are low-bandwidth devices, so this slowdown
1492can help the device and guest to keep up and not lose events in case
1493events are arriving in bulk.  Possible causes for the latter are flaky
1494network connections, or scripts for automated testing.
1495
1496@end table
1497ETEXI
1498
1499STEXI
1500@end table
1501ETEXI
1502ARCHHEADING(, QEMU_ARCH_I386)
1503
1504ARCHHEADING(i386 target only, QEMU_ARCH_I386)
1505STEXI
1506@table @option
1507ETEXI
1508
1509DEF("win2k-hack", 0, QEMU_OPTION_win2k_hack,
1510    "-win2k-hack     use it when installing Windows 2000 to avoid a disk full bug\n",
1511    QEMU_ARCH_I386)
1512STEXI
1513@item -win2k-hack
1514@findex -win2k-hack
1515Use it when installing Windows 2000 to avoid a disk full bug. After
1516Windows 2000 is installed, you no longer need this option (this option
1517slows down the IDE transfers).
1518ETEXI
1519
1520HXCOMM Deprecated by -rtc
1521DEF("rtc-td-hack", 0, QEMU_OPTION_rtc_td_hack, "", QEMU_ARCH_I386)
1522
1523DEF("no-fd-bootchk", 0, QEMU_OPTION_no_fd_bootchk,
1524    "-no-fd-bootchk  disable boot signature checking for floppy disks\n",
1525    QEMU_ARCH_I386)
1526STEXI
1527@item -no-fd-bootchk
1528@findex -no-fd-bootchk
1529Disable boot signature checking for floppy disks in BIOS. May
1530be needed to boot from old floppy disks.
1531ETEXI
1532
1533DEF("no-acpi", 0, QEMU_OPTION_no_acpi,
1534           "-no-acpi        disable ACPI\n", QEMU_ARCH_I386 | QEMU_ARCH_ARM)
1535STEXI
1536@item -no-acpi
1537@findex -no-acpi
1538Disable ACPI (Advanced Configuration and Power Interface) support. Use
1539it if your guest OS complains about ACPI problems (PC target machine
1540only).
1541ETEXI
1542
1543DEF("no-hpet", 0, QEMU_OPTION_no_hpet,
1544    "-no-hpet        disable HPET\n", QEMU_ARCH_I386)
1545STEXI
1546@item -no-hpet
1547@findex -no-hpet
1548Disable HPET support.
1549ETEXI
1550
1551DEF("acpitable", HAS_ARG, QEMU_OPTION_acpitable,
1552    "-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"
1553    "                ACPI table description\n", QEMU_ARCH_I386)
1554STEXI
1555@item -acpitable [sig=@var{str}][,rev=@var{n}][,oem_id=@var{str}][,oem_table_id=@var{str}][,oem_rev=@var{n}] [,asl_compiler_id=@var{str}][,asl_compiler_rev=@var{n}][,data=@var{file1}[:@var{file2}]...]
1556@findex -acpitable
1557Add ACPI table with specified header fields and context from specified files.
1558For file=, take whole ACPI table from the specified files, including all
1559ACPI headers (possible overridden by other options).
1560For data=, only data
1561portion of the table is used, all header information is specified in the
1562command line.
1563If a SLIC table is supplied to QEMU, then the SLIC's oem_id and oem_table_id
1564fields will override the same in the RSDT and the FADT (a.k.a. FACP), in order
1565to ensure the field matches required by the Microsoft SLIC spec and the ACPI
1566spec.
1567ETEXI
1568
1569DEF("smbios", HAS_ARG, QEMU_OPTION_smbios,
1570    "-smbios file=binary\n"
1571    "                load SMBIOS entry from binary file\n"
1572    "-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]\n"
1573    "              [,uefi=on|off]\n"
1574    "                specify SMBIOS type 0 fields\n"
1575    "-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]\n"
1576    "              [,uuid=uuid][,sku=str][,family=str]\n"
1577    "                specify SMBIOS type 1 fields\n"
1578    "-smbios type=2[,manufacturer=str][,product=str][,version=str][,serial=str]\n"
1579    "              [,asset=str][,location=str]\n"
1580    "                specify SMBIOS type 2 fields\n"
1581    "-smbios type=3[,manufacturer=str][,version=str][,serial=str][,asset=str]\n"
1582    "              [,sku=str]\n"
1583    "                specify SMBIOS type 3 fields\n"
1584    "-smbios type=4[,sock_pfx=str][,manufacturer=str][,version=str][,serial=str]\n"
1585    "              [,asset=str][,part=str]\n"
1586    "                specify SMBIOS type 4 fields\n"
1587    "-smbios type=17[,loc_pfx=str][,bank=str][,manufacturer=str][,serial=str]\n"
1588    "               [,asset=str][,part=str][,speed=%d]\n"
1589    "                specify SMBIOS type 17 fields\n",
1590    QEMU_ARCH_I386 | QEMU_ARCH_ARM)
1591STEXI
1592@item -smbios file=@var{binary}
1593@findex -smbios
1594Load SMBIOS entry from binary file.
1595
1596@item -smbios type=0[,vendor=@var{str}][,version=@var{str}][,date=@var{str}][,release=@var{%d.%d}][,uefi=on|off]
1597Specify SMBIOS type 0 fields
1598
1599@item -smbios type=1[,manufacturer=@var{str}][,product=@var{str}][,version=@var{str}][,serial=@var{str}][,uuid=@var{uuid}][,sku=@var{str}][,family=@var{str}]
1600Specify SMBIOS type 1 fields
1601
1602@item -smbios type=2[,manufacturer=@var{str}][,product=@var{str}][,version=@var{str}][,serial=@var{str}][,asset=@var{str}][,location=@var{str}][,family=@var{str}]
1603Specify SMBIOS type 2 fields
1604
1605@item -smbios type=3[,manufacturer=@var{str}][,version=@var{str}][,serial=@var{str}][,asset=@var{str}][,sku=@var{str}]
1606Specify SMBIOS type 3 fields
1607
1608@item -smbios type=4[,sock_pfx=@var{str}][,manufacturer=@var{str}][,version=@var{str}][,serial=@var{str}][,asset=@var{str}][,part=@var{str}]
1609Specify SMBIOS type 4 fields
1610
1611@item -smbios type=17[,loc_pfx=@var{str}][,bank=@var{str}][,manufacturer=@var{str}][,serial=@var{str}][,asset=@var{str}][,part=@var{str}][,speed=@var{%d}]
1612Specify SMBIOS type 17 fields
1613ETEXI
1614
1615STEXI
1616@end table
1617ETEXI
1618DEFHEADING()
1619
1620DEFHEADING(Network options)
1621STEXI
1622@table @option
1623ETEXI
1624
1625HXCOMM Legacy slirp options (now moved to -net user):
1626#ifdef CONFIG_SLIRP
1627DEF("tftp", HAS_ARG, QEMU_OPTION_tftp, "", QEMU_ARCH_ALL)
1628DEF("bootp", HAS_ARG, QEMU_OPTION_bootp, "", QEMU_ARCH_ALL)
1629DEF("redir", HAS_ARG, QEMU_OPTION_redir, "", QEMU_ARCH_ALL)
1630#ifndef _WIN32
1631DEF("smb", HAS_ARG, QEMU_OPTION_smb, "", QEMU_ARCH_ALL)
1632#endif
1633#endif
1634
1635DEF("netdev", HAS_ARG, QEMU_OPTION_netdev,
1636#ifdef CONFIG_SLIRP
1637    "-netdev user,id=str[,ipv4[=on|off]][,net=addr[/mask]][,host=addr]\n"
1638    "         [,ipv6[=on|off]][,ipv6-net=addr[/int]][,ipv6-host=addr]\n"
1639    "         [,restrict=on|off][,hostname=host][,dhcpstart=addr]\n"
1640    "         [,dns=addr][,ipv6-dns=addr][,dnssearch=domain][,tftp=dir]\n"
1641    "         [,bootfile=f][,hostfwd=rule][,guestfwd=rule]"
1642#ifndef _WIN32
1643                                             "[,smb=dir[,smbserver=addr]]\n"
1644#endif
1645    "                configure a user mode network backend with ID 'str',\n"
1646    "                its DHCP server and optional services\n"
1647#endif
1648#ifdef _WIN32
1649    "-netdev tap,id=str,ifname=name\n"
1650    "                configure a host TAP network backend with ID 'str'\n"
1651#else
1652    "-netdev tap,id=str[,fd=h][,fds=x:y:...:z][,ifname=name][,script=file][,downscript=dfile]\n"
1653    "         [,br=bridge][,helper=helper][,sndbuf=nbytes][,vnet_hdr=on|off][,vhost=on|off]\n"
1654    "         [,vhostfd=h][,vhostfds=x:y:...:z][,vhostforce=on|off][,queues=n]\n"
1655    "         [,poll-us=n]\n"
1656    "                configure a host TAP network backend with ID 'str'\n"
1657    "                connected to a bridge (default=" DEFAULT_BRIDGE_INTERFACE ")\n"
1658    "                use network scripts 'file' (default=" DEFAULT_NETWORK_SCRIPT ")\n"
1659    "                to configure it and 'dfile' (default=" DEFAULT_NETWORK_DOWN_SCRIPT ")\n"
1660    "                to deconfigure it\n"
1661    "                use '[down]script=no' to disable script execution\n"
1662    "                use network helper 'helper' (default=" DEFAULT_BRIDGE_HELPER ") to\n"
1663    "                configure it\n"
1664    "                use 'fd=h' to connect to an already opened TAP interface\n"
1665    "                use 'fds=x:y:...:z' to connect to already opened multiqueue capable TAP interfaces\n"
1666    "                use 'sndbuf=nbytes' to limit the size of the send buffer (the\n"
1667    "                default is disabled 'sndbuf=0' to enable flow control set 'sndbuf=1048576')\n"
1668    "                use vnet_hdr=off to avoid enabling the IFF_VNET_HDR tap flag\n"
1669    "                use vnet_hdr=on to make the lack of IFF_VNET_HDR support an error condition\n"
1670    "                use vhost=on to enable experimental in kernel accelerator\n"
1671    "                    (only has effect for virtio guests which use MSIX)\n"
1672    "                use vhostforce=on to force vhost on for non-MSIX virtio guests\n"
1673    "                use 'vhostfd=h' to connect to an already opened vhost net device\n"
1674    "                use 'vhostfds=x:y:...:z to connect to multiple already opened vhost net devices\n"
1675    "                use 'queues=n' to specify the number of queues to be created for multiqueue TAP\n"
1676    "                use 'poll-us=n' to speciy the maximum number of microseconds that could be\n"
1677    "                spent on busy polling for vhost net\n"
1678    "-netdev bridge,id=str[,br=bridge][,helper=helper]\n"
1679    "                configure a host TAP network backend with ID 'str' that is\n"
1680    "                connected to a bridge (default=" DEFAULT_BRIDGE_INTERFACE ")\n"
1681    "                using the program 'helper (default=" DEFAULT_BRIDGE_HELPER ")\n"
1682#endif
1683#ifdef __linux__
1684    "-netdev l2tpv3,id=str,src=srcaddr,dst=dstaddr[,srcport=srcport][,dstport=dstport]\n"
1685    "         [,rxsession=rxsession],txsession=txsession[,ipv6=on/off][,udp=on/off]\n"
1686    "         [,cookie64=on/off][,counter][,pincounter][,txcookie=txcookie]\n"
1687    "         [,rxcookie=rxcookie][,offset=offset]\n"
1688    "                configure a network backend with ID 'str' connected to\n"
1689    "                an Ethernet over L2TPv3 pseudowire.\n"
1690    "                Linux kernel 3.3+ as well as most routers can talk\n"
1691    "                L2TPv3. This transport allows connecting a VM to a VM,\n"
1692    "                VM to a router and even VM to Host. It is a nearly-universal\n"
1693    "                standard (RFC3391). Note - this implementation uses static\n"
1694    "                pre-configured tunnels (same as the Linux kernel).\n"
1695    "                use 'src=' to specify source address\n"
1696    "                use 'dst=' to specify destination address\n"
1697    "                use 'udp=on' to specify udp encapsulation\n"
1698    "                use 'srcport=' to specify source udp port\n"
1699    "                use 'dstport=' to specify destination udp port\n"
1700    "                use 'ipv6=on' to force v6\n"
1701    "                L2TPv3 uses cookies to prevent misconfiguration as\n"
1702    "                well as a weak security measure\n"
1703    "                use 'rxcookie=0x012345678' to specify a rxcookie\n"
1704    "                use 'txcookie=0x012345678' to specify a txcookie\n"
1705    "                use 'cookie64=on' to set cookie size to 64 bit, otherwise 32\n"
1706    "                use 'counter=off' to force a 'cut-down' L2TPv3 with no counter\n"
1707    "                use 'pincounter=on' to work around broken counter handling in peer\n"
1708    "                use 'offset=X' to add an extra offset between header and data\n"
1709#endif
1710    "-netdev socket,id=str[,fd=h][,listen=[host]:port][,connect=host:port]\n"
1711    "                configure a network backend to connect to another network\n"
1712    "                using a socket connection\n"
1713    "-netdev socket,id=str[,fd=h][,mcast=maddr:port[,localaddr=addr]]\n"
1714    "                configure a network backend to connect to a multicast maddr and port\n"
1715    "                use 'localaddr=addr' to specify the host address to send packets from\n"
1716    "-netdev socket,id=str[,fd=h][,udp=host:port][,localaddr=host:port]\n"
1717    "                configure a network backend to connect to another network\n"
1718    "                using an UDP tunnel\n"
1719#ifdef CONFIG_VDE
1720    "-netdev vde,id=str[,sock=socketpath][,port=n][,group=groupname][,mode=octalmode]\n"
1721    "                configure a network backend to connect to port 'n' of a vde switch\n"
1722    "                running on host and listening for incoming connections on 'socketpath'.\n"
1723    "                Use group 'groupname' and mode 'octalmode' to change default\n"
1724    "                ownership and permissions for communication port.\n"
1725#endif
1726#ifdef CONFIG_NETMAP
1727    "-netdev netmap,id=str,ifname=name[,devname=nmname]\n"
1728    "                attach to the existing netmap-enabled network interface 'name', or to a\n"
1729    "                VALE port (created on the fly) called 'name' ('nmname' is name of the \n"
1730    "                netmap device, defaults to '/dev/netmap')\n"
1731#endif
1732    "-netdev vhost-user,id=str,chardev=dev[,vhostforce=on|off]\n"
1733    "                configure a vhost-user network, backed by a chardev 'dev'\n"
1734    "-netdev hubport,id=str,hubid=n\n"
1735    "                configure a hub port on QEMU VLAN 'n'\n", QEMU_ARCH_ALL)
1736DEF("net", HAS_ARG, QEMU_OPTION_net,
1737    "-net nic[,vlan=n][,macaddr=mac][,model=type][,name=str][,addr=str][,vectors=v]\n"
1738    "                old way to create a new NIC and connect it to VLAN 'n'\n"
1739    "                (use the '-device devtype,netdev=str' option if possible instead)\n"
1740    "-net dump[,vlan=n][,file=f][,len=n]\n"
1741    "                dump traffic on vlan 'n' to file 'f' (max n bytes per packet)\n"
1742    "-net none       use it alone to have zero network devices. If no -net option\n"
1743    "                is provided, the default is '-net nic -net user'\n"
1744    "-net ["
1745#ifdef CONFIG_SLIRP
1746    "user|"
1747#endif
1748    "tap|"
1749    "bridge|"
1750#ifdef CONFIG_VDE
1751    "vde|"
1752#endif
1753#ifdef CONFIG_NETMAP
1754    "netmap|"
1755#endif
1756    "socket][,vlan=n][,option][,option][,...]\n"
1757    "                old way to initialize a host network interface\n"
1758    "                (use the -netdev option if possible instead)\n", QEMU_ARCH_ALL)
1759STEXI
1760@item -net nic[,vlan=@var{n}][,macaddr=@var{mac}][,model=@var{type}] [,name=@var{name}][,addr=@var{addr}][,vectors=@var{v}]
1761@findex -net
1762Create a new Network Interface Card and connect it to VLAN @var{n} (@var{n}
1763= 0 is the default). The NIC is an e1000 by default on the PC
1764target. Optionally, the MAC address can be changed to @var{mac}, the
1765device address set to @var{addr} (PCI cards only),
1766and a @var{name} can be assigned for use in monitor commands.
1767Optionally, for PCI cards, you can specify the number @var{v} of MSI-X vectors
1768that the card should have; this option currently only affects virtio cards; set
1769@var{v} = 0 to disable MSI-X. If no @option{-net} option is specified, a single
1770NIC is created.  QEMU can emulate several different models of network card.
1771Valid values for @var{type} are
1772@code{virtio}, @code{i82551}, @code{i82557b}, @code{i82559er},
1773@code{ne2k_pci}, @code{ne2k_isa}, @code{pcnet}, @code{rtl8139},
1774@code{e1000}, @code{smc91c111}, @code{lance} and @code{mcf_fec}.
1775Not all devices are supported on all targets.  Use @code{-net nic,model=help}
1776for a list of available devices for your target.
1777
1778@item -netdev user,id=@var{id}[,@var{option}][,@var{option}][,...]
1779@findex -netdev
1780@item -net user[,@var{option}][,@var{option}][,...]
1781Use the user mode network stack which requires no administrator
1782privilege to run. Valid options are:
1783
1784@table @option
1785@item vlan=@var{n}
1786Connect user mode stack to VLAN @var{n} (@var{n} = 0 is the default).
1787
1788@item id=@var{id}
1789@itemx name=@var{name}
1790Assign symbolic name for use in monitor commands.
1791
1792@option{ipv4} and @option{ipv6} specify that either IPv4 or IPv6 must
1793be enabled.  If neither is specified both protocols are enabled.
1794
1795@item net=@var{addr}[/@var{mask}]
1796Set IP network address the guest will see. Optionally specify the netmask,
1797either in the form a.b.c.d or as number of valid top-most bits. Default is
179810.0.2.0/24.
1799
1800@item host=@var{addr}
1801Specify the guest-visible address of the host. Default is the 2nd IP in the
1802guest network, i.e. x.x.x.2.
1803
1804@item ipv6-net=@var{addr}[/@var{int}]
1805Set IPv6 network address the guest will see (default is fec0::/64). The
1806network prefix is given in the usual hexadecimal IPv6 address
1807notation. The prefix size is optional, and is given as the number of
1808valid top-most bits (default is 64).
1809
1810@item ipv6-host=@var{addr}
1811Specify the guest-visible IPv6 address of the host. Default is the 2nd IPv6 in
1812the guest network, i.e. xxxx::2.
1813
1814@item restrict=on|off
1815If this option is enabled, the guest will be isolated, i.e. it will not be
1816able to contact the host and no guest IP packets will be routed over the host
1817to the outside. This option does not affect any explicitly set forwarding rules.
1818
1819@item hostname=@var{name}
1820Specifies the client hostname reported by the built-in DHCP server.
1821
1822@item dhcpstart=@var{addr}
1823Specify the first of the 16 IPs the built-in DHCP server can assign. Default
1824is the 15th to 31st IP in the guest network, i.e. x.x.x.15 to x.x.x.31.
1825
1826@item dns=@var{addr}
1827Specify the guest-visible address of the virtual nameserver. The address must
1828be different from the host address. Default is the 3rd IP in the guest network,
1829i.e. x.x.x.3.
1830
1831@item ipv6-dns=@var{addr}
1832Specify the guest-visible address of the IPv6 virtual nameserver. The address
1833must be different from the host address. Default is the 3rd IP in the guest
1834network, i.e. xxxx::3.
1835
1836@item dnssearch=@var{domain}
1837Provides an entry for the domain-search list sent by the built-in
1838DHCP server. More than one domain suffix can be transmitted by specifying
1839this option multiple times. If supported, this will cause the guest to
1840automatically try to append the given domain suffix(es) in case a domain name
1841can not be resolved.
1842
1843Example:
1844@example
1845qemu -net user,dnssearch=mgmt.example.org,dnssearch=example.org [...]
1846@end example
1847
1848@item tftp=@var{dir}
1849When using the user mode network stack, activate a built-in TFTP
1850server. The files in @var{dir} will be exposed as the root of a TFTP server.
1851The TFTP client on the guest must be configured in binary mode (use the command
1852@code{bin} of the Unix TFTP client).
1853
1854@item bootfile=@var{file}
1855When using the user mode network stack, broadcast @var{file} as the BOOTP
1856filename. In conjunction with @option{tftp}, this can be used to network boot
1857a guest from a local directory.
1858
1859Example (using pxelinux):
1860@example
1861qemu-system-i386 -hda linux.img -boot n -net user,tftp=/path/to/tftp/files,bootfile=/pxelinux.0
1862@end example
1863
1864@item smb=@var{dir}[,smbserver=@var{addr}]
1865When using the user mode network stack, activate a built-in SMB
1866server so that Windows OSes can access to the host files in @file{@var{dir}}
1867transparently. The IP address of the SMB server can be set to @var{addr}. By
1868default the 4th IP in the guest network is used, i.e. x.x.x.4.
1869
1870In the guest Windows OS, the line:
1871@example
187210.0.2.4 smbserver
1873@end example
1874must be added in the file @file{C:\WINDOWS\LMHOSTS} (for windows 9x/Me)
1875or @file{C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS} (Windows NT/2000).
1876
1877Then @file{@var{dir}} can be accessed in @file{\\smbserver\qemu}.
1878
1879Note that a SAMBA server must be installed on the host OS.
1880QEMU was tested successfully with smbd versions from Red Hat 9,
1881Fedora Core 3 and OpenSUSE 11.x.
1882
1883@item hostfwd=[tcp|udp]:[@var{hostaddr}]:@var{hostport}-[@var{guestaddr}]:@var{guestport}
1884Redirect incoming TCP or UDP connections to the host port @var{hostport} to
1885the guest IP address @var{guestaddr} on guest port @var{guestport}. If
1886@var{guestaddr} is not specified, its value is x.x.x.15 (default first address
1887given by the built-in DHCP server). By specifying @var{hostaddr}, the rule can
1888be bound to a specific host interface. If no connection type is set, TCP is
1889used. This option can be given multiple times.
1890
1891For example, to redirect host X11 connection from screen 1 to guest
1892screen 0, use the following:
1893
1894@example
1895# on the host
1896qemu-system-i386 -net user,hostfwd=tcp:127.0.0.1:6001-:6000 [...]
1897# this host xterm should open in the guest X11 server
1898xterm -display :1
1899@end example
1900
1901To redirect telnet connections from host port 5555 to telnet port on
1902the guest, use the following:
1903
1904@example
1905# on the host
1906qemu-system-i386 -net user,hostfwd=tcp::5555-:23 [...]
1907telnet localhost 5555
1908@end example
1909
1910Then when you use on the host @code{telnet localhost 5555}, you
1911connect to the guest telnet server.
1912
1913@item guestfwd=[tcp]:@var{server}:@var{port}-@var{dev}
1914@itemx guestfwd=[tcp]:@var{server}:@var{port}-@var{cmd:command}
1915Forward guest TCP connections to the IP address @var{server} on port @var{port}
1916to the character device @var{dev} or to a program executed by @var{cmd:command}
1917which gets spawned for each connection. This option can be given multiple times.
1918
1919You can either use a chardev directly and have that one used throughout QEMU's
1920lifetime, like in the following example:
1921
1922@example
1923# open 10.10.1.1:4321 on bootup, connect 10.0.2.100:1234 to it whenever
1924# the guest accesses it
1925qemu -net user,guestfwd=tcp:10.0.2.100:1234-tcp:10.10.1.1:4321 [...]
1926@end example
1927
1928Or you can execute a command on every TCP connection established by the guest,
1929so that QEMU behaves similar to an inetd process for that virtual server:
1930
1931@example
1932# call "netcat 10.10.1.1 4321" on every TCP connection to 10.0.2.100:1234
1933# and connect the TCP stream to its stdin/stdout
1934qemu -net 'user,guestfwd=tcp:10.0.2.100:1234-cmd:netcat 10.10.1.1 4321'
1935@end example
1936
1937@end table
1938
1939Note: Legacy stand-alone options -tftp, -bootp, -smb and -redir are still
1940processed and applied to -net user. Mixing them with the new configuration
1941syntax gives undefined results. Their use for new applications is discouraged
1942as they will be removed from future versions.
1943
1944@item -netdev tap,id=@var{id}[,fd=@var{h}][,ifname=@var{name}][,script=@var{file}][,downscript=@var{dfile}][,br=@var{bridge}][,helper=@var{helper}]
1945@itemx -net tap[,vlan=@var{n}][,name=@var{name}][,fd=@var{h}][,ifname=@var{name}][,script=@var{file}][,downscript=@var{dfile}][,br=@var{bridge}][,helper=@var{helper}]
1946Connect the host TAP network interface @var{name} to VLAN @var{n}.
1947
1948Use the network script @var{file} to configure it and the network script
1949@var{dfile} to deconfigure it. If @var{name} is not provided, the OS
1950automatically provides one. The default network configure script is
1951@file{/etc/qemu-ifup} and the default network deconfigure script is
1952@file{/etc/qemu-ifdown}. Use @option{script=no} or @option{downscript=no}
1953to disable script execution.
1954
1955If running QEMU as an unprivileged user, use the network helper
1956@var{helper} to configure the TAP interface and attach it to the bridge.
1957The default network helper executable is @file{/path/to/qemu-bridge-helper}
1958and the default bridge device is @file{br0}.
1959
1960@option{fd}=@var{h} can be used to specify the handle of an already
1961opened host TAP interface.
1962
1963Examples:
1964
1965@example
1966#launch a QEMU instance with the default network script
1967qemu-system-i386 linux.img -net nic -net tap
1968@end example
1969
1970@example
1971#launch a QEMU instance with two NICs, each one connected
1972#to a TAP device
1973qemu-system-i386 linux.img \
1974                 -net nic,vlan=0 -net tap,vlan=0,ifname=tap0 \
1975                 -net nic,vlan=1 -net tap,vlan=1,ifname=tap1
1976@end example
1977
1978@example
1979#launch a QEMU instance with the default network helper to
1980#connect a TAP device to bridge br0
1981qemu-system-i386 linux.img \
1982                 -net nic -net tap,"helper=/path/to/qemu-bridge-helper"
1983@end example
1984
1985@item -netdev bridge,id=@var{id}[,br=@var{bridge}][,helper=@var{helper}]
1986@itemx -net bridge[,vlan=@var{n}][,name=@var{name}][,br=@var{bridge}][,helper=@var{helper}]
1987Connect a host TAP network interface to a host bridge device.
1988
1989Use the network helper @var{helper} to configure the TAP interface and
1990attach it to the bridge. The default network helper executable is
1991@file{/path/to/qemu-bridge-helper} and the default bridge
1992device is @file{br0}.
1993
1994Examples:
1995
1996@example
1997#launch a QEMU instance with the default network helper to
1998#connect a TAP device to bridge br0
1999qemu-system-i386 linux.img -net bridge -net nic,model=virtio
2000@end example
2001
2002@example
2003#launch a QEMU instance with the default network helper to
2004#connect a TAP device to bridge qemubr0
2005qemu-system-i386 linux.img -net bridge,br=qemubr0 -net nic,model=virtio
2006@end example
2007
2008@item -netdev socket,id=@var{id}[,fd=@var{h}][,listen=[@var{host}]:@var{port}][,connect=@var{host}:@var{port}]
2009@itemx -net socket[,vlan=@var{n}][,name=@var{name}][,fd=@var{h}] [,listen=[@var{host}]:@var{port}][,connect=@var{host}:@var{port}]
2010
2011Connect the VLAN @var{n} to a remote VLAN in another QEMU virtual
2012machine using a TCP socket connection. If @option{listen} is
2013specified, QEMU waits for incoming connections on @var{port}
2014(@var{host} is optional). @option{connect} is used to connect to
2015another QEMU instance using the @option{listen} option. @option{fd}=@var{h}
2016specifies an already opened TCP socket.
2017
2018Example:
2019@example
2020# launch a first QEMU instance
2021qemu-system-i386 linux.img \
2022                 -net nic,macaddr=52:54:00:12:34:56 \
2023                 -net socket,listen=:1234
2024# connect the VLAN 0 of this instance to the VLAN 0
2025# of the first instance
2026qemu-system-i386 linux.img \
2027                 -net nic,macaddr=52:54:00:12:34:57 \
2028                 -net socket,connect=127.0.0.1:1234
2029@end example
2030
2031@item -netdev socket,id=@var{id}[,fd=@var{h}][,mcast=@var{maddr}:@var{port}[,localaddr=@var{addr}]]
2032@itemx -net socket[,vlan=@var{n}][,name=@var{name}][,fd=@var{h}][,mcast=@var{maddr}:@var{port}[,localaddr=@var{addr}]]
2033
2034Create a VLAN @var{n} shared with another QEMU virtual
2035machines using a UDP multicast socket, effectively making a bus for
2036every QEMU with same multicast address @var{maddr} and @var{port}.
2037NOTES:
2038@enumerate
2039@item
2040Several QEMU can be running on different hosts and share same bus (assuming
2041correct multicast setup for these hosts).
2042@item
2043mcast support is compatible with User Mode Linux (argument @option{eth@var{N}=mcast}), see
2044@url{http://user-mode-linux.sf.net}.
2045@item
2046Use @option{fd=h} to specify an already opened UDP multicast socket.
2047@end enumerate
2048
2049Example:
2050@example
2051# launch one QEMU instance
2052qemu-system-i386 linux.img \
2053                 -net nic,macaddr=52:54:00:12:34:56 \
2054                 -net socket,mcast=230.0.0.1:1234
2055# launch another QEMU instance on same "bus"
2056qemu-system-i386 linux.img \
2057                 -net nic,macaddr=52:54:00:12:34:57 \
2058                 -net socket,mcast=230.0.0.1:1234
2059# launch yet another QEMU instance on same "bus"
2060qemu-system-i386 linux.img \
2061                 -net nic,macaddr=52:54:00:12:34:58 \
2062                 -net socket,mcast=230.0.0.1:1234
2063@end example
2064
2065Example (User Mode Linux compat.):
2066@example
2067# launch QEMU instance (note mcast address selected
2068# is UML's default)
2069qemu-system-i386 linux.img \
2070                 -net nic,macaddr=52:54:00:12:34:56 \
2071                 -net socket,mcast=239.192.168.1:1102
2072# launch UML
2073/path/to/linux ubd0=/path/to/root_fs eth0=mcast
2074@end example
2075
2076Example (send packets from host's 1.2.3.4):
2077@example
2078qemu-system-i386 linux.img \
2079                 -net nic,macaddr=52:54:00:12:34:56 \
2080                 -net socket,mcast=239.192.168.1:1102,localaddr=1.2.3.4
2081@end example
2082
2083@item -netdev l2tpv3,id=@var{id},src=@var{srcaddr},dst=@var{dstaddr}[,srcport=@var{srcport}][,dstport=@var{dstport}],txsession=@var{txsession}[,rxsession=@var{rxsession}][,ipv6][,udp][,cookie64][,counter][,pincounter][,txcookie=@var{txcookie}][,rxcookie=@var{rxcookie}][,offset=@var{offset}]
2084@itemx -net l2tpv3[,vlan=@var{n}][,name=@var{name}],src=@var{srcaddr},dst=@var{dstaddr}[,srcport=@var{srcport}][,dstport=@var{dstport}],txsession=@var{txsession}[,rxsession=@var{rxsession}][,ipv6][,udp][,cookie64][,counter][,pincounter][,txcookie=@var{txcookie}][,rxcookie=@var{rxcookie}][,offset=@var{offset}]
2085Connect VLAN @var{n} to L2TPv3 pseudowire. L2TPv3 (RFC3391) is a popular
2086protocol to transport Ethernet (and other Layer 2) data frames between
2087two systems. It is present in routers, firewalls and the Linux kernel
2088(from version 3.3 onwards).
2089
2090This transport allows a VM to communicate to another VM, router or firewall directly.
2091
2092@item src=@var{srcaddr}
2093    source address (mandatory)
2094@item dst=@var{dstaddr}
2095    destination address (mandatory)
2096@item udp
2097    select udp encapsulation (default is ip).
2098@item srcport=@var{srcport}
2099    source udp port.
2100@item dstport=@var{dstport}
2101    destination udp port.
2102@item ipv6
2103    force v6, otherwise defaults to v4.
2104@item rxcookie=@var{rxcookie}
2105@itemx txcookie=@var{txcookie}
2106    Cookies are a weak form of security in the l2tpv3 specification.
2107Their function is mostly to prevent misconfiguration. By default they are 32
2108bit.
2109@item cookie64
2110    Set cookie size to 64 bit instead of the default 32
2111@item counter=off
2112    Force a 'cut-down' L2TPv3 with no counter as in
2113draft-mkonstan-l2tpext-keyed-ipv6-tunnel-00
2114@item pincounter=on
2115    Work around broken counter handling in peer. This may also help on
2116networks which have packet reorder.
2117@item offset=@var{offset}
2118    Add an extra offset between header and data
2119
2120For example, to attach a VM running on host 4.3.2.1 via L2TPv3 to the bridge br-lan
2121on the remote Linux host 1.2.3.4:
2122@example
2123# Setup tunnel on linux host using raw ip as encapsulation
2124# on 1.2.3.4
2125ip l2tp add tunnel remote 4.3.2.1 local 1.2.3.4 tunnel_id 1 peer_tunnel_id 1 \
2126    encap udp udp_sport 16384 udp_dport 16384
2127ip l2tp add session tunnel_id 1 name vmtunnel0 session_id \
2128    0xFFFFFFFF peer_session_id 0xFFFFFFFF
2129ifconfig vmtunnel0 mtu 1500
2130ifconfig vmtunnel0 up
2131brctl addif br-lan vmtunnel0
2132
2133
2134# on 4.3.2.1
2135# launch QEMU instance - if your network has reorder or is very lossy add ,pincounter
2136
2137qemu-system-i386 linux.img -net nic -net l2tpv3,src=4.2.3.1,dst=1.2.3.4,udp,srcport=16384,dstport=16384,rxsession=0xffffffff,txsession=0xffffffff,counter
2138
2139
2140@end example
2141
2142@item -netdev vde,id=@var{id}[,sock=@var{socketpath}][,port=@var{n}][,group=@var{groupname}][,mode=@var{octalmode}]
2143@itemx -net vde[,vlan=@var{n}][,name=@var{name}][,sock=@var{socketpath}] [,port=@var{n}][,group=@var{groupname}][,mode=@var{octalmode}]
2144Connect VLAN @var{n} to PORT @var{n} of a vde switch running on host and
2145listening for incoming connections on @var{socketpath}. Use GROUP @var{groupname}
2146and MODE @var{octalmode} to change default ownership and permissions for
2147communication port. This option is only available if QEMU has been compiled
2148with vde support enabled.
2149
2150Example:
2151@example
2152# launch vde switch
2153vde_switch -F -sock /tmp/myswitch
2154# launch QEMU instance
2155qemu-system-i386 linux.img -net nic -net vde,sock=/tmp/myswitch
2156@end example
2157
2158@item -netdev hubport,id=@var{id},hubid=@var{hubid}
2159
2160Create a hub port on QEMU "vlan" @var{hubid}.
2161
2162The hubport netdev lets you connect a NIC to a QEMU "vlan" instead of a single
2163netdev.  @code{-net} and @code{-device} with parameter @option{vlan} create the
2164required hub automatically.
2165
2166@item -netdev vhost-user,chardev=@var{id}[,vhostforce=on|off][,queues=n]
2167
2168Establish a vhost-user netdev, backed by a chardev @var{id}. The chardev should
2169be a unix domain socket backed one. The vhost-user uses a specifically defined
2170protocol to pass vhost ioctl replacement messages to an application on the other
2171end of the socket. On non-MSIX guests, the feature can be forced with
2172@var{vhostforce}. Use 'queues=@var{n}' to specify the number of queues to
2173be created for multiqueue vhost-user.
2174
2175Example:
2176@example
2177qemu -m 512 -object memory-backend-file,id=mem,size=512M,mem-path=/hugetlbfs,share=on \
2178     -numa node,memdev=mem \
2179     -chardev socket,id=chr0,path=/path/to/socket \
2180     -netdev type=vhost-user,id=net0,chardev=chr0 \
2181     -device virtio-net-pci,netdev=net0
2182@end example
2183
2184@item -net dump[,vlan=@var{n}][,file=@var{file}][,len=@var{len}]
2185Dump network traffic on VLAN @var{n} to file @var{file} (@file{qemu-vlan0.pcap} by default).
2186At most @var{len} bytes (64k by default) per packet are stored. The file format is
2187libpcap, so it can be analyzed with tools such as tcpdump or Wireshark.
2188Note: For devices created with '-netdev', use '-object filter-dump,...' instead.
2189
2190@item -net none
2191Indicate that no network devices should be configured. It is used to
2192override the default configuration (@option{-net nic -net user}) which
2193is activated if no @option{-net} options are provided.
2194ETEXI
2195
2196STEXI
2197@end table
2198ETEXI
2199DEFHEADING()
2200
2201DEFHEADING(Character device options)
2202STEXI
2203
2204The general form of a character device option is:
2205@table @option
2206ETEXI
2207
2208DEF("chardev", HAS_ARG, QEMU_OPTION_chardev,
2209    "-chardev help\n"
2210    "-chardev null,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
2211    "-chardev socket,id=id[,host=host],port=port[,to=to][,ipv4][,ipv6][,nodelay][,reconnect=seconds]\n"
2212    "         [,server][,nowait][,telnet][,reconnect=seconds][,mux=on|off]\n"
2213    "         [,logfile=PATH][,logappend=on|off][,tls-creds=ID] (tcp)\n"
2214    "-chardev socket,id=id,path=path[,server][,nowait][,telnet][,reconnect=seconds]\n"
2215    "         [,mux=on|off][,logfile=PATH][,logappend=on|off] (unix)\n"
2216    "-chardev udp,id=id[,host=host],port=port[,localaddr=localaddr]\n"
2217    "         [,localport=localport][,ipv4][,ipv6][,mux=on|off]\n"
2218    "         [,logfile=PATH][,logappend=on|off]\n"
2219    "-chardev msmouse,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
2220    "-chardev vc,id=id[[,width=width][,height=height]][[,cols=cols][,rows=rows]]\n"
2221    "         [,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
2222    "-chardev ringbuf,id=id[,size=size][,logfile=PATH][,logappend=on|off]\n"
2223    "-chardev file,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
2224    "-chardev pipe,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
2225#ifdef _WIN32
2226    "-chardev console,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
2227    "-chardev serial,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
2228#else
2229    "-chardev pty,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
2230    "-chardev stdio,id=id[,mux=on|off][,signal=on|off][,logfile=PATH][,logappend=on|off]\n"
2231#endif
2232#ifdef CONFIG_BRLAPI
2233    "-chardev braille,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
2234#endif
2235#if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \
2236        || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
2237    "-chardev serial,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
2238    "-chardev tty,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
2239#endif
2240#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__)
2241    "-chardev parallel,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
2242    "-chardev parport,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
2243#endif
2244#if defined(CONFIG_SPICE)
2245    "-chardev spicevmc,id=id,name=name[,debug=debug][,logfile=PATH][,logappend=on|off]\n"
2246    "-chardev spiceport,id=id,name=name[,debug=debug][,logfile=PATH][,logappend=on|off]\n"
2247#endif
2248    , QEMU_ARCH_ALL
2249)
2250
2251STEXI
2252@item -chardev @var{backend} ,id=@var{id} [,mux=on|off] [,@var{options}]
2253@findex -chardev
2254Backend is one of:
2255@option{null},
2256@option{socket},
2257@option{udp},
2258@option{msmouse},
2259@option{vc},
2260@option{ringbuf},
2261@option{file},
2262@option{pipe},
2263@option{console},
2264@option{serial},
2265@option{pty},
2266@option{stdio},
2267@option{braille},
2268@option{tty},
2269@option{parallel},
2270@option{parport},
2271@option{spicevmc}.
2272@option{spiceport}.
2273The specific backend will determine the applicable options.
2274
2275Use "-chardev help" to print all available chardev backend types.
2276
2277All devices must have an id, which can be any string up to 127 characters long.
2278It is used to uniquely identify this device in other command line directives.
2279
2280A character device may be used in multiplexing mode by multiple front-ends.
2281Specify @option{mux=on} to enable this mode.
2282A multiplexer is a "1:N" device, and here the "1" end is your specified chardev
2283backend, and the "N" end is the various parts of QEMU that can talk to a chardev.
2284If you create a chardev with @option{id=myid} and @option{mux=on}, QEMU will
2285create a multiplexer with your specified ID, and you can then configure multiple
2286front ends to use that chardev ID for their input/output. Up to four different
2287front ends can be connected to a single multiplexed chardev. (Without
2288multiplexing enabled, a chardev can only be used by a single front end.)
2289For instance you could use this to allow a single stdio chardev to be used by
2290two serial ports and the QEMU monitor:
2291
2292@example
2293-chardev stdio,mux=on,id=char0 \
2294-mon chardev=char0,mode=readline \
2295-serial chardev:char0 \
2296-serial chardev:char0
2297@end example
2298
2299You can have more than one multiplexer in a system configuration; for instance
2300you could have a TCP port multiplexed between UART 0 and UART 1, and stdio
2301multiplexed between the QEMU monitor and a parallel port:
2302
2303@example
2304-chardev stdio,mux=on,id=char0 \
2305-mon chardev=char0,mode=readline \
2306-parallel chardev:char0 \
2307-chardev tcp,...,mux=on,id=char1 \
2308-serial chardev:char1 \
2309-serial chardev:char1
2310@end example
2311
2312When you're using a multiplexed character device, some escape sequences are
2313interpreted in the input. @xref{mux_keys, Keys in the character backend
2314multiplexer}.
2315
2316Note that some other command line options may implicitly create multiplexed
2317character backends; for instance @option{-serial mon:stdio} creates a
2318multiplexed stdio backend connected to the serial port and the QEMU monitor,
2319and @option{-nographic} also multiplexes the console and the monitor to
2320stdio.
2321
2322There is currently no support for multiplexing in the other direction
2323(where a single QEMU front end takes input and output from multiple chardevs).
2324
2325Every backend supports the @option{logfile} option, which supplies the path
2326to a file to record all data transmitted via the backend. The @option{logappend}
2327option controls whether the log file will be truncated or appended to when
2328opened.
2329
2330Further options to each backend are described below.
2331
2332@item -chardev null ,id=@var{id}
2333A void device. This device will not emit any data, and will drop any data it
2334receives. The null backend does not take any options.
2335
2336@item -chardev socket ,id=@var{id} [@var{TCP options} or @var{unix options}] [,server] [,nowait] [,telnet] [,reconnect=@var{seconds}] [,tls-creds=@var{id}]
2337
2338Create a two-way stream socket, which can be either a TCP or a unix socket. A
2339unix socket will be created if @option{path} is specified. Behaviour is
2340undefined if TCP options are specified for a unix socket.
2341
2342@option{server} specifies that the socket shall be a listening socket.
2343
2344@option{nowait} specifies that QEMU should not block waiting for a client to
2345connect to a listening socket.
2346
2347@option{telnet} specifies that traffic on the socket should interpret telnet
2348escape sequences.
2349
2350@option{reconnect} sets the timeout for reconnecting on non-server sockets when
2351the remote end goes away.  qemu will delay this many seconds and then attempt
2352to reconnect.  Zero disables reconnecting, and is the default.
2353
2354@option{tls-creds} requests enablement of the TLS protocol for encryption,
2355and specifies the id of the TLS credentials to use for the handshake. The
2356credentials must be previously created with the @option{-object tls-creds}
2357argument.
2358
2359TCP and unix socket options are given below:
2360
2361@table @option
2362
2363@item TCP options: port=@var{port} [,host=@var{host}] [,to=@var{to}] [,ipv4] [,ipv6] [,nodelay]
2364
2365@option{host} for a listening socket specifies the local address to be bound.
2366For a connecting socket species the remote host to connect to. @option{host} is
2367optional for listening sockets. If not specified it defaults to @code{0.0.0.0}.
2368
2369@option{port} for a listening socket specifies the local port to be bound. For a
2370connecting socket specifies the port on the remote host to connect to.
2371@option{port} can be given as either a port number or a service name.
2372@option{port} is required.
2373
2374@option{to} is only relevant to listening sockets. If it is specified, and
2375@option{port} cannot be bound, QEMU will attempt to bind to subsequent ports up
2376to and including @option{to} until it succeeds. @option{to} must be specified
2377as a port number.
2378
2379@option{ipv4} and @option{ipv6} specify that either IPv4 or IPv6 must be used.
2380If neither is specified the socket may use either protocol.
2381
2382@option{nodelay} disables the Nagle algorithm.
2383
2384@item unix options: path=@var{path}
2385
2386@option{path} specifies the local path of the unix socket. @option{path} is
2387required.
2388
2389@end table
2390
2391@item -chardev udp ,id=@var{id} [,host=@var{host}] ,port=@var{port} [,localaddr=@var{localaddr}] [,localport=@var{localport}] [,ipv4] [,ipv6]
2392
2393Sends all traffic from the guest to a remote host over UDP.
2394
2395@option{host} specifies the remote host to connect to. If not specified it
2396defaults to @code{localhost}.
2397
2398@option{port} specifies the port on the remote host to connect to. @option{port}
2399is required.
2400
2401@option{localaddr} specifies the local address to bind to. If not specified it
2402defaults to @code{0.0.0.0}.
2403
2404@option{localport} specifies the local port to bind to. If not specified any
2405available local port will be used.
2406
2407@option{ipv4} and @option{ipv6} specify that either IPv4 or IPv6 must be used.
2408If neither is specified the device may use either protocol.
2409
2410@item -chardev msmouse ,id=@var{id}
2411
2412Forward QEMU's emulated msmouse events to the guest. @option{msmouse} does not
2413take any options.
2414
2415@item -chardev vc ,id=@var{id} [[,width=@var{width}] [,height=@var{height}]] [[,cols=@var{cols}] [,rows=@var{rows}]]
2416
2417Connect to a QEMU text console. @option{vc} may optionally be given a specific
2418size.
2419
2420@option{width} and @option{height} specify the width and height respectively of
2421the console, in pixels.
2422
2423@option{cols} and @option{rows} specify that the console be sized to fit a text
2424console with the given dimensions.
2425
2426@item -chardev ringbuf ,id=@var{id} [,size=@var{size}]
2427
2428Create a ring buffer with fixed size @option{size}.
2429@var{size} must be a power of two and defaults to @code{64K}.
2430
2431@item -chardev file ,id=@var{id} ,path=@var{path}
2432
2433Log all traffic received from the guest to a file.
2434
2435@option{path} specifies the path of the file to be opened. This file will be
2436created if it does not already exist, and overwritten if it does. @option{path}
2437is required.
2438
2439@item -chardev pipe ,id=@var{id} ,path=@var{path}
2440
2441Create a two-way connection to the guest. The behaviour differs slightly between
2442Windows hosts and other hosts:
2443
2444On Windows, a single duplex pipe will be created at
2445@file{\\.pipe\@option{path}}.
2446
2447On other hosts, 2 pipes will be created called @file{@option{path}.in} and
2448@file{@option{path}.out}. Data written to @file{@option{path}.in} will be
2449received by the guest. Data written by the guest can be read from
2450@file{@option{path}.out}. QEMU will not create these fifos, and requires them to
2451be present.
2452
2453@option{path} forms part of the pipe path as described above. @option{path} is
2454required.
2455
2456@item -chardev console ,id=@var{id}
2457
2458Send traffic from the guest to QEMU's standard output. @option{console} does not
2459take any options.
2460
2461@option{console} is only available on Windows hosts.
2462
2463@item -chardev serial ,id=@var{id} ,path=@option{path}
2464
2465Send traffic from the guest to a serial device on the host.
2466
2467On Unix hosts serial will actually accept any tty device,
2468not only serial lines.
2469
2470@option{path} specifies the name of the serial device to open.
2471
2472@item -chardev pty ,id=@var{id}
2473
2474Create a new pseudo-terminal on the host and connect to it. @option{pty} does
2475not take any options.
2476
2477@option{pty} is not available on Windows hosts.
2478
2479@item -chardev stdio ,id=@var{id} [,signal=on|off]
2480Connect to standard input and standard output of the QEMU process.
2481
2482@option{signal} controls if signals are enabled on the terminal, that includes
2483exiting QEMU with the key sequence @key{Control-c}. This option is enabled by
2484default, use @option{signal=off} to disable it.
2485
2486@item -chardev braille ,id=@var{id}
2487
2488Connect to a local BrlAPI server. @option{braille} does not take any options.
2489
2490@item -chardev tty ,id=@var{id} ,path=@var{path}
2491
2492@option{tty} is only available on Linux, Sun, FreeBSD, NetBSD, OpenBSD and
2493DragonFlyBSD hosts.  It is an alias for @option{serial}.
2494
2495@option{path} specifies the path to the tty. @option{path} is required.
2496
2497@item -chardev parallel ,id=@var{id} ,path=@var{path}
2498@itemx -chardev parport ,id=@var{id} ,path=@var{path}
2499
2500@option{parallel} is only available on Linux, FreeBSD and DragonFlyBSD hosts.
2501
2502Connect to a local parallel port.
2503
2504@option{path} specifies the path to the parallel port device. @option{path} is
2505required.
2506
2507@item -chardev spicevmc ,id=@var{id} ,debug=@var{debug}, name=@var{name}
2508
2509@option{spicevmc} is only available when spice support is built in.
2510
2511@option{debug} debug level for spicevmc
2512
2513@option{name} name of spice channel to connect to
2514
2515Connect to a spice virtual machine channel, such as vdiport.
2516
2517@item -chardev spiceport ,id=@var{id} ,debug=@var{debug}, name=@var{name}
2518
2519@option{spiceport} is only available when spice support is built in.
2520
2521@option{debug} debug level for spicevmc
2522
2523@option{name} name of spice port to connect to
2524
2525Connect to a spice port, allowing a Spice client to handle the traffic
2526identified by a name (preferably a fqdn).
2527ETEXI
2528
2529STEXI
2530@end table
2531ETEXI
2532DEFHEADING()
2533
2534DEFHEADING(Device URL Syntax)
2535STEXI
2536
2537In addition to using normal file images for the emulated storage devices,
2538QEMU can also use networked resources such as iSCSI devices. These are
2539specified using a special URL syntax.
2540
2541@table @option
2542@item iSCSI
2543iSCSI support allows QEMU to access iSCSI resources directly and use as
2544images for the guest storage. Both disk and cdrom images are supported.
2545
2546Syntax for specifying iSCSI LUNs is
2547``iscsi://<target-ip>[:<port>]/<target-iqn>/<lun>''
2548
2549By default qemu will use the iSCSI initiator-name
2550'iqn.2008-11.org.linux-kvm[:<name>]' but this can also be set from the command
2551line or a configuration file.
2552
2553Since version Qemu 2.4 it is possible to specify a iSCSI request timeout to detect
2554stalled requests and force a reestablishment of the session. The timeout
2555is specified in seconds. The default is 0 which means no timeout. Libiscsi
25561.15.0 or greater is required for this feature.
2557
2558Example (without authentication):
2559@example
2560qemu-system-i386 -iscsi initiator-name=iqn.2001-04.com.example:my-initiator \
2561                 -cdrom iscsi://192.0.2.1/iqn.2001-04.com.example/2 \
2562                 -drive file=iscsi://192.0.2.1/iqn.2001-04.com.example/1
2563@end example
2564
2565Example (CHAP username/password via URL):
2566@example
2567qemu-system-i386 -drive file=iscsi://user%password@@192.0.2.1/iqn.2001-04.com.example/1
2568@end example
2569
2570Example (CHAP username/password via environment variables):
2571@example
2572LIBISCSI_CHAP_USERNAME="user" \
2573LIBISCSI_CHAP_PASSWORD="password" \
2574qemu-system-i386 -drive file=iscsi://192.0.2.1/iqn.2001-04.com.example/1
2575@end example
2576
2577iSCSI support is an optional feature of QEMU and only available when
2578compiled and linked against libiscsi.
2579ETEXI
2580DEF("iscsi", HAS_ARG, QEMU_OPTION_iscsi,
2581    "-iscsi [user=user][,password=password]\n"
2582    "       [,header-digest=CRC32C|CR32C-NONE|NONE-CRC32C|NONE\n"
2583    "       [,initiator-name=initiator-iqn][,id=target-iqn]\n"
2584    "       [,timeout=timeout]\n"
2585    "                iSCSI session parameters\n", QEMU_ARCH_ALL)
2586STEXI
2587
2588iSCSI parameters such as username and password can also be specified via
2589a configuration file. See qemu-doc for more information and examples.
2590
2591@item NBD
2592QEMU supports NBD (Network Block Devices) both using TCP protocol as well
2593as Unix Domain Sockets.
2594
2595Syntax for specifying a NBD device using TCP
2596``nbd:<server-ip>:<port>[:exportname=<export>]''
2597
2598Syntax for specifying a NBD device using Unix Domain Sockets
2599``nbd:unix:<domain-socket>[:exportname=<export>]''
2600
2601
2602Example for TCP
2603@example
2604qemu-system-i386 --drive file=nbd:192.0.2.1:30000
2605@end example
2606
2607Example for Unix Domain Sockets
2608@example
2609qemu-system-i386 --drive file=nbd:unix:/tmp/nbd-socket
2610@end example
2611
2612@item SSH
2613QEMU supports SSH (Secure Shell) access to remote disks.
2614
2615Examples:
2616@example
2617qemu-system-i386 -drive file=ssh://user@@host/path/to/disk.img
2618qemu-system-i386 -drive file.driver=ssh,file.user=user,file.host=host,file.port=22,file.path=/path/to/disk.img
2619@end example
2620
2621Currently authentication must be done using ssh-agent.  Other
2622authentication methods may be supported in future.
2623
2624@item Sheepdog
2625Sheepdog is a distributed storage system for QEMU.
2626QEMU supports using either local sheepdog devices or remote networked
2627devices.
2628
2629Syntax for specifying a sheepdog device
2630@example
2631sheepdog[+tcp|+unix]://[host:port]/vdiname[?socket=path][#snapid|#tag]
2632@end example
2633
2634Example
2635@example
2636qemu-system-i386 --drive file=sheepdog://192.0.2.1:30000/MyVirtualMachine
2637@end example
2638
2639See also @url{https://sheepdog.github.io/sheepdog/}.
2640
2641@item GlusterFS
2642GlusterFS is a user space distributed file system.
2643QEMU supports the use of GlusterFS volumes for hosting VM disk images using
2644TCP, Unix Domain Sockets and RDMA transport protocols.
2645
2646Syntax for specifying a VM disk image on GlusterFS volume is
2647@example
2648
2649URI:
2650gluster[+type]://[host[:port]]/volume/path[?socket=...][,debug=N][,logfile=...]
2651
2652JSON:
2653'json:@{"driver":"qcow2","file":@{"driver":"gluster","volume":"testvol","path":"a.img","debug":N,"logfile":"...",
2654@                                 "server":[@{"type":"tcp","host":"...","port":"..."@},
2655@                                           @{"type":"unix","socket":"..."@}]@}@}'
2656@end example
2657
2658
2659Example
2660@example
2661URI:
2662qemu-system-x86_64 --drive file=gluster://192.0.2.1/testvol/a.img,
2663@                               file.debug=9,file.logfile=/var/log/qemu-gluster.log
2664
2665JSON:
2666qemu-system-x86_64 'json:@{"driver":"qcow2",
2667@                          "file":@{"driver":"gluster",
2668@                                   "volume":"testvol","path":"a.img",
2669@                                   "debug":9,"logfile":"/var/log/qemu-gluster.log",
2670@                                   "server":[@{"type":"tcp","host":"1.2.3.4","port":24007@},
2671@                                             @{"type":"unix","socket":"/var/run/glusterd.socket"@}]@}@}'
2672qemu-system-x86_64 -drive driver=qcow2,file.driver=gluster,file.volume=testvol,file.path=/path/a.img,
2673@                                      file.debug=9,file.logfile=/var/log/qemu-gluster.log,
2674@                                      file.server.0.type=tcp,file.server.0.host=1.2.3.4,file.server.0.port=24007,
2675@                                      file.server.1.type=unix,file.server.1.socket=/var/run/glusterd.socket
2676@end example
2677
2678See also @url{http://www.gluster.org}.
2679
2680@item HTTP/HTTPS/FTP/FTPS
2681QEMU supports read-only access to files accessed over http(s) and ftp(s).
2682
2683Syntax using a single filename:
2684@example
2685<protocol>://[<username>[:<password>]@@]<host>/<path>
2686@end example
2687
2688where:
2689@table @option
2690@item protocol
2691'http', 'https', 'ftp', or 'ftps'.
2692
2693@item username
2694Optional username for authentication to the remote server.
2695
2696@item password
2697Optional password for authentication to the remote server.
2698
2699@item host
2700Address of the remote server.
2701
2702@item path
2703Path on the remote server, including any query string.
2704@end table
2705
2706The following options are also supported:
2707@table @option
2708@item url
2709The full URL when passing options to the driver explicitly.
2710
2711@item readahead
2712The amount of data to read ahead with each range request to the remote server.
2713This value may optionally have the suffix 'T', 'G', 'M', 'K', 'k' or 'b'. If it
2714does not have a suffix, it will be assumed to be in bytes. The value must be a
2715multiple of 512 bytes. It defaults to 256k.
2716
2717@item sslverify
2718Whether to verify the remote server's certificate when connecting over SSL. It
2719can have the value 'on' or 'off'. It defaults to 'on'.
2720
2721@item cookie
2722Send this cookie (it can also be a list of cookies separated by ';') with
2723each outgoing request.  Only supported when using protocols such as HTTP
2724which support cookies, otherwise ignored.
2725
2726@item timeout
2727Set the timeout in seconds of the CURL connection. This timeout is the time
2728that CURL waits for a response from the remote server to get the size of the
2729image to be downloaded. If not set, the default timeout of 5 seconds is used.
2730@end table
2731
2732Note that when passing options to qemu explicitly, @option{driver} is the value
2733of <protocol>.
2734
2735Example: boot from a remote Fedora 20 live ISO image
2736@example
2737qemu-system-x86_64 --drive media=cdrom,file=http://dl.fedoraproject.org/pub/fedora/linux/releases/20/Live/x86_64/Fedora-Live-Desktop-x86_64-20-1.iso,readonly
2738
2739qemu-system-x86_64 --drive media=cdrom,file.driver=http,file.url=http://dl.fedoraproject.org/pub/fedora/linux/releases/20/Live/x86_64/Fedora-Live-Desktop-x86_64-20-1.iso,readonly
2740@end example
2741
2742Example: boot from a remote Fedora 20 cloud image using a local overlay for
2743writes, copy-on-read, and a readahead of 64k
2744@example
2745qemu-img create -f qcow2 -o backing_file='json:@{"file.driver":"http",, "file.url":"https://dl.fedoraproject.org/pub/fedora/linux/releases/20/Images/x86_64/Fedora-x86_64-20-20131211.1-sda.qcow2",, "file.readahead":"64k"@}' /tmp/Fedora-x86_64-20-20131211.1-sda.qcow2
2746
2747qemu-system-x86_64 -drive file=/tmp/Fedora-x86_64-20-20131211.1-sda.qcow2,copy-on-read=on
2748@end example
2749
2750Example: boot from an image stored on a VMware vSphere server with a self-signed
2751certificate using a local overlay for writes, a readahead of 64k and a timeout
2752of 10 seconds.
2753@example
2754qemu-img create -f qcow2 -o backing_file='json:@{"file.driver":"https",, "file.url":"https://user:password@@vsphere.example.com/folder/test/test-flat.vmdk?dcPath=Datacenter&dsName=datastore1",, "file.sslverify":"off",, "file.readahead":"64k",, "file.timeout":10@}' /tmp/test.qcow2
2755
2756qemu-system-x86_64 -drive file=/tmp/test.qcow2
2757@end example
2758ETEXI
2759
2760STEXI
2761@end table
2762ETEXI
2763
2764DEFHEADING(Bluetooth(R) options)
2765STEXI
2766@table @option
2767ETEXI
2768
2769DEF("bt", HAS_ARG, QEMU_OPTION_bt, \
2770    "-bt hci,null    dumb bluetooth HCI - doesn't respond to commands\n" \
2771    "-bt hci,host[:id]\n" \
2772    "                use host's HCI with the given name\n" \
2773    "-bt hci[,vlan=n]\n" \
2774    "                emulate a standard HCI in virtual scatternet 'n'\n" \
2775    "-bt vhci[,vlan=n]\n" \
2776    "                add host computer to virtual scatternet 'n' using VHCI\n" \
2777    "-bt device:dev[,vlan=n]\n" \
2778    "                emulate a bluetooth device 'dev' in scatternet 'n'\n",
2779    QEMU_ARCH_ALL)
2780STEXI
2781@item -bt hci[...]
2782@findex -bt
2783Defines the function of the corresponding Bluetooth HCI.  -bt options
2784are matched with the HCIs present in the chosen machine type.  For
2785example when emulating a machine with only one HCI built into it, only
2786the first @code{-bt hci[...]} option is valid and defines the HCI's
2787logic.  The Transport Layer is decided by the machine type.  Currently
2788the machines @code{n800} and @code{n810} have one HCI and all other
2789machines have none.
2790
2791@anchor{bt-hcis}
2792The following three types are recognized:
2793
2794@table @option
2795@item -bt hci,null
2796(default) The corresponding Bluetooth HCI assumes no internal logic
2797and will not respond to any HCI commands or emit events.
2798
2799@item -bt hci,host[:@var{id}]
2800(@code{bluez} only) The corresponding HCI passes commands / events
2801to / from the physical HCI identified by the name @var{id} (default:
2802@code{hci0}) on the computer running QEMU.  Only available on @code{bluez}
2803capable systems like Linux.
2804
2805@item -bt hci[,vlan=@var{n}]
2806Add a virtual, standard HCI that will participate in the Bluetooth
2807scatternet @var{n} (default @code{0}).  Similarly to @option{-net}
2808VLANs, devices inside a bluetooth network @var{n} can only communicate
2809with other devices in the same network (scatternet).
2810@end table
2811
2812@item -bt vhci[,vlan=@var{n}]
2813(Linux-host only) Create a HCI in scatternet @var{n} (default 0) attached
2814to the host bluetooth stack instead of to the emulated target.  This
2815allows the host and target machines to participate in a common scatternet
2816and communicate.  Requires the Linux @code{vhci} driver installed.  Can
2817be used as following:
2818
2819@example
2820qemu-system-i386 [...OPTIONS...] -bt hci,vlan=5 -bt vhci,vlan=5
2821@end example
2822
2823@item -bt device:@var{dev}[,vlan=@var{n}]
2824Emulate a bluetooth device @var{dev} and place it in network @var{n}
2825(default @code{0}).  QEMU can only emulate one type of bluetooth devices
2826currently:
2827
2828@table @option
2829@item keyboard
2830Virtual wireless keyboard implementing the HIDP bluetooth profile.
2831@end table
2832ETEXI
2833
2834STEXI
2835@end table
2836ETEXI
2837DEFHEADING()
2838
2839#ifdef CONFIG_TPM
2840DEFHEADING(TPM device options)
2841
2842DEF("tpmdev", HAS_ARG, QEMU_OPTION_tpmdev, \
2843    "-tpmdev passthrough,id=id[,path=path][,cancel-path=path]\n"
2844    "                use path to provide path to a character device; default is /dev/tpm0\n"
2845    "                use cancel-path to provide path to TPM's cancel sysfs entry; if\n"
2846    "                not provided it will be searched for in /sys/class/misc/tpm?/device\n",
2847    QEMU_ARCH_ALL)
2848STEXI
2849
2850The general form of a TPM device option is:
2851@table @option
2852
2853@item -tpmdev @var{backend} ,id=@var{id} [,@var{options}]
2854@findex -tpmdev
2855Backend type must be:
2856@option{passthrough}.
2857
2858The specific backend type will determine the applicable options.
2859The @code{-tpmdev} option creates the TPM backend and requires a
2860@code{-device} option that specifies the TPM frontend interface model.
2861
2862Options to each backend are described below.
2863
2864Use 'help' to print all available TPM backend types.
2865@example
2866qemu -tpmdev help
2867@end example
2868
2869@item -tpmdev passthrough, id=@var{id}, path=@var{path}, cancel-path=@var{cancel-path}
2870
2871(Linux-host only) Enable access to the host's TPM using the passthrough
2872driver.
2873
2874@option{path} specifies the path to the host's TPM device, i.e., on
2875a Linux host this would be @code{/dev/tpm0}.
2876@option{path} is optional and by default @code{/dev/tpm0} is used.
2877
2878@option{cancel-path} specifies the path to the host TPM device's sysfs
2879entry allowing for cancellation of an ongoing TPM command.
2880@option{cancel-path} is optional and by default QEMU will search for the
2881sysfs entry to use.
2882
2883Some notes about using the host's TPM with the passthrough driver:
2884
2885The TPM device accessed by the passthrough driver must not be
2886used by any other application on the host.
2887
2888Since the host's firmware (BIOS/UEFI) has already initialized the TPM,
2889the VM's firmware (BIOS/UEFI) will not be able to initialize the
2890TPM again and may therefore not show a TPM-specific menu that would
2891otherwise allow the user to configure the TPM, e.g., allow the user to
2892enable/disable or activate/deactivate the TPM.
2893Further, if TPM ownership is released from within a VM then the host's TPM
2894will get disabled and deactivated. To enable and activate the
2895TPM again afterwards, the host has to be rebooted and the user is
2896required to enter the firmware's menu to enable and activate the TPM.
2897If the TPM is left disabled and/or deactivated most TPM commands will fail.
2898
2899To create a passthrough TPM use the following two options:
2900@example
2901-tpmdev passthrough,id=tpm0 -device tpm-tis,tpmdev=tpm0
2902@end example
2903Note that the @code{-tpmdev} id is @code{tpm0} and is referenced by
2904@code{tpmdev=tpm0} in the device option.
2905
2906@end table
2907
2908ETEXI
2909
2910DEFHEADING()
2911
2912#endif
2913
2914DEFHEADING(Linux/Multiboot boot specific)
2915STEXI
2916
2917When using these options, you can use a given Linux or Multiboot
2918kernel without installing it in the disk image. It can be useful
2919for easier testing of various kernels.
2920
2921@table @option
2922ETEXI
2923
2924DEF("kernel", HAS_ARG, QEMU_OPTION_kernel, \
2925    "-kernel bzImage use 'bzImage' as kernel image\n", QEMU_ARCH_ALL)
2926STEXI
2927@item -kernel @var{bzImage}
2928@findex -kernel
2929Use @var{bzImage} as kernel image. The kernel can be either a Linux kernel
2930or in multiboot format.
2931ETEXI
2932
2933DEF("append", HAS_ARG, QEMU_OPTION_append, \
2934    "-append cmdline use 'cmdline' as kernel command line\n", QEMU_ARCH_ALL)
2935STEXI
2936@item -append @var{cmdline}
2937@findex -append
2938Use @var{cmdline} as kernel command line
2939ETEXI
2940
2941DEF("initrd", HAS_ARG, QEMU_OPTION_initrd, \
2942           "-initrd file    use 'file' as initial ram disk\n", QEMU_ARCH_ALL)
2943STEXI
2944@item -initrd @var{file}
2945@findex -initrd
2946Use @var{file} as initial ram disk.
2947
2948@item -initrd "@var{file1} arg=foo,@var{file2}"
2949
2950This syntax is only available with multiboot.
2951
2952Use @var{file1} and @var{file2} as modules and pass arg=foo as parameter to the
2953first module.
2954ETEXI
2955
2956DEF("dtb", HAS_ARG, QEMU_OPTION_dtb, \
2957    "-dtb    file    use 'file' as device tree image\n", QEMU_ARCH_ALL)
2958STEXI
2959@item -dtb @var{file}
2960@findex -dtb
2961Use @var{file} as a device tree binary (dtb) image and pass it to the kernel
2962on boot.
2963ETEXI
2964
2965STEXI
2966@end table
2967ETEXI
2968DEFHEADING()
2969
2970DEFHEADING(Debug/Expert options)
2971STEXI
2972@table @option
2973ETEXI
2974
2975DEF("fw_cfg", HAS_ARG, QEMU_OPTION_fwcfg,
2976    "-fw_cfg [name=]<name>,file=<file>\n"
2977    "                add named fw_cfg entry with contents from file\n"
2978    "-fw_cfg [name=]<name>,string=<str>\n"
2979    "                add named fw_cfg entry with contents from string\n",
2980    QEMU_ARCH_ALL)
2981STEXI
2982
2983@item -fw_cfg [name=]@var{name},file=@var{file}
2984@findex -fw_cfg
2985Add named fw_cfg entry with contents from file @var{file}.
2986
2987@item -fw_cfg [name=]@var{name},string=@var{str}
2988Add named fw_cfg entry with contents from string @var{str}.
2989
2990The terminating NUL character of the contents of @var{str} will not be
2991included as part of the fw_cfg item data. To insert contents with
2992embedded NUL characters, you have to use the @var{file} parameter.
2993
2994The fw_cfg entries are passed by QEMU through to the guest.
2995
2996Example:
2997@example
2998    -fw_cfg name=opt/com.mycompany/blob,file=./my_blob.bin
2999@end example
3000creates an fw_cfg entry named opt/com.mycompany/blob with contents
3001from ./my_blob.bin.
3002
3003ETEXI
3004
3005DEF("serial", HAS_ARG, QEMU_OPTION_serial, \
3006    "-serial dev     redirect the serial port to char device 'dev'\n",
3007    QEMU_ARCH_ALL)
3008STEXI
3009@item -serial @var{dev}
3010@findex -serial
3011Redirect the virtual serial port to host character device
3012@var{dev}. The default device is @code{vc} in graphical mode and
3013@code{stdio} in non graphical mode.
3014
3015This option can be used several times to simulate up to 4 serial
3016ports.
3017
3018Use @code{-serial none} to disable all serial ports.
3019
3020Available character devices are:
3021@table @option
3022@item vc[:@var{W}x@var{H}]
3023Virtual console. Optionally, a width and height can be given in pixel with
3024@example
3025vc:800x600
3026@end example
3027It is also possible to specify width or height in characters:
3028@example
3029vc:80Cx24C
3030@end example
3031@item pty
3032[Linux only] Pseudo TTY (a new PTY is automatically allocated)
3033@item none
3034No device is allocated.
3035@item null
3036void device
3037@item chardev:@var{id}
3038Use a named character device defined with the @code{-chardev} option.
3039@item /dev/XXX
3040[Linux only] Use host tty, e.g. @file{/dev/ttyS0}. The host serial port
3041parameters are set according to the emulated ones.
3042@item /dev/parport@var{N}
3043[Linux only, parallel port only] Use host parallel port
3044@var{N}. Currently SPP and EPP parallel port features can be used.
3045@item file:@var{filename}
3046Write output to @var{filename}. No character can be read.
3047@item stdio
3048[Unix only] standard input/output
3049@item pipe:@var{filename}
3050name pipe @var{filename}
3051@item COM@var{n}
3052[Windows only] Use host serial port @var{n}
3053@item udp:[@var{remote_host}]:@var{remote_port}[@@[@var{src_ip}]:@var{src_port}]
3054This implements UDP Net Console.
3055When @var{remote_host} or @var{src_ip} are not specified
3056they default to @code{0.0.0.0}.
3057When not using a specified @var{src_port} a random port is automatically chosen.
3058
3059If you just want a simple readonly console you can use @code{netcat} or
3060@code{nc}, by starting QEMU with: @code{-serial udp::4555} and nc as:
3061@code{nc -u -l -p 4555}. Any time QEMU writes something to that port it
3062will appear in the netconsole session.
3063
3064If you plan to send characters back via netconsole or you want to stop
3065and start QEMU a lot of times, you should have QEMU use the same
3066source port each time by using something like @code{-serial
3067udp::4555@@:4556} to QEMU. Another approach is to use a patched
3068version of netcat which can listen to a TCP port and send and receive
3069characters via udp.  If you have a patched version of netcat which
3070activates telnet remote echo and single char transfer, then you can
3071use the following options to set up a netcat redirector to allow
3072telnet on port 5555 to access the QEMU port.
3073@table @code
3074@item QEMU Options:
3075-serial udp::4555@@:4556
3076@item netcat options:
3077-u -P 4555 -L 0.0.0.0:4556 -t -p 5555 -I -T
3078@item telnet options:
3079localhost 5555
3080@end table
3081
3082@item tcp:[@var{host}]:@var{port}[,@var{server}][,nowait][,nodelay][,reconnect=@var{seconds}]
3083The TCP Net Console has two modes of operation.  It can send the serial
3084I/O to a location or wait for a connection from a location.  By default
3085the TCP Net Console is sent to @var{host} at the @var{port}.  If you use
3086the @var{server} option QEMU will wait for a client socket application
3087to connect to the port before continuing, unless the @code{nowait}
3088option was specified.  The @code{nodelay} option disables the Nagle buffering
3089algorithm.  The @code{reconnect} option only applies if @var{noserver} is
3090set, if the connection goes down it will attempt to reconnect at the
3091given interval.  If @var{host} is omitted, 0.0.0.0 is assumed. Only
3092one TCP connection at a time is accepted. You can use @code{telnet} to
3093connect to the corresponding character device.
3094@table @code
3095@item Example to send tcp console to 192.168.0.2 port 4444
3096-serial tcp:192.168.0.2:4444
3097@item Example to listen and wait on port 4444 for connection
3098-serial tcp::4444,server
3099@item Example to not wait and listen on ip 192.168.0.100 port 4444
3100-serial tcp:192.168.0.100:4444,server,nowait
3101@end table
3102
3103@item telnet:@var{host}:@var{port}[,server][,nowait][,nodelay]
3104The telnet protocol is used instead of raw tcp sockets.  The options
3105work the same as if you had specified @code{-serial tcp}.  The
3106difference is that the port acts like a telnet server or client using
3107telnet option negotiation.  This will also allow you to send the
3108MAGIC_SYSRQ sequence if you use a telnet that supports sending the break
3109sequence.  Typically in unix telnet you do it with Control-] and then
3110type "send break" followed by pressing the enter key.
3111
3112@item unix:@var{path}[,server][,nowait][,reconnect=@var{seconds}]
3113A unix domain socket is used instead of a tcp socket.  The option works the
3114same as if you had specified @code{-serial tcp} except the unix domain socket
3115@var{path} is used for connections.
3116
3117@item mon:@var{dev_string}
3118This is a special option to allow the monitor to be multiplexed onto
3119another serial port.  The monitor is accessed with key sequence of
3120@key{Control-a} and then pressing @key{c}.
3121@var{dev_string} should be any one of the serial devices specified
3122above.  An example to multiplex the monitor onto a telnet server
3123listening on port 4444 would be:
3124@table @code
3125@item -serial mon:telnet::4444,server,nowait
3126@end table
3127When the monitor is multiplexed to stdio in this way, Ctrl+C will not terminate
3128QEMU any more but will be passed to the guest instead.
3129
3130@item braille
3131Braille device.  This will use BrlAPI to display the braille output on a real
3132or fake device.
3133
3134@item msmouse
3135Three button serial mouse. Configure the guest to use Microsoft protocol.
3136@end table
3137ETEXI
3138
3139DEF("parallel", HAS_ARG, QEMU_OPTION_parallel, \
3140    "-parallel dev   redirect the parallel port to char device 'dev'\n",
3141    QEMU_ARCH_ALL)
3142STEXI
3143@item -parallel @var{dev}
3144@findex -parallel
3145Redirect the virtual parallel port to host device @var{dev} (same
3146devices as the serial port). On Linux hosts, @file{/dev/parportN} can
3147be used to use hardware devices connected on the corresponding host
3148parallel port.
3149
3150This option can be used several times to simulate up to 3 parallel
3151ports.
3152
3153Use @code{-parallel none} to disable all parallel ports.
3154ETEXI
3155
3156DEF("monitor", HAS_ARG, QEMU_OPTION_monitor, \
3157    "-monitor dev    redirect the monitor to char device 'dev'\n",
3158    QEMU_ARCH_ALL)
3159STEXI
3160@item -monitor @var{dev}
3161@findex -monitor
3162Redirect the monitor to host device @var{dev} (same devices as the
3163serial port).
3164The default device is @code{vc} in graphical mode and @code{stdio} in
3165non graphical mode.
3166Use @code{-monitor none} to disable the default monitor.
3167ETEXI
3168DEF("qmp", HAS_ARG, QEMU_OPTION_qmp, \
3169    "-qmp dev        like -monitor but opens in 'control' mode\n",
3170    QEMU_ARCH_ALL)
3171STEXI
3172@item -qmp @var{dev}
3173@findex -qmp
3174Like -monitor but opens in 'control' mode.
3175ETEXI
3176DEF("qmp-pretty", HAS_ARG, QEMU_OPTION_qmp_pretty, \
3177    "-qmp-pretty dev like -qmp but uses pretty JSON formatting\n",
3178    QEMU_ARCH_ALL)
3179STEXI
3180@item -qmp-pretty @var{dev}
3181@findex -qmp-pretty
3182Like -qmp but uses pretty JSON formatting.
3183ETEXI
3184
3185DEF("mon", HAS_ARG, QEMU_OPTION_mon, \
3186    "-mon [chardev=]name[,mode=readline|control]\n", QEMU_ARCH_ALL)
3187STEXI
3188@item -mon [chardev=]name[,mode=readline|control]
3189@findex -mon
3190Setup monitor on chardev @var{name}.
3191ETEXI
3192
3193DEF("debugcon", HAS_ARG, QEMU_OPTION_debugcon, \
3194    "-debugcon dev   redirect the debug console to char device 'dev'\n",
3195    QEMU_ARCH_ALL)
3196STEXI
3197@item -debugcon @var{dev}
3198@findex -debugcon
3199Redirect the debug console to host device @var{dev} (same devices as the
3200serial port).  The debug console is an I/O port which is typically port
32010xe9; writing to that I/O port sends output to this device.
3202The default device is @code{vc} in graphical mode and @code{stdio} in
3203non graphical mode.
3204ETEXI
3205
3206DEF("pidfile", HAS_ARG, QEMU_OPTION_pidfile, \
3207    "-pidfile file   write PID to 'file'\n", QEMU_ARCH_ALL)
3208STEXI
3209@item -pidfile @var{file}
3210@findex -pidfile
3211Store the QEMU process PID in @var{file}. It is useful if you launch QEMU
3212from a script.
3213ETEXI
3214
3215DEF("singlestep", 0, QEMU_OPTION_singlestep, \
3216    "-singlestep     always run in singlestep mode\n", QEMU_ARCH_ALL)
3217STEXI
3218@item -singlestep
3219@findex -singlestep
3220Run the emulation in single step mode.
3221ETEXI
3222
3223DEF("S", 0, QEMU_OPTION_S, \
3224    "-S              freeze CPU at startup (use 'c' to start execution)\n",
3225    QEMU_ARCH_ALL)
3226STEXI
3227@item -S
3228@findex -S
3229Do not start CPU at startup (you must type 'c' in the monitor).
3230ETEXI
3231
3232DEF("realtime", HAS_ARG, QEMU_OPTION_realtime,
3233    "-realtime [mlock=on|off]\n"
3234    "                run qemu with realtime features\n"
3235    "                mlock=on|off controls mlock support (default: on)\n",
3236    QEMU_ARCH_ALL)
3237STEXI
3238@item -realtime mlock=on|off
3239@findex -realtime
3240Run qemu with realtime features.
3241mlocking qemu and guest memory can be enabled via @option{mlock=on}
3242(enabled by default).
3243ETEXI
3244
3245DEF("gdb", HAS_ARG, QEMU_OPTION_gdb, \
3246    "-gdb dev        wait for gdb connection on 'dev'\n", QEMU_ARCH_ALL)
3247STEXI
3248@item -gdb @var{dev}
3249@findex -gdb
3250Wait for gdb connection on device @var{dev} (@pxref{gdb_usage}). Typical
3251connections will likely be TCP-based, but also UDP, pseudo TTY, or even
3252stdio are reasonable use case. The latter is allowing to start QEMU from
3253within gdb and establish the connection via a pipe:
3254@example
3255(gdb) target remote | exec qemu-system-i386 -gdb stdio ...
3256@end example
3257ETEXI
3258
3259DEF("s", 0, QEMU_OPTION_s, \
3260    "-s              shorthand for -gdb tcp::" DEFAULT_GDBSTUB_PORT "\n",
3261    QEMU_ARCH_ALL)
3262STEXI
3263@item -s
3264@findex -s
3265Shorthand for -gdb tcp::1234, i.e. open a gdbserver on TCP port 1234
3266(@pxref{gdb_usage}).
3267ETEXI
3268
3269DEF("d", HAS_ARG, QEMU_OPTION_d, \
3270    "-d item1,...    enable logging of specified items (use '-d help' for a list of log items)\n",
3271    QEMU_ARCH_ALL)
3272STEXI
3273@item -d @var{item1}[,...]
3274@findex -d
3275Enable logging of specified items. Use '-d help' for a list of log items.
3276ETEXI
3277
3278DEF("D", HAS_ARG, QEMU_OPTION_D, \
3279    "-D logfile      output log to logfile (default stderr)\n",
3280    QEMU_ARCH_ALL)
3281STEXI
3282@item -D @var{logfile}
3283@findex -D
3284Output log in @var{logfile} instead of to stderr
3285ETEXI
3286
3287DEF("dfilter", HAS_ARG, QEMU_OPTION_DFILTER, \
3288    "-dfilter range,..  filter debug output to range of addresses (useful for -d cpu,exec,etc..)\n",
3289    QEMU_ARCH_ALL)
3290STEXI
3291@item -dfilter @var{range1}[,...]
3292@findex -dfilter
3293Filter debug output to that relevant to a range of target addresses. The filter
3294spec can be either @var{start}+@var{size}, @var{start}-@var{size} or
3295@var{start}..@var{end} where @var{start} @var{end} and @var{size} are the
3296addresses and sizes required. For example:
3297@example
3298    -dfilter 0x8000..0x8fff,0xffffffc000080000+0x200,0xffffffc000060000-0x1000
3299@end example
3300Will dump output for any code in the 0x1000 sized block starting at 0x8000 and
3301the 0x200 sized block starting at 0xffffffc000080000 and another 0x1000 sized
3302block starting at 0xffffffc00005f000.
3303ETEXI
3304
3305DEF("L", HAS_ARG, QEMU_OPTION_L, \
3306    "-L path         set the directory for the BIOS, VGA BIOS and keymaps\n",
3307    QEMU_ARCH_ALL)
3308STEXI
3309@item -L  @var{path}
3310@findex -L
3311Set the directory for the BIOS, VGA BIOS and keymaps.
3312
3313To list all the data directories, use @code{-L help}.
3314ETEXI
3315
3316DEF("bios", HAS_ARG, QEMU_OPTION_bios, \
3317    "-bios file      set the filename for the BIOS\n", QEMU_ARCH_ALL)
3318STEXI
3319@item -bios @var{file}
3320@findex -bios
3321Set the filename for the BIOS.
3322ETEXI
3323
3324DEF("enable-kvm", 0, QEMU_OPTION_enable_kvm, \
3325    "-enable-kvm     enable KVM full virtualization support\n", QEMU_ARCH_ALL)
3326STEXI
3327@item -enable-kvm
3328@findex -enable-kvm
3329Enable KVM full virtualization support. This option is only available
3330if KVM support is enabled when compiling.
3331ETEXI
3332
3333DEF("enable-hax", 0, QEMU_OPTION_enable_hax, \
3334    "-enable-hax     enable HAX virtualization support\n", QEMU_ARCH_I386)
3335STEXI
3336@item -enable-hax
3337@findex -enable-hax
3338Enable HAX (Hardware-based Acceleration eXecution) support. This option
3339is only available if HAX support is enabled when compiling. HAX is only
3340applicable to MAC and Windows platform, and thus does not conflict with
3341KVM.
3342ETEXI
3343
3344DEF("xen-domid", HAS_ARG, QEMU_OPTION_xen_domid,
3345    "-xen-domid id   specify xen guest domain id\n", QEMU_ARCH_ALL)
3346DEF("xen-create", 0, QEMU_OPTION_xen_create,
3347    "-xen-create     create domain using xen hypercalls, bypassing xend\n"
3348    "                warning: should not be used when xend is in use\n",
3349    QEMU_ARCH_ALL)
3350DEF("xen-attach", 0, QEMU_OPTION_xen_attach,
3351    "-xen-attach     attach to existing xen domain\n"
3352    "                xend will use this when starting QEMU\n",
3353    QEMU_ARCH_ALL)
3354STEXI
3355@item -xen-domid @var{id}
3356@findex -xen-domid
3357Specify xen guest domain @var{id} (XEN only).
3358@item -xen-create
3359@findex -xen-create
3360Create domain using xen hypercalls, bypassing xend.
3361Warning: should not be used when xend is in use (XEN only).
3362@item -xen-attach
3363@findex -xen-attach
3364Attach to existing xen domain.
3365xend will use this when starting QEMU (XEN only).
3366ETEXI
3367
3368DEF("no-reboot", 0, QEMU_OPTION_no_reboot, \
3369    "-no-reboot      exit instead of rebooting\n", QEMU_ARCH_ALL)
3370STEXI
3371@item -no-reboot
3372@findex -no-reboot
3373Exit instead of rebooting.
3374ETEXI
3375
3376DEF("no-shutdown", 0, QEMU_OPTION_no_shutdown, \
3377    "-no-shutdown    stop before shutdown\n", QEMU_ARCH_ALL)
3378STEXI
3379@item -no-shutdown
3380@findex -no-shutdown
3381Don't exit QEMU on guest shutdown, but instead only stop the emulation.
3382This allows for instance switching to monitor to commit changes to the
3383disk image.
3384ETEXI
3385
3386DEF("loadvm", HAS_ARG, QEMU_OPTION_loadvm, \
3387    "-loadvm [tag|id]\n" \
3388    "                start right away with a saved state (loadvm in monitor)\n",
3389    QEMU_ARCH_ALL)
3390STEXI
3391@item -loadvm @var{file}
3392@findex -loadvm
3393Start right away with a saved state (@code{loadvm} in monitor)
3394ETEXI
3395
3396#ifndef _WIN32
3397DEF("daemonize", 0, QEMU_OPTION_daemonize, \
3398    "-daemonize      daemonize QEMU after initializing\n", QEMU_ARCH_ALL)
3399#endif
3400STEXI
3401@item -daemonize
3402@findex -daemonize
3403Daemonize the QEMU process after initialization.  QEMU will not detach from
3404standard IO until it is ready to receive connections on any of its devices.
3405This option is a useful way for external programs to launch QEMU without having
3406to cope with initialization race conditions.
3407ETEXI
3408
3409DEF("option-rom", HAS_ARG, QEMU_OPTION_option_rom, \
3410    "-option-rom rom load a file, rom, into the option ROM space\n",
3411    QEMU_ARCH_ALL)
3412STEXI
3413@item -option-rom @var{file}
3414@findex -option-rom
3415Load the contents of @var{file} as an option ROM.
3416This option is useful to load things like EtherBoot.
3417ETEXI
3418
3419HXCOMM Silently ignored for compatibility
3420DEF("clock", HAS_ARG, QEMU_OPTION_clock, "", QEMU_ARCH_ALL)
3421
3422HXCOMM Options deprecated by -rtc
3423DEF("localtime", 0, QEMU_OPTION_localtime, "", QEMU_ARCH_ALL)
3424DEF("startdate", HAS_ARG, QEMU_OPTION_startdate, "", QEMU_ARCH_ALL)
3425
3426DEF("rtc", HAS_ARG, QEMU_OPTION_rtc, \
3427    "-rtc [base=utc|localtime|date][,clock=host|rt|vm][,driftfix=none|slew]\n" \
3428    "                set the RTC base and clock, enable drift fix for clock ticks (x86 only)\n",
3429    QEMU_ARCH_ALL)
3430
3431STEXI
3432
3433@item -rtc [base=utc|localtime|@var{date}][,clock=host|vm][,driftfix=none|slew]
3434@findex -rtc
3435Specify @option{base} as @code{utc} or @code{localtime} to let the RTC start at the current
3436UTC or local time, respectively. @code{localtime} is required for correct date in
3437MS-DOS or Windows. To start at a specific point in time, provide @var{date} in the
3438format @code{2006-06-17T16:01:21} or @code{2006-06-17}. The default base is UTC.
3439
3440By default the RTC is driven by the host system time. This allows using of the
3441RTC as accurate reference clock inside the guest, specifically if the host
3442time is smoothly following an accurate external reference clock, e.g. via NTP.
3443If you want to isolate the guest time from the host, you can set @option{clock}
3444to @code{rt} instead.  To even prevent it from progressing during suspension,
3445you can set it to @code{vm}.
3446
3447Enable @option{driftfix} (i386 targets only) if you experience time drift problems,
3448specifically with Windows' ACPI HAL. This option will try to figure out how
3449many timer interrupts were not processed by the Windows guest and will
3450re-inject them.
3451ETEXI
3452
3453DEF("icount", HAS_ARG, QEMU_OPTION_icount, \
3454    "-icount [shift=N|auto][,align=on|off][,sleep=on|off,rr=record|replay,rrfile=<filename>,rrsnapshot=<snapshot>]\n" \
3455    "                enable virtual instruction counter with 2^N clock ticks per\n" \
3456    "                instruction, enable aligning the host and virtual clocks\n" \
3457    "                or disable real time cpu sleeping\n", QEMU_ARCH_ALL)
3458STEXI
3459@item -icount [shift=@var{N}|auto][,rr=record|replay,rrfile=@var{filename},rrsnapshot=@var{snapshot}]
3460@findex -icount
3461Enable virtual instruction counter.  The virtual cpu will execute one
3462instruction every 2^@var{N} ns of virtual time.  If @code{auto} is specified
3463then the virtual cpu speed will be automatically adjusted to keep virtual
3464time within a few seconds of real time.
3465
3466When the virtual cpu is sleeping, the virtual time will advance at default
3467speed unless @option{sleep=on|off} is specified.
3468With @option{sleep=on|off}, the virtual time will jump to the next timer deadline
3469instantly whenever the virtual cpu goes to sleep mode and will not advance
3470if no timer is enabled. This behavior give deterministic execution times from
3471the guest point of view.
3472
3473Note that while this option can give deterministic behavior, it does not
3474provide cycle accurate emulation.  Modern CPUs contain superscalar out of
3475order cores with complex cache hierarchies.  The number of instructions
3476executed often has little or no correlation with actual performance.
3477
3478@option{align=on} will activate the delay algorithm which will try
3479to synchronise the host clock and the virtual clock. The goal is to
3480have a guest running at the real frequency imposed by the shift option.
3481Whenever the guest clock is behind the host clock and if
3482@option{align=on} is specified then we print a message to the user
3483to inform about the delay.
3484Currently this option does not work when @option{shift} is @code{auto}.
3485Note: The sync algorithm will work for those shift values for which
3486the guest clock runs ahead of the host clock. Typically this happens
3487when the shift value is high (how high depends on the host machine).
3488
3489When @option{rr} option is specified deterministic record/replay is enabled.
3490Replay log is written into @var{filename} file in record mode and
3491read from this file in replay mode.
3492
3493Option rrsnapshot is used to create new vm snapshot named @var{snapshot}
3494at the start of execution recording. In replay mode this option is used
3495to load the initial VM state.
3496ETEXI
3497
3498DEF("watchdog", HAS_ARG, QEMU_OPTION_watchdog, \
3499    "-watchdog model\n" \
3500    "                enable virtual hardware watchdog [default=none]\n",
3501    QEMU_ARCH_ALL)
3502STEXI
3503@item -watchdog @var{model}
3504@findex -watchdog
3505Create a virtual hardware watchdog device.  Once enabled (by a guest
3506action), the watchdog must be periodically polled by an agent inside
3507the guest or else the guest will be restarted. Choose a model for
3508which your guest has drivers.
3509
3510The @var{model} is the model of hardware watchdog to emulate. Use
3511@code{-watchdog help} to list available hardware models. Only one
3512watchdog can be enabled for a guest.
3513
3514The following models may be available:
3515@table @option
3516@item ib700
3517iBASE 700 is a very simple ISA watchdog with a single timer.
3518@item i6300esb
3519Intel 6300ESB I/O controller hub is a much more featureful PCI-based
3520dual-timer watchdog.
3521@item diag288
3522A virtual watchdog for s390x backed by the diagnose 288 hypercall
3523(currently KVM only).
3524@end table
3525ETEXI
3526
3527DEF("watchdog-action", HAS_ARG, QEMU_OPTION_watchdog_action, \
3528    "-watchdog-action reset|shutdown|poweroff|pause|debug|none\n" \
3529    "                action when watchdog fires [default=reset]\n",
3530    QEMU_ARCH_ALL)
3531STEXI
3532@item -watchdog-action @var{action}
3533@findex -watchdog-action
3534
3535The @var{action} controls what QEMU will do when the watchdog timer
3536expires.
3537The default is
3538@code{reset} (forcefully reset the guest).
3539Other possible actions are:
3540@code{shutdown} (attempt to gracefully shutdown the guest),
3541@code{poweroff} (forcefully poweroff the guest),
3542@code{pause} (pause the guest),
3543@code{debug} (print a debug message and continue), or
3544@code{none} (do nothing).
3545
3546Note that the @code{shutdown} action requires that the guest responds
3547to ACPI signals, which it may not be able to do in the sort of
3548situations where the watchdog would have expired, and thus
3549@code{-watchdog-action shutdown} is not recommended for production use.
3550
3551Examples:
3552
3553@table @code
3554@item -watchdog i6300esb -watchdog-action pause
3555@itemx -watchdog ib700
3556@end table
3557ETEXI
3558
3559DEF("echr", HAS_ARG, QEMU_OPTION_echr, \
3560    "-echr chr       set terminal escape character instead of ctrl-a\n",
3561    QEMU_ARCH_ALL)
3562STEXI
3563
3564@item -echr @var{numeric_ascii_value}
3565@findex -echr
3566Change the escape character used for switching to the monitor when using
3567monitor and serial sharing.  The default is @code{0x01} when using the
3568@code{-nographic} option.  @code{0x01} is equal to pressing
3569@code{Control-a}.  You can select a different character from the ascii
3570control keys where 1 through 26 map to Control-a through Control-z.  For
3571instance you could use the either of the following to change the escape
3572character to Control-t.
3573@table @code
3574@item -echr 0x14
3575@itemx -echr 20
3576@end table
3577ETEXI
3578
3579DEF("virtioconsole", HAS_ARG, QEMU_OPTION_virtiocon, \
3580    "-virtioconsole c\n" \
3581    "                set virtio console\n", QEMU_ARCH_ALL)
3582STEXI
3583@item -virtioconsole @var{c}
3584@findex -virtioconsole
3585Set virtio console.
3586
3587This option is maintained for backward compatibility.
3588
3589Please use @code{-device virtconsole} for the new way of invocation.
3590ETEXI
3591
3592DEF("show-cursor", 0, QEMU_OPTION_show_cursor, \
3593    "-show-cursor    show cursor\n", QEMU_ARCH_ALL)
3594STEXI
3595@item -show-cursor
3596@findex -show-cursor
3597Show cursor.
3598ETEXI
3599
3600DEF("tb-size", HAS_ARG, QEMU_OPTION_tb_size, \
3601    "-tb-size n      set TB size\n", QEMU_ARCH_ALL)
3602STEXI
3603@item -tb-size @var{n}
3604@findex -tb-size
3605Set TB size.
3606ETEXI
3607
3608DEF("incoming", HAS_ARG, QEMU_OPTION_incoming, \
3609    "-incoming tcp:[host]:port[,to=maxport][,ipv4][,ipv6]\n" \
3610    "-incoming rdma:host:port[,ipv4][,ipv6]\n" \
3611    "-incoming unix:socketpath\n" \
3612    "                prepare for incoming migration, listen on\n" \
3613    "                specified protocol and socket address\n" \
3614    "-incoming fd:fd\n" \
3615    "-incoming exec:cmdline\n" \
3616    "                accept incoming migration on given file descriptor\n" \
3617    "                or from given external command\n" \
3618    "-incoming defer\n" \
3619    "                wait for the URI to be specified via migrate_incoming\n",
3620    QEMU_ARCH_ALL)
3621STEXI
3622@item -incoming tcp:[@var{host}]:@var{port}[,to=@var{maxport}][,ipv4][,ipv6]
3623@itemx -incoming rdma:@var{host}:@var{port}[,ipv4][,ipv6]
3624@findex -incoming
3625Prepare for incoming migration, listen on a given tcp port.
3626
3627@item -incoming unix:@var{socketpath}
3628Prepare for incoming migration, listen on a given unix socket.
3629
3630@item -incoming fd:@var{fd}
3631Accept incoming migration from a given filedescriptor.
3632
3633@item -incoming exec:@var{cmdline}
3634Accept incoming migration as an output from specified external command.
3635
3636@item -incoming defer
3637Wait for the URI to be specified via migrate_incoming.  The monitor can
3638be used to change settings (such as migration parameters) prior to issuing
3639the migrate_incoming to allow the migration to begin.
3640ETEXI
3641
3642DEF("only-migratable", 0, QEMU_OPTION_only_migratable, \
3643    "-only-migratable     allow only migratable devices\n", QEMU_ARCH_ALL)
3644STEXI
3645@item -only-migratable
3646@findex -only-migratable
3647Only allow migratable devices. Devices will not be allowed to enter an
3648unmigratable state.
3649ETEXI
3650
3651DEF("nodefaults", 0, QEMU_OPTION_nodefaults, \
3652    "-nodefaults     don't create default devices\n", QEMU_ARCH_ALL)
3653STEXI
3654@item -nodefaults
3655@findex -nodefaults
3656Don't create default devices. Normally, QEMU sets the default devices like serial
3657port, parallel port, virtual console, monitor device, VGA adapter, floppy and
3658CD-ROM drive and others. The @code{-nodefaults} option will disable all those
3659default devices.
3660ETEXI
3661
3662#ifndef _WIN32
3663DEF("chroot", HAS_ARG, QEMU_OPTION_chroot, \
3664    "-chroot dir     chroot to dir just before starting the VM\n",
3665    QEMU_ARCH_ALL)
3666#endif
3667STEXI
3668@item -chroot @var{dir}
3669@findex -chroot
3670Immediately before starting guest execution, chroot to the specified
3671directory.  Especially useful in combination with -runas.
3672ETEXI
3673
3674#ifndef _WIN32
3675DEF("runas", HAS_ARG, QEMU_OPTION_runas, \
3676    "-runas user     change to user id user just before starting the VM\n",
3677    QEMU_ARCH_ALL)
3678#endif
3679STEXI
3680@item -runas @var{user}
3681@findex -runas
3682Immediately before starting guest execution, drop root privileges, switching
3683to the specified user.
3684ETEXI
3685
3686DEF("prom-env", HAS_ARG, QEMU_OPTION_prom_env,
3687    "-prom-env variable=value\n"
3688    "                set OpenBIOS nvram variables\n",
3689    QEMU_ARCH_PPC | QEMU_ARCH_SPARC)
3690STEXI
3691@item -prom-env @var{variable}=@var{value}
3692@findex -prom-env
3693Set OpenBIOS nvram @var{variable} to given @var{value} (PPC, SPARC only).
3694ETEXI
3695DEF("semihosting", 0, QEMU_OPTION_semihosting,
3696    "-semihosting    semihosting mode\n",
3697    QEMU_ARCH_ARM | QEMU_ARCH_M68K | QEMU_ARCH_XTENSA | QEMU_ARCH_LM32 |
3698    QEMU_ARCH_MIPS)
3699STEXI
3700@item -semihosting
3701@findex -semihosting
3702Enable semihosting mode (ARM, M68K, Xtensa, MIPS only).
3703ETEXI
3704DEF("semihosting-config", HAS_ARG, QEMU_OPTION_semihosting_config,
3705    "-semihosting-config [enable=on|off][,target=native|gdb|auto][,arg=str[,...]]\n" \
3706    "                semihosting configuration\n",
3707QEMU_ARCH_ARM | QEMU_ARCH_M68K | QEMU_ARCH_XTENSA | QEMU_ARCH_LM32 |
3708QEMU_ARCH_MIPS)
3709STEXI
3710@item -semihosting-config [enable=on|off][,target=native|gdb|auto][,arg=str[,...]]
3711@findex -semihosting-config
3712Enable and configure semihosting (ARM, M68K, Xtensa, MIPS only).
3713@table @option
3714@item target=@code{native|gdb|auto}
3715Defines where the semihosting calls will be addressed, to QEMU (@code{native})
3716or to GDB (@code{gdb}). The default is @code{auto}, which means @code{gdb}
3717during debug sessions and @code{native} otherwise.
3718@item arg=@var{str1},arg=@var{str2},...
3719Allows the user to pass input arguments, and can be used multiple times to build
3720up a list. The old-style @code{-kernel}/@code{-append} method of passing a
3721command line is still supported for backward compatibility. If both the
3722@code{--semihosting-config arg} and the @code{-kernel}/@code{-append} are
3723specified, the former is passed to semihosting as it always takes precedence.
3724@end table
3725ETEXI
3726DEF("old-param", 0, QEMU_OPTION_old_param,
3727    "-old-param      old param mode\n", QEMU_ARCH_ARM)
3728STEXI
3729@item -old-param
3730@findex -old-param (ARM)
3731Old param mode (ARM only).
3732ETEXI
3733
3734DEF("sandbox", HAS_ARG, QEMU_OPTION_sandbox, \
3735    "-sandbox <arg>  Enable seccomp mode 2 system call filter (default 'off').\n",
3736    QEMU_ARCH_ALL)
3737STEXI
3738@item -sandbox @var{arg}
3739@findex -sandbox
3740Enable Seccomp mode 2 system call filter. 'on' will enable syscall filtering and 'off' will
3741disable it.  The default is 'off'.
3742ETEXI
3743
3744DEF("readconfig", HAS_ARG, QEMU_OPTION_readconfig,
3745    "-readconfig <file>\n", QEMU_ARCH_ALL)
3746STEXI
3747@item -readconfig @var{file}
3748@findex -readconfig
3749Read device configuration from @var{file}. This approach is useful when you want to spawn
3750QEMU process with many command line options but you don't want to exceed the command line
3751character limit.
3752ETEXI
3753DEF("writeconfig", HAS_ARG, QEMU_OPTION_writeconfig,
3754    "-writeconfig <file>\n"
3755    "                read/write config file\n", QEMU_ARCH_ALL)
3756STEXI
3757@item -writeconfig @var{file}
3758@findex -writeconfig
3759Write device configuration to @var{file}. The @var{file} can be either filename to save
3760command line and device configuration into file or dash @code{-}) character to print the
3761output to stdout. This can be later used as input file for @code{-readconfig} option.
3762ETEXI
3763DEF("nodefconfig", 0, QEMU_OPTION_nodefconfig,
3764    "-nodefconfig\n"
3765    "                do not load default config files at startup\n",
3766    QEMU_ARCH_ALL)
3767STEXI
3768@item -nodefconfig
3769@findex -nodefconfig
3770Normally QEMU loads configuration files from @var{sysconfdir} and @var{datadir} at startup.
3771The @code{-nodefconfig} option will prevent QEMU from loading any of those config files.
3772ETEXI
3773DEF("no-user-config", 0, QEMU_OPTION_nouserconfig,
3774    "-no-user-config\n"
3775    "                do not load user-provided config files at startup\n",
3776    QEMU_ARCH_ALL)
3777STEXI
3778@item -no-user-config
3779@findex -no-user-config
3780The @code{-no-user-config} option makes QEMU not load any of the user-provided
3781config files on @var{sysconfdir}, but won't make it skip the QEMU-provided config
3782files from @var{datadir}.
3783ETEXI
3784DEF("trace", HAS_ARG, QEMU_OPTION_trace,
3785    "-trace [[enable=]<pattern>][,events=<file>][,file=<file>]\n"
3786    "                specify tracing options\n",
3787    QEMU_ARCH_ALL)
3788STEXI
3789HXCOMM This line is not accurate, as some sub-options are backend-specific but
3790HXCOMM HX does not support conditional compilation of text.
3791@item -trace [[enable=]@var{pattern}][,events=@var{file}][,file=@var{file}]
3792@findex -trace
3793@include qemu-option-trace.texi
3794ETEXI
3795
3796HXCOMM Internal use
3797DEF("qtest", HAS_ARG, QEMU_OPTION_qtest, "", QEMU_ARCH_ALL)
3798DEF("qtest-log", HAS_ARG, QEMU_OPTION_qtest_log, "", QEMU_ARCH_ALL)
3799
3800#ifdef __linux__
3801DEF("enable-fips", 0, QEMU_OPTION_enablefips,
3802    "-enable-fips    enable FIPS 140-2 compliance\n",
3803    QEMU_ARCH_ALL)
3804#endif
3805STEXI
3806@item -enable-fips
3807@findex -enable-fips
3808Enable FIPS 140-2 compliance mode.
3809ETEXI
3810
3811HXCOMM Deprecated by -machine accel=tcg property
3812DEF("no-kvm", 0, QEMU_OPTION_no_kvm, "", QEMU_ARCH_I386)
3813
3814HXCOMM Deprecated by kvm-pit driver properties
3815DEF("no-kvm-pit-reinjection", 0, QEMU_OPTION_no_kvm_pit_reinjection,
3816    "", QEMU_ARCH_I386)
3817
3818HXCOMM Deprecated (ignored)
3819DEF("no-kvm-pit", 0, QEMU_OPTION_no_kvm_pit, "", QEMU_ARCH_I386)
3820
3821HXCOMM Deprecated by -machine kernel_irqchip=on|off property
3822DEF("no-kvm-irqchip", 0, QEMU_OPTION_no_kvm_irqchip, "", QEMU_ARCH_I386)
3823
3824HXCOMM Deprecated (ignored)
3825DEF("tdf", 0, QEMU_OPTION_tdf,"", QEMU_ARCH_ALL)
3826
3827DEF("msg", HAS_ARG, QEMU_OPTION_msg,
3828    "-msg timestamp[=on|off]\n"
3829    "                change the format of messages\n"
3830    "                on|off controls leading timestamps (default:on)\n",
3831    QEMU_ARCH_ALL)
3832STEXI
3833@item -msg timestamp[=on|off]
3834@findex -msg
3835prepend a timestamp to each log message.(default:on)
3836ETEXI
3837
3838DEF("dump-vmstate", HAS_ARG, QEMU_OPTION_dump_vmstate,
3839    "-dump-vmstate <file>\n"
3840    "                Output vmstate information in JSON format to file.\n"
3841    "                Use the scripts/vmstate-static-checker.py file to\n"
3842    "                check for possible regressions in migration code\n"
3843    "                by comparing two such vmstate dumps.\n",
3844    QEMU_ARCH_ALL)
3845STEXI
3846@item -dump-vmstate @var{file}
3847@findex -dump-vmstate
3848Dump json-encoded vmstate information for current machine type to file
3849in @var{file}
3850ETEXI
3851
3852STEXI
3853@end table
3854ETEXI
3855DEFHEADING()
3856DEFHEADING(Generic object creation)
3857STEXI
3858@table @option
3859ETEXI
3860
3861DEF("object", HAS_ARG, QEMU_OPTION_object,
3862    "-object TYPENAME[,PROP1=VALUE1,...]\n"
3863    "                create a new object of type TYPENAME setting properties\n"
3864    "                in the order they are specified.  Note that the 'id'\n"
3865    "                property must be set.  These objects are placed in the\n"
3866    "                '/objects' path.\n",
3867    QEMU_ARCH_ALL)
3868STEXI
3869@item -object @var{typename}[,@var{prop1}=@var{value1},...]
3870@findex -object
3871Create a new object of type @var{typename} setting properties
3872in the order they are specified.  Note that the 'id'
3873property must be set.  These objects are placed in the
3874'/objects' path.
3875
3876@table @option
3877
3878@item -object memory-backend-file,id=@var{id},size=@var{size},mem-path=@var{dir},share=@var{on|off}
3879
3880Creates a memory file backend object, which can be used to back
3881the guest RAM with huge pages. The @option{id} parameter is a
3882unique ID that will be used to reference this memory region
3883when configuring the @option{-numa} argument. The @option{size}
3884option provides the size of the memory region, and accepts
3885common suffixes, eg @option{500M}. The @option{mem-path} provides
3886the path to either a shared memory or huge page filesystem mount.
3887The @option{share} boolean option determines whether the memory
3888region is marked as private to QEMU, or shared. The latter allows
3889a co-operating external process to access the QEMU memory region.
3890
3891@item -object rng-random,id=@var{id},filename=@var{/dev/random}
3892
3893Creates a random number generator backend which obtains entropy from
3894a device on the host. The @option{id} parameter is a unique ID that
3895will be used to reference this entropy backend from the @option{virtio-rng}
3896device. The @option{filename} parameter specifies which file to obtain
3897entropy from and if omitted defaults to @option{/dev/random}.
3898
3899@item -object rng-egd,id=@var{id},chardev=@var{chardevid}
3900
3901Creates a random number generator backend which obtains entropy from
3902an external daemon running on the host. The @option{id} parameter is
3903a unique ID that will be used to reference this entropy backend from
3904the @option{virtio-rng} device. The @option{chardev} parameter is
3905the unique ID of a character device backend that provides the connection
3906to the RNG daemon.
3907
3908@item -object tls-creds-anon,id=@var{id},endpoint=@var{endpoint},dir=@var{/path/to/cred/dir},verify-peer=@var{on|off}
3909
3910Creates a TLS anonymous credentials object, which can be used to provide
3911TLS support on network backends. The @option{id} parameter is a unique
3912ID which network backends will use to access the credentials. The
3913@option{endpoint} is either @option{server} or @option{client} depending
3914on whether the QEMU network backend that uses the credentials will be
3915acting as a client or as a server. If @option{verify-peer} is enabled
3916(the default) then once the handshake is completed, the peer credentials
3917will be verified, though this is a no-op for anonymous credentials.
3918
3919The @var{dir} parameter tells QEMU where to find the credential
3920files. For server endpoints, this directory may contain a file
3921@var{dh-params.pem} providing diffie-hellman parameters to use
3922for the TLS server. If the file is missing, QEMU will generate
3923a set of DH parameters at startup. This is a computationally
3924expensive operation that consumes random pool entropy, so it is
3925recommended that a persistent set of parameters be generated
3926upfront and saved.
3927
3928@item -object tls-creds-x509,id=@var{id},endpoint=@var{endpoint},dir=@var{/path/to/cred/dir},verify-peer=@var{on|off},passwordid=@var{id}
3929
3930Creates a TLS anonymous credentials object, which can be used to provide
3931TLS support on network backends. The @option{id} parameter is a unique
3932ID which network backends will use to access the credentials. The
3933@option{endpoint} is either @option{server} or @option{client} depending
3934on whether the QEMU network backend that uses the credentials will be
3935acting as a client or as a server. If @option{verify-peer} is enabled
3936(the default) then once the handshake is completed, the peer credentials
3937will be verified. With x509 certificates, this implies that the clients
3938must be provided with valid client certificates too.
3939
3940The @var{dir} parameter tells QEMU where to find the credential
3941files. For server endpoints, this directory may contain a file
3942@var{dh-params.pem} providing diffie-hellman parameters to use
3943for the TLS server. If the file is missing, QEMU will generate
3944a set of DH parameters at startup. This is a computationally
3945expensive operation that consumes random pool entropy, so it is
3946recommended that a persistent set of parameters be generated
3947upfront and saved.
3948
3949For x509 certificate credentials the directory will contain further files
3950providing the x509 certificates. The certificates must be stored
3951in PEM format, in filenames @var{ca-cert.pem}, @var{ca-crl.pem} (optional),
3952@var{server-cert.pem} (only servers), @var{server-key.pem} (only servers),
3953@var{client-cert.pem} (only clients), and @var{client-key.pem} (only clients).
3954
3955For the @var{server-key.pem} and @var{client-key.pem} files which
3956contain sensitive private keys, it is possible to use an encrypted
3957version by providing the @var{passwordid} parameter. This provides
3958the ID of a previously created @code{secret} object containing the
3959password for decryption.
3960
3961@item -object filter-buffer,id=@var{id},netdev=@var{netdevid},interval=@var{t}[,queue=@var{all|rx|tx}][,status=@var{on|off}]
3962
3963Interval @var{t} can't be 0, this filter batches the packet delivery: all
3964packets arriving in a given interval on netdev @var{netdevid} are delayed
3965until the end of the interval. Interval is in microseconds.
3966@option{status} is optional that indicate whether the netfilter is
3967on (enabled) or off (disabled), the default status for netfilter will be 'on'.
3968
3969queue @var{all|rx|tx} is an option that can be applied to any netfilter.
3970
3971@option{all}: the filter is attached both to the receive and the transmit
3972              queue of the netdev (default).
3973
3974@option{rx}: the filter is attached to the receive queue of the netdev,
3975             where it will receive packets sent to the netdev.
3976
3977@option{tx}: the filter is attached to the transmit queue of the netdev,
3978             where it will receive packets sent by the netdev.
3979
3980@item -object filter-mirror,id=@var{id},netdev=@var{netdevid},outdev=@var{chardevid}[,queue=@var{all|rx|tx}]
3981
3982filter-mirror on netdev @var{netdevid},mirror net packet to chardev
3983@var{chardevid}
3984
3985@item -object filter-redirector,id=@var{id},netdev=@var{netdevid},indev=@var{chardevid},
3986outdev=@var{chardevid}[,queue=@var{all|rx|tx}]
3987
3988filter-redirector on netdev @var{netdevid},redirect filter's net packet to chardev
3989@var{chardevid},and redirect indev's packet to filter.
3990Create a filter-redirector we need to differ outdev id from indev id, id can not
3991be the same. we can just use indev or outdev, but at least one of indev or outdev
3992need to be specified.
3993
3994@item -object filter-rewriter,id=@var{id},netdev=@var{netdevid},rewriter-mode=@var{mode}[,queue=@var{all|rx|tx}]
3995
3996Filter-rewriter is a part of COLO project.It will rewrite tcp packet to
3997secondary from primary to keep secondary tcp connection,and rewrite
3998tcp packet to primary from secondary make tcp packet can be handled by
3999client.
4000
4001usage:
4002colo secondary:
4003-object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0
4004-object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1
4005-object filter-rewriter,id=rew0,netdev=hn0,queue=all
4006
4007@item -object filter-dump,id=@var{id},netdev=@var{dev}[,file=@var{filename}][,maxlen=@var{len}]
4008
4009Dump the network traffic on netdev @var{dev} to the file specified by
4010@var{filename}. At most @var{len} bytes (64k by default) per packet are stored.
4011The file format is libpcap, so it can be analyzed with tools such as tcpdump
4012or Wireshark.
4013
4014@item -object colo-compare,id=@var{id},primary_in=@var{chardevid},secondary_in=@var{chardevid},
4015outdev=@var{chardevid}
4016
4017Colo-compare gets packet from primary_in@var{chardevid} and secondary_in@var{chardevid}, than compare primary packet with
4018secondary packet. If the packets are same, we will output primary
4019packet to outdev@var{chardevid}, else we will notify colo-frame
4020do checkpoint and send primary packet to outdev@var{chardevid}.
4021
4022we must use it with the help of filter-mirror and filter-redirector.
4023
4024@example
4025
4026primary:
4027-netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
4028-device e1000,id=e0,netdev=hn0,mac=52:a4:00:12:78:66
4029-chardev socket,id=mirror0,host=3.3.3.3,port=9003,server,nowait
4030-chardev socket,id=compare1,host=3.3.3.3,port=9004,server,nowait
4031-chardev socket,id=compare0,host=3.3.3.3,port=9001,server,nowait
4032-chardev socket,id=compare0-0,host=3.3.3.3,port=9001
4033-chardev socket,id=compare_out,host=3.3.3.3,port=9005,server,nowait
4034-chardev socket,id=compare_out0,host=3.3.3.3,port=9005
4035-object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0
4036-object filter-redirector,netdev=hn0,id=redire0,queue=rx,indev=compare_out
4037-object filter-redirector,netdev=hn0,id=redire1,queue=rx,outdev=compare0
4038-object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0
4039
4040secondary:
4041-netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,down script=/etc/qemu-ifdown
4042-device e1000,netdev=hn0,mac=52:a4:00:12:78:66
4043-chardev socket,id=red0,host=3.3.3.3,port=9003
4044-chardev socket,id=red1,host=3.3.3.3,port=9004
4045-object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0
4046-object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1
4047
4048@end example
4049
4050If you want to know the detail of above command line, you can read
4051the colo-compare git log.
4052
4053@item -object cryptodev-backend-builtin,id=@var{id}[,queues=@var{queues}]
4054
4055Creates a cryptodev backend which executes crypto opreation from
4056the QEMU cipher APIS. The @var{id} parameter is
4057a unique ID that will be used to reference this cryptodev backend from
4058the @option{virtio-crypto} device. The @var{queues} parameter is optional,
4059which specify the queue number of cryptodev backend, the default of
4060@var{queues} is 1.
4061
4062@example
4063
4064 # qemu-system-x86_64 \
4065   [...] \
4066       -object cryptodev-backend-builtin,id=cryptodev0 \
4067       -device virtio-crypto-pci,id=crypto0,cryptodev=cryptodev0 \
4068   [...]
4069@end example
4070
4071@item -object secret,id=@var{id},data=@var{string},format=@var{raw|base64}[,keyid=@var{secretid},iv=@var{string}]
4072@item -object secret,id=@var{id},file=@var{filename},format=@var{raw|base64}[,keyid=@var{secretid},iv=@var{string}]
4073
4074Defines a secret to store a password, encryption key, or some other sensitive
4075data. The sensitive data can either be passed directly via the @var{data}
4076parameter, or indirectly via the @var{file} parameter. Using the @var{data}
4077parameter is insecure unless the sensitive data is encrypted.
4078
4079The sensitive data can be provided in raw format (the default), or base64.
4080When encoded as JSON, the raw format only supports valid UTF-8 characters,
4081so base64 is recommended for sending binary data. QEMU will convert from
4082which ever format is provided to the format it needs internally. eg, an
4083RBD password can be provided in raw format, even though it will be base64
4084encoded when passed onto the RBD sever.
4085
4086For added protection, it is possible to encrypt the data associated with
4087a secret using the AES-256-CBC cipher. Use of encryption is indicated
4088by providing the @var{keyid} and @var{iv} parameters. The @var{keyid}
4089parameter provides the ID of a previously defined secret that contains
4090the AES-256 decryption key. This key should be 32-bytes long and be
4091base64 encoded. The @var{iv} parameter provides the random initialization
4092vector used for encryption of this particular secret and should be a
4093base64 encrypted string of the 16-byte IV.
4094
4095The simplest (insecure) usage is to provide the secret inline
4096
4097@example
4098
4099 # $QEMU -object secret,id=sec0,data=letmein,format=raw
4100
4101@end example
4102
4103The simplest secure usage is to provide the secret via a file
4104
4105 # echo -n "letmein" > mypasswd.txt
4106 # $QEMU -object secret,id=sec0,file=mypasswd.txt,format=raw
4107
4108For greater security, AES-256-CBC should be used. To illustrate usage,
4109consider the openssl command line tool which can encrypt the data. Note
4110that when encrypting, the plaintext must be padded to the cipher block
4111size (32 bytes) using the standard PKCS#5/6 compatible padding algorithm.
4112
4113First a master key needs to be created in base64 encoding:
4114
4115@example
4116 # openssl rand -base64 32 > key.b64
4117 # KEY=$(base64 -d key.b64 | hexdump  -v -e '/1 "%02X"')
4118@end example
4119
4120Each secret to be encrypted needs to have a random initialization vector
4121generated. These do not need to be kept secret
4122
4123@example
4124 # openssl rand -base64 16 > iv.b64
4125 # IV=$(base64 -d iv.b64 | hexdump  -v -e '/1 "%02X"')
4126@end example
4127
4128The secret to be defined can now be encrypted, in this case we're
4129telling openssl to base64 encode the result, but it could be left
4130as raw bytes if desired.
4131
4132@example
4133 # SECRET=$(echo -n "letmein" |
4134            openssl enc -aes-256-cbc -a -K $KEY -iv $IV)
4135@end example
4136
4137When launching QEMU, create a master secret pointing to @code{key.b64}
4138and specify that to be used to decrypt the user password. Pass the
4139contents of @code{iv.b64} to the second secret
4140
4141@example
4142 # $QEMU \
4143     -object secret,id=secmaster0,format=base64,file=key.b64 \
4144     -object secret,id=sec0,keyid=secmaster0,format=base64,\
4145         data=$SECRET,iv=$(<iv.b64)
4146@end example
4147
4148@end table
4149
4150ETEXI
4151
4152
4153HXCOMM This is the last statement. Insert new options before this line!
4154STEXI
4155@end table
4156ETEXI
4157