qemu-options.hx 174 KB
Newer Older
1 2 3
HXCOMM Use DEFHEADING() to define headings in both help text and texi
HXCOMM Text between STEXI and ETEXI are copied to texi version and
HXCOMM discarded from C version
4 5 6
HXCOMM DEF(option, HAS_ARG/0, opt_enum, opt_help, arch_mask) is used to
HXCOMM construct option structures, enums and help message for specified
HXCOMM architectures.
7 8
HXCOMM HXCOMM can be used for comments, discarded from both texi and C

9
DEFHEADING(Standard options:)
10 11 12 13 14
STEXI
@table @option
ETEXI

DEF("help", 0, QEMU_OPTION_h,
15
    "-h or -help     display this help and exit\n", QEMU_ARCH_ALL)
16 17
STEXI
@item -h
18
@findex -h
19 20 21
Display help and exit
ETEXI

pbrook's avatar
pbrook committed
22
DEF("version", 0, QEMU_OPTION_version,
23
    "-version        display version information and exit\n", QEMU_ARCH_ALL)
pbrook's avatar
pbrook committed
24 25
STEXI
@item -version
26
@findex -version
pbrook's avatar
pbrook committed
27 28 29
Display version information and exit
ETEXI

30 31
DEF("machine", HAS_ARG, QEMU_OPTION_machine, \
    "-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, hax, hvf, whpx or tcg (default: tcg)\n"
35
    "                kernel_irqchip=on|off|split controls accelerated irqchip support (default=off)\n"
36
    "                vmport=on|off|auto controls emulation of vmport (default: auto)\n"
37
    "                kvm_shadow_mem=size of KVM shadow MMU in bytes\n"
38
    "                dump-guest-core=on|off include guest memory in a core dump (default=on)\n"
39
    "                mem-merge=on|off controls memory merge support (default: on)\n"
40
    "                igd-passthru=on|off controls IGD GFX passthrough support (default=off)\n"
41
    "                aes-key-wrap=on|off controls support for AES key wrapping (default=on)\n"
42
    "                dea-key-wrap=on|off controls support for DEA key wrapping (default=on)\n"
43
    "                suppress-vmdesc=on|off disables self-describing migration (default=off)\n"
44
    "                nvdimm=on|off controls NVDIMM support (default=off)\n"
45
    "                enforce-config-section=on|off enforce configuration section migration (default=off)\n"
46 47
    "                s390-squash-mcss=on|off (deprecated) controls support for squashing into default css (default=off)\n"
    "                memory-encryption=@var{} memory encryption object to use (default=none)\n",
48
    QEMU_ARCH_ALL)
49
STEXI
50 51
@item -machine [type=]@var{name}[,prop=@var{value}[,...]]
@findex -machine
52
Select the emulated machine by @var{name}. Use @code{-machine help} to list
53 54 55 56 57 58 59 60 61 62 63 64 65 66
available machines.

For architectures which aim to support live migration compatibility
across releases, each release will introduce a new versioned machine
type. For example, the 2.8.0 release introduced machine types
``pc-i440fx-2.8'' and ``pc-q35-2.8'' for the x86_64/i686 architectures.

To allow live migration of guests from QEMU version 2.8.0, to QEMU
version 2.9.0, the 2.9.0 version must support the ``pc-i440fx-2.8''
and ``pc-q35-2.8'' machines too. To allow users live migrating VMs
to skip multiple intermediate releases when upgrading, new releases
of QEMU will support machine types from many previous versions.

Supported machine properties are:
67 68 69
@table @option
@item accel=@var{accels1}[:@var{accels2}[:...]]
This is used to enable an accelerator. Depending on the target architecture,
70
kvm, xen, hax, hvf, whpx or tcg can be available. By default, tcg is used. If there is
71 72
more than one accelerator specified, the next one is used if the previous one
fails to initialize.
73
@item kernel_irqchip=on|off
74
Controls in-kernel irqchip support for the chosen accelerator when available.
75 76
@item gfx_passthru=on|off
Enables IGD GFX passthrough support for the chosen machine when available.
77 78 79 80
@item vmport=on|off|auto
Enables emulation of VMWare IO port, for vmmouse etc. auto says to select the
value based on accel. For accel=xen the default is off otherwise the default
is on.
81 82
@item kvm_shadow_mem=size
Defines the size of the KVM shadow MMU.
83 84
@item dump-guest-core=on|off
Include guest memory in a core dump. The default is on.
85 86 87 88
@item mem-merge=on|off
Enables or disables memory merge support. This feature, when supported by
the host, de-duplicates identical memory pages among VMs instances
(enabled by default).
89 90 91 92 93 94 95 96
@item aes-key-wrap=on|off
Enables or disables AES key wrapping support on s390-ccw hosts. This feature
controls whether AES wrapping keys will be created to allow
execution of AES cryptographic functions.  The default is on.
@item dea-key-wrap=on|off
Enables or disables DEA key wrapping support on s390-ccw hosts. This feature
controls whether DEA wrapping keys will be created to allow
execution of DEA cryptographic functions.  The default is on.
97 98
@item nvdimm=on|off
Enables or disables NVDIMM support. The default is off.
99 100 101
@item s390-squash-mcss=on|off
Enables or disables squashing subchannels into the default css.
The default is off.
102 103 104 105 106 107
NOTE: This property is deprecated and will be removed in future releases.
The ``s390-squash-mcss=on`` property has been obsoleted by allowing the
cssid to be chosen freely. Instead of squashing subchannels into the
default channel subsystem image for guests that do not support multiple
channel subsystems, all devices can be put into the default channel
subsystem image.
108 109 110 111 112 113
@item enforce-config-section=on|off
If @option{enforce-config-section} is set to @var{on}, force migration
code to send configuration section even if the machine-type sets the
@option{migration.send-configuration} property to @var{off}.
NOTE: this parameter is deprecated. Please use @option{-global}
@option{migration.send-configuration}=@var{on|off} instead.
114 115
@item memory-encryption=@var{}
Memory encryption object to use. The default is none.
116
@end table
117 118
ETEXI

119 120 121
HXCOMM Deprecated by -machine
DEF("M", HAS_ARG, QEMU_OPTION_M, "", QEMU_ARCH_ALL)

122
DEF("cpu", HAS_ARG, QEMU_OPTION_cpu,
123
    "-cpu cpu        select CPU ('-cpu help' for list)\n", QEMU_ARCH_ALL)
124 125
STEXI
@item -cpu @var{model}
126
@findex -cpu
127
Select CPU model (@code{-cpu help} for list and additional feature selection)
128 129
ETEXI

130 131
DEF("accel", HAS_ARG, QEMU_OPTION_accel,
    "-accel [accel=]accelerator[,thread=single|multi]\n"
132
    "                select accelerator (kvm, xen, hax, hvf, whpx or tcg; use 'help' for a list)\n"
133
    "                thread=single|multi (enable multi-threaded TCG)", QEMU_ARCH_ALL)
134 135 136 137
STEXI
@item -accel @var{name}[,prop=@var{value}[,...]]
@findex -accel
This is used to enable an accelerator. Depending on the target architecture,
138
kvm, xen, hax, hvf, whpx or tcg can be available. By default, tcg is used. If there is
139 140
more than one accelerator specified, the next one is used if the previous one
fails to initialize.
141 142 143 144 145 146 147 148 149
@table @option
@item thread=single|multi
Controls number of TCG threads. When the TCG is multi-threaded there will be one
thread per vCPU therefor taking advantage of additional host cores. The default
is to enable multi-threading where both the back-end and front-ends support it and
no incompatible TCG features have been enabled (e.g. icount/replay).
@end table
ETEXI

150
DEF("smp", HAS_ARG, QEMU_OPTION_smp,
151
    "-smp [cpus=]n[,maxcpus=cpus][,cores=cores][,threads=threads][,sockets=sockets]\n"
152 153
    "                set the number of CPUs to 'n' [default=1]\n"
    "                maxcpus= maximum number of total cpus, including\n"
154
    "                offline CPUs for hotplug, etc\n"
155 156
    "                cores= number of CPU cores on one socket\n"
    "                threads= number of threads on one CPU core\n"
157 158
    "                sockets= number of discrete sockets in the system\n",
        QEMU_ARCH_ALL)
159
STEXI
160
@item -smp [cpus=]@var{n}[,cores=@var{cores}][,threads=@var{threads}][,sockets=@var{sockets}][,maxcpus=@var{maxcpus}]
161
@findex -smp
162 163 164
Simulate an SMP system with @var{n} CPUs. On the PC target, up to 255
CPUs are supported. On Sparc32 target, Linux limits the number of usable CPUs
to 4.
165 166 167 168 169
For the PC target, the number of @var{cores} per socket, the number
of @var{threads} per cores and the total number of @var{sockets} can be
specified. Missing values will be computed. If any on the three values is
given, the total number of CPUs @var{n} can be omitted. @var{maxcpus}
specifies the maximum number of hotpluggable CPUs.
170 171
ETEXI

172
DEF("numa", HAS_ARG, QEMU_OPTION_numa,
173
    "-numa node[,mem=size][,cpus=firstcpu[-lastcpu]][,nodeid=node]\n"
174
    "-numa node[,memdev=id][,cpus=firstcpu[-lastcpu]][,nodeid=node]\n"
175 176 177
    "-numa dist,src=source,dst=destination,val=distance\n"
    "-numa cpu,node-id=node[,socket-id=x][,core-id=y][,thread-id=z]\n",
    QEMU_ARCH_ALL)
178
STEXI
179 180
@item -numa node[,mem=@var{size}][,cpus=@var{firstcpu}[-@var{lastcpu}]][,nodeid=@var{node}]
@itemx -numa node[,memdev=@var{id}][,cpus=@var{firstcpu}[-@var{lastcpu}]][,nodeid=@var{node}]
181
@itemx -numa dist,src=@var{source},dst=@var{destination},val=@var{distance}
182
@itemx -numa cpu,node-id=@var{node}[,socket-id=@var{x}][,core-id=@var{y}][,thread-id=@var{z}]
183
@findex -numa
184
Define a NUMA node and assign RAM and VCPUs to it.
185
Set the NUMA distance from a source node to a destination node.
186

187
Legacy VCPU assignment uses @samp{cpus} option where
188 189 190 191 192 193 194 195 196 197 198 199 200
@var{firstcpu} and @var{lastcpu} are CPU indexes. Each
@samp{cpus} option represent a contiguous range of CPU indexes
(or a single VCPU if @var{lastcpu} is omitted). A non-contiguous
set of VCPUs can be represented by providing multiple @samp{cpus}
options. If @samp{cpus} is omitted on all nodes, VCPUs are automatically
split between them.

For example, the following option assigns VCPUs 0, 1, 2 and 5 to
a NUMA node:
@example
-numa node,cpus=0-2,cpus=5
@end example

201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218
@samp{cpu} option is a new alternative to @samp{cpus} option
which uses @samp{socket-id|core-id|thread-id} properties to assign
CPU objects to a @var{node} using topology layout properties of CPU.
The set of properties is machine specific, and depends on used
machine type/@samp{smp} options. It could be queried with
@samp{hotpluggable-cpus} monitor command.
@samp{node-id} property specifies @var{node} to which CPU object
will be assigned, it's required for @var{node} to be declared
with @samp{node} option before it's used with @samp{cpu} option.

For example:
@example
-M pc \
-smp 1,sockets=2,maxcpus=2 \
-numa node,nodeid=0 -numa node,nodeid=1 \
-numa cpu,node-id=0,socket-id=0 -numa cpu,node-id=1,socket-id=1
@end example

219 220 221 222 223 224 225 226
@samp{mem} assigns a given RAM amount to a node. @samp{memdev}
assigns RAM from a given memory backend device to a node. If
@samp{mem} and @samp{memdev} are omitted in all nodes, RAM is
split equally between them.

@samp{mem} and @samp{memdev} are mutually exclusive. Furthermore,
if one node uses @samp{memdev}, all of them have to use it.

227 228 229 230 231 232 233 234 235 236 237
@var{source} and @var{destination} are NUMA node IDs.
@var{distance} is the NUMA distance from @var{source} to @var{destination}.
The distance from a node to itself is always 10. If any pair of nodes is
given a distance, then all pairs must be given distances. Although, when
distances are only given in one direction for each pair of nodes, then
the distances in the opposite directions are assumed to be the same. If,
however, an asymmetrical pair of distances is given for even one node
pair, then all node pairs must be provided distance values for both
directions, even when they are symmetrical. When a node is unreachable
from another node, set the pair's distance to 255.

238 239 240 241 242
Note that the -@option{numa} option doesn't allocate any of the
specified resources, it just assigns existing resources to NUMA
nodes. This means that one still has to use the @option{-m},
@option{-smp} options to allocate RAM and VCPUs respectively.

243 244
ETEXI

245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272
DEF("add-fd", HAS_ARG, QEMU_OPTION_add_fd,
    "-add-fd fd=fd,set=set[,opaque=opaque]\n"
    "                Add 'fd' to fd 'set'\n", QEMU_ARCH_ALL)
STEXI
@item -add-fd fd=@var{fd},set=@var{set}[,opaque=@var{opaque}]
@findex -add-fd

Add a file descriptor to an fd set.  Valid options are:

@table @option
@item fd=@var{fd}
This option defines the file descriptor of which a duplicate is added to fd set.
The file descriptor cannot be stdin, stdout, or stderr.
@item set=@var{set}
This option defines the ID of the fd set to add the file descriptor to.
@item opaque=@var{opaque}
This option defines a free-form string that can be used to describe @var{fd}.
@end table

You can open an image using pre-opened file descriptors from an fd set:
@example
qemu-system-i386
-add-fd fd=3,set=2,opaque="rdwr:/path/to/file"
-add-fd fd=4,set=2,opaque="rdonly:/path/to/file"
-drive file=/dev/fdset/2,index=0,media=disk
@end example
ETEXI

273 274 275
DEF("set", HAS_ARG, QEMU_OPTION_set,
    "-set group.id.arg=value\n"
    "                set <arg> parameter for item <id> of type <group>\n"
276
    "                i.e. -set drive.$id.file=/path/to/image\n", QEMU_ARCH_ALL)
277
STEXI
278
@item -set @var{group}.@var{id}.@var{arg}=@var{value}
279
@findex -set
280
Set parameter @var{arg} for item @var{id} of type @var{group}
281 282 283
ETEXI

DEF("global", HAS_ARG, QEMU_OPTION_global,
284 285
    "-global driver.property=value\n"
    "-global driver=driver,property=property,value=value\n"
286 287
    "                set a global default for a driver property\n",
    QEMU_ARCH_ALL)
288
STEXI
289
@item -global @var{driver}.@var{prop}=@var{value}
290
@itemx -global driver=@var{driver},property=@var{property},value=@var{value}
291
@findex -global
292 293 294
Set default value of @var{driver}'s property @var{prop} to @var{value}, e.g.:

@example
295
qemu-system-i386 -global ide-hd.physical_block_size=4096 disk-image.img
296 297
@end example

298 299
In particular, you can use this to set driver properties for devices which are
created automatically by the machine model. To create a device which is not
300
created automatically and set properties on it, use -@option{device}.
301

302 303 304
-global @var{driver}.@var{prop}=@var{value} is shorthand for -global
driver=@var{driver},property=@var{prop},value=@var{value}.  The
longhand syntax works even when @var{driver} contains a dot.
305 306
ETEXI

307
DEF("boot", HAS_ARG, QEMU_OPTION_boot,
308
    "-boot [order=drives][,once=drives][,menu=on|off]\n"
309
    "      [,splash=sp_name][,splash-time=sp_time][,reboot-timeout=rb_time][,strict=on|off]\n"
310 311
    "                'drives': floppy (a), hard disk (c), CD-ROM (d), network (n)\n"
    "                'sp_name': the file's name that would be passed to bios as logo picture, if menu=on\n"
312 313
    "                'sp_time': the period that splash picture last if menu=on, unit is ms\n"
    "                'rb_timeout': the timeout before guest reboot when boot failed, unit is ms\n",
314
    QEMU_ARCH_ALL)
315
STEXI
316
@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]
317
@findex -boot
318
Specify boot order @var{drives} as a string of drive letters. Valid
Gonglei's avatar
Gonglei committed
319
drive letters depend on the target architecture. The x86 PC uses: a, b
320 321 322
(floppy 1 and 2), c (first hard disk), d (first CD-ROM), n-p (Etherboot
from network adapter 1-4), hard disk boot is the default. To apply a
particular boot order only on the first startup, specify it via
323 324 325 326
@option{once}. Note that the @option{order} or @option{once} parameter
should not be used together with the @option{bootindex} property of
devices, since the firmware implementations normally do not support both
at the same time.
327 328 329 330

Interactive boot menus/prompts can be enabled via @option{menu=on} as far
as firmware/BIOS supports them. The default is non-interactive boot.

331 332 333 334 335 336 337
A splash picture could be passed to bios, enabling user to show it as logo,
when option splash=@var{sp_name} is given and menu=on, If firmware/BIOS
supports them. Currently Seabios for X86 system support it.
limitation: The splash file could be a jpeg file or a BMP file in 24 BPP
format(true color). The resolution should be supported by the SVGA mode, so
the recommended is 320x240, 640x480, 800x640.

338 339 340 341 342
A timeout could be passed to bios, guest will pause for @var{rb_timeout} ms
when boot failed, then reboot. If @var{rb_timeout} is '-1', guest will not
reboot, qemu passes '-1' to bios by default. Currently Seabios for X86
system support it.

343 344 345 346
Do strict boot via @option{strict=on} as far as firmware/BIOS
supports it. This only effects when boot priority is changed by
bootindex options. The default is non-strict boot.

347 348
@example
# try to boot from network first, then from hard disk
349
qemu-system-i386 -boot order=nc
350
# boot from CD-ROM first, switch back to default order after reboot
351
qemu-system-i386 -boot once=d
352
# boot with a splash picture for 5 seconds.
353
qemu-system-i386 -boot menu=on,splash=/root/boot.bmp,splash-time=5000
354 355 356 357
@end example

Note: The legacy format '-boot @var{drives}' is still supported but its
use is discouraged as it may be removed from future versions.
358 359 360
ETEXI

DEF("m", HAS_ARG, QEMU_OPTION_m,
361
    "-m [size=]megs[,slots=n,maxmem=size]\n"
362
    "                configure guest RAM\n"
363
    "                size: initial amount of guest memory\n"
364
    "                slots: number of hotplug slots (default: none)\n"
365 366
    "                maxmem: maximum amount of guest memory (default: none)\n"
    "NOTE: Some architectures might enforce a specific granularity\n",
367
    QEMU_ARCH_ALL)
368
STEXI
369
@item -m [size=]@var{megs}[,slots=n,maxmem=size]
370
@findex -m
371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386
Sets guest startup RAM size to @var{megs} megabytes. Default is 128 MiB.
Optionally, a suffix of ``M'' or ``G'' can be used to signify a value in
megabytes or gigabytes respectively. Optional pair @var{slots}, @var{maxmem}
could be used to set amount of hotpluggable memory slots and maximum amount of
memory. Note that @var{maxmem} must be aligned to the page size.

For example, the following command-line sets the guest startup RAM size to
1GB, creates 3 slots to hotplug additional memory and sets the maximum
memory the guest can reach to 4GB:

@example
qemu-system-x86_64 -m 1G,slots=3,maxmem=4G
@end example

If @var{slots} and @var{maxmem} are not specified, memory hotplug won't
be enabled and the guest startup RAM will never increase.
387 388
ETEXI

389
DEF("mem-path", HAS_ARG, QEMU_OPTION_mempath,
390
    "-mem-path FILE  provide backing storage for guest RAM\n", QEMU_ARCH_ALL)
391 392
STEXI
@item -mem-path @var{path}
393
@findex -mem-path
394 395 396 397
Allocate guest RAM from a temporarily created file in @var{path}.
ETEXI

DEF("mem-prealloc", 0, QEMU_OPTION_mem_prealloc,
398 399
    "-mem-prealloc   preallocate guest memory (use with -mem-path)\n",
    QEMU_ARCH_ALL)
400 401
STEXI
@item -mem-prealloc
402
@findex -mem-prealloc
403 404 405
Preallocate memory when using -mem-path.
ETEXI

406
DEF("k", HAS_ARG, QEMU_OPTION_k,
407 408
    "-k language     use keyboard layout (for example 'fr' for French)\n",
    QEMU_ARCH_ALL)
409 410
STEXI
@item -k @var{language}
411
@findex -k
412 413
Use keyboard layout @var{language} (for example @code{fr} for
French). This option is only needed where it is not easy to get raw PC
414
keycodes (e.g. on Macs, with some X11 servers or with a VNC or curses
415 416 417 418 419 420 421 422 423 424 425 426 427 428 429
display). You don't normally need to use it on PC/Linux or PC/Windows
hosts.

The available layouts are:
@example
ar  de-ch  es  fo     fr-ca  hu  ja  mk     no  pt-br  sv
da  en-gb  et  fr     fr-ch  is  lt  nl     pl  ru     th
de  en-us  fi  fr-be  hr     it  lv  nl-be  pt  sl     tr
@end example

The default is @code{en-us}.
ETEXI


DEF("audio-help", 0, QEMU_OPTION_audio_help,
430 431
    "-audio-help     print list of audio drivers and their options\n",
    QEMU_ARCH_ALL)
432 433
STEXI
@item -audio-help
434
@findex -audio-help
435 436 437 438 439 440 441
Will show the audio subsystem help: list of drivers, tunable
parameters.
ETEXI

DEF("soundhw", HAS_ARG, QEMU_OPTION_soundhw,
    "-soundhw c1,... enable audio support\n"
    "                and only specified sound cards (comma separated list)\n"
442 443
    "                use '-soundhw help' to get the list of supported cards\n"
    "                use '-soundhw all' to enable all of them\n", QEMU_ARCH_ALL)
444 445
STEXI
@item -soundhw @var{card1}[,@var{card2},...] or -soundhw all
446
@findex -soundhw
447
Enable audio and selected sound hardware. Use 'help' to print all
448 449 450
available sound hardware.

@example
451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468
qemu-system-i386 -soundhw sb16,adlib disk.img
qemu-system-i386 -soundhw es1370 disk.img
qemu-system-i386 -soundhw ac97 disk.img
qemu-system-i386 -soundhw hda disk.img
qemu-system-i386 -soundhw all disk.img
qemu-system-i386 -soundhw help
@end example

Note that Linux's i810_audio OSS kernel (for AC97) module might
require manually specifying clocking.

@example
modprobe i810_audio clocking=48000
@end example
ETEXI

DEF("balloon", HAS_ARG, QEMU_OPTION_balloon,
    "-balloon virtio[,addr=str]\n"
469
    "                enable virtio balloon device (deprecated)\n", QEMU_ARCH_ALL)
470 471
STEXI
@item -balloon virtio[,addr=@var{addr}]
472 473 474
@findex -balloon
Enable virtio balloon device, optionally with PCI address @var{addr}. This
option is deprecated, use @option{--device virtio-balloon} instead.
475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490
ETEXI

DEF("device", HAS_ARG, QEMU_OPTION_device,
    "-device driver[,prop[=value][,...]]\n"
    "                add device (based on driver)\n"
    "                prop=value,... sets driver properties\n"
    "                use '-device help' to print all possible drivers\n"
    "                use '-device driver,help' to print all possible properties\n",
    QEMU_ARCH_ALL)
STEXI
@item -device @var{driver}[,@var{prop}[=@var{value}][,...]]
@findex -device
Add device @var{driver}.  @var{prop}=@var{value} sets driver
properties.  Valid properties depend on the driver.  To get help on
possible drivers and properties, use @code{-device help} and
@code{-device @var{driver},help}.
Corey Minyard's avatar
Corey Minyard committed
491 492

Some drivers are:
493
@item -device ipmi-bmc-sim,id=@var{id}[,slave_addr=@var{val}][,sdrfile=@var{file}][,furareasize=@var{val}][,furdatafile=@var{file}]
Corey Minyard's avatar
Corey Minyard committed
494 495 496 497 498 499 500 501 502 503 504

Add an IPMI BMC.  This is a simulation of a hardware management
interface processor that normally sits on a system.  It provides
a watchdog and the ability to reset and power control the system.
You need to connect this to an IPMI interface to make it useful

The IPMI slave address to use for the BMC.  The default is 0x20.
This address is the BMC's address on the I2C network of management
controllers.  If you don't know what this means, it is safe to ignore
it.

505 506 507 508 509 510
@table @option
@item bmc=@var{id}
The BMC to connect to, one of ipmi-bmc-sim or ipmi-bmc-extern above.
@item slave_addr=@var{val}
Define slave address to use for the BMC.  The default is 0x20.
@item sdrfile=@var{file}
511 512 513 514 515
file containing raw Sensor Data Records (SDR) data. The default is none.
@item fruareasize=@var{val}
size of a Field Replaceable Unit (FRU) area.  The default is 1024.
@item frudatafile=@var{file}
file containing raw Field Replaceable Unit (FRU) inventory data. The default is none.
516 517
@end table

Corey Minyard's avatar
Corey Minyard committed
518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555
@item -device ipmi-bmc-extern,id=@var{id},chardev=@var{id}[,slave_addr=@var{val}]

Add a connection to an external IPMI BMC simulator.  Instead of
locally emulating the BMC like the above item, instead connect
to an external entity that provides the IPMI services.

A connection is made to an external BMC simulator.  If you do this, it
is strongly recommended that you use the "reconnect=" chardev option
to reconnect to the simulator if the connection is lost.  Note that if
this is not used carefully, it can be a security issue, as the
interface has the ability to send resets, NMIs, and power off the VM.
It's best if QEMU makes a connection to an external simulator running
on a secure port on localhost, so neither the simulator nor QEMU is
exposed to any outside network.

See the "lanserv/README.vm" file in the OpenIPMI library for more
details on the external interface.

@item -device isa-ipmi-kcs,bmc=@var{id}[,ioport=@var{val}][,irq=@var{val}]

Add a KCS IPMI interafce on the ISA bus.  This also adds a
corresponding ACPI and SMBIOS entries, if appropriate.

@table @option
@item bmc=@var{id}
The BMC to connect to, one of ipmi-bmc-sim or ipmi-bmc-extern above.
@item ioport=@var{val}
Define the I/O address of the interface.  The default is 0xca0 for KCS.
@item irq=@var{val}
Define the interrupt to use.  The default is 5.  To disable interrupts,
set this to 0.
@end table

@item -device isa-ipmi-bt,bmc=@var{id}[,ioport=@var{val}][,irq=@var{val}]

Like the KCS interface, but defines a BT interface.  The default port is
0xe4 and the default interrupt is 5.

556 557 558
ETEXI

DEF("name", HAS_ARG, QEMU_OPTION_name,
559
    "-name string1[,process=string2][,debug-threads=on|off]\n"
560
    "                set the name of the guest\n"
561 562 563
    "                string1 sets the window title and string2 the process name (on Linux)\n"
    "                When debug-threads is enabled, individual threads are given a separate name (on Linux)\n"
    "                NOTE: The thread names are for debugging and not a stable API.\n",
564 565 566 567 568 569 570 571
    QEMU_ARCH_ALL)
STEXI
@item -name @var{name}
@findex -name
Sets the @var{name} of the guest.
This name will be displayed in the SDL window caption.
The @var{name} will also be used for the VNC server.
Also optionally set the top visible process name in Linux.
572
Naming of individual threads can also be enabled on Linux to aid debugging.
573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588
ETEXI

DEF("uuid", HAS_ARG, QEMU_OPTION_uuid,
    "-uuid %08x-%04x-%04x-%04x-%012x\n"
    "                specify machine UUID\n", QEMU_ARCH_ALL)
STEXI
@item -uuid @var{uuid}
@findex -uuid
Set system UUID.
ETEXI

STEXI
@end table
ETEXI
DEFHEADING()

589
DEFHEADING(Block device options:)
590 591 592 593 594 595 596 597 598
STEXI
@table @option
ETEXI

DEF("fda", HAS_ARG, QEMU_OPTION_fda,
    "-fda/-fdb file  use 'file' as floppy disk 0/1 image\n", QEMU_ARCH_ALL)
DEF("fdb", HAS_ARG, QEMU_OPTION_fdb, "", QEMU_ARCH_ALL)
STEXI
@item -fda @var{file}
599
@itemx -fdb @var{file}
600 601
@findex -fda
@findex -fdb
602
Use @var{file} as floppy disk 0/1 image (@pxref{disk_images}).
603 604 605 606 607 608 609 610 611 612
ETEXI

DEF("hda", HAS_ARG, QEMU_OPTION_hda,
    "-hda/-hdb file  use 'file' as IDE hard disk 0/1 image\n", QEMU_ARCH_ALL)
DEF("hdb", HAS_ARG, QEMU_OPTION_hdb, "", QEMU_ARCH_ALL)
DEF("hdc", HAS_ARG, QEMU_OPTION_hdc,
    "-hdc/-hdd file  use 'file' as IDE hard disk 2/3 image\n", QEMU_ARCH_ALL)
DEF("hdd", HAS_ARG, QEMU_OPTION_hdd, "", QEMU_ARCH_ALL)
STEXI
@item -hda @var{file}
613 614 615
@itemx -hdb @var{file}
@itemx -hdc @var{file}
@itemx -hdd @var{file}
616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633
@findex -hda
@findex -hdb
@findex -hdc
@findex -hdd
Use @var{file} as hard disk 0, 1, 2 or 3 image (@pxref{disk_images}).
ETEXI

DEF("cdrom", HAS_ARG, QEMU_OPTION_cdrom,
    "-cdrom file     use 'file' as IDE cdrom image (cdrom is ide1 master)\n",
    QEMU_ARCH_ALL)
STEXI
@item -cdrom @var{file}
@findex -cdrom
Use @var{file} as CD-ROM image (you cannot use @option{-hdc} and
@option{-cdrom} at the same time). You can use the host CD-ROM by
using @file{/dev/cdrom} as filename (@pxref{host_drives}).
ETEXI

634 635 636 637 638 639
DEF("blockdev", HAS_ARG, QEMU_OPTION_blockdev,
    "-blockdev [driver=]driver[,node-name=N][,discard=ignore|unmap]\n"
    "          [,cache.direct=on|off][,cache.no-flush=on|off]\n"
    "          [,read-only=on|off][,detect-zeroes=on|off|unmap]\n"
    "          [,driver specific parameters...]\n"
    "                configure a block backend\n", QEMU_ARCH_ALL)
640 641 642 643
STEXI
@item -blockdev @var{option}[,@var{option}[,@var{option}[,...]]]
@findex -blockdev

644 645 646 647 648 649 650 651 652 653 654 655
Define a new block driver node. Some of the options apply to all block drivers,
other options are only accepted for a specific block driver. See below for a
list of generic options and options for the most common block drivers.

Options that expect a reference to another node (e.g. @code{file}) can be
given in two ways. Either you specify the node name of an already existing node
(file=@var{node-name}), or you define a new node inline, adding options
for the referenced node after a dot (file.filename=@var{path},file.aio=native).

A block driver node created with @option{-blockdev} can be used for a guest
device by specifying its node name for the @code{drive} property in a
@option{-device} argument that defines a block device.
656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694

@table @option
@item Valid options for any block driver node:

@table @code
@item driver
Specifies the block driver to use for the given node.
@item node-name
This defines the name of the block driver node by which it will be referenced
later. The name must be unique, i.e. it must not match the name of a different
block driver node, or (if you use @option{-drive} as well) the ID of a drive.

If no node name is specified, it is automatically generated. The generated node
name is not intended to be predictable and changes between QEMU invocations.
For the top level, an explicit node name must be specified.
@item read-only
Open the node read-only. Guest write attempts will fail.
@item cache.direct
The host page cache can be avoided with @option{cache.direct=on}. This will
attempt to do disk IO directly to the guest's memory. QEMU may still perform an
internal copy of the data.
@item cache.no-flush
In case you don't care about data integrity over host failures, you can use
@option{cache.no-flush=on}. This option tells QEMU that it never needs to write
any data to the disk but can instead keep things in cache. If anything goes
wrong, like your host losing power, the disk storage getting disconnected
accidentally, etc. your image will most probably be rendered unusable.
@item discard=@var{discard}
@var{discard} is one of "ignore" (or "off") or "unmap" (or "on") and controls
whether @code{discard} (also known as @code{trim} or @code{unmap}) requests are
ignored or passed to the filesystem. Some machine types may not support
discard requests.
@item detect-zeroes=@var{detect-zeroes}
@var{detect-zeroes} is "off", "on" or "unmap" and enables the automatic
conversion of plain zero writes by the OS to driver specific optimized
zero write commands. You may even choose "unmap" if @var{discard} is set
to "unmap" to allow a zero write to be converted to an @code{unmap} operation.
@end table

695 696 697 698 699 700 701 702 703
@item Driver-specific options for @code{file}

This is the protocol-level block driver for accessing regular files.

@table @code
@item filename
The path to the image file in the local filesystem
@item aio
Specifies the AIO backend (threads/native, default: threads)
704 705 706 707
@item locking
Specifies whether the image file is protected with Linux OFD / POSIX locks. The
default is to use the Linux Open File Descriptor API if available, otherwise no
lock is applied.  (auto/on/off, default: auto)
708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745
@end table
Example:
@example
-blockdev driver=file,node-name=disk,filename=disk.img
@end example

@item Driver-specific options for @code{raw}

This is the image format block driver for raw images. It is usually
stacked on top of a protocol level block driver such as @code{file}.

@table @code
@item file
Reference to or definition of the data source block driver node
(e.g. a @code{file} driver node)
@end table
Example 1:
@example
-blockdev driver=file,node-name=disk_file,filename=disk.img
-blockdev driver=raw,node-name=disk,file=disk_file
@end example
Example 2:
@example
-blockdev driver=raw,node-name=disk,file.driver=file,file.filename=disk.img
@end example

@item Driver-specific options for @code{qcow2}

This is the image format block driver for qcow2 images. It is usually
stacked on top of a protocol level block driver such as @code{file}.

@table @code
@item file
Reference to or definition of the data source block driver node
(e.g. a @code{file} driver node)

@item backing
Reference to or definition of the backing file block device (default is taken
746 747
from the image file). It is allowed to pass @code{null} here in order to disable
the default backing file.
748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800

@item lazy-refcounts
Whether to enable the lazy refcounts feature (on/off; default is taken from the
image file)

@item cache-size
The maximum total size of the L2 table and refcount block caches in bytes
(default: 1048576 bytes or 8 clusters, whichever is larger)

@item l2-cache-size
The maximum size of the L2 table cache in bytes
(default: 4/5 of the total cache size)

@item refcount-cache-size
The maximum size of the refcount block cache in bytes
(default: 1/5 of the total cache size)

@item cache-clean-interval
Clean unused entries in the L2 and refcount caches. The interval is in seconds.
The default value is 0 and it disables this feature.

@item pass-discard-request
Whether discard requests to the qcow2 device should be forwarded to the data
source (on/off; default: on if discard=unmap is specified, off otherwise)

@item pass-discard-snapshot
Whether discard requests for the data source should be issued when a snapshot
operation (e.g. deleting a snapshot) frees clusters in the qcow2 file (on/off;
default: on)

@item pass-discard-other
Whether discard requests for the data source should be issued on other
occasions where a cluster gets freed (on/off; default: off)

@item overlap-check
Which overlap checks to perform for writes to the image
(none/constant/cached/all; default: cached). For details or finer
granularity control refer to the QAPI documentation of @code{blockdev-add}.
@end table

Example 1:
@example
-blockdev driver=file,node-name=my_file,filename=/tmp/disk.qcow2
-blockdev driver=qcow2,node-name=hda,file=my_file,overlap-check=none,cache-size=16777216
@end example
Example 2:
@example
-blockdev driver=qcow2,node-name=disk,file.driver=http,file.filename=http://example.com/image.qcow2
@end example

@item Driver-specific options for other drivers
Please refer to the QAPI documentation of the @code{blockdev-add} QMP command.

801 802 803
@end table

ETEXI
804

805 806 807 808
DEF("drive", HAS_ARG, QEMU_OPTION_drive,
    "-drive [file=file][,if=type][,bus=n][,unit=m][,media=d][,index=i]\n"
    "       [,cyls=c,heads=h,secs=s[,trans=t]][,snapshot=on|off]\n"
    "       [,cache=writethrough|writeback|none|directsync|unsafe][,format=f]\n"
809 810
    "       [,serial=s][,addr=A][,rerror=ignore|stop|report]\n"
    "       [,werror=ignore|stop|report|enospc][,id=name][,aio=threads|native]\n"
811
    "       [,readonly=on|off][,copy-on-read=on|off]\n"
812
    "       [,discard=ignore|unmap][,detect-zeroes=on|off|unmap]\n"
813 814 815 816
    "       [[,bps=b]|[[,bps_rd=r][,bps_wr=w]]]\n"
    "       [[,iops=i]|[[,iops_rd=r][,iops_wr=w]]]\n"
    "       [[,bps_max=bm]|[[,bps_rd_max=rm][,bps_wr_max=wm]]]\n"
    "       [[,iops_max=im]|[[,iops_rd_max=irm][,iops_wr_max=iwm]]]\n"
817
    "       [[,iops_size=is]]\n"
818
    "       [[,group=g]]\n"
819 820 821 822 823
    "                use 'file' as a drive image\n", QEMU_ARCH_ALL)
STEXI
@item -drive @var{option}[,@var{option}[,@var{option}[,...]]]
@findex -drive

824 825 826 827 828 829
Define a new drive. This includes creating a block driver node (the backend) as
well as a guest device, and is mostly a shortcut for defining the corresponding
@option{-blockdev} and @option{-device} options.

@option{-drive} accepts all options that are accepted by @option{-blockdev}. In
addition, it knows the following options:
830 831 832 833 834 835 836 837 838 839 840

@table @option
@item file=@var{file}
This option defines which disk image (@pxref{disk_images}) to use with
this drive. If the filename contains comma, you must double it
(for instance, "file=my,,file" to use file "my,file").

Special files such as iSCSI devices can be specified using protocol
specific URLs. See the section for "Device URL Syntax" for more information.
@item if=@var{interface}
This option defines on which type on interface the drive is connected.
841
Available types are: ide, scsi, sd, mtd, floppy, pflash, virtio, none.
842 843 844 845 846 847 848 849 850
@item bus=@var{bus},unit=@var{unit}
These options define where is connected the drive by defining the bus number and
the unit id.
@item index=@var{index}
This option defines where is connected the drive by using an index in the list
of available connectors of a given interface type.
@item media=@var{media}
This option defines the type of the media: disk or cdrom.
@item cyls=@var{c},heads=@var{h},secs=@var{s}[,trans=@var{t}]
851 852
Force disk physical geometry and the optional BIOS translation (trans=none or
lba). These parameters are deprecated, use the corresponding parameters
853
of @code{-device} instead.
854
@item snapshot=@var{snapshot}
855 856
@var{snapshot} is "on" or "off" and controls snapshot mode for the given drive
(see @option{-snapshot}).
857
@item cache=@var{cache}
858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880
@var{cache} is "none", "writeback", "unsafe", "directsync" or "writethrough"
and controls how the host cache is used to access block data. This is a
shortcut that sets the @option{cache.direct} and @option{cache.no-flush}
options (as in @option{-blockdev}), and additionally @option{cache.writeback},
which provides a default for the @option{write-cache} option of block guest
devices (as in @option{-device}). The modes correspond to the following
settings:

@c Our texi2pod.pl script doesn't support @multitable, so fall back to using
@c plain ASCII art (well, UTF-8 art really). This looks okay both in the manpage
@c and the HTML output.
@example
@             │ cache.writeback   cache.direct   cache.no-flush
─────────────┼─────────────────────────────────────────────────
writeback    │ on                off            off
none         │ on                on             off
writethrough │ off               off            off
directsync   │ off               on             off
unsafe       │ on                off            on
@end example

The default mode is @option{cache=writeback}.

881 882 883 884
@item aio=@var{aio}
@var{aio} is "threads", or "native" and selects between pthread based disk I/O and native Linux AIO.
@item format=@var{format}
Specify which disk @var{format} will be used rather than detecting
885
the format.  Can be used to specify format=raw to avoid interpreting
886 887
an untrusted format header.
@item serial=@var{serial}
888 889 890
This option specifies the serial number to assign to the device. This
parameter is deprecated, use the corresponding parameter of @code{-device}
instead.
891
@item addr=@var{addr}
892 893
Specify the controller's PCI address (if=virtio only). This parameter is
deprecated, use the corresponding parameter of @code{-device} instead.
894 895 896 897 898 899 900 901 902
@item werror=@var{action},rerror=@var{action}
Specify which @var{action} to take on write and read errors. Valid actions are:
"ignore" (ignore the error and try to continue), "stop" (pause QEMU),
"report" (report the error to the guest), "enospc" (pause QEMU only if the
host disk is full; report the error to the guest otherwise).
The default setting is @option{werror=enospc} and @option{rerror=report}.
@item copy-on-read=@var{copy-on-read}
@var{copy-on-read} is "on" or "off" and enables whether to copy read backing
file sectors into the image file.
903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926
@item bps=@var{b},bps_rd=@var{r},bps_wr=@var{w}
Specify bandwidth throttling limits in bytes per second, either for all request
types or for reads or writes only.  Small values can lead to timeouts or hangs
inside the guest.  A safe minimum for disks is 2 MB/s.
@item bps_max=@var{bm},bps_rd_max=@var{rm},bps_wr_max=@var{wm}
Specify bursts in bytes per second, either for all request types or for reads
or writes only.  Bursts allow the guest I/O to spike above the limit
temporarily.
@item iops=@var{i},iops_rd=@var{r},iops_wr=@var{w}
Specify request rate limits in requests per second, either for all request
types or for reads or writes only.
@item iops_max=@var{bm},iops_rd_max=@var{rm},iops_wr_max=@var{wm}
Specify bursts in requests per second, either for all request types or for reads
or writes only.  Bursts allow the guest I/O to spike above the limit
temporarily.
@item iops_size=@var{is}
Let every @var{is} bytes of a request count as a new request for iops
throttling purposes.  Use this option to prevent guests from circumventing iops
limits by sending fewer but larger requests.
@item group=@var{g}
Join a throttling quota group with given name @var{g}.  All drives that are
members of the same group are accounted for together.  Use this option to
prevent guests from circumventing throttling limits by using many small disks
instead of a single larger disk.
927 928
@end table

929
By default, the @option{cache.writeback=on} mode is used. It will report data
930 931 932 933 934 935
writes as completed as soon as the data is present in the host page cache.
This is safe as long as your guest OS makes sure to correctly flush disk caches
where needed. If your guest OS does not handle volatile disk write caches
correctly and your host crashes or loses power, then the guest may experience
data corruption.

936
For such guests, you should consider using @option{cache.writeback=off}. This
937 938 939 940
means that the host page cache will be used to read and write data, but write
notification will be sent to the guest only after QEMU has made sure to flush
each write to the disk. Be aware that this has a major impact on performance.

941
When using the @option{-snapshot} option, unsafe caching is always used.
942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971

Copy-on-read avoids accessing the same backing file sectors repeatedly and is
useful when the backing file is over a slow network.  By default copy-on-read
is off.

Instead of @option{-cdrom} you can use:
@example
qemu-system-i386 -drive file=file,index=2,media=cdrom
@end example

Instead of @option{-hda}, @option{-hdb}, @option{-hdc}, @option{-hdd}, you can
use:
@example
qemu-system-i386 -drive file=file,index=0,media=disk
qemu-system-i386 -drive file=file,index=1,media=disk
qemu-system-i386 -drive file=file,index=2,media=disk
qemu-system-i386 -drive file=file,index=3,media=disk
@end example

You can open an image using pre-opened file descriptors from an fd set:
@example
qemu-system-i386
-add-fd fd=3,set=2,opaque="rdwr:/path/to/file"
-add-fd fd=4,set=2,opaque="rdonly:/path/to/file"
-drive file=/dev/fdset/2,index=0,media=disk
@end example

You can connect a CDROM to the slave of ide0:
@example
qemu-system-i386 -drive file=file,if=ide,index=1,media=cdrom
972 973
@end example

974 975 976 977
If you don't specify the "file=" argument, you define an empty drive:
@example
qemu-system-i386 -drive if=ide,index=1,media=cdrom
@end example
978

979 980 981 982 983
Instead of @option{-fda}, @option{-fdb}, you can use:
@example
qemu-system-i386 -drive file=file,index=0,if=floppy
qemu-system-i386 -drive file=file,index=1,if=floppy
@end example
984

985 986 987 988 989 990 991 992 993
By default, @var{interface} is "ide" and @var{index} is automatically
incremented:
@example
qemu-system-i386 -drive file=a -drive file=b"
@end example
is interpreted like:
@example
qemu-system-i386 -hda a -hdb b
@end example
994 995
ETEXI

996 997
DEF("mtdblock", HAS_ARG, QEMU_OPTION_mtdblock,
    "-mtdblock file  use 'file' as on-board Flash memory image\n",
998 999
    QEMU_ARCH_ALL)
STEXI
1000 1001 1002
@item -mtdblock @var{file}
@findex -mtdblock
Use @var{file} as on-board Flash memory image.
1003 1004
ETEXI

1005 1006
DEF("sd", HAS_ARG, QEMU_OPTION_sd,
    "-sd file        use 'file' as SecureDigital card image\n", QEMU_ARCH_ALL)
1007
STEXI
1008 1009 1010
@item -sd @var{file}
@findex -sd
Use @var{file} as SecureDigital card image.
1011 1012
ETEXI

1013 1014
DEF("pflash", HAS_ARG, QEMU_OPTION_pflash,
    "-pflash file    use 'file' as a parallel flash image\n", QEMU_ARCH_ALL)
1015
STEXI
1016 1017 1018
@item -pflash @var{file}
@findex -pflash
Use @var{file} as a parallel flash image.
1019
ETEXI
1020

1021 1022
DEF("snapshot", 0, QEMU_OPTION_snapshot,
    "-snapshot       write to temporary files instead of disk image files\n",
1023 1024
    QEMU_ARCH_ALL)
STEXI
1025 1026 1027 1028 1029
@item -snapshot
@findex -snapshot
Write to temporary files instead of disk image files. In this case,
the raw disk image you use is not written back. You can however force
the write back by pressing @key{C-a s} (@pxref{disk_images}).
1030 1031
ETEXI

1032
DEF("fsdev", HAS_ARG, QEMU_OPTION_fsdev,
1033
    "-fsdev fsdriver,id=id[,path=path,][security_model={mapped-xattr|mapped-file|passthrough|none}]\n"
1034
    " [,writeout=immediate][,readonly][,socket=socket|sock_fd=sock_fd][,fmode=fmode][,dmode=dmode]\n"
1035 1036 1037 1038 1039
    " [[,throttling.bps-total=b]|[[,throttling.bps-read=r][,throttling.bps-write=w]]]\n"
    " [[,throttling.iops-total=i]|[[,throttling.iops-read=r][,throttling.iops-write=w]]]\n"
    " [[,throttling.bps-total-max=bm]|[[,throttling.bps-read-max=rm][,throttling.bps-write-max=wm]]]\n"
    " [[,throttling.iops-total-max=im]|[[,throttling.iops-read-max=irm][,throttling.iops-write-max=iwm]]]\n"
    " [[,throttling.iops-size=is]]\n",
1040 1041 1042 1043
    QEMU_ARCH_ALL)

STEXI

1044
@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}][,fmode=@var{fmode}][,dmode=@var{dmode}]
1045
@findex -fsdev
1046 1047 1048 1049
Define a new file system device. Valid options are:
@table @option
@item @var{fsdriver}
This option specifies the fs driver backend to use.
1050
Currently "local", "handle" and "proxy" file system drivers are supported.
1051 1052 1053 1054 1055 1056 1057
@item id=@var{id}
Specifies identifier for this device
@item path=@var{path}
Specifies the export path for the file system device. Files under
this path will be available to the 9p client on the guest.
@item security_model=@var{security_model}
Specifies the security model to be used for this export path.
1058
Supported security models are "passthrough", "mapped-xattr", "mapped-file" and "none".
1059
In "passthrough" security model, files are stored using the same
1060
credentials as they are created on the guest. This requires QEMU
1061
to run as root. In "mapped-xattr" security model, some of the file
1062
attributes like uid, gid, mode bits and link target are stored as
1063 1064
file attributes. For "mapped-file" these attributes are stored in the
hidden .virtfs_metadata directory. Directories exported by this security model cannot
1065 1066
interact with other unix tools. "none" security model is same as
passthrough except the sever won't report failures if it fails to
1067
set file attributes like ownership. Security model is mandatory
1068
only for local fsdriver. Other fsdrivers (like handle, proxy) don't take
1069
security model as a parameter.
1070 1071 1072 1073 1074
@item writeout=@var{writeout}
This is an optional argument. The only supported value is "immediate".
This means that host page cache will be used to read and write data but
write notification will be sent to the guest only when the data has been
reported as written by the storage subsystem.
1075 1076 1077
@item readonly
Enables exporting 9p share as a readonly mount for guests. By default
read-write access is given.
1078 1079 1080
@item socket=@var{socket}
Enables proxy filesystem driver to use passed socket file for communicating
with virtfs-proxy-helper
1081 1082 1083 1084
@item sock_fd=@var{sock_fd}
Enables proxy filesystem driver to use passed socket descriptor for
communicating with virtfs-proxy-helper. Usually a helper like libvirt
will create socketpair and pass one of the fds as sock_fd
1085 1086 1087 1088 1089 1090
@item fmode=@var{fmode}
Specifies the default mode for newly created files on the host. Works only
with security models "mapped-xattr" and "mapped-file".
@item dmode=@var{dmode}
Specifies the default mode for newly created directories on the host. Works
only with security models "mapped-xattr" and "mapped-file".
1091
@end table
1092

1093 1094 1095 1096 1097 1098 1099 1100
-fsdev option is used along with -device driver "virtio-9p-pci".
@item -device virtio-9p-pci,fsdev=@var{id},mount_tag=@var{mount_tag}
Options for virtio-9p-pci driver are:
@table @option
@item fsdev=@var{id}
Specifies the id value specified along with -fsdev option
@item mount_tag=@var{mount_tag}
Specifies the tag name to be used by the guest to mount this export point
1101
@end table
1102

1103 1104
ETEXI

1105
DEF("virtfs", HAS_ARG, QEMU_OPTION_virtfs,
1106
    "-virtfs local,path=path,mount_tag=tag,security_model=[mapped-xattr|mapped-file|passthrough|none]\n"
1107
    "        [,id=id][,writeout=immediate][,readonly][,socket=socket|sock_fd=sock_fd][,fmode=fmode][,dmode=dmode]\n",
1108 1109 1110 1111
    QEMU_ARCH_ALL)

STEXI

1112
@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}][,fmode=@var{fmode}][,dmode=@var{dmode}]
1113 1114
@findex -virtfs

1115 1116 1117 1118
The general form of a Virtual File system pass-through options are:
@table @option
@item @var{fsdriver}
This option specifies the fs driver backend to use.
1119
Currently "local", "handle" and "proxy" file system drivers are supported.
1120 1121 1122 1123 1124 1125 1126
@item id=@var{id}
Specifies identifier for this device
@item path=@var{path}
Specifies the export path for the file system device. Files under
this path will be available to the 9p client on the guest.
@item security_model=@var{security_model}
Specifies the security model to be used for this export path.
1127
Supported security models are "passthrough", "mapped-xattr", "mapped-file" and "none".
1128
In "passthrough" security model, files are stored using the same
1129
credentials as they are created on the guest. This requires QEMU
1130
to run as root. In "mapped-xattr" security model, some of the file
1131
attributes like uid, gid, mode bits and link target are stored as
1132 1133
file attributes. For "mapped-file" these attributes are stored in the
hidden .virtfs_metadata directory. Directories exported by this security model cannot
1134 1135
interact with other unix tools. "none" security model is same as
passthrough except the sever won't report failures if it fails to
1136
set file attributes like ownership. Security model is mandatory only
1137
for local fsdriver. Other fsdrivers (like handle, proxy) don't take security
1138
model as a parameter.
1139 1140 1141 1142 1143
@item writeout=@var{writeout}
This is an optional argument. The only supported value is "immediate".
This means that host page cache will be used to read and write data but
write notification will be sent to the guest only when the data has been
reported as written by the storage subsystem.
1144 1145 1146
@item readonly
Enables exporting 9p share as a readonly mount for guests. By default
read-write access is given.
1147 1148 1149 1150
@item socket=@var{socket}
Enables proxy filesystem driver to use passed socket file for
communicating with virtfs-proxy-helper. Usually a helper like libvirt
will create socketpair and pass one of the fds as sock_fd
1151 1152 1153
@item sock_fd
Enables proxy filesystem driver to use passed 'sock_fd' as the socket
descriptor for interfacing with virtfs-proxy-helper
1154 1155 1156 1157 1158 1159
@item fmode=@var{fmode}
Specifies the default mode for newly created files on the host. Works only
with security models "mapped-xattr" and "mapped-file".
@item dmode=@var{dmode}
Specifies the default mode for newly created directories on the host. Works
only with security models "mapped-xattr" and "mapped-file".
1160 1161 1162
@end table
ETEXI

1163 1164 1165 1166 1167 1168 1169 1170 1171
DEF("virtfs_synth", 0, QEMU_OPTION_virtfs_synth,
    "-virtfs_synth Create synthetic file system image\n",
    QEMU_ARCH_ALL)
STEXI
@item -virtfs_synth
@findex -virtfs_synth
Create synthetic file system image
ETEXI

1172 1173 1174 1175 1176 1177 1178
DEF("iscsi", HAS_ARG, QEMU_OPTION_iscsi,
    "-iscsi [user=user][,password=password]\n"
    "       [,header-digest=CRC32C|CR32C-NONE|NONE-CRC32C|NONE\n"
    "       [,initiator-name=initiator-iqn][,id=target-iqn]\n"
    "       [,timeout=timeout]\n"
    "                iSCSI session parameters\n", QEMU_ARCH_ALL)

1179 1180 1181 1182 1183 1184
STEXI
@item -iscsi
@findex -iscsi
Configure iSCSI session parameters.
ETEXI

1185 1186 1187 1188 1189
STEXI
@end table
ETEXI
DEFHEADING()

1190
DEFHEADING(USB options:)
1191 1192 1193 1194 1195
STEXI
@table @option
ETEXI

DEF("usb", 0, QEMU_OPTION_usb,
1196
    "-usb            enable the USB driver (if it is not used by default yet)\n",
1197 1198 1199 1200
    QEMU_ARCH_ALL)
STEXI
@item -usb
@findex -usb
1201
Enable the USB driver (if it is not used by default yet).
1202 1203 1204 1205 1206 1207 1208 1209 1210
ETEXI

DEF("usbdevice", HAS_ARG, QEMU_OPTION_usbdevice,
    "-usbdevice name add the host or guest USB device 'name'\n",
    QEMU_ARCH_ALL)
STEXI

@item -usbdevice @var{devname}
@findex -usbdevice
1211 1212
Add the USB device @var{devname}. Note that this option is deprecated,
please use @code{-device usb-...} instead. @xref{usb_devices}.
1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235

@table @option

@item mouse
Virtual Mouse. This will override the PS/2 mouse emulation when activated.

@item tablet
Pointer device that uses absolute coordinates (like a touchscreen). This
means QEMU is able to report the mouse position without having to grab the
mouse. Also overrides the PS/2 mouse emulation when activated.

@item braille
Braille device.  This will use BrlAPI to display the braille output on a real
or fake device.

@end table
ETEXI

STEXI
@end table
ETEXI
DEFHEADING()

1236
DEFHEADING(Display options:)
1237 1238 1239 1240
STEXI
@table @option
ETEXI

1241 1242
DEF("display", HAS_ARG, QEMU_OPTION_display,
    "-display sdl[,frame=on|off][,alt_grab=on|off][,ctrl_grab=on|off]\n"
1243
    "            [,window_close=on|off][,gl=on|off]\n"
1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261
    "-display gtk[,grab_on_hover=on|off][,gl=on|off]|\n"
    "-display vnc=<display>[,<optargs>]\n"
    "-display curses\n"
    "-display none"
    "                select display type\n"
    "The default display is equivalent to\n"
#if defined(CONFIG_GTK)
            "\t\"-display gtk\"\n"
#elif defined(CONFIG_SDL)
            "\t\"-display sdl\"\n"
#elif defined(CONFIG_COCOA)
            "\t\"-display cocoa\"\n"
#elif defined(CONFIG_VNC)
            "\t\"-vnc localhost:0,to=99,id=default\"\n"
#else
            "\t\"-display none\"\n"
#endif
    , QEMU_ARCH_ALL)
1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276
STEXI
@item -display @var{type}
@findex -display
Select type of display to use. This option is a replacement for the
old style -sdl/-curses/... options. Valid values for @var{type} are
@table @option
@item sdl
Display video output via SDL (usually in a separate graphics
window; see the SDL documentation for other possibilities).
@item curses
Display video output via curses. For graphics device models which
support a text mode, QEMU can display this output using a
curses/ncurses interface. Nothing is displayed when the graphics
device is in graphical mode or if the graphics device does not support
a text mode. Generally only the VGA device models support text mode.
Jes Sorensen's avatar
Jes Sorensen committed
1277 1278 1279 1280 1281 1282
@item none
Do not display video output. The guest will still see an emulated
graphics card, but its output will not be displayed to the QEMU
user. This option differs from the -nographic option in that it
only affects what is done with video output; -nographic also changes
the destination of the serial and parallel port data.
1283 1284 1285 1286
@item gtk
Display video output in a GTK window. This interface provides drop-down
menus and other UI elements to configure and control the VM during
runtime.
1287 1288
@item vnc
Start a VNC server on display <arg>
1289 1290 1291
@end table
ETEXI

1292
DEF("nographic", 0, QEMU_OPTION_nographic,
1293 1294
    "-nographic      disable graphical output and redirect serial I/Os to console\n",
    QEMU_ARCH_ALL)
1295 1296
STEXI
@item -nographic
1297
@findex -nographic
1298 1299 1300 1301 1302 1303 1304 1305
Normally, if QEMU is compiled with graphical window support, it displays
output such as guest graphics, guest console, and the QEMU monitor in a
window. With this option, you can totally disable graphical output so
that QEMU is a simple command line application. The emulated serial port
is redirected on the console and muxed with the monitor (unless
redirected elsewhere explicitly). Therefore, you can still use QEMU to
debug a Linux kernel with a serial console. Use @key{C-a h} for help on
switching between the console and monitor.
1306 1307 1308
ETEXI

DEF("curses", 0, QEMU_OPTION_curses,
1309
    "-curses         shorthand for -display curses\n",
1310
    QEMU_ARCH_ALL)
1311 1312
STEXI
@item -curses
1313
@findex -curses
1314 1315 1316 1317 1318
Normally, if QEMU is compiled with graphical window support, it displays
output such as guest graphics, guest console, and the QEMU monitor in a
window. With this option, QEMU can display the VGA output when in text
mode using a curses/ncurses interface. Nothing is displayed in graphical
mode.
1319 1320 1321
ETEXI

DEF("no-frame", 0, QEMU_OPTION_no_frame,
1322 1323
    "-no-frame       open SDL window without a frame and window decorations\n",
    QEMU_ARCH_ALL)
1324 1325
STEXI
@item -no-frame
1326
@findex -no-frame
1327 1328 1329 1330 1331 1332
Do not use decorations for SDL windows and start them using the whole
available screen space. This makes the using QEMU in a dedicated desktop
workspace more convenient.
ETEXI

DEF("alt-grab", 0, QEMU_OPTION_alt_grab,
1333 1334
    "-alt-grab       use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt)\n",
    QEMU_ARCH_ALL)
1335 1336
STEXI
@item -alt-grab
1337
@findex -alt-grab
1338 1339
Use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt). Note that this also
affects the special keys (for fullscreen, monitor-mode switching, etc).
1340 1341
ETEXI

1342
DEF("ctrl-grab", 0, QEMU_OPTION_ctrl_grab,
1343 1344
    "-ctrl-grab      use Right-Ctrl to grab mouse (instead of Ctrl-Alt)\n",
    QEMU_ARCH_ALL)
1345 1346
STEXI
@item -ctrl-grab
1347
@findex -ctrl-grab
1348 1349
Use Right-Ctrl to grab mouse (instead of Ctrl-Alt). Note that this also
affects the special keys (for fullscreen, monitor-mode switching, etc).
1350 1351
ETEXI

1352
DEF("no-quit", 0, QEMU_OPTION_no_quit,
1353
    "-no-quit        disable SDL window close capability\n", QEMU_ARCH_ALL)
1354 1355
STEXI
@item -no-quit
1356
@findex -no-quit
1357 1358 1359 1360
Disable SDL window close capability.
ETEXI

DEF("sdl", 0, QEMU_OPTION_sdl,
1361
    "-sdl            shorthand for -display sdl\n", QEMU_ARCH_ALL)
1362 1363
STEXI
@item -sdl
1364
@findex -sdl
1365 1366 1367
Enable SDL.
ETEXI

Gerd Hoffmann's avatar
Gerd Hoffmann committed
1368
DEF("spice", HAS_ARG, QEMU_OPTION_spice,
1369 1370 1371
    "-spice [port=port][,tls-port=secured-port][,x509-dir=<dir>]\n"
    "       [,x509-key-file=<file>][,x509-key-password=<file>]\n"
    "       [,x509-cert-file=<file>][,x509-cacert-file=<file>]\n"
1372
    "       [,x509-dh-key-file=<file>][,addr=addr][,ipv4|ipv6|unix]\n"
1373 1374 1375 1376 1377 1378 1379 1380
    "       [,tls-ciphers=<list>]\n"
    "       [,tls-channel=[main|display|cursor|inputs|record|playback]]\n"
    "       [,plaintext-channel=[main|display|cursor|inputs|record|playback]]\n"
    "       [,sasl][,password=<secret>][,disable-ticketing]\n"
    "       [,image-compression=[auto_glz|auto_lz|quic|glz|lz|off]]\n"
    "       [,jpeg-wan-compression=[auto|never|always]]\n"
    "       [,zlib-glz-wan-compression=[auto|never|always]]\n"
    "       [,streaming-video=[off|all|filter]][,disable-copy-paste]\n"
1381 1382
    "       [,disable-agent-file-xfer][,agent-mouse=[on|off]]\n"
    "       [,playback-compression=[on|off]][,seamless-migration=[on|off]]\n"
1383
    "       [,gl=[on|off]][,rendernode=<file>]\n"
1384 1385 1386
    "   enable spice\n"
    "   at least one of {port, tls-port} is mandatory\n",
    QEMU_ARCH_ALL)
Gerd Hoffmann's avatar
Gerd Hoffmann committed
1387 1388 1389 1390 1391 1392 1393 1394
STEXI
@item -spice @var{option}[,@var{option}[,...]]
@findex -spice
Enable the spice remote desktop protocol. Valid options are

@table @option

@item port=<nr>
Gerd Hoffmann's avatar
Gerd Hoffmann committed
1395
Set the TCP port spice is listening on for plaintext channels.
Gerd Hoffmann's avatar
Gerd Hoffmann committed
1396

1397 1398 1399 1400
@item addr=<addr>
Set the IP address spice is listening on.  Default is any address.

@item ipv4
1401 1402
@itemx ipv6
@itemx unix
1403 1404
Force using the specified IP version.

Gerd Hoffmann's avatar
Gerd Hoffmann committed
1405 1406 1407
@item password=<secret>
Set the password you need to authenticate.

1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420
@item sasl
Require that the client use SASL to authenticate with the spice.
The exact choice of authentication method used is controlled from the
system / user's SASL configuration file for the 'qemu' service. This
is typically found in /etc/sasl2/qemu.conf. If running QEMU as an
unprivileged user, an environment variable SASL_CONF_PATH can be used
to make it search alternate locations for the service config.
While some SASL auth methods can also provide data encryption (eg GSSAPI),
it is recommended that SASL always be combined with the 'tls' and
'x509' settings to enable use of SSL and server certificates. This
ensures a data encryption preventing compromise of authentication
credentials.

Gerd Hoffmann's avatar
Gerd Hoffmann committed
1421 1422 1423
@item disable-ticketing
Allow client connects without authentication.

1424 1425 1426
@item disable-copy-paste
Disable copy paste between the client and the guest.

1427 1428 1429
@item disable-agent-file-xfer
Disable spice-vdagent based file-xfer between the client and the guest.

Gerd Hoffmann's avatar
Gerd Hoffmann committed
1430 1431 1432 1433 1434 1435 1436
@item tls-port=<nr>
Set the TCP port spice is listening on for encrypted channels.

@item x509-dir=<dir>
Set the x509 file directory. Expects same filenames as -vnc $display,x509=$dir

@item x509-key-file=<file>
1437 1438 1439 1440
@itemx x509-key-password=<file>
@itemx x509-cert-file=<file>
@itemx x509-cacert-file=<file>
@itemx x509-dh-key-file=<file>
Gerd Hoffmann's avatar
Gerd Hoffmann committed
1441 1442 1443 1444 1445
The x509 file names can also be configured individually.

@item tls-ciphers=<list>
Specify which ciphers to use.

1446
@item tls-channel=[main|display|cursor|inputs|record|playback]
1447
@itemx plaintext-channel=[main|display|cursor|inputs|record|playback]
1448 1449 1450 1451 1452 1453
Force specific channel to be used with or without TLS encryption.  The
options can be specified multiple times to configure multiple
channels.  The special name "default" can be used to set the default
mode.  For channels which are not explicitly forced into one mode the
spice client is allowed to pick tls/plaintext as he pleases.

1454 1455 1456 1457 1458
@item image-compression=[auto_glz|auto_lz|quic|glz|lz|off]
Configure image compression (lossless).
Default is auto_glz.

@item jpeg-wan-compression=[auto|never|always]
1459
@itemx zlib-glz-wan-compression=[auto|never|always]
1460 1461 1462
Configure wan image compression (lossy for slow links).
Default is auto.

1463
@item streaming-video=[off|all|filter]
1464
Configure video stream detection.  Default is off.
1465 1466 1467 1468 1469 1470 1471

@item agent-mouse=[on|off]
Enable/disable passing mouse events via vdagent.  Default is on.

@item playback-compression=[on|off]
Enable/disable audio stream compression (using celt 0.5.1).  Default is on.

1472 1473 1474
@item seamless-migration=[on|off]
Enable/disable spice seamless migration. Default is off.

1475 1476 1477
@item gl=[on|off]
Enable/disable OpenGL context. Default is off.

1478 1479 1480 1481
@item rendernode=<file>
DRM render node for OpenGL rendering. If not specified, it will pick
the first available. (Since 2.9)

Gerd Hoffmann's avatar
Gerd Hoffmann committed
1482 1483 1484
@end table
ETEXI

1485
DEF("portrait", 0, QEMU_OPTION_portrait,
1486 1487
    "-portrait       rotate graphical output 90 deg left (only PXA LCD)\n",
    QEMU_ARCH_ALL)
1488 1489
STEXI
@item -portrait
1490
@findex -portrait