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