13c95fdefSPeter MaydellHXCOMM Use DEFHEADING() to define headings in both help text and rST. 23c95fdefSPeter MaydellHXCOMM Text between SRST and ERST is copied to the rST version and 33c95fdefSPeter MaydellHXCOMM discarded from C version. 4ad96090aSBlue SwirlHXCOMM DEF(option, HAS_ARG/0, opt_enum, opt_help, arch_mask) is used to 5ad96090aSBlue SwirlHXCOMM construct option structures, enums and help message for specified 6ad96090aSBlue SwirlHXCOMM architectures. 73c95fdefSPeter MaydellHXCOMM HXCOMM can be used for comments, discarded from both rST and C. 85824d651Sblueswir1 9de6b4f90SMarkus ArmbrusterDEFHEADING(Standard options:) 105824d651Sblueswir1 115824d651Sblueswir1DEF("help", 0, QEMU_OPTION_h, 12ad96090aSBlue Swirl "-h or -help display this help and exit\n", QEMU_ARCH_ALL) 13e2fcbf42SPeter MaydellSRST 14e2fcbf42SPeter Maydell``-h`` 15e2fcbf42SPeter Maydell Display help and exit 16e2fcbf42SPeter MaydellERST 175824d651Sblueswir1 189bd7e6d9SpbrookDEF("version", 0, QEMU_OPTION_version, 19ad96090aSBlue Swirl "-version display version information and exit\n", QEMU_ARCH_ALL) 20e2fcbf42SPeter MaydellSRST 21e2fcbf42SPeter Maydell``-version`` 22e2fcbf42SPeter Maydell Display version information and exit 23e2fcbf42SPeter MaydellERST 249bd7e6d9Spbrook 2580f52a66SJan KiszkaDEF("machine", HAS_ARG, QEMU_OPTION_machine, \ 2680f52a66SJan Kiszka "-machine [type=]name[,prop[=value][,...]]\n" 27585f6036SPeter Maydell " selects emulated machine ('-machine help' for list)\n" 2880f52a66SJan Kiszka " property accel=accel1[:accel2[:...]] selects accelerator\n" 2974a414a1SReinoud Zandijk " supported accelerators are kvm, xen, hax, hvf, nvmm, whpx or tcg (default: tcg)\n" 30d1048befSDon Slutz " vmport=on|off|auto controls emulation of vmport (default: auto)\n" 318490fc78SLuiz Capitulino " dump-guest-core=on|off include guest memory in a core dump (default=on)\n" 32a52a7fdfSLe Tan " mem-merge=on|off controls memory merge support (default: on)\n" 332eb1cd07STony Krowiak " aes-key-wrap=on|off controls support for AES key wrapping (default=on)\n" 349850c604SAlexander Graf " dea-key-wrap=on|off controls support for DEA key wrapping (default=on)\n" 3587252e1bSXiao Guangrong " suppress-vmdesc=on|off disables self-describing migration (default=off)\n" 36902c053dSGreg Kurz " nvdimm=on|off controls NVDIMM support (default=off)\n" 37244b3f44STao Xu " memory-encryption=@var{} memory encryption object to use (default=none)\n" 388db0b204SIgor Mammedov " hmat=on|off controls ACPI HMAT support (default=off)\n" 398db0b204SIgor Mammedov " memory-backend='backend-id' specifies explicitly provided backend for main RAM (default=none)\n", 4080f52a66SJan Kiszka QEMU_ARCH_ALL) 41e2fcbf42SPeter MaydellSRST 42e2fcbf42SPeter Maydell``-machine [type=]name[,prop=value[,...]]`` 43e2fcbf42SPeter Maydell Select the emulated machine by name. Use ``-machine help`` to list 44e2fcbf42SPeter Maydell available machines. 45e2fcbf42SPeter Maydell 46e2fcbf42SPeter Maydell For architectures which aim to support live migration compatibility 47e2fcbf42SPeter Maydell across releases, each release will introduce a new versioned machine 48e2fcbf42SPeter Maydell type. For example, the 2.8.0 release introduced machine types 49e2fcbf42SPeter Maydell "pc-i440fx-2.8" and "pc-q35-2.8" for the x86\_64/i686 architectures. 50e2fcbf42SPeter Maydell 51e2fcbf42SPeter Maydell To allow live migration of guests from QEMU version 2.8.0, to QEMU 52e2fcbf42SPeter Maydell version 2.9.0, the 2.9.0 version must support the "pc-i440fx-2.8" 53e2fcbf42SPeter Maydell and "pc-q35-2.8" machines too. To allow users live migrating VMs to 54e2fcbf42SPeter Maydell skip multiple intermediate releases when upgrading, new releases of 55e2fcbf42SPeter Maydell QEMU will support machine types from many previous versions. 56e2fcbf42SPeter Maydell 57e2fcbf42SPeter Maydell Supported machine properties are: 58e2fcbf42SPeter Maydell 59e2fcbf42SPeter Maydell ``accel=accels1[:accels2[:...]]`` 60e2fcbf42SPeter Maydell This is used to enable an accelerator. Depending on the target 6174a414a1SReinoud Zandijk architecture, kvm, xen, hax, hvf, nvmm, whpx or tcg can be available. 62e2fcbf42SPeter Maydell By default, tcg is used. If there is more than one accelerator 63e2fcbf42SPeter Maydell specified, the next one is used if the previous one fails to 64e2fcbf42SPeter Maydell initialize. 65e2fcbf42SPeter Maydell 66e2fcbf42SPeter Maydell ``vmport=on|off|auto`` 67e2fcbf42SPeter Maydell Enables emulation of VMWare IO port, for vmmouse etc. auto says 68e2fcbf42SPeter Maydell to select the value based on accel. For accel=xen the default is 69e2fcbf42SPeter Maydell off otherwise the default is on. 70e2fcbf42SPeter Maydell 71e2fcbf42SPeter Maydell ``dump-guest-core=on|off`` 72e2fcbf42SPeter Maydell Include guest memory in a core dump. The default is on. 73e2fcbf42SPeter Maydell 74e2fcbf42SPeter Maydell ``mem-merge=on|off`` 75e2fcbf42SPeter Maydell Enables or disables memory merge support. This feature, when 76e2fcbf42SPeter Maydell supported by the host, de-duplicates identical memory pages 77e2fcbf42SPeter Maydell among VMs instances (enabled by default). 78e2fcbf42SPeter Maydell 79e2fcbf42SPeter Maydell ``aes-key-wrap=on|off`` 80e2fcbf42SPeter Maydell Enables or disables AES key wrapping support on s390-ccw hosts. 81e2fcbf42SPeter Maydell This feature controls whether AES wrapping keys will be created 82e2fcbf42SPeter Maydell to allow execution of AES cryptographic functions. The default 83e2fcbf42SPeter Maydell is on. 84e2fcbf42SPeter Maydell 85e2fcbf42SPeter Maydell ``dea-key-wrap=on|off`` 86e2fcbf42SPeter Maydell Enables or disables DEA key wrapping support on s390-ccw hosts. 87e2fcbf42SPeter Maydell This feature controls whether DEA wrapping keys will be created 88e2fcbf42SPeter Maydell to allow execution of DEA cryptographic functions. The default 89e2fcbf42SPeter Maydell is on. 90e2fcbf42SPeter Maydell 91e2fcbf42SPeter Maydell ``nvdimm=on|off`` 92e2fcbf42SPeter Maydell Enables or disables NVDIMM support. The default is off. 93e2fcbf42SPeter Maydell 94e2fcbf42SPeter Maydell ``memory-encryption=`` 95e2fcbf42SPeter Maydell Memory encryption object to use. The default is none. 96e2fcbf42SPeter Maydell 97e2fcbf42SPeter Maydell ``hmat=on|off`` 98e2fcbf42SPeter Maydell Enables or disables ACPI Heterogeneous Memory Attribute Table 99e2fcbf42SPeter Maydell (HMAT) support. The default is off. 1008db0b204SIgor Mammedov 1018db0b204SIgor Mammedov ``memory-backend='id'`` 1028db0b204SIgor Mammedov An alternative to legacy ``-mem-path`` and ``mem-prealloc`` options. 1038db0b204SIgor Mammedov Allows to use a memory backend as main RAM. 1048db0b204SIgor Mammedov 1058db0b204SIgor Mammedov For example: 1068db0b204SIgor Mammedov :: 10795355829SPeter Maydell 1088db0b204SIgor Mammedov -object memory-backend-file,id=pc.ram,size=512M,mem-path=/hugetlbfs,prealloc=on,share=on 1098db0b204SIgor Mammedov -machine memory-backend=pc.ram 1108db0b204SIgor Mammedov -m 512M 1118db0b204SIgor Mammedov 1128db0b204SIgor Mammedov Migration compatibility note: 11395355829SPeter Maydell 11495355829SPeter Maydell * as backend id one shall use value of 'default-ram-id', advertised by 1158db0b204SIgor Mammedov machine type (available via ``query-machines`` QMP command), if migration 1168db0b204SIgor Mammedov to/from old QEMU (<5.0) is expected. 11795355829SPeter Maydell * for machine types 4.0 and older, user shall 1188db0b204SIgor Mammedov use ``x-use-canonical-path-for-ramblock-id=off`` backend option 1198db0b204SIgor Mammedov if migration to/from old QEMU (<5.0) is expected. 12095355829SPeter Maydell 1218db0b204SIgor Mammedov For example: 1228db0b204SIgor Mammedov :: 12395355829SPeter Maydell 1248db0b204SIgor Mammedov -object memory-backend-ram,id=pc.ram,size=512M,x-use-canonical-path-for-ramblock-id=off 1258db0b204SIgor Mammedov -machine memory-backend=pc.ram 1268db0b204SIgor Mammedov -m 512M 127e2fcbf42SPeter MaydellERST 1285824d651Sblueswir1 129dfce81f1SSean ChristophersonDEF("M", HAS_ARG, QEMU_OPTION_M, 130dfce81f1SSean Christopherson " sgx-epc.0.memdev=memid\n", 131dfce81f1SSean Christopherson QEMU_ARCH_ALL) 132dfce81f1SSean Christopherson 133dfce81f1SSean ChristophersonSRST 134dfce81f1SSean Christopherson``sgx-epc.0.memdev=@var{memid}`` 135dfce81f1SSean Christopherson Define an SGX EPC section. 136dfce81f1SSean ChristophersonERST 13780f52a66SJan Kiszka 1385824d651Sblueswir1DEF("cpu", HAS_ARG, QEMU_OPTION_cpu, 139585f6036SPeter Maydell "-cpu cpu select CPU ('-cpu help' for list)\n", QEMU_ARCH_ALL) 140e2fcbf42SPeter MaydellSRST 141e2fcbf42SPeter Maydell``-cpu model`` 142e2fcbf42SPeter Maydell Select CPU model (``-cpu help`` for list and additional feature 143e2fcbf42SPeter Maydell selection) 144e2fcbf42SPeter MaydellERST 1455824d651Sblueswir1 1468d4e9146SKONRAD FredericDEF("accel", HAS_ARG, QEMU_OPTION_accel, 147fe174132SPaolo Bonzini "-accel [accel=]accelerator[,prop[=value][,...]]\n" 14874a414a1SReinoud Zandijk " select accelerator (kvm, xen, hax, hvf, nvmm, whpx or tcg; use 'help' for a list)\n" 14946472d82SPaolo Bonzini " igd-passthru=on|off (enable Xen integrated Intel graphics passthrough, default=off)\n" 15011bc4a13SPaolo Bonzini " kernel-irqchip=on|off|split controls accelerated irqchip support (default=on)\n" 15123b0898eSPaolo Bonzini " kvm-shadow-mem=size of KVM shadow MMU in bytes\n" 152a35b3e14SRichard Henderson " split-wx=on|off (enable TCG split w^x mapping)\n" 153fe174132SPaolo Bonzini " tb-size=n (TCG translation block cache size)\n" 1542ea5cb0aSPeter Xu " dirty-ring-size=n (KVM dirty ring GFN count, default 0)\n" 1550b3c5c81SEduardo Habkost " thread=single|multi (enable multi-threaded TCG)\n", QEMU_ARCH_ALL) 156e2fcbf42SPeter MaydellSRST 157e2fcbf42SPeter Maydell``-accel name[,prop=value[,...]]`` 158e2fcbf42SPeter Maydell This is used to enable an accelerator. Depending on the target 15974a414a1SReinoud Zandijk architecture, kvm, xen, hax, hvf, nvmm, whpx or tcg can be available. By 160e2fcbf42SPeter Maydell default, tcg is used. If there is more than one accelerator 161e2fcbf42SPeter Maydell specified, the next one is used if the previous one fails to 162e2fcbf42SPeter Maydell initialize. 163e2fcbf42SPeter Maydell 164e2fcbf42SPeter Maydell ``igd-passthru=on|off`` 165e2fcbf42SPeter Maydell When Xen is in use, this option controls whether Intel 166e2fcbf42SPeter Maydell integrated graphics devices can be passed through to the guest 167e2fcbf42SPeter Maydell (default=off) 168e2fcbf42SPeter Maydell 169e2fcbf42SPeter Maydell ``kernel-irqchip=on|off|split`` 170e2fcbf42SPeter Maydell Controls KVM in-kernel irqchip support. The default is full 171e2fcbf42SPeter Maydell acceleration of the interrupt controllers. On x86, split irqchip 172e2fcbf42SPeter Maydell reduces the kernel attack surface, at a performance cost for 173e2fcbf42SPeter Maydell non-MSI interrupts. Disabling the in-kernel irqchip completely 174e2fcbf42SPeter Maydell is not recommended except for debugging purposes. 175e2fcbf42SPeter Maydell 176e2fcbf42SPeter Maydell ``kvm-shadow-mem=size`` 177e2fcbf42SPeter Maydell Defines the size of the KVM shadow MMU. 178e2fcbf42SPeter Maydell 179a35b3e14SRichard Henderson ``split-wx=on|off`` 180a35b3e14SRichard Henderson Controls the use of split w^x mapping for the TCG code generation 181a35b3e14SRichard Henderson buffer. Some operating systems require this to be enabled, and in 182a35b3e14SRichard Henderson such a case this will default on. On other operating systems, this 183a35b3e14SRichard Henderson will default off, but one may enable this for testing or debugging. 184a35b3e14SRichard Henderson 185e2fcbf42SPeter Maydell ``tb-size=n`` 186e2fcbf42SPeter Maydell Controls the size (in MiB) of the TCG translation block cache. 187e2fcbf42SPeter Maydell 188e2fcbf42SPeter Maydell ``thread=single|multi`` 189e2fcbf42SPeter Maydell Controls number of TCG threads. When the TCG is multi-threaded 190cba42d61SMichael Tokarev there will be one thread per vCPU therefore taking advantage of 191e2fcbf42SPeter Maydell additional host cores. The default is to enable multi-threading 192e2fcbf42SPeter Maydell where both the back-end and front-ends support it and no 193e2fcbf42SPeter Maydell incompatible TCG features have been enabled (e.g. 194e2fcbf42SPeter Maydell icount/replay). 1952ea5cb0aSPeter Xu 1962ea5cb0aSPeter Xu ``dirty-ring-size=n`` 1972ea5cb0aSPeter Xu When the KVM accelerator is used, it controls the size of the per-vCPU 1982ea5cb0aSPeter Xu dirty page ring buffer (number of entries for each vCPU). It should 1992ea5cb0aSPeter Xu be a value that is power of two, and it should be 1024 or bigger (but 2002ea5cb0aSPeter Xu still less than the maximum value that the kernel supports). 4096 2012ea5cb0aSPeter Xu could be a good initial value if you have no idea which is the best. 2022ea5cb0aSPeter Xu Set this value to 0 to disable the feature. By default, this feature 2032ea5cb0aSPeter Xu is disabled (dirty-ring-size=0). When enabled, KVM will instead 2042ea5cb0aSPeter Xu record dirty pages in a bitmap. 2052ea5cb0aSPeter Xu 206e2fcbf42SPeter MaydellERST 2078d4e9146SKONRAD Frederic 2085824d651Sblueswir1DEF("smp", HAS_ARG, QEMU_OPTION_smp, 209553dc36bSYanan Wang "-smp [[cpus=]n][,maxcpus=maxcpus][,sockets=sockets][,dies=dies][,cores=cores][,threads=threads]\n" 2106be68d7eSJes Sorensen " set the number of CPUs to 'n' [default=1]\n" 211ce8ee7c6SDaniel P. Berrangé " maxcpus= maximum number of total CPUs, including\n" 212ca1a8a06SBruce Rogers " offline CPUs for hotplug, etc\n" 213ce8ee7c6SDaniel P. Berrangé " sockets= number of discrete sockets in the system\n" 2141b458422SLike Xu " dies= number of CPU dies on one socket (for PC only)\n" 215ce8ee7c6SDaniel P. Berrangé " cores= number of CPU cores on one socket (for PC, it's on one die)\n" 216ce8ee7c6SDaniel P. Berrangé " threads= number of threads on one CPU core\n", 217ad96090aSBlue Swirl QEMU_ARCH_ALL) 218e2fcbf42SPeter MaydellSRST 219b9361bdcSDaniel P. Berrangé``-smp [[cpus=]n][,maxcpus=maxcpus][,sockets=sockets][,dies=dies][,cores=cores][,threads=threads]`` 22080d78357SDaniel P. Berrangé Simulate a SMP system with '\ ``n``\ ' CPUs initially present on 22180d78357SDaniel P. Berrangé the machine type board. On boards supporting CPU hotplug, the optional 22280d78357SDaniel P. Berrangé '\ ``maxcpus``\ ' parameter can be set to enable further CPUs to be 2237d8c5a39SYanan Wang added at runtime. When both parameters are omitted, the maximum number 2247d8c5a39SYanan Wang of CPUs will be calculated from the provided topology members and the 2257d8c5a39SYanan Wang initial CPU count will match the maximum number. When only one of them 2267d8c5a39SYanan Wang is given then the omitted one will be set to its counterpart's value. 2277d8c5a39SYanan Wang Both parameters may be specified, but the maximum number of CPUs must 2287d8c5a39SYanan Wang be equal to or greater than the initial CPU count. Both parameters are 2297d8c5a39SYanan Wang subject to an upper limit that is determined by the specific machine 2307d8c5a39SYanan Wang type chosen. 23180d78357SDaniel P. Berrangé 23280d78357SDaniel P. Berrangé To control reporting of CPU topology information, the number of sockets, 23380d78357SDaniel P. Berrangé dies per socket, cores per die, and threads per core can be specified. 23480d78357SDaniel P. Berrangé The sum `` sockets * cores * dies * threads `` must be equal to the 23580d78357SDaniel P. Berrangé maximum CPU count. CPU targets may only support a subset of the topology 23680d78357SDaniel P. Berrangé parameters. Where a CPU target does not support use of a particular 23780d78357SDaniel P. Berrangé topology parameter, its value should be assumed to be 1 for the purpose 23880d78357SDaniel P. Berrangé of computing the CPU maximum count. 23980d78357SDaniel P. Berrangé 24080d78357SDaniel P. Berrangé Either the initial CPU count, or at least one of the topology parameters 241c2511b16SYanan Wang must be specified. The specified parameters must be greater than zero, 242c2511b16SYanan Wang explicit configuration like "cpus=0" is not allowed. Values for any 243c2511b16SYanan Wang omitted parameters will be computed from those which are given. 244c2511b16SYanan Wang Historically preference was given to the coarsest topology parameters 245c2511b16SYanan Wang when computing missing values (ie sockets preferred over cores, which 246c2511b16SYanan Wang were preferred over threads), however, this behaviour is considered 2474a0af293SYanan Wang liable to change. Prior to 6.2 the preference was sockets over cores 2484a0af293SYanan Wang over threads. Since 6.2 the preference is cores over sockets over threads. 249e2fcbf42SPeter MaydellERST 2505824d651Sblueswir1 251268a362cSaliguoriDEF("numa", HAS_ARG, QEMU_OPTION_numa, 252244b3f44STao Xu "-numa node[,mem=size][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=node]\n" 253244b3f44STao Xu "-numa node[,memdev=id][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=node]\n" 2542d19c656SIgor Mammedov "-numa dist,src=source,dst=destination,val=distance\n" 2559b12dfa0SLiu Jingqi "-numa cpu,node-id=node[,socket-id=x][,core-id=y][,thread-id=z]\n" 256c412a48dSLiu Jingqi "-numa hmat-lb,initiator=node,target=node,hierarchy=memory|first-level|second-level|third-level,data-type=access-latency|read-latency|write-latency[,latency=lat][,bandwidth=bw]\n" 257c412a48dSLiu Jingqi "-numa hmat-cache,node-id=node,size=size,level=level[,associativity=none|direct|complex][,policy=none|write-back|write-through][,line=size]\n", 2582d19c656SIgor Mammedov QEMU_ARCH_ALL) 259e2fcbf42SPeter MaydellSRST 26009ce5f2dSPeter Maydell``-numa node[,mem=size][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=initiator]`` 26109ce5f2dSPeter Maydell \ 26209ce5f2dSPeter Maydell``-numa node[,memdev=id][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=initiator]`` 26309ce5f2dSPeter Maydell \ 26409ce5f2dSPeter Maydell``-numa dist,src=source,dst=destination,val=distance`` 26509ce5f2dSPeter Maydell \ 26609ce5f2dSPeter Maydell``-numa cpu,node-id=node[,socket-id=x][,core-id=y][,thread-id=z]`` 26709ce5f2dSPeter Maydell \ 26809ce5f2dSPeter Maydell``-numa hmat-lb,initiator=node,target=node,hierarchy=hierarchy,data-type=tpye[,latency=lat][,bandwidth=bw]`` 26909ce5f2dSPeter Maydell \ 27009ce5f2dSPeter Maydell``-numa hmat-cache,node-id=node,size=size,level=level[,associativity=str][,policy=str][,line=size]`` 271e2fcbf42SPeter Maydell Define a NUMA node and assign RAM and VCPUs to it. Set the NUMA 272e2fcbf42SPeter Maydell distance from a source node to a destination node. Set the ACPI 273e2fcbf42SPeter Maydell Heterogeneous Memory Attributes for the given nodes. 274e2fcbf42SPeter Maydell 275e2fcbf42SPeter Maydell Legacy VCPU assignment uses '\ ``cpus``\ ' option where firstcpu and 276e2fcbf42SPeter Maydell lastcpu are CPU indexes. Each '\ ``cpus``\ ' option represent a 277e2fcbf42SPeter Maydell contiguous range of CPU indexes (or a single VCPU if lastcpu is 278e2fcbf42SPeter Maydell omitted). A non-contiguous set of VCPUs can be represented by 279e2fcbf42SPeter Maydell providing multiple '\ ``cpus``\ ' options. If '\ ``cpus``\ ' is 280e2fcbf42SPeter Maydell omitted on all nodes, VCPUs are automatically split between them. 281e2fcbf42SPeter Maydell 282e2fcbf42SPeter Maydell For example, the following option assigns VCPUs 0, 1, 2 and 5 to a 283e2fcbf42SPeter Maydell NUMA node: 284e2fcbf42SPeter Maydell 285e2fcbf42SPeter Maydell :: 286e2fcbf42SPeter Maydell 287e2fcbf42SPeter Maydell -numa node,cpus=0-2,cpus=5 288e2fcbf42SPeter Maydell 289e2fcbf42SPeter Maydell '\ ``cpu``\ ' option is a new alternative to '\ ``cpus``\ ' option 290e2fcbf42SPeter Maydell which uses '\ ``socket-id|core-id|thread-id``\ ' properties to 291e2fcbf42SPeter Maydell assign CPU objects to a node using topology layout properties of 292e2fcbf42SPeter Maydell CPU. The set of properties is machine specific, and depends on used 293e2fcbf42SPeter Maydell machine type/'\ ``smp``\ ' options. It could be queried with 294e2fcbf42SPeter Maydell '\ ``hotpluggable-cpus``\ ' monitor command. '\ ``node-id``\ ' 295e2fcbf42SPeter Maydell property specifies node to which CPU object will be assigned, it's 296e2fcbf42SPeter Maydell required for node to be declared with '\ ``node``\ ' option before 297e2fcbf42SPeter Maydell it's used with '\ ``cpu``\ ' option. 298e2fcbf42SPeter Maydell 299e2fcbf42SPeter Maydell For example: 300e2fcbf42SPeter Maydell 301e2fcbf42SPeter Maydell :: 302e2fcbf42SPeter Maydell 303e2fcbf42SPeter Maydell -M pc \ 304e2fcbf42SPeter Maydell -smp 1,sockets=2,maxcpus=2 \ 305e2fcbf42SPeter Maydell -numa node,nodeid=0 -numa node,nodeid=1 \ 306e2fcbf42SPeter Maydell -numa cpu,node-id=0,socket-id=0 -numa cpu,node-id=1,socket-id=1 307e2fcbf42SPeter Maydell 30832a354dcSIgor Mammedov Legacy '\ ``mem``\ ' assigns a given RAM amount to a node (not supported 30932a354dcSIgor Mammedov for 5.1 and newer machine types). '\ ``memdev``\ ' assigns RAM from 31032a354dcSIgor Mammedov a given memory backend device to a node. If '\ ``mem``\ ' and 31132a354dcSIgor Mammedov '\ ``memdev``\ ' are omitted in all nodes, RAM is split equally between them. 31232a354dcSIgor Mammedov 313e2fcbf42SPeter Maydell 314e2fcbf42SPeter Maydell '\ ``mem``\ ' and '\ ``memdev``\ ' are mutually exclusive. 315e2fcbf42SPeter Maydell Furthermore, if one node uses '\ ``memdev``\ ', all of them have to 316e2fcbf42SPeter Maydell use it. 317e2fcbf42SPeter Maydell 318e2fcbf42SPeter Maydell '\ ``initiator``\ ' is an additional option that points to an 319e2fcbf42SPeter Maydell initiator NUMA node that has best performance (the lowest latency or 320e2fcbf42SPeter Maydell largest bandwidth) to this NUMA node. Note that this option can be 321e2fcbf42SPeter Maydell set only when the machine property 'hmat' is set to 'on'. 322e2fcbf42SPeter Maydell 323e2fcbf42SPeter Maydell Following example creates a machine with 2 NUMA nodes, node 0 has 324e2fcbf42SPeter Maydell CPU. node 1 has only memory, and its initiator is node 0. Note that 325e2fcbf42SPeter Maydell because node 0 has CPU, by default the initiator of node 0 is itself 326e2fcbf42SPeter Maydell and must be itself. 327e2fcbf42SPeter Maydell 328e2fcbf42SPeter Maydell :: 329e2fcbf42SPeter Maydell 330e2fcbf42SPeter Maydell -machine hmat=on \ 331e2fcbf42SPeter Maydell -m 2G,slots=2,maxmem=4G \ 332e2fcbf42SPeter Maydell -object memory-backend-ram,size=1G,id=m0 \ 333e2fcbf42SPeter Maydell -object memory-backend-ram,size=1G,id=m1 \ 334e2fcbf42SPeter Maydell -numa node,nodeid=0,memdev=m0 \ 335e2fcbf42SPeter Maydell -numa node,nodeid=1,memdev=m1,initiator=0 \ 336e2fcbf42SPeter Maydell -smp 2,sockets=2,maxcpus=2 \ 337e2fcbf42SPeter Maydell -numa cpu,node-id=0,socket-id=0 \ 338e2fcbf42SPeter Maydell -numa cpu,node-id=0,socket-id=1 339e2fcbf42SPeter Maydell 340e2fcbf42SPeter Maydell source and destination are NUMA node IDs. distance is the NUMA 341e2fcbf42SPeter Maydell distance from source to destination. The distance from a node to 342e2fcbf42SPeter Maydell itself is always 10. If any pair of nodes is given a distance, then 343e2fcbf42SPeter Maydell all pairs must be given distances. Although, when distances are only 344e2fcbf42SPeter Maydell given in one direction for each pair of nodes, then the distances in 345e2fcbf42SPeter Maydell the opposite directions are assumed to be the same. If, however, an 346e2fcbf42SPeter Maydell asymmetrical pair of distances is given for even one node pair, then 347e2fcbf42SPeter Maydell all node pairs must be provided distance values for both directions, 348e2fcbf42SPeter Maydell even when they are symmetrical. When a node is unreachable from 349e2fcbf42SPeter Maydell another node, set the pair's distance to 255. 350e2fcbf42SPeter Maydell 351e2fcbf42SPeter Maydell Note that the -``numa`` option doesn't allocate any of the specified 352e2fcbf42SPeter Maydell resources, it just assigns existing resources to NUMA nodes. This 353e2fcbf42SPeter Maydell means that one still has to use the ``-m``, ``-smp`` options to 354e2fcbf42SPeter Maydell allocate RAM and VCPUs respectively. 355e2fcbf42SPeter Maydell 356e2fcbf42SPeter Maydell Use '\ ``hmat-lb``\ ' to set System Locality Latency and Bandwidth 357e2fcbf42SPeter Maydell Information between initiator and target NUMA nodes in ACPI 358e2fcbf42SPeter Maydell Heterogeneous Attribute Memory Table (HMAT). Initiator NUMA node can 359e2fcbf42SPeter Maydell create memory requests, usually it has one or more processors. 360e2fcbf42SPeter Maydell Target NUMA node contains addressable memory. 361e2fcbf42SPeter Maydell 362e2fcbf42SPeter Maydell In '\ ``hmat-lb``\ ' option, node are NUMA node IDs. hierarchy is 363e2fcbf42SPeter Maydell the memory hierarchy of the target NUMA node: if hierarchy is 364e2fcbf42SPeter Maydell 'memory', the structure represents the memory performance; if 365e2fcbf42SPeter Maydell hierarchy is 'first-level\|second-level\|third-level', this 366e2fcbf42SPeter Maydell structure represents aggregated performance of memory side caches 367e2fcbf42SPeter Maydell for each domain. type of 'data-type' is type of data represented by 368e2fcbf42SPeter Maydell this structure instance: if 'hierarchy' is 'memory', 'data-type' is 369e2fcbf42SPeter Maydell 'access\|read\|write' latency or 'access\|read\|write' bandwidth of 370e2fcbf42SPeter Maydell the target memory; if 'hierarchy' is 371e2fcbf42SPeter Maydell 'first-level\|second-level\|third-level', 'data-type' is 372e2fcbf42SPeter Maydell 'access\|read\|write' hit latency or 'access\|read\|write' hit 373e2fcbf42SPeter Maydell bandwidth of the target memory side cache. 374e2fcbf42SPeter Maydell 375e2fcbf42SPeter Maydell lat is latency value in nanoseconds. bw is bandwidth value, the 376e2fcbf42SPeter Maydell possible value and units are NUM[M\|G\|T], mean that the bandwidth 377e2fcbf42SPeter Maydell value are NUM byte per second (or MB/s, GB/s or TB/s depending on 378e2fcbf42SPeter Maydell used suffix). Note that if latency or bandwidth value is 0, means 379e2fcbf42SPeter Maydell the corresponding latency or bandwidth information is not provided. 380e2fcbf42SPeter Maydell 381e2fcbf42SPeter Maydell In '\ ``hmat-cache``\ ' option, node-id is the NUMA-id of the memory 382e2fcbf42SPeter Maydell belongs. size is the size of memory side cache in bytes. level is 383e2fcbf42SPeter Maydell the cache level described in this structure, note that the cache 384e2fcbf42SPeter Maydell level 0 should not be used with '\ ``hmat-cache``\ ' option. 385e2fcbf42SPeter Maydell associativity is the cache associativity, the possible value is 386e2fcbf42SPeter Maydell 'none/direct(direct-mapped)/complex(complex cache indexing)'. policy 387e2fcbf42SPeter Maydell is the write policy. line is the cache Line size in bytes. 388e2fcbf42SPeter Maydell 389e2fcbf42SPeter Maydell For example, the following options describe 2 NUMA nodes. Node 0 has 390e2fcbf42SPeter Maydell 2 cpus and a ram, node 1 has only a ram. The processors in node 0 391e2fcbf42SPeter Maydell access memory in node 0 with access-latency 5 nanoseconds, 392e2fcbf42SPeter Maydell access-bandwidth is 200 MB/s; The processors in NUMA node 0 access 393e2fcbf42SPeter Maydell memory in NUMA node 1 with access-latency 10 nanoseconds, 394e2fcbf42SPeter Maydell access-bandwidth is 100 MB/s. And for memory side cache information, 395e2fcbf42SPeter Maydell NUMA node 0 and 1 both have 1 level memory cache, size is 10KB, 396e2fcbf42SPeter Maydell policy is write-back, the cache Line size is 8 bytes: 397e2fcbf42SPeter Maydell 398e2fcbf42SPeter Maydell :: 399e2fcbf42SPeter Maydell 400e2fcbf42SPeter Maydell -machine hmat=on \ 401e2fcbf42SPeter Maydell -m 2G \ 402e2fcbf42SPeter Maydell -object memory-backend-ram,size=1G,id=m0 \ 403e2fcbf42SPeter Maydell -object memory-backend-ram,size=1G,id=m1 \ 404848dd269SYanan Wang -smp 2,sockets=2,maxcpus=2 \ 405e2fcbf42SPeter Maydell -numa node,nodeid=0,memdev=m0 \ 406e2fcbf42SPeter Maydell -numa node,nodeid=1,memdev=m1,initiator=0 \ 407e2fcbf42SPeter Maydell -numa cpu,node-id=0,socket-id=0 \ 408e2fcbf42SPeter Maydell -numa cpu,node-id=0,socket-id=1 \ 409e2fcbf42SPeter Maydell -numa hmat-lb,initiator=0,target=0,hierarchy=memory,data-type=access-latency,latency=5 \ 410e2fcbf42SPeter Maydell -numa hmat-lb,initiator=0,target=0,hierarchy=memory,data-type=access-bandwidth,bandwidth=200M \ 411e2fcbf42SPeter Maydell -numa hmat-lb,initiator=0,target=1,hierarchy=memory,data-type=access-latency,latency=10 \ 412e2fcbf42SPeter Maydell -numa hmat-lb,initiator=0,target=1,hierarchy=memory,data-type=access-bandwidth,bandwidth=100M \ 413e2fcbf42SPeter Maydell -numa hmat-cache,node-id=0,size=10K,level=1,associativity=direct,policy=write-back,line=8 \ 414e2fcbf42SPeter Maydell -numa hmat-cache,node-id=1,size=10K,level=1,associativity=direct,policy=write-back,line=8 415e2fcbf42SPeter MaydellERST 416268a362cSaliguori 41710adb8beSMarkus ArmbrusterDEF("add-fd", HAS_ARG, QEMU_OPTION_add_fd, 41810adb8beSMarkus Armbruster "-add-fd fd=fd,set=set[,opaque=opaque]\n" 41910adb8beSMarkus Armbruster " Add 'fd' to fd 'set'\n", QEMU_ARCH_ALL) 420e2fcbf42SPeter MaydellSRST 421e2fcbf42SPeter Maydell``-add-fd fd=fd,set=set[,opaque=opaque]`` 422e2fcbf42SPeter Maydell Add a file descriptor to an fd set. Valid options are: 423e2fcbf42SPeter Maydell 424e2fcbf42SPeter Maydell ``fd=fd`` 425e2fcbf42SPeter Maydell This option defines the file descriptor of which a duplicate is 426e2fcbf42SPeter Maydell added to fd set. The file descriptor cannot be stdin, stdout, or 427e2fcbf42SPeter Maydell stderr. 428e2fcbf42SPeter Maydell 429e2fcbf42SPeter Maydell ``set=set`` 430e2fcbf42SPeter Maydell This option defines the ID of the fd set to add the file 431e2fcbf42SPeter Maydell descriptor to. 432e2fcbf42SPeter Maydell 433e2fcbf42SPeter Maydell ``opaque=opaque`` 434e2fcbf42SPeter Maydell This option defines a free-form string that can be used to 435e2fcbf42SPeter Maydell describe fd. 436e2fcbf42SPeter Maydell 437e2fcbf42SPeter Maydell You can open an image using pre-opened file descriptors from an fd 438e2fcbf42SPeter Maydell set: 439e2fcbf42SPeter Maydell 440e2fcbf42SPeter Maydell .. parsed-literal:: 441e2fcbf42SPeter Maydell 442353a06b4SLaszlo Ersek |qemu_system| \\ 443353a06b4SLaszlo Ersek -add-fd fd=3,set=2,opaque="rdwr:/path/to/file" \\ 444353a06b4SLaszlo Ersek -add-fd fd=4,set=2,opaque="rdonly:/path/to/file" \\ 445e2fcbf42SPeter Maydell -drive file=/dev/fdset/2,index=0,media=disk 446e2fcbf42SPeter MaydellERST 44710adb8beSMarkus Armbruster 44810adb8beSMarkus ArmbrusterDEF("set", HAS_ARG, QEMU_OPTION_set, 44910adb8beSMarkus Armbruster "-set group.id.arg=value\n" 45010adb8beSMarkus Armbruster " set <arg> parameter for item <id> of type <group>\n" 45110adb8beSMarkus Armbruster " i.e. -set drive.$id.file=/path/to/image\n", QEMU_ARCH_ALL) 452e2fcbf42SPeter MaydellSRST 453e2fcbf42SPeter Maydell``-set group.id.arg=value`` 454e2fcbf42SPeter Maydell Set parameter arg for item id of type group 455e2fcbf42SPeter MaydellERST 45610adb8beSMarkus Armbruster 45710adb8beSMarkus ArmbrusterDEF("global", HAS_ARG, QEMU_OPTION_global, 4583751d7c4SPaolo Bonzini "-global driver.property=value\n" 4593751d7c4SPaolo Bonzini "-global driver=driver,property=property,value=value\n" 46010adb8beSMarkus Armbruster " set a global default for a driver property\n", 46110adb8beSMarkus Armbruster QEMU_ARCH_ALL) 462e2fcbf42SPeter MaydellSRST 46309ce5f2dSPeter Maydell``-global driver.prop=value`` 46409ce5f2dSPeter Maydell \ 46509ce5f2dSPeter Maydell``-global driver=driver,property=property,value=value`` 466e2fcbf42SPeter Maydell Set default value of driver's property prop to value, e.g.: 467e2fcbf42SPeter Maydell 468e2fcbf42SPeter Maydell .. parsed-literal:: 469e2fcbf42SPeter Maydell 470e2fcbf42SPeter Maydell |qemu_system_x86| -global ide-hd.physical_block_size=4096 disk-image.img 471e2fcbf42SPeter Maydell 472e2fcbf42SPeter Maydell In particular, you can use this to set driver properties for devices 473e2fcbf42SPeter Maydell which are created automatically by the machine model. To create a 474e2fcbf42SPeter Maydell device which is not created automatically and set properties on it, 475e2fcbf42SPeter Maydell use -``device``. 476e2fcbf42SPeter Maydell 477e2fcbf42SPeter Maydell -global driver.prop=value is shorthand for -global 478e2fcbf42SPeter Maydell driver=driver,property=prop,value=value. The longhand syntax works 479e2fcbf42SPeter Maydell even when driver contains a dot. 480e2fcbf42SPeter MaydellERST 48110adb8beSMarkus Armbruster 48210adb8beSMarkus ArmbrusterDEF("boot", HAS_ARG, QEMU_OPTION_boot, 48310adb8beSMarkus Armbruster "-boot [order=drives][,once=drives][,menu=on|off]\n" 484c8a6ae8bSAmos Kong " [,splash=sp_name][,splash-time=sp_time][,reboot-timeout=rb_time][,strict=on|off]\n" 48510adb8beSMarkus Armbruster " 'drives': floppy (a), hard disk (c), CD-ROM (d), network (n)\n" 48610adb8beSMarkus Armbruster " 'sp_name': the file's name that would be passed to bios as logo picture, if menu=on\n" 48710adb8beSMarkus Armbruster " 'sp_time': the period that splash picture last if menu=on, unit is ms\n" 48810adb8beSMarkus Armbruster " 'rb_timeout': the timeout before guest reboot when boot failed, unit is ms\n", 48910adb8beSMarkus Armbruster QEMU_ARCH_ALL) 490e2fcbf42SPeter MaydellSRST 491e2fcbf42SPeter Maydell``-boot [order=drives][,once=drives][,menu=on|off][,splash=sp_name][,splash-time=sp_time][,reboot-timeout=rb_timeout][,strict=on|off]`` 492e2fcbf42SPeter Maydell Specify boot order drives as a string of drive letters. Valid drive 493e2fcbf42SPeter Maydell letters depend on the target architecture. The x86 PC uses: a, b 494e2fcbf42SPeter Maydell (floppy 1 and 2), c (first hard disk), d (first CD-ROM), n-p 495e2fcbf42SPeter Maydell (Etherboot from network adapter 1-4), hard disk boot is the default. 496e2fcbf42SPeter Maydell To apply a particular boot order only on the first startup, specify 497e2fcbf42SPeter Maydell it via ``once``. Note that the ``order`` or ``once`` parameter 498e2fcbf42SPeter Maydell should not be used together with the ``bootindex`` property of 499e2fcbf42SPeter Maydell devices, since the firmware implementations normally do not support 500e2fcbf42SPeter Maydell both at the same time. 501e2fcbf42SPeter Maydell 502e2fcbf42SPeter Maydell Interactive boot menus/prompts can be enabled via ``menu=on`` as far 503e2fcbf42SPeter Maydell as firmware/BIOS supports them. The default is non-interactive boot. 504e2fcbf42SPeter Maydell 505e2fcbf42SPeter Maydell A splash picture could be passed to bios, enabling user to show it 506e2fcbf42SPeter Maydell as logo, when option splash=sp\_name is given and menu=on, If 507e2fcbf42SPeter Maydell firmware/BIOS supports them. Currently Seabios for X86 system 508e2fcbf42SPeter Maydell support it. limitation: The splash file could be a jpeg file or a 509e2fcbf42SPeter Maydell BMP file in 24 BPP format(true color). The resolution should be 510e2fcbf42SPeter Maydell supported by the SVGA mode, so the recommended is 320x240, 640x480, 511e2fcbf42SPeter Maydell 800x640. 512e2fcbf42SPeter Maydell 513e2fcbf42SPeter Maydell A timeout could be passed to bios, guest will pause for rb\_timeout 514e2fcbf42SPeter Maydell ms when boot failed, then reboot. If rb\_timeout is '-1', guest will 515e2fcbf42SPeter Maydell not reboot, qemu passes '-1' to bios by default. Currently Seabios 516e2fcbf42SPeter Maydell for X86 system support it. 517e2fcbf42SPeter Maydell 518e2fcbf42SPeter Maydell Do strict boot via ``strict=on`` as far as firmware/BIOS supports 519e2fcbf42SPeter Maydell it. This only effects when boot priority is changed by bootindex 520e2fcbf42SPeter Maydell options. The default is non-strict boot. 521e2fcbf42SPeter Maydell 52209ce5f2dSPeter Maydell .. parsed-literal:: 523e2fcbf42SPeter Maydell 524e2fcbf42SPeter Maydell # try to boot from network first, then from hard disk 525e2fcbf42SPeter Maydell |qemu_system_x86| -boot order=nc 526e2fcbf42SPeter Maydell # boot from CD-ROM first, switch back to default order after reboot 527e2fcbf42SPeter Maydell |qemu_system_x86| -boot once=d 528e2fcbf42SPeter Maydell # boot with a splash picture for 5 seconds. 529e2fcbf42SPeter Maydell |qemu_system_x86| -boot menu=on,splash=/root/boot.bmp,splash-time=5000 530e2fcbf42SPeter Maydell 531e2fcbf42SPeter Maydell Note: The legacy format '-boot drives' is still supported but its 532e2fcbf42SPeter Maydell use is discouraged as it may be removed from future versions. 533e2fcbf42SPeter MaydellERST 53410adb8beSMarkus Armbruster 53510adb8beSMarkus ArmbrusterDEF("m", HAS_ARG, QEMU_OPTION_m, 53689f3ea2bSMichael Tokarev "-m [size=]megs[,slots=n,maxmem=size]\n" 5376e1d3c1cSIgor Mammedov " configure guest RAM\n" 5380daba1f0SAlexander Graf " size: initial amount of guest memory\n" 539c270fb9eSIgor Mammedov " slots: number of hotplug slots (default: none)\n" 540b6fe0124SMatthew Rosato " maxmem: maximum amount of guest memory (default: none)\n" 541b6fe0124SMatthew Rosato "NOTE: Some architectures might enforce a specific granularity\n", 5426e1d3c1cSIgor Mammedov QEMU_ARCH_ALL) 543e2fcbf42SPeter MaydellSRST 544e2fcbf42SPeter Maydell``-m [size=]megs[,slots=n,maxmem=size]`` 545e2fcbf42SPeter Maydell Sets guest startup RAM size to megs megabytes. Default is 128 MiB. 546e2fcbf42SPeter Maydell Optionally, a suffix of "M" or "G" can be used to signify a value in 547e2fcbf42SPeter Maydell megabytes or gigabytes respectively. Optional pair slots, maxmem 548e2fcbf42SPeter Maydell could be used to set amount of hotpluggable memory slots and maximum 549e2fcbf42SPeter Maydell amount of memory. Note that maxmem must be aligned to the page size. 550e2fcbf42SPeter Maydell 551e2fcbf42SPeter Maydell For example, the following command-line sets the guest startup RAM 552e2fcbf42SPeter Maydell size to 1GB, creates 3 slots to hotplug additional memory and sets 553e2fcbf42SPeter Maydell the maximum memory the guest can reach to 4GB: 554e2fcbf42SPeter Maydell 555e2fcbf42SPeter Maydell .. parsed-literal:: 556e2fcbf42SPeter Maydell 557e2fcbf42SPeter Maydell |qemu_system| -m 1G,slots=3,maxmem=4G 558e2fcbf42SPeter Maydell 559e2fcbf42SPeter Maydell If slots and maxmem are not specified, memory hotplug won't be 560e2fcbf42SPeter Maydell enabled and the guest startup RAM will never increase. 561e2fcbf42SPeter MaydellERST 56210adb8beSMarkus Armbruster 56310adb8beSMarkus ArmbrusterDEF("mem-path", HAS_ARG, QEMU_OPTION_mempath, 56410adb8beSMarkus Armbruster "-mem-path FILE provide backing storage for guest RAM\n", QEMU_ARCH_ALL) 565e2fcbf42SPeter MaydellSRST 566e2fcbf42SPeter Maydell``-mem-path path`` 567e2fcbf42SPeter Maydell Allocate guest RAM from a temporarily created file in path. 568e2fcbf42SPeter MaydellERST 56910adb8beSMarkus Armbruster 57010adb8beSMarkus ArmbrusterDEF("mem-prealloc", 0, QEMU_OPTION_mem_prealloc, 57110adb8beSMarkus Armbruster "-mem-prealloc preallocate guest memory (use with -mem-path)\n", 57210adb8beSMarkus Armbruster QEMU_ARCH_ALL) 573e2fcbf42SPeter MaydellSRST 574e2fcbf42SPeter Maydell``-mem-prealloc`` 575e2fcbf42SPeter Maydell Preallocate memory when using -mem-path. 576e2fcbf42SPeter MaydellERST 57710adb8beSMarkus Armbruster 57810adb8beSMarkus ArmbrusterDEF("k", HAS_ARG, QEMU_OPTION_k, 57910adb8beSMarkus Armbruster "-k language use keyboard layout (for example 'fr' for French)\n", 58010adb8beSMarkus Armbruster QEMU_ARCH_ALL) 581e2fcbf42SPeter MaydellSRST 582e2fcbf42SPeter Maydell``-k language`` 583e2fcbf42SPeter Maydell Use keyboard layout language (for example ``fr`` for French). This 584e2fcbf42SPeter Maydell option is only needed where it is not easy to get raw PC keycodes 585e2fcbf42SPeter Maydell (e.g. on Macs, with some X11 servers or with a VNC or curses 586e2fcbf42SPeter Maydell display). You don't normally need to use it on PC/Linux or 587e2fcbf42SPeter Maydell PC/Windows hosts. 588e2fcbf42SPeter Maydell 589e2fcbf42SPeter Maydell The available layouts are: 590e2fcbf42SPeter Maydell 591e2fcbf42SPeter Maydell :: 592e2fcbf42SPeter Maydell 593e2fcbf42SPeter Maydell ar de-ch es fo fr-ca hu ja mk no pt-br sv 594e2fcbf42SPeter Maydell da en-gb et fr fr-ch is lt nl pl ru th 595e2fcbf42SPeter Maydell de en-us fi fr-be hr it lv nl-be pt sl tr 596e2fcbf42SPeter Maydell 597e2fcbf42SPeter Maydell The default is ``en-us``. 598e2fcbf42SPeter MaydellERST 59910adb8beSMarkus Armbruster 60010adb8beSMarkus Armbruster 601f0b3d811SKővágó, ZoltánHXCOMM Deprecated by -audiodev 60210adb8beSMarkus ArmbrusterDEF("audio-help", 0, QEMU_OPTION_audio_help, 603f0b3d811SKővágó, Zoltán "-audio-help show -audiodev equivalent of the currently specified audio settings\n", 60410adb8beSMarkus Armbruster QEMU_ARCH_ALL) 605e2fcbf42SPeter MaydellSRST 606e2fcbf42SPeter Maydell``-audio-help`` 607e2fcbf42SPeter Maydell Will show the -audiodev equivalent of the currently specified 608e2fcbf42SPeter Maydell (deprecated) environment variables. 609e2fcbf42SPeter MaydellERST 610f0b3d811SKővágó, Zoltán 611f0b3d811SKővágó, ZoltánDEF("audiodev", HAS_ARG, QEMU_OPTION_audiodev, 612f0b3d811SKővágó, Zoltán "-audiodev [driver=]driver,id=id[,prop[=value][,...]]\n" 613f0b3d811SKővágó, Zoltán " specifies the audio backend to use\n" 614f0b3d811SKővágó, Zoltán " id= identifier of the backend\n" 615f0b3d811SKővágó, Zoltán " timer-period= timer period in microseconds\n" 6168efac073SKővágó, Zoltán " in|out.mixing-engine= use mixing engine to mix streams inside QEMU\n" 617f0b3d811SKővágó, Zoltán " in|out.fixed-settings= use fixed settings for host audio\n" 618f0b3d811SKővágó, Zoltán " in|out.frequency= frequency to use with fixed settings\n" 619f0b3d811SKővágó, Zoltán " in|out.channels= number of channels to use with fixed settings\n" 620f0b3d811SKővágó, Zoltán " in|out.format= sample format to use with fixed settings\n" 62149f77e6fSVolker Rümelin " valid values: s8, s16, s32, u8, u16, u32, f32\n" 622f0b3d811SKővágó, Zoltán " in|out.voices= number of voices to use\n" 6238624725bSStefan Hajnoczi " in|out.buffer-length= length of buffer in microseconds\n" 624f0b3d811SKővágó, Zoltán "-audiodev none,id=id,[,prop[=value][,...]]\n" 625f0b3d811SKővágó, Zoltán " dummy driver that discards all output\n" 626f0b3d811SKővágó, Zoltán#ifdef CONFIG_AUDIO_ALSA 627f0b3d811SKővágó, Zoltán "-audiodev alsa,id=id[,prop[=value][,...]]\n" 628f0b3d811SKővágó, Zoltán " in|out.dev= name of the audio device to use\n" 629dfc54343SStefan Hajnoczi " in|out.period-length= length of period in microseconds\n" 630f0b3d811SKővágó, Zoltán " in|out.try-poll= attempt to use poll mode\n" 631f0b3d811SKővágó, Zoltán " threshold= threshold (in microseconds) when playback starts\n" 632f0b3d811SKővágó, Zoltán#endif 633f0b3d811SKővágó, Zoltán#ifdef CONFIG_AUDIO_COREAUDIO 634f0b3d811SKővágó, Zoltán "-audiodev coreaudio,id=id[,prop[=value][,...]]\n" 635f0b3d811SKővágó, Zoltán " in|out.buffer-count= number of buffers\n" 636f0b3d811SKővágó, Zoltán#endif 637f0b3d811SKővágó, Zoltán#ifdef CONFIG_AUDIO_DSOUND 638f0b3d811SKővágó, Zoltán "-audiodev dsound,id=id[,prop[=value][,...]]\n" 639f0b3d811SKővágó, Zoltán " latency= add extra latency to playback in microseconds\n" 640f0b3d811SKővágó, Zoltán#endif 641f0b3d811SKővágó, Zoltán#ifdef CONFIG_AUDIO_OSS 642f0b3d811SKővágó, Zoltán "-audiodev oss,id=id[,prop[=value][,...]]\n" 643f0b3d811SKővágó, Zoltán " in|out.dev= path of the audio device to use\n" 644f0b3d811SKővágó, Zoltán " in|out.buffer-count= number of buffers\n" 645f0b3d811SKővágó, Zoltán " in|out.try-poll= attempt to use poll mode\n" 646f0b3d811SKővágó, Zoltán " try-mmap= try using memory mapped access\n" 647f0b3d811SKővágó, Zoltán " exclusive= open device in exclusive mode\n" 648f0b3d811SKővágó, Zoltán " dsp-policy= set timing policy (0..10), -1 to use fragment mode\n" 649f0b3d811SKővágó, Zoltán#endif 650f0b3d811SKővágó, Zoltán#ifdef CONFIG_AUDIO_PA 651f0b3d811SKővágó, Zoltán "-audiodev pa,id=id[,prop[=value][,...]]\n" 652f0b3d811SKővágó, Zoltán " server= PulseAudio server address\n" 653f0b3d811SKővágó, Zoltán " in|out.name= source/sink device name\n" 65414d4f011SStefan Hajnoczi " in|out.latency= desired latency in microseconds\n" 655f0b3d811SKővágó, Zoltán#endif 656f0b3d811SKővágó, Zoltán#ifdef CONFIG_AUDIO_SDL 657f0b3d811SKővágó, Zoltán "-audiodev sdl,id=id[,prop[=value][,...]]\n" 6585a0926c2SVolker Rümelin " in|out.buffer-count= number of buffers\n" 659f0b3d811SKővágó, Zoltán#endif 660f0b3d811SKővágó, Zoltán#ifdef CONFIG_SPICE 661f0b3d811SKővágó, Zoltán "-audiodev spice,id=id[,prop[=value][,...]]\n" 662f0b3d811SKővágó, Zoltán#endif 663f0b3d811SKővágó, Zoltán "-audiodev wav,id=id[,prop[=value][,...]]\n" 664f0b3d811SKővágó, Zoltán " path= path of wav file to record\n", 665f0b3d811SKővágó, Zoltán QEMU_ARCH_ALL) 666e2fcbf42SPeter MaydellSRST 667e2fcbf42SPeter Maydell``-audiodev [driver=]driver,id=id[,prop[=value][,...]]`` 668e2fcbf42SPeter Maydell Adds a new audio backend driver identified by id. There are global 669e2fcbf42SPeter Maydell and driver specific properties. Some values can be set differently 670e2fcbf42SPeter Maydell for input and output, they're marked with ``in|out.``. You can set 671e2fcbf42SPeter Maydell the input's property with ``in.prop`` and the output's property with 672e2fcbf42SPeter Maydell ``out.prop``. For example: 673e2fcbf42SPeter Maydell 674e2fcbf42SPeter Maydell :: 675e2fcbf42SPeter Maydell 676e2fcbf42SPeter Maydell -audiodev alsa,id=example,in.frequency=44110,out.frequency=8000 677e2fcbf42SPeter Maydell -audiodev alsa,id=example,out.channels=1 # leaves in.channels unspecified 678e2fcbf42SPeter Maydell 679e2fcbf42SPeter Maydell NOTE: parameter validation is known to be incomplete, in many cases 680e2fcbf42SPeter Maydell specifying an invalid option causes QEMU to print an error message 681e2fcbf42SPeter Maydell and continue emulation without sound. 682e2fcbf42SPeter Maydell 683e2fcbf42SPeter Maydell Valid global options are: 684e2fcbf42SPeter Maydell 685e2fcbf42SPeter Maydell ``id=identifier`` 686e2fcbf42SPeter Maydell Identifies the audio backend. 687e2fcbf42SPeter Maydell 688e2fcbf42SPeter Maydell ``timer-period=period`` 689e2fcbf42SPeter Maydell Sets the timer period used by the audio subsystem in 690e2fcbf42SPeter Maydell microseconds. Default is 10000 (10 ms). 691e2fcbf42SPeter Maydell 692e2fcbf42SPeter Maydell ``in|out.mixing-engine=on|off`` 693e2fcbf42SPeter Maydell Use QEMU's mixing engine to mix all streams inside QEMU and 694e2fcbf42SPeter Maydell convert audio formats when not supported by the backend. When 695e2fcbf42SPeter Maydell off, fixed-settings must be off too. Note that disabling this 696e2fcbf42SPeter Maydell option means that the selected backend must support multiple 697e2fcbf42SPeter Maydell streams and the audio formats used by the virtual cards, 698e2fcbf42SPeter Maydell otherwise you'll get no sound. It's not recommended to disable 699e2fcbf42SPeter Maydell this option unless you want to use 5.1 or 7.1 audio, as mixing 700e2fcbf42SPeter Maydell engine only supports mono and stereo audio. Default is on. 701e2fcbf42SPeter Maydell 702e2fcbf42SPeter Maydell ``in|out.fixed-settings=on|off`` 703e2fcbf42SPeter Maydell Use fixed settings for host audio. When off, it will change 704e2fcbf42SPeter Maydell based on how the guest opens the sound card. In this case you 705e2fcbf42SPeter Maydell must not specify frequency, channels or format. Default is on. 706e2fcbf42SPeter Maydell 707e2fcbf42SPeter Maydell ``in|out.frequency=frequency`` 708e2fcbf42SPeter Maydell Specify the frequency to use when using fixed-settings. Default 709e2fcbf42SPeter Maydell is 44100Hz. 710e2fcbf42SPeter Maydell 711e2fcbf42SPeter Maydell ``in|out.channels=channels`` 712e2fcbf42SPeter Maydell Specify the number of channels to use when using fixed-settings. 713e2fcbf42SPeter Maydell Default is 2 (stereo). 714e2fcbf42SPeter Maydell 715e2fcbf42SPeter Maydell ``in|out.format=format`` 716e2fcbf42SPeter Maydell Specify the sample format to use when using fixed-settings. 717e2fcbf42SPeter Maydell Valid values are: ``s8``, ``s16``, ``s32``, ``u8``, ``u16``, 71849f77e6fSVolker Rümelin ``u32``, ``f32``. Default is ``s16``. 719e2fcbf42SPeter Maydell 720e2fcbf42SPeter Maydell ``in|out.voices=voices`` 721e2fcbf42SPeter Maydell Specify the number of voices to use. Default is 1. 722e2fcbf42SPeter Maydell 723e2fcbf42SPeter Maydell ``in|out.buffer-length=usecs`` 724e2fcbf42SPeter Maydell Sets the size of the buffer in microseconds. 725e2fcbf42SPeter Maydell 726e2fcbf42SPeter Maydell``-audiodev none,id=id[,prop[=value][,...]]`` 727e2fcbf42SPeter Maydell Creates a dummy backend that discards all outputs. This backend has 728e2fcbf42SPeter Maydell no backend specific properties. 729e2fcbf42SPeter Maydell 730e2fcbf42SPeter Maydell``-audiodev alsa,id=id[,prop[=value][,...]]`` 731e2fcbf42SPeter Maydell Creates backend using the ALSA. This backend is only available on 732e2fcbf42SPeter Maydell Linux. 733e2fcbf42SPeter Maydell 734e2fcbf42SPeter Maydell ALSA specific options are: 735e2fcbf42SPeter Maydell 736e2fcbf42SPeter Maydell ``in|out.dev=device`` 737e2fcbf42SPeter Maydell Specify the ALSA device to use for input and/or output. Default 738e2fcbf42SPeter Maydell is ``default``. 739e2fcbf42SPeter Maydell 740e2fcbf42SPeter Maydell ``in|out.period-length=usecs`` 741e2fcbf42SPeter Maydell Sets the period length in microseconds. 742e2fcbf42SPeter Maydell 743e2fcbf42SPeter Maydell ``in|out.try-poll=on|off`` 744e2fcbf42SPeter Maydell Attempt to use poll mode with the device. Default is on. 745e2fcbf42SPeter Maydell 746e2fcbf42SPeter Maydell ``threshold=threshold`` 747e2fcbf42SPeter Maydell Threshold (in microseconds) when playback starts. Default is 0. 748e2fcbf42SPeter Maydell 749e2fcbf42SPeter Maydell``-audiodev coreaudio,id=id[,prop[=value][,...]]`` 750e2fcbf42SPeter Maydell Creates a backend using Apple's Core Audio. This backend is only 751e2fcbf42SPeter Maydell available on Mac OS and only supports playback. 752e2fcbf42SPeter Maydell 753e2fcbf42SPeter Maydell Core Audio specific options are: 754e2fcbf42SPeter Maydell 755e2fcbf42SPeter Maydell ``in|out.buffer-count=count`` 756e2fcbf42SPeter Maydell Sets the count of the buffers. 757e2fcbf42SPeter Maydell 758e2fcbf42SPeter Maydell``-audiodev dsound,id=id[,prop[=value][,...]]`` 759e2fcbf42SPeter Maydell Creates a backend using Microsoft's DirectSound. This backend is 760e2fcbf42SPeter Maydell only available on Windows and only supports playback. 761e2fcbf42SPeter Maydell 762e2fcbf42SPeter Maydell DirectSound specific options are: 763e2fcbf42SPeter Maydell 764e2fcbf42SPeter Maydell ``latency=usecs`` 765e2fcbf42SPeter Maydell Add extra usecs microseconds latency to playback. Default is 766e2fcbf42SPeter Maydell 10000 (10 ms). 767e2fcbf42SPeter Maydell 768e2fcbf42SPeter Maydell``-audiodev oss,id=id[,prop[=value][,...]]`` 769e2fcbf42SPeter Maydell Creates a backend using OSS. This backend is available on most 770e2fcbf42SPeter Maydell Unix-like systems. 771e2fcbf42SPeter Maydell 772e2fcbf42SPeter Maydell OSS specific options are: 773e2fcbf42SPeter Maydell 774e2fcbf42SPeter Maydell ``in|out.dev=device`` 775e2fcbf42SPeter Maydell Specify the file name of the OSS device to use. Default is 776e2fcbf42SPeter Maydell ``/dev/dsp``. 777e2fcbf42SPeter Maydell 778e2fcbf42SPeter Maydell ``in|out.buffer-count=count`` 779e2fcbf42SPeter Maydell Sets the count of the buffers. 780e2fcbf42SPeter Maydell 781e2fcbf42SPeter Maydell ``in|out.try-poll=on|of`` 782e2fcbf42SPeter Maydell Attempt to use poll mode with the device. Default is on. 783e2fcbf42SPeter Maydell 784e2fcbf42SPeter Maydell ``try-mmap=on|off`` 785e2fcbf42SPeter Maydell Try using memory mapped device access. Default is off. 786e2fcbf42SPeter Maydell 787e2fcbf42SPeter Maydell ``exclusive=on|off`` 788e2fcbf42SPeter Maydell Open the device in exclusive mode (vmix won't work in this 789e2fcbf42SPeter Maydell case). Default is off. 790e2fcbf42SPeter Maydell 791e2fcbf42SPeter Maydell ``dsp-policy=policy`` 792e2fcbf42SPeter Maydell Sets the timing policy (between 0 and 10, where smaller number 793e2fcbf42SPeter Maydell means smaller latency but higher CPU usage). Use -1 to use 794e2fcbf42SPeter Maydell buffer sizes specified by ``buffer`` and ``buffer-count``. This 795e2fcbf42SPeter Maydell option is ignored if you do not have OSS 4. Default is 5. 796e2fcbf42SPeter Maydell 797e2fcbf42SPeter Maydell``-audiodev pa,id=id[,prop[=value][,...]]`` 798e2fcbf42SPeter Maydell Creates a backend using PulseAudio. This backend is available on 799e2fcbf42SPeter Maydell most systems. 800e2fcbf42SPeter Maydell 801e2fcbf42SPeter Maydell PulseAudio specific options are: 802e2fcbf42SPeter Maydell 803e2fcbf42SPeter Maydell ``server=server`` 804e2fcbf42SPeter Maydell Sets the PulseAudio server to connect to. 805e2fcbf42SPeter Maydell 806e2fcbf42SPeter Maydell ``in|out.name=sink`` 807e2fcbf42SPeter Maydell Use the specified source/sink for recording/playback. 808e2fcbf42SPeter Maydell 809e2fcbf42SPeter Maydell ``in|out.latency=usecs`` 810e2fcbf42SPeter Maydell Desired latency in microseconds. The PulseAudio server will try 811e2fcbf42SPeter Maydell to honor this value but actual latencies may be lower or higher. 812e2fcbf42SPeter Maydell 813e2fcbf42SPeter Maydell``-audiodev sdl,id=id[,prop[=value][,...]]`` 814e2fcbf42SPeter Maydell Creates a backend using SDL. This backend is available on most 815e2fcbf42SPeter Maydell systems, but you should use your platform's native backend if 8165a0926c2SVolker Rümelin possible. 8175a0926c2SVolker Rümelin 8185a0926c2SVolker Rümelin SDL specific options are: 8195a0926c2SVolker Rümelin 8205a0926c2SVolker Rümelin ``in|out.buffer-count=count`` 8215a0926c2SVolker Rümelin Sets the count of the buffers. 822e2fcbf42SPeter Maydell 823e2fcbf42SPeter Maydell``-audiodev spice,id=id[,prop[=value][,...]]`` 824e2fcbf42SPeter Maydell Creates a backend that sends audio through SPICE. This backend 825e2fcbf42SPeter Maydell requires ``-spice`` and automatically selected in that case, so 826e2fcbf42SPeter Maydell usually you can ignore this option. This backend has no backend 827e2fcbf42SPeter Maydell specific properties. 828e2fcbf42SPeter Maydell 829e2fcbf42SPeter Maydell``-audiodev wav,id=id[,prop[=value][,...]]`` 830e2fcbf42SPeter Maydell Creates a backend that writes audio to a WAV file. 831e2fcbf42SPeter Maydell 832e2fcbf42SPeter Maydell Backend specific options are: 833e2fcbf42SPeter Maydell 834e2fcbf42SPeter Maydell ``path=path`` 835e2fcbf42SPeter Maydell Write recorded audio into the specified file. Default is 836e2fcbf42SPeter Maydell ``qemu.wav``. 837e2fcbf42SPeter MaydellERST 83810adb8beSMarkus Armbruster 83910adb8beSMarkus ArmbrusterDEF("soundhw", HAS_ARG, QEMU_OPTION_soundhw, 84010adb8beSMarkus Armbruster "-soundhw c1,... enable audio support\n" 84110adb8beSMarkus Armbruster " and only specified sound cards (comma separated list)\n" 84210adb8beSMarkus Armbruster " use '-soundhw help' to get the list of supported cards\n" 84310adb8beSMarkus Armbruster " use '-soundhw all' to enable all of them\n", QEMU_ARCH_ALL) 844e2fcbf42SPeter MaydellSRST 845e2fcbf42SPeter Maydell``-soundhw card1[,card2,...] or -soundhw all`` 846e2fcbf42SPeter Maydell Enable audio and selected sound hardware. Use 'help' to print all 847e2fcbf42SPeter Maydell available sound hardware. For example: 848e2fcbf42SPeter Maydell 849e2fcbf42SPeter Maydell .. parsed-literal:: 850e2fcbf42SPeter Maydell 851e2fcbf42SPeter Maydell |qemu_system_x86| -soundhw sb16,adlib disk.img 852e2fcbf42SPeter Maydell |qemu_system_x86| -soundhw es1370 disk.img 853e2fcbf42SPeter Maydell |qemu_system_x86| -soundhw ac97 disk.img 854e2fcbf42SPeter Maydell |qemu_system_x86| -soundhw hda disk.img 855e2fcbf42SPeter Maydell |qemu_system_x86| -soundhw all disk.img 856e2fcbf42SPeter Maydell |qemu_system_x86| -soundhw help 857e2fcbf42SPeter Maydell 858e2fcbf42SPeter Maydell Note that Linux's i810\_audio OSS kernel (for AC97) module might 859e2fcbf42SPeter Maydell require manually specifying clocking. 860e2fcbf42SPeter Maydell 861e2fcbf42SPeter Maydell :: 862e2fcbf42SPeter Maydell 863e2fcbf42SPeter Maydell modprobe i810_audio clocking=48000 864e2fcbf42SPeter MaydellERST 86510adb8beSMarkus Armbruster 86610adb8beSMarkus ArmbrusterDEF("device", HAS_ARG, QEMU_OPTION_device, 86710adb8beSMarkus Armbruster "-device driver[,prop[=value][,...]]\n" 86810adb8beSMarkus Armbruster " add device (based on driver)\n" 86910adb8beSMarkus Armbruster " prop=value,... sets driver properties\n" 87010adb8beSMarkus Armbruster " use '-device help' to print all possible drivers\n" 87110adb8beSMarkus Armbruster " use '-device driver,help' to print all possible properties\n", 87210adb8beSMarkus Armbruster QEMU_ARCH_ALL) 873e2fcbf42SPeter MaydellSRST 874e2fcbf42SPeter Maydell``-device driver[,prop[=value][,...]]`` 875e2fcbf42SPeter Maydell Add device driver. prop=value sets driver properties. Valid 876e2fcbf42SPeter Maydell properties depend on the driver. To get help on possible drivers and 877e2fcbf42SPeter Maydell properties, use ``-device help`` and ``-device driver,help``. 878e2fcbf42SPeter Maydell 879e2fcbf42SPeter Maydell Some drivers are: 880e2fcbf42SPeter Maydell 881789101b7SCorey Minyard``-device ipmi-bmc-sim,id=id[,prop[=value][,...]]`` 882e2fcbf42SPeter Maydell Add an IPMI BMC. This is a simulation of a hardware management 883e2fcbf42SPeter Maydell interface processor that normally sits on a system. It provides a 884e2fcbf42SPeter Maydell watchdog and the ability to reset and power control the system. You 885e2fcbf42SPeter Maydell need to connect this to an IPMI interface to make it useful 886e2fcbf42SPeter Maydell 887e2fcbf42SPeter Maydell The IPMI slave address to use for the BMC. The default is 0x20. This 888e2fcbf42SPeter Maydell address is the BMC's address on the I2C network of management 889e2fcbf42SPeter Maydell controllers. If you don't know what this means, it is safe to ignore 890e2fcbf42SPeter Maydell it. 891e2fcbf42SPeter Maydell 892e2fcbf42SPeter Maydell ``id=id`` 893e2fcbf42SPeter Maydell The BMC id for interfaces to use this device. 894e2fcbf42SPeter Maydell 895e2fcbf42SPeter Maydell ``slave_addr=val`` 896e2fcbf42SPeter Maydell Define slave address to use for the BMC. The default is 0x20. 897e2fcbf42SPeter Maydell 898e2fcbf42SPeter Maydell ``sdrfile=file`` 899e2fcbf42SPeter Maydell file containing raw Sensor Data Records (SDR) data. The default 900e2fcbf42SPeter Maydell is none. 901e2fcbf42SPeter Maydell 902e2fcbf42SPeter Maydell ``fruareasize=val`` 903e2fcbf42SPeter Maydell size of a Field Replaceable Unit (FRU) area. The default is 904e2fcbf42SPeter Maydell 1024. 905e2fcbf42SPeter Maydell 906e2fcbf42SPeter Maydell ``frudatafile=file`` 907e2fcbf42SPeter Maydell file containing raw Field Replaceable Unit (FRU) inventory data. 908e2fcbf42SPeter Maydell The default is none. 909e2fcbf42SPeter Maydell 910e2fcbf42SPeter Maydell ``guid=uuid`` 911e2fcbf42SPeter Maydell value for the GUID for the BMC, in standard UUID format. If this 912e2fcbf42SPeter Maydell is set, get "Get GUID" command to the BMC will return it. 913e2fcbf42SPeter Maydell Otherwise "Get GUID" will return an error. 914e2fcbf42SPeter Maydell 915e2fcbf42SPeter Maydell``-device ipmi-bmc-extern,id=id,chardev=id[,slave_addr=val]`` 916e2fcbf42SPeter Maydell Add a connection to an external IPMI BMC simulator. Instead of 917e2fcbf42SPeter Maydell locally emulating the BMC like the above item, instead connect to an 918e2fcbf42SPeter Maydell external entity that provides the IPMI services. 919e2fcbf42SPeter Maydell 920e2fcbf42SPeter Maydell A connection is made to an external BMC simulator. If you do this, 921e2fcbf42SPeter Maydell it is strongly recommended that you use the "reconnect=" chardev 922e2fcbf42SPeter Maydell option to reconnect to the simulator if the connection is lost. Note 923e2fcbf42SPeter Maydell that if this is not used carefully, it can be a security issue, as 924e2fcbf42SPeter Maydell the interface has the ability to send resets, NMIs, and power off 925e2fcbf42SPeter Maydell the VM. It's best if QEMU makes a connection to an external 926e2fcbf42SPeter Maydell simulator running on a secure port on localhost, so neither the 927e2fcbf42SPeter Maydell simulator nor QEMU is exposed to any outside network. 928e2fcbf42SPeter Maydell 929e2fcbf42SPeter Maydell See the "lanserv/README.vm" file in the OpenIPMI library for more 930e2fcbf42SPeter Maydell details on the external interface. 931e2fcbf42SPeter Maydell 932e2fcbf42SPeter Maydell``-device isa-ipmi-kcs,bmc=id[,ioport=val][,irq=val]`` 933e2fcbf42SPeter Maydell Add a KCS IPMI interafce on the ISA bus. This also adds a 934e2fcbf42SPeter Maydell corresponding ACPI and SMBIOS entries, if appropriate. 935e2fcbf42SPeter Maydell 936e2fcbf42SPeter Maydell ``bmc=id`` 937e2fcbf42SPeter Maydell The BMC to connect to, one of ipmi-bmc-sim or ipmi-bmc-extern 938e2fcbf42SPeter Maydell above. 939e2fcbf42SPeter Maydell 940e2fcbf42SPeter Maydell ``ioport=val`` 941e2fcbf42SPeter Maydell Define the I/O address of the interface. The default is 0xca0 942e2fcbf42SPeter Maydell for KCS. 943e2fcbf42SPeter Maydell 944e2fcbf42SPeter Maydell ``irq=val`` 945e2fcbf42SPeter Maydell Define the interrupt to use. The default is 5. To disable 946e2fcbf42SPeter Maydell interrupts, set this to 0. 947e2fcbf42SPeter Maydell 948e2fcbf42SPeter Maydell``-device isa-ipmi-bt,bmc=id[,ioport=val][,irq=val]`` 949e2fcbf42SPeter Maydell Like the KCS interface, but defines a BT interface. The default port 950e2fcbf42SPeter Maydell is 0xe4 and the default interrupt is 5. 951323679daSCorey Minyard 952323679daSCorey Minyard``-device pci-ipmi-kcs,bmc=id`` 953323679daSCorey Minyard Add a KCS IPMI interafce on the PCI bus. 954323679daSCorey Minyard 955323679daSCorey Minyard ``bmc=id`` 956323679daSCorey Minyard The BMC to connect to, one of ipmi-bmc-sim or ipmi-bmc-extern above. 957323679daSCorey Minyard 958323679daSCorey Minyard``-device pci-ipmi-bt,bmc=id`` 959323679daSCorey Minyard Like the KCS interface, but defines a BT interface on the PCI bus. 9607395b3e3SPeter Xu 9617395b3e3SPeter Xu``-device intel-iommu[,option=...]`` 9627395b3e3SPeter Xu This is only supported by ``-machine q35``, which will enable Intel VT-d 9637395b3e3SPeter Xu emulation within the guest. It supports below options: 9647395b3e3SPeter Xu 9657395b3e3SPeter Xu ``intremap=on|off`` (default: auto) 9667395b3e3SPeter Xu This enables interrupt remapping feature. It's required to enable 9677395b3e3SPeter Xu complete x2apic. Currently it only supports kvm kernel-irqchip modes 9687395b3e3SPeter Xu ``off`` or ``split``, while full kernel-irqchip is not yet supported. 9697395b3e3SPeter Xu The default value is "auto", which will be decided by the mode of 9707395b3e3SPeter Xu kernel-irqchip. 9717395b3e3SPeter Xu 9727395b3e3SPeter Xu ``caching-mode=on|off`` (default: off) 9737395b3e3SPeter Xu This enables caching mode for the VT-d emulated device. When 9747395b3e3SPeter Xu caching-mode is enabled, each guest DMA buffer mapping will generate an 9757395b3e3SPeter Xu IOTLB invalidation from the guest IOMMU driver to the vIOMMU device in 9767395b3e3SPeter Xu a synchronous way. It is required for ``-device vfio-pci`` to work 9777395b3e3SPeter Xu with the VT-d device, because host assigned devices requires to setup 9787395b3e3SPeter Xu the DMA mapping on the host before guest DMA starts. 9797395b3e3SPeter Xu 9807395b3e3SPeter Xu ``device-iotlb=on|off`` (default: off) 9817395b3e3SPeter Xu This enables device-iotlb capability for the emulated VT-d device. So 9827395b3e3SPeter Xu far virtio/vhost should be the only real user for this parameter, 9837395b3e3SPeter Xu paired with ats=on configured for the device. 9847395b3e3SPeter Xu 9857395b3e3SPeter Xu ``aw-bits=39|48`` (default: 39) 9867395b3e3SPeter Xu This decides the address width of IOVA address space. The address 9877395b3e3SPeter Xu space has 39 bits width for 3-level IOMMU page tables, and 48 bits for 9887395b3e3SPeter Xu 4-level IOMMU page tables. 9897395b3e3SPeter Xu 9907395b3e3SPeter Xu Please also refer to the wiki page for general scenarios of VT-d 9917395b3e3SPeter Xu emulation in QEMU: https://wiki.qemu.org/Features/VT-d. 9927395b3e3SPeter Xu 993e2fcbf42SPeter MaydellERST 99410adb8beSMarkus Armbruster 99510adb8beSMarkus ArmbrusterDEF("name", HAS_ARG, QEMU_OPTION_name, 9968f480de0SDr. David Alan Gilbert "-name string1[,process=string2][,debug-threads=on|off]\n" 99710adb8beSMarkus Armbruster " set the name of the guest\n" 998479a5747SRoman Bolshakov " string1 sets the window title and string2 the process name\n" 999479a5747SRoman Bolshakov " When debug-threads is enabled, individual threads are given a separate name\n" 10008f480de0SDr. David Alan Gilbert " NOTE: The thread names are for debugging and not a stable API.\n", 100110adb8beSMarkus Armbruster QEMU_ARCH_ALL) 1002e2fcbf42SPeter MaydellSRST 1003e2fcbf42SPeter Maydell``-name name`` 1004e2fcbf42SPeter Maydell Sets the name of the guest. This name will be displayed in the SDL 1005e2fcbf42SPeter Maydell window caption. The name will also be used for the VNC server. Also 1006e2fcbf42SPeter Maydell optionally set the top visible process name in Linux. Naming of 1007e2fcbf42SPeter Maydell individual threads can also be enabled on Linux to aid debugging. 1008e2fcbf42SPeter MaydellERST 100910adb8beSMarkus Armbruster 101010adb8beSMarkus ArmbrusterDEF("uuid", HAS_ARG, QEMU_OPTION_uuid, 101110adb8beSMarkus Armbruster "-uuid %08x-%04x-%04x-%04x-%012x\n" 101210adb8beSMarkus Armbruster " specify machine UUID\n", QEMU_ARCH_ALL) 1013e2fcbf42SPeter MaydellSRST 1014e2fcbf42SPeter Maydell``-uuid uuid`` 1015e2fcbf42SPeter Maydell Set system UUID. 1016e2fcbf42SPeter MaydellERST 101710adb8beSMarkus Armbruster 101810adb8beSMarkus ArmbrusterDEFHEADING() 101910adb8beSMarkus Armbruster 1020de6b4f90SMarkus ArmbrusterDEFHEADING(Block device options:) 102110adb8beSMarkus Armbruster 10225824d651Sblueswir1DEF("fda", HAS_ARG, QEMU_OPTION_fda, 1023ad96090aSBlue Swirl "-fda/-fdb file use 'file' as floppy disk 0/1 image\n", QEMU_ARCH_ALL) 1024ad96090aSBlue SwirlDEF("fdb", HAS_ARG, QEMU_OPTION_fdb, "", QEMU_ARCH_ALL) 1025e2fcbf42SPeter MaydellSRST 102609ce5f2dSPeter Maydell``-fda file`` 102709ce5f2dSPeter Maydell \ 102809ce5f2dSPeter Maydell``-fdb file`` 1029923e9311SThomas Huth Use file as floppy disk 0/1 image (see the :ref:`disk images` chapter in 1030923e9311SThomas Huth the System Emulation Users Guide). 1031e2fcbf42SPeter MaydellERST 10325824d651Sblueswir1 10335824d651Sblueswir1DEF("hda", HAS_ARG, QEMU_OPTION_hda, 1034ad96090aSBlue Swirl "-hda/-hdb file use 'file' as IDE hard disk 0/1 image\n", QEMU_ARCH_ALL) 1035ad96090aSBlue SwirlDEF("hdb", HAS_ARG, QEMU_OPTION_hdb, "", QEMU_ARCH_ALL) 10365824d651Sblueswir1DEF("hdc", HAS_ARG, QEMU_OPTION_hdc, 1037ad96090aSBlue Swirl "-hdc/-hdd file use 'file' as IDE hard disk 2/3 image\n", QEMU_ARCH_ALL) 1038ad96090aSBlue SwirlDEF("hdd", HAS_ARG, QEMU_OPTION_hdd, "", QEMU_ARCH_ALL) 1039e2fcbf42SPeter MaydellSRST 104009ce5f2dSPeter Maydell``-hda file`` 104109ce5f2dSPeter Maydell \ 104209ce5f2dSPeter Maydell``-hdb file`` 104309ce5f2dSPeter Maydell \ 104409ce5f2dSPeter Maydell``-hdc file`` 104509ce5f2dSPeter Maydell \ 104609ce5f2dSPeter Maydell``-hdd file`` 1047923e9311SThomas Huth Use file as hard disk 0, 1, 2 or 3 image (see the :ref:`disk images` 1048923e9311SThomas Huth chapter in the System Emulation Users Guide). 1049e2fcbf42SPeter MaydellERST 10505824d651Sblueswir1 10515824d651Sblueswir1DEF("cdrom", HAS_ARG, QEMU_OPTION_cdrom, 1052ad96090aSBlue Swirl "-cdrom file use 'file' as IDE cdrom image (cdrom is ide1 master)\n", 1053ad96090aSBlue Swirl QEMU_ARCH_ALL) 1054e2fcbf42SPeter MaydellSRST 1055e2fcbf42SPeter Maydell``-cdrom file`` 1056e2fcbf42SPeter Maydell Use file as CD-ROM image (you cannot use ``-hdc`` and ``-cdrom`` at 1057e2fcbf42SPeter Maydell the same time). You can use the host CD-ROM by using ``/dev/cdrom`` 1058e2fcbf42SPeter Maydell as filename. 1059e2fcbf42SPeter MaydellERST 10605824d651Sblueswir1 106142e5f393SMarkus ArmbrusterDEF("blockdev", HAS_ARG, QEMU_OPTION_blockdev, 106242e5f393SMarkus Armbruster "-blockdev [driver=]driver[,node-name=N][,discard=ignore|unmap]\n" 106342e5f393SMarkus Armbruster " [,cache.direct=on|off][,cache.no-flush=on|off]\n" 1064c9b749d7SKevin Wolf " [,read-only=on|off][,auto-read-only=on|off]\n" 1065c9b749d7SKevin Wolf " [,force-share=on|off][,detect-zeroes=on|off|unmap]\n" 106642e5f393SMarkus Armbruster " [,driver specific parameters...]\n" 106742e5f393SMarkus Armbruster " configure a block backend\n", QEMU_ARCH_ALL) 1068e2fcbf42SPeter MaydellSRST 1069e2fcbf42SPeter Maydell``-blockdev option[,option[,option[,...]]]`` 1070e2fcbf42SPeter Maydell Define a new block driver node. Some of the options apply to all 1071e2fcbf42SPeter Maydell block drivers, other options are only accepted for a specific block 1072e2fcbf42SPeter Maydell driver. See below for a list of generic options and options for the 1073e2fcbf42SPeter Maydell most common block drivers. 1074e2fcbf42SPeter Maydell 1075e2fcbf42SPeter Maydell Options that expect a reference to another node (e.g. ``file``) can 1076e2fcbf42SPeter Maydell be given in two ways. Either you specify the node name of an already 1077e2fcbf42SPeter Maydell existing node (file=node-name), or you define a new node inline, 1078e2fcbf42SPeter Maydell adding options for the referenced node after a dot 1079e2fcbf42SPeter Maydell (file.filename=path,file.aio=native). 1080e2fcbf42SPeter Maydell 1081e2fcbf42SPeter Maydell A block driver node created with ``-blockdev`` can be used for a 1082e2fcbf42SPeter Maydell guest device by specifying its node name for the ``drive`` property 1083e2fcbf42SPeter Maydell in a ``-device`` argument that defines a block device. 1084e2fcbf42SPeter Maydell 1085e2fcbf42SPeter Maydell ``Valid options for any block driver node:`` 1086e2fcbf42SPeter Maydell ``driver`` 1087e2fcbf42SPeter Maydell Specifies the block driver to use for the given node. 1088e2fcbf42SPeter Maydell 1089e2fcbf42SPeter Maydell ``node-name`` 1090e2fcbf42SPeter Maydell This defines the name of the block driver node by which it 1091e2fcbf42SPeter Maydell will be referenced later. The name must be unique, i.e. it 1092e2fcbf42SPeter Maydell must not match the name of a different block driver node, or 1093e2fcbf42SPeter Maydell (if you use ``-drive`` as well) the ID of a drive. 1094e2fcbf42SPeter Maydell 1095e2fcbf42SPeter Maydell If no node name is specified, it is automatically generated. 1096e2fcbf42SPeter Maydell The generated node name is not intended to be predictable 1097e2fcbf42SPeter Maydell and changes between QEMU invocations. For the top level, an 1098e2fcbf42SPeter Maydell explicit node name must be specified. 1099e2fcbf42SPeter Maydell 1100e2fcbf42SPeter Maydell ``read-only`` 1101e2fcbf42SPeter Maydell Open the node read-only. Guest write attempts will fail. 1102e2fcbf42SPeter Maydell 1103e2fcbf42SPeter Maydell Note that some block drivers support only read-only access, 1104e2fcbf42SPeter Maydell either generally or in certain configurations. In this case, 1105e2fcbf42SPeter Maydell the default value ``read-only=off`` does not work and the 1106e2fcbf42SPeter Maydell option must be specified explicitly. 1107e2fcbf42SPeter Maydell 1108e2fcbf42SPeter Maydell ``auto-read-only`` 1109e2fcbf42SPeter Maydell If ``auto-read-only=on`` is set, QEMU may fall back to 1110e2fcbf42SPeter Maydell read-only usage even when ``read-only=off`` is requested, or 1111e2fcbf42SPeter Maydell even switch between modes as needed, e.g. depending on 1112e2fcbf42SPeter Maydell whether the image file is writable or whether a writing user 1113e2fcbf42SPeter Maydell is attached to the node. 1114e2fcbf42SPeter Maydell 1115e2fcbf42SPeter Maydell ``force-share`` 1116e2fcbf42SPeter Maydell Override the image locking system of QEMU by forcing the 1117e2fcbf42SPeter Maydell node to utilize weaker shared access for permissions where 1118e2fcbf42SPeter Maydell it would normally request exclusive access. When there is 1119e2fcbf42SPeter Maydell the potential for multiple instances to have the same file 1120e2fcbf42SPeter Maydell open (whether this invocation of QEMU is the first or the 1121e2fcbf42SPeter Maydell second instance), both instances must permit shared access 1122e2fcbf42SPeter Maydell for the second instance to succeed at opening the file. 1123e2fcbf42SPeter Maydell 1124e2fcbf42SPeter Maydell Enabling ``force-share=on`` requires ``read-only=on``. 1125e2fcbf42SPeter Maydell 1126e2fcbf42SPeter Maydell ``cache.direct`` 1127e2fcbf42SPeter Maydell The host page cache can be avoided with ``cache.direct=on``. 1128e2fcbf42SPeter Maydell This will attempt to do disk IO directly to the guest's 1129e2fcbf42SPeter Maydell memory. QEMU may still perform an internal copy of the data. 1130e2fcbf42SPeter Maydell 1131e2fcbf42SPeter Maydell ``cache.no-flush`` 1132e2fcbf42SPeter Maydell In case you don't care about data integrity over host 1133e2fcbf42SPeter Maydell failures, you can use ``cache.no-flush=on``. This option 1134e2fcbf42SPeter Maydell tells QEMU that it never needs to write any data to the disk 1135e2fcbf42SPeter Maydell but can instead keep things in cache. If anything goes 1136e2fcbf42SPeter Maydell wrong, like your host losing power, the disk storage getting 1137e2fcbf42SPeter Maydell disconnected accidentally, etc. your image will most 1138e2fcbf42SPeter Maydell probably be rendered unusable. 1139e2fcbf42SPeter Maydell 1140e2fcbf42SPeter Maydell ``discard=discard`` 1141e2fcbf42SPeter Maydell discard is one of "ignore" (or "off") or "unmap" (or "on") 1142e2fcbf42SPeter Maydell and controls whether ``discard`` (also known as ``trim`` or 1143e2fcbf42SPeter Maydell ``unmap``) requests are ignored or passed to the filesystem. 1144e2fcbf42SPeter Maydell Some machine types may not support discard requests. 1145e2fcbf42SPeter Maydell 1146e2fcbf42SPeter Maydell ``detect-zeroes=detect-zeroes`` 1147e2fcbf42SPeter Maydell detect-zeroes is "off", "on" or "unmap" and enables the 1148e2fcbf42SPeter Maydell automatic conversion of plain zero writes by the OS to 1149e2fcbf42SPeter Maydell driver specific optimized zero write commands. You may even 1150e2fcbf42SPeter Maydell choose "unmap" if discard is set to "unmap" to allow a zero 1151e2fcbf42SPeter Maydell write to be converted to an ``unmap`` operation. 1152e2fcbf42SPeter Maydell 1153e2fcbf42SPeter Maydell ``Driver-specific options for file`` 1154e2fcbf42SPeter Maydell This is the protocol-level block driver for accessing regular 1155e2fcbf42SPeter Maydell files. 1156e2fcbf42SPeter Maydell 1157e2fcbf42SPeter Maydell ``filename`` 1158e2fcbf42SPeter Maydell The path to the image file in the local filesystem 1159e2fcbf42SPeter Maydell 1160e2fcbf42SPeter Maydell ``aio`` 1161ad1e691dSStefano Garzarella Specifies the AIO backend (threads/native/io_uring, 1162ad1e691dSStefano Garzarella default: threads) 1163e2fcbf42SPeter Maydell 1164e2fcbf42SPeter Maydell ``locking`` 1165e2fcbf42SPeter Maydell Specifies whether the image file is protected with Linux OFD 1166e2fcbf42SPeter Maydell / POSIX locks. The default is to use the Linux Open File 1167e2fcbf42SPeter Maydell Descriptor API if available, otherwise no lock is applied. 1168e2fcbf42SPeter Maydell (auto/on/off, default: auto) 1169e2fcbf42SPeter Maydell 1170e2fcbf42SPeter Maydell Example: 1171e2fcbf42SPeter Maydell 1172e2fcbf42SPeter Maydell :: 1173e2fcbf42SPeter Maydell 1174e2fcbf42SPeter Maydell -blockdev driver=file,node-name=disk,filename=disk.img 1175e2fcbf42SPeter Maydell 1176e2fcbf42SPeter Maydell ``Driver-specific options for raw`` 1177e2fcbf42SPeter Maydell This is the image format block driver for raw images. It is 1178e2fcbf42SPeter Maydell usually stacked on top of a protocol level block driver such as 1179e2fcbf42SPeter Maydell ``file``. 1180e2fcbf42SPeter Maydell 1181e2fcbf42SPeter Maydell ``file`` 1182e2fcbf42SPeter Maydell Reference to or definition of the data source block driver 1183e2fcbf42SPeter Maydell node (e.g. a ``file`` driver node) 1184e2fcbf42SPeter Maydell 1185e2fcbf42SPeter Maydell Example 1: 1186e2fcbf42SPeter Maydell 1187e2fcbf42SPeter Maydell :: 1188e2fcbf42SPeter Maydell 1189e2fcbf42SPeter Maydell -blockdev driver=file,node-name=disk_file,filename=disk.img 1190e2fcbf42SPeter Maydell -blockdev driver=raw,node-name=disk,file=disk_file 1191e2fcbf42SPeter Maydell 1192e2fcbf42SPeter Maydell Example 2: 1193e2fcbf42SPeter Maydell 1194e2fcbf42SPeter Maydell :: 1195e2fcbf42SPeter Maydell 1196e2fcbf42SPeter Maydell -blockdev driver=raw,node-name=disk,file.driver=file,file.filename=disk.img 1197e2fcbf42SPeter Maydell 1198e2fcbf42SPeter Maydell ``Driver-specific options for qcow2`` 1199e2fcbf42SPeter Maydell This is the image format block driver for qcow2 images. It is 1200e2fcbf42SPeter Maydell usually stacked on top of a protocol level block driver such as 1201e2fcbf42SPeter Maydell ``file``. 1202e2fcbf42SPeter Maydell 1203e2fcbf42SPeter Maydell ``file`` 1204e2fcbf42SPeter Maydell Reference to or definition of the data source block driver 1205e2fcbf42SPeter Maydell node (e.g. a ``file`` driver node) 1206e2fcbf42SPeter Maydell 1207e2fcbf42SPeter Maydell ``backing`` 1208e2fcbf42SPeter Maydell Reference to or definition of the backing file block device 1209e2fcbf42SPeter Maydell (default is taken from the image file). It is allowed to 1210e2fcbf42SPeter Maydell pass ``null`` here in order to disable the default backing 1211e2fcbf42SPeter Maydell file. 1212e2fcbf42SPeter Maydell 1213e2fcbf42SPeter Maydell ``lazy-refcounts`` 1214e2fcbf42SPeter Maydell Whether to enable the lazy refcounts feature (on/off; 1215e2fcbf42SPeter Maydell default is taken from the image file) 1216e2fcbf42SPeter Maydell 1217e2fcbf42SPeter Maydell ``cache-size`` 1218e2fcbf42SPeter Maydell The maximum total size of the L2 table and refcount block 1219e2fcbf42SPeter Maydell caches in bytes (default: the sum of l2-cache-size and 1220e2fcbf42SPeter Maydell refcount-cache-size) 1221e2fcbf42SPeter Maydell 1222e2fcbf42SPeter Maydell ``l2-cache-size`` 1223e2fcbf42SPeter Maydell The maximum size of the L2 table cache in bytes (default: if 1224e2fcbf42SPeter Maydell cache-size is not specified - 32M on Linux platforms, and 8M 1225e2fcbf42SPeter Maydell on non-Linux platforms; otherwise, as large as possible 1226e2fcbf42SPeter Maydell within the cache-size, while permitting the requested or the 1227e2fcbf42SPeter Maydell minimal refcount cache size) 1228e2fcbf42SPeter Maydell 1229e2fcbf42SPeter Maydell ``refcount-cache-size`` 1230e2fcbf42SPeter Maydell The maximum size of the refcount block cache in bytes 1231e2fcbf42SPeter Maydell (default: 4 times the cluster size; or if cache-size is 1232e2fcbf42SPeter Maydell specified, the part of it which is not used for the L2 1233e2fcbf42SPeter Maydell cache) 1234e2fcbf42SPeter Maydell 1235e2fcbf42SPeter Maydell ``cache-clean-interval`` 1236e2fcbf42SPeter Maydell Clean unused entries in the L2 and refcount caches. The 1237e2fcbf42SPeter Maydell interval is in seconds. The default value is 600 on 1238e2fcbf42SPeter Maydell supporting platforms, and 0 on other platforms. Setting it 1239e2fcbf42SPeter Maydell to 0 disables this feature. 1240e2fcbf42SPeter Maydell 1241e2fcbf42SPeter Maydell ``pass-discard-request`` 1242e2fcbf42SPeter Maydell Whether discard requests to the qcow2 device should be 1243e2fcbf42SPeter Maydell forwarded to the data source (on/off; default: on if 1244e2fcbf42SPeter Maydell discard=unmap is specified, off otherwise) 1245e2fcbf42SPeter Maydell 1246e2fcbf42SPeter Maydell ``pass-discard-snapshot`` 1247e2fcbf42SPeter Maydell Whether discard requests for the data source should be 1248e2fcbf42SPeter Maydell issued when a snapshot operation (e.g. deleting a snapshot) 1249e2fcbf42SPeter Maydell frees clusters in the qcow2 file (on/off; default: on) 1250e2fcbf42SPeter Maydell 1251e2fcbf42SPeter Maydell ``pass-discard-other`` 1252e2fcbf42SPeter Maydell Whether discard requests for the data source should be 1253e2fcbf42SPeter Maydell issued on other occasions where a cluster gets freed 1254e2fcbf42SPeter Maydell (on/off; default: off) 1255e2fcbf42SPeter Maydell 1256e2fcbf42SPeter Maydell ``overlap-check`` 1257e2fcbf42SPeter Maydell Which overlap checks to perform for writes to the image 1258e2fcbf42SPeter Maydell (none/constant/cached/all; default: cached). For details or 1259e2fcbf42SPeter Maydell finer granularity control refer to the QAPI documentation of 1260e2fcbf42SPeter Maydell ``blockdev-add``. 1261e2fcbf42SPeter Maydell 1262e2fcbf42SPeter Maydell Example 1: 1263e2fcbf42SPeter Maydell 1264e2fcbf42SPeter Maydell :: 1265e2fcbf42SPeter Maydell 1266e2fcbf42SPeter Maydell -blockdev driver=file,node-name=my_file,filename=/tmp/disk.qcow2 1267e2fcbf42SPeter Maydell -blockdev driver=qcow2,node-name=hda,file=my_file,overlap-check=none,cache-size=16777216 1268e2fcbf42SPeter Maydell 1269e2fcbf42SPeter Maydell Example 2: 1270e2fcbf42SPeter Maydell 1271e2fcbf42SPeter Maydell :: 1272e2fcbf42SPeter Maydell 1273e2fcbf42SPeter Maydell -blockdev driver=qcow2,node-name=disk,file.driver=http,file.filename=http://example.com/image.qcow2 1274e2fcbf42SPeter Maydell 1275e2fcbf42SPeter Maydell ``Driver-specific options for other drivers`` 1276e2fcbf42SPeter Maydell Please refer to the QAPI documentation of the ``blockdev-add`` 1277e2fcbf42SPeter Maydell QMP command. 1278e2fcbf42SPeter MaydellERST 127942e5f393SMarkus Armbruster 12805824d651Sblueswir1DEF("drive", HAS_ARG, QEMU_OPTION_drive, 12815824d651Sblueswir1 "-drive [file=file][,if=type][,bus=n][,unit=m][,media=d][,index=i]\n" 128292196b2fSStefan Hajnoczi " [,cache=writethrough|writeback|none|directsync|unsafe][,format=f]\n" 1283572023f7SKevin Wolf " [,snapshot=on|off][,rerror=ignore|stop|report]\n" 1284ad1e691dSStefano Garzarella " [,werror=ignore|stop|report|enospc][,id=name]\n" 1285ad1e691dSStefano Garzarella " [,aio=threads|native|io_uring]\n" 1286fb0490f6SStefan Hajnoczi " [,readonly=on|off][,copy-on-read=on|off]\n" 12872f7133b2SPeter Lieven " [,discard=ignore|unmap][,detect-zeroes=on|off|unmap]\n" 12883e9fab69SBenoît Canet " [[,bps=b]|[[,bps_rd=r][,bps_wr=w]]]\n" 12893e9fab69SBenoît Canet " [[,iops=i]|[[,iops_rd=r][,iops_wr=w]]]\n" 12903e9fab69SBenoît Canet " [[,bps_max=bm]|[[,bps_rd_max=rm][,bps_wr_max=wm]]]\n" 12913e9fab69SBenoît Canet " [[,iops_max=im]|[[,iops_rd_max=irm][,iops_wr_max=iwm]]]\n" 12922024c1dfSBenoît Canet " [[,iops_size=is]]\n" 129376f4afb4SAlberto Garcia " [[,group=g]]\n" 1294ad96090aSBlue Swirl " use 'file' as a drive image\n", QEMU_ARCH_ALL) 1295e2fcbf42SPeter MaydellSRST 1296e2fcbf42SPeter Maydell``-drive option[,option[,option[,...]]]`` 1297e2fcbf42SPeter Maydell Define a new drive. This includes creating a block driver node (the 1298e2fcbf42SPeter Maydell backend) as well as a guest device, and is mostly a shortcut for 1299e2fcbf42SPeter Maydell defining the corresponding ``-blockdev`` and ``-device`` options. 1300e2fcbf42SPeter Maydell 1301e2fcbf42SPeter Maydell ``-drive`` accepts all options that are accepted by ``-blockdev``. 1302e2fcbf42SPeter Maydell In addition, it knows the following options: 1303e2fcbf42SPeter Maydell 1304e2fcbf42SPeter Maydell ``file=file`` 1305923e9311SThomas Huth This option defines which disk image (see the :ref:`disk images` 1306923e9311SThomas Huth chapter in the System Emulation Users Guide) to use with this drive. 1307923e9311SThomas Huth If the filename contains comma, you must double it (for instance, 1308e2fcbf42SPeter Maydell "file=my,,file" to use file "my,file"). 1309e2fcbf42SPeter Maydell 1310e2fcbf42SPeter Maydell Special files such as iSCSI devices can be specified using 1311e2fcbf42SPeter Maydell protocol specific URLs. See the section for "Device URL Syntax" 1312e2fcbf42SPeter Maydell for more information. 1313e2fcbf42SPeter Maydell 1314e2fcbf42SPeter Maydell ``if=interface`` 1315e2fcbf42SPeter Maydell This option defines on which type on interface the drive is 1316e2fcbf42SPeter Maydell connected. Available types are: ide, scsi, sd, mtd, floppy, 1317e2fcbf42SPeter Maydell pflash, virtio, none. 1318e2fcbf42SPeter Maydell 1319e2fcbf42SPeter Maydell ``bus=bus,unit=unit`` 1320e2fcbf42SPeter Maydell These options define where is connected the drive by defining 1321e2fcbf42SPeter Maydell the bus number and the unit id. 1322e2fcbf42SPeter Maydell 1323e2fcbf42SPeter Maydell ``index=index`` 1324e2fcbf42SPeter Maydell This option defines where is connected the drive by using an 1325e2fcbf42SPeter Maydell index in the list of available connectors of a given interface 1326e2fcbf42SPeter Maydell type. 1327e2fcbf42SPeter Maydell 1328e2fcbf42SPeter Maydell ``media=media`` 1329e2fcbf42SPeter Maydell This option defines the type of the media: disk or cdrom. 1330e2fcbf42SPeter Maydell 1331e2fcbf42SPeter Maydell ``snapshot=snapshot`` 1332e2fcbf42SPeter Maydell snapshot is "on" or "off" and controls snapshot mode for the 1333e2fcbf42SPeter Maydell given drive (see ``-snapshot``). 1334e2fcbf42SPeter Maydell 1335e2fcbf42SPeter Maydell ``cache=cache`` 1336e2fcbf42SPeter Maydell cache is "none", "writeback", "unsafe", "directsync" or 1337e2fcbf42SPeter Maydell "writethrough" and controls how the host cache is used to access 1338e2fcbf42SPeter Maydell block data. This is a shortcut that sets the ``cache.direct`` 1339e2fcbf42SPeter Maydell and ``cache.no-flush`` options (as in ``-blockdev``), and 1340e2fcbf42SPeter Maydell additionally ``cache.writeback``, which provides a default for 1341e2fcbf42SPeter Maydell the ``write-cache`` option of block guest devices (as in 1342e2fcbf42SPeter Maydell ``-device``). The modes correspond to the following settings: 1343e2fcbf42SPeter Maydell 134409ce5f2dSPeter Maydell ============= =============== ============ ============== 134509ce5f2dSPeter Maydell \ cache.writeback cache.direct cache.no-flush 134609ce5f2dSPeter Maydell ============= =============== ============ ============== 134709ce5f2dSPeter Maydell writeback on off off 134809ce5f2dSPeter Maydell none on on off 134909ce5f2dSPeter Maydell writethrough off off off 135009ce5f2dSPeter Maydell directsync off on off 135109ce5f2dSPeter Maydell unsafe on off on 135209ce5f2dSPeter Maydell ============= =============== ============ ============== 1353e2fcbf42SPeter Maydell 1354e2fcbf42SPeter Maydell The default mode is ``cache=writeback``. 1355e2fcbf42SPeter Maydell 1356e2fcbf42SPeter Maydell ``aio=aio`` 1357ad1e691dSStefano Garzarella aio is "threads", "native", or "io_uring" and selects between pthread 1358ad1e691dSStefano Garzarella based disk I/O, native Linux AIO, or Linux io_uring API. 1359e2fcbf42SPeter Maydell 1360e2fcbf42SPeter Maydell ``format=format`` 1361e2fcbf42SPeter Maydell Specify which disk format will be used rather than detecting the 1362e2fcbf42SPeter Maydell format. Can be used to specify format=raw to avoid interpreting 1363e2fcbf42SPeter Maydell an untrusted format header. 1364e2fcbf42SPeter Maydell 1365e2fcbf42SPeter Maydell ``werror=action,rerror=action`` 1366e2fcbf42SPeter Maydell Specify which action to take on write and read errors. Valid 1367e2fcbf42SPeter Maydell actions are: "ignore" (ignore the error and try to continue), 1368e2fcbf42SPeter Maydell "stop" (pause QEMU), "report" (report the error to the guest), 1369e2fcbf42SPeter Maydell "enospc" (pause QEMU only if the host disk is full; report the 1370e2fcbf42SPeter Maydell error to the guest otherwise). The default setting is 1371e2fcbf42SPeter Maydell ``werror=enospc`` and ``rerror=report``. 1372e2fcbf42SPeter Maydell 1373e2fcbf42SPeter Maydell ``copy-on-read=copy-on-read`` 1374e2fcbf42SPeter Maydell copy-on-read is "on" or "off" and enables whether to copy read 1375e2fcbf42SPeter Maydell backing file sectors into the image file. 1376e2fcbf42SPeter Maydell 1377e2fcbf42SPeter Maydell ``bps=b,bps_rd=r,bps_wr=w`` 1378e2fcbf42SPeter Maydell Specify bandwidth throttling limits in bytes per second, either 1379e2fcbf42SPeter Maydell for all request types or for reads or writes only. Small values 1380e2fcbf42SPeter Maydell can lead to timeouts or hangs inside the guest. A safe minimum 1381e2fcbf42SPeter Maydell for disks is 2 MB/s. 1382e2fcbf42SPeter Maydell 1383e2fcbf42SPeter Maydell ``bps_max=bm,bps_rd_max=rm,bps_wr_max=wm`` 1384e2fcbf42SPeter Maydell Specify bursts in bytes per second, either for all request types 1385e2fcbf42SPeter Maydell or for reads or writes only. Bursts allow the guest I/O to spike 1386e2fcbf42SPeter Maydell above the limit temporarily. 1387e2fcbf42SPeter Maydell 1388e2fcbf42SPeter Maydell ``iops=i,iops_rd=r,iops_wr=w`` 1389e2fcbf42SPeter Maydell Specify request rate limits in requests per second, either for 1390e2fcbf42SPeter Maydell all request types or for reads or writes only. 1391e2fcbf42SPeter Maydell 1392e2fcbf42SPeter Maydell ``iops_max=bm,iops_rd_max=rm,iops_wr_max=wm`` 1393e2fcbf42SPeter Maydell Specify bursts in requests per second, either for all request 1394e2fcbf42SPeter Maydell types or for reads or writes only. Bursts allow the guest I/O to 1395e2fcbf42SPeter Maydell spike above the limit temporarily. 1396e2fcbf42SPeter Maydell 1397e2fcbf42SPeter Maydell ``iops_size=is`` 1398e2fcbf42SPeter Maydell Let every is bytes of a request count as a new request for iops 1399e2fcbf42SPeter Maydell throttling purposes. Use this option to prevent guests from 1400e2fcbf42SPeter Maydell circumventing iops limits by sending fewer but larger requests. 1401e2fcbf42SPeter Maydell 1402e2fcbf42SPeter Maydell ``group=g`` 1403e2fcbf42SPeter Maydell Join a throttling quota group with given name g. All drives that 1404e2fcbf42SPeter Maydell are members of the same group are accounted for together. Use 1405e2fcbf42SPeter Maydell this option to prevent guests from circumventing throttling 1406e2fcbf42SPeter Maydell limits by using many small disks instead of a single larger 1407e2fcbf42SPeter Maydell disk. 1408e2fcbf42SPeter Maydell 1409e2fcbf42SPeter Maydell By default, the ``cache.writeback=on`` mode is used. It will report 1410e2fcbf42SPeter Maydell data writes as completed as soon as the data is present in the host 1411e2fcbf42SPeter Maydell page cache. This is safe as long as your guest OS makes sure to 1412e2fcbf42SPeter Maydell correctly flush disk caches where needed. If your guest OS does not 1413e2fcbf42SPeter Maydell handle volatile disk write caches correctly and your host crashes or 1414e2fcbf42SPeter Maydell loses power, then the guest may experience data corruption. 1415e2fcbf42SPeter Maydell 1416e2fcbf42SPeter Maydell For such guests, you should consider using ``cache.writeback=off``. 1417e2fcbf42SPeter Maydell This means that the host page cache will be used to read and write 1418e2fcbf42SPeter Maydell data, but write notification will be sent to the guest only after 1419e2fcbf42SPeter Maydell QEMU has made sure to flush each write to the disk. Be aware that 1420e2fcbf42SPeter Maydell this has a major impact on performance. 1421e2fcbf42SPeter Maydell 1422e2fcbf42SPeter Maydell When using the ``-snapshot`` option, unsafe caching is always used. 1423e2fcbf42SPeter Maydell 1424e2fcbf42SPeter Maydell Copy-on-read avoids accessing the same backing file sectors 1425e2fcbf42SPeter Maydell repeatedly and is useful when the backing file is over a slow 1426e2fcbf42SPeter Maydell network. By default copy-on-read is off. 1427e2fcbf42SPeter Maydell 1428e2fcbf42SPeter Maydell Instead of ``-cdrom`` you can use: 1429e2fcbf42SPeter Maydell 1430e2fcbf42SPeter Maydell .. parsed-literal:: 1431e2fcbf42SPeter Maydell 1432e2fcbf42SPeter Maydell |qemu_system| -drive file=file,index=2,media=cdrom 1433e2fcbf42SPeter Maydell 1434e2fcbf42SPeter Maydell Instead of ``-hda``, ``-hdb``, ``-hdc``, ``-hdd``, you can use: 1435e2fcbf42SPeter Maydell 1436e2fcbf42SPeter Maydell .. parsed-literal:: 1437e2fcbf42SPeter Maydell 1438e2fcbf42SPeter Maydell |qemu_system| -drive file=file,index=0,media=disk 1439e2fcbf42SPeter Maydell |qemu_system| -drive file=file,index=1,media=disk 1440e2fcbf42SPeter Maydell |qemu_system| -drive file=file,index=2,media=disk 1441e2fcbf42SPeter Maydell |qemu_system| -drive file=file,index=3,media=disk 1442e2fcbf42SPeter Maydell 1443e2fcbf42SPeter Maydell You can open an image using pre-opened file descriptors from an fd 1444e2fcbf42SPeter Maydell set: 1445e2fcbf42SPeter Maydell 1446e2fcbf42SPeter Maydell .. parsed-literal:: 1447e2fcbf42SPeter Maydell 1448353a06b4SLaszlo Ersek |qemu_system| \\ 1449353a06b4SLaszlo Ersek -add-fd fd=3,set=2,opaque="rdwr:/path/to/file" \\ 1450353a06b4SLaszlo Ersek -add-fd fd=4,set=2,opaque="rdonly:/path/to/file" \\ 1451e2fcbf42SPeter Maydell -drive file=/dev/fdset/2,index=0,media=disk 1452e2fcbf42SPeter Maydell 1453e2fcbf42SPeter Maydell You can connect a CDROM to the slave of ide0: 1454e2fcbf42SPeter Maydell 1455e2fcbf42SPeter Maydell .. parsed-literal:: 1456e2fcbf42SPeter Maydell 1457e2fcbf42SPeter Maydell |qemu_system_x86| -drive file=file,if=ide,index=1,media=cdrom 1458e2fcbf42SPeter Maydell 1459e2fcbf42SPeter Maydell If you don't specify the "file=" argument, you define an empty 1460e2fcbf42SPeter Maydell drive: 1461e2fcbf42SPeter Maydell 1462e2fcbf42SPeter Maydell .. parsed-literal:: 1463e2fcbf42SPeter Maydell 1464e2fcbf42SPeter Maydell |qemu_system_x86| -drive if=ide,index=1,media=cdrom 1465e2fcbf42SPeter Maydell 1466e2fcbf42SPeter Maydell Instead of ``-fda``, ``-fdb``, you can use: 1467e2fcbf42SPeter Maydell 1468e2fcbf42SPeter Maydell .. parsed-literal:: 1469e2fcbf42SPeter Maydell 1470e2fcbf42SPeter Maydell |qemu_system_x86| -drive file=file,index=0,if=floppy 1471e2fcbf42SPeter Maydell |qemu_system_x86| -drive file=file,index=1,if=floppy 1472e2fcbf42SPeter Maydell 1473e2fcbf42SPeter Maydell By default, interface is "ide" and index is automatically 1474e2fcbf42SPeter Maydell incremented: 1475e2fcbf42SPeter Maydell 1476e2fcbf42SPeter Maydell .. parsed-literal:: 1477e2fcbf42SPeter Maydell 1478e2fcbf42SPeter Maydell |qemu_system_x86| -drive file=a -drive file=b" 1479e2fcbf42SPeter Maydell 1480e2fcbf42SPeter Maydell is interpreted like: 1481e2fcbf42SPeter Maydell 1482e2fcbf42SPeter Maydell .. parsed-literal:: 1483e2fcbf42SPeter Maydell 1484e2fcbf42SPeter Maydell |qemu_system_x86| -hda a -hdb b 1485e2fcbf42SPeter MaydellERST 14865824d651Sblueswir1 14875824d651Sblueswir1DEF("mtdblock", HAS_ARG, QEMU_OPTION_mtdblock, 1488ad96090aSBlue Swirl "-mtdblock file use 'file' as on-board Flash memory image\n", 1489ad96090aSBlue Swirl QEMU_ARCH_ALL) 1490e2fcbf42SPeter MaydellSRST 1491e2fcbf42SPeter Maydell``-mtdblock file`` 1492e2fcbf42SPeter Maydell Use file as on-board Flash memory image. 1493e2fcbf42SPeter MaydellERST 14945824d651Sblueswir1 14955824d651Sblueswir1DEF("sd", HAS_ARG, QEMU_OPTION_sd, 1496ad96090aSBlue Swirl "-sd file use 'file' as SecureDigital card image\n", QEMU_ARCH_ALL) 1497e2fcbf42SPeter MaydellSRST 1498e2fcbf42SPeter Maydell``-sd file`` 1499e2fcbf42SPeter Maydell Use file as SecureDigital card image. 1500e2fcbf42SPeter MaydellERST 15015824d651Sblueswir1 15025824d651Sblueswir1DEF("pflash", HAS_ARG, QEMU_OPTION_pflash, 1503ad96090aSBlue Swirl "-pflash file use 'file' as a parallel flash image\n", QEMU_ARCH_ALL) 1504e2fcbf42SPeter MaydellSRST 1505e2fcbf42SPeter Maydell``-pflash file`` 1506e2fcbf42SPeter Maydell Use file as a parallel flash image. 1507e2fcbf42SPeter MaydellERST 15085824d651Sblueswir1 15095824d651Sblueswir1DEF("snapshot", 0, QEMU_OPTION_snapshot, 1510ad96090aSBlue Swirl "-snapshot write to temporary files instead of disk image files\n", 1511ad96090aSBlue Swirl QEMU_ARCH_ALL) 1512e2fcbf42SPeter MaydellSRST 1513e2fcbf42SPeter Maydell``-snapshot`` 1514e2fcbf42SPeter Maydell Write to temporary files instead of disk image files. In this case, 1515e2fcbf42SPeter Maydell the raw disk image you use is not written back. You can however 1516923e9311SThomas Huth force the write back by pressing C-a s (see the :ref:`disk images` 1517923e9311SThomas Huth chapter in the System Emulation Users Guide). 1518e2fcbf42SPeter MaydellERST 15195824d651Sblueswir1 152074db920cSGautham R ShenoyDEF("fsdev", HAS_ARG, QEMU_OPTION_fsdev, 1521b44a6b09SGreg Kurz "-fsdev local,id=id,path=path,security_model=mapped-xattr|mapped-file|passthrough|none\n" 1522991c180dSPaolo Bonzini " [,writeout=immediate][,readonly=on][,fmode=fmode][,dmode=dmode]\n" 1523b8bbdb88SPradeep Jagadeesh " [[,throttling.bps-total=b]|[[,throttling.bps-read=r][,throttling.bps-write=w]]]\n" 1524b8bbdb88SPradeep Jagadeesh " [[,throttling.iops-total=i]|[[,throttling.iops-read=r][,throttling.iops-write=w]]]\n" 1525b8bbdb88SPradeep Jagadeesh " [[,throttling.bps-total-max=bm]|[[,throttling.bps-read-max=rm][,throttling.bps-write-max=wm]]]\n" 1526b8bbdb88SPradeep Jagadeesh " [[,throttling.iops-total-max=im]|[[,throttling.iops-read-max=irm][,throttling.iops-write-max=iwm]]]\n" 1527b44a6b09SGreg Kurz " [[,throttling.iops-size=is]]\n" 1528991c180dSPaolo Bonzini "-fsdev proxy,id=id,socket=socket[,writeout=immediate][,readonly=on]\n" 1529991c180dSPaolo Bonzini "-fsdev proxy,id=id,sock_fd=sock_fd[,writeout=immediate][,readonly=on]\n" 1530b44a6b09SGreg Kurz "-fsdev synth,id=id\n", 153174db920cSGautham R Shenoy QEMU_ARCH_ALL) 153274db920cSGautham R Shenoy 1533e2fcbf42SPeter MaydellSRST 1534991c180dSPaolo Bonzini``-fsdev local,id=id,path=path,security_model=security_model [,writeout=writeout][,readonly=on][,fmode=fmode][,dmode=dmode] [,throttling.option=value[,throttling.option=value[,...]]]`` 153509ce5f2dSPeter Maydell \ 1536991c180dSPaolo Bonzini``-fsdev proxy,id=id,socket=socket[,writeout=writeout][,readonly=on]`` 153709ce5f2dSPeter Maydell \ 1538991c180dSPaolo Bonzini``-fsdev proxy,id=id,sock_fd=sock_fd[,writeout=writeout][,readonly=on]`` 153909ce5f2dSPeter Maydell \ 1540991c180dSPaolo Bonzini``-fsdev synth,id=id[,readonly=on]`` 1541e2fcbf42SPeter Maydell Define a new file system device. Valid options are: 1542e2fcbf42SPeter Maydell 1543e2fcbf42SPeter Maydell ``local`` 1544e2fcbf42SPeter Maydell Accesses to the filesystem are done by QEMU. 1545e2fcbf42SPeter Maydell 1546e2fcbf42SPeter Maydell ``proxy`` 1547e2fcbf42SPeter Maydell Accesses to the filesystem are done by virtfs-proxy-helper(1). 1548e2fcbf42SPeter Maydell 1549e2fcbf42SPeter Maydell ``synth`` 1550e2fcbf42SPeter Maydell Synthetic filesystem, only used by QTests. 1551e2fcbf42SPeter Maydell 1552e2fcbf42SPeter Maydell ``id=id`` 1553e2fcbf42SPeter Maydell Specifies identifier for this device. 1554e2fcbf42SPeter Maydell 1555e2fcbf42SPeter Maydell ``path=path`` 1556e2fcbf42SPeter Maydell Specifies the export path for the file system device. Files 1557e2fcbf42SPeter Maydell under this path will be available to the 9p client on the guest. 1558e2fcbf42SPeter Maydell 1559e2fcbf42SPeter Maydell ``security_model=security_model`` 1560e2fcbf42SPeter Maydell Specifies the security model to be used for this export path. 1561e2fcbf42SPeter Maydell Supported security models are "passthrough", "mapped-xattr", 1562e2fcbf42SPeter Maydell "mapped-file" and "none". In "passthrough" security model, files 1563e2fcbf42SPeter Maydell are stored using the same credentials as they are created on the 1564e2fcbf42SPeter Maydell guest. This requires QEMU to run as root. In "mapped-xattr" 1565e2fcbf42SPeter Maydell security model, some of the file attributes like uid, gid, mode 1566e2fcbf42SPeter Maydell bits and link target are stored as file attributes. For 1567e2fcbf42SPeter Maydell "mapped-file" these attributes are stored in the hidden 1568e2fcbf42SPeter Maydell .virtfs\_metadata directory. Directories exported by this 1569e2fcbf42SPeter Maydell security model cannot interact with other unix tools. "none" 1570e2fcbf42SPeter Maydell security model is same as passthrough except the sever won't 1571e2fcbf42SPeter Maydell report failures if it fails to set file attributes like 1572e2fcbf42SPeter Maydell ownership. Security model is mandatory only for local fsdriver. 1573e2fcbf42SPeter Maydell Other fsdrivers (like proxy) don't take security model as a 1574e2fcbf42SPeter Maydell parameter. 1575e2fcbf42SPeter Maydell 1576e2fcbf42SPeter Maydell ``writeout=writeout`` 1577e2fcbf42SPeter Maydell This is an optional argument. The only supported value is 1578e2fcbf42SPeter Maydell "immediate". This means that host page cache will be used to 1579e2fcbf42SPeter Maydell read and write data but write notification will be sent to the 1580e2fcbf42SPeter Maydell guest only when the data has been reported as written by the 1581e2fcbf42SPeter Maydell storage subsystem. 1582e2fcbf42SPeter Maydell 1583991c180dSPaolo Bonzini ``readonly=on`` 1584e2fcbf42SPeter Maydell Enables exporting 9p share as a readonly mount for guests. By 1585e2fcbf42SPeter Maydell default read-write access is given. 1586e2fcbf42SPeter Maydell 1587e2fcbf42SPeter Maydell ``socket=socket`` 1588e2fcbf42SPeter Maydell Enables proxy filesystem driver to use passed socket file for 1589e2fcbf42SPeter Maydell communicating with virtfs-proxy-helper(1). 1590e2fcbf42SPeter Maydell 1591e2fcbf42SPeter Maydell ``sock_fd=sock_fd`` 1592e2fcbf42SPeter Maydell Enables proxy filesystem driver to use passed socket descriptor 1593e2fcbf42SPeter Maydell for communicating with virtfs-proxy-helper(1). Usually a helper 1594e2fcbf42SPeter Maydell like libvirt will create socketpair and pass one of the fds as 1595e2fcbf42SPeter Maydell sock\_fd. 1596e2fcbf42SPeter Maydell 1597e2fcbf42SPeter Maydell ``fmode=fmode`` 1598e2fcbf42SPeter Maydell Specifies the default mode for newly created files on the host. 1599e2fcbf42SPeter Maydell Works only with security models "mapped-xattr" and 1600e2fcbf42SPeter Maydell "mapped-file". 1601e2fcbf42SPeter Maydell 1602e2fcbf42SPeter Maydell ``dmode=dmode`` 1603e2fcbf42SPeter Maydell Specifies the default mode for newly created directories on the 1604e2fcbf42SPeter Maydell host. Works only with security models "mapped-xattr" and 1605e2fcbf42SPeter Maydell "mapped-file". 1606e2fcbf42SPeter Maydell 1607e2fcbf42SPeter Maydell ``throttling.bps-total=b,throttling.bps-read=r,throttling.bps-write=w`` 1608e2fcbf42SPeter Maydell Specify bandwidth throttling limits in bytes per second, either 1609e2fcbf42SPeter Maydell for all request types or for reads or writes only. 1610e2fcbf42SPeter Maydell 1611e2fcbf42SPeter Maydell ``throttling.bps-total-max=bm,bps-read-max=rm,bps-write-max=wm`` 1612e2fcbf42SPeter Maydell Specify bursts in bytes per second, either for all request types 1613e2fcbf42SPeter Maydell or for reads or writes only. Bursts allow the guest I/O to spike 1614e2fcbf42SPeter Maydell above the limit temporarily. 1615e2fcbf42SPeter Maydell 1616e2fcbf42SPeter Maydell ``throttling.iops-total=i,throttling.iops-read=r, throttling.iops-write=w`` 1617e2fcbf42SPeter Maydell Specify request rate limits in requests per second, either for 1618e2fcbf42SPeter Maydell all request types or for reads or writes only. 1619e2fcbf42SPeter Maydell 1620e2fcbf42SPeter Maydell ``throttling.iops-total-max=im,throttling.iops-read-max=irm, throttling.iops-write-max=iwm`` 1621e2fcbf42SPeter Maydell Specify bursts in requests per second, either for all request 1622e2fcbf42SPeter Maydell types or for reads or writes only. Bursts allow the guest I/O to 1623e2fcbf42SPeter Maydell spike above the limit temporarily. 1624e2fcbf42SPeter Maydell 1625e2fcbf42SPeter Maydell ``throttling.iops-size=is`` 1626e2fcbf42SPeter Maydell Let every is bytes of a request count as a new request for iops 1627e2fcbf42SPeter Maydell throttling purposes. 1628e2fcbf42SPeter Maydell 1629e2fcbf42SPeter Maydell -fsdev option is used along with -device driver "virtio-9p-...". 1630e2fcbf42SPeter Maydell 1631e2fcbf42SPeter Maydell``-device virtio-9p-type,fsdev=id,mount_tag=mount_tag`` 1632e2fcbf42SPeter Maydell Options for virtio-9p-... driver are: 1633e2fcbf42SPeter Maydell 1634e2fcbf42SPeter Maydell ``type`` 1635e2fcbf42SPeter Maydell Specifies the variant to be used. Supported values are "pci", 1636e2fcbf42SPeter Maydell "ccw" or "device", depending on the machine type. 1637e2fcbf42SPeter Maydell 1638e2fcbf42SPeter Maydell ``fsdev=id`` 1639e2fcbf42SPeter Maydell Specifies the id value specified along with -fsdev option. 1640e2fcbf42SPeter Maydell 1641e2fcbf42SPeter Maydell ``mount_tag=mount_tag`` 1642e2fcbf42SPeter Maydell Specifies the tag name to be used by the guest to mount this 1643e2fcbf42SPeter Maydell export point. 1644e2fcbf42SPeter MaydellERST 164574db920cSGautham R Shenoy 16463d54abc7SGautham R ShenoyDEF("virtfs", HAS_ARG, QEMU_OPTION_virtfs, 1647b44a6b09SGreg Kurz "-virtfs local,path=path,mount_tag=tag,security_model=mapped-xattr|mapped-file|passthrough|none\n" 1648991c180dSPaolo Bonzini " [,id=id][,writeout=immediate][,readonly=on][,fmode=fmode][,dmode=dmode][,multidevs=remap|forbid|warn]\n" 1649991c180dSPaolo Bonzini "-virtfs proxy,mount_tag=tag,socket=socket[,id=id][,writeout=immediate][,readonly=on]\n" 1650991c180dSPaolo Bonzini "-virtfs proxy,mount_tag=tag,sock_fd=sock_fd[,id=id][,writeout=immediate][,readonly=on]\n" 1651991c180dSPaolo Bonzini "-virtfs synth,mount_tag=tag[,id=id][,readonly=on]\n", 16523d54abc7SGautham R Shenoy QEMU_ARCH_ALL) 16533d54abc7SGautham R Shenoy 1654e2fcbf42SPeter MaydellSRST 1655991c180dSPaolo Bonzini``-virtfs local,path=path,mount_tag=mount_tag ,security_model=security_model[,writeout=writeout][,readonly=on] [,fmode=fmode][,dmode=dmode][,multidevs=multidevs]`` 165609ce5f2dSPeter Maydell \ 1657991c180dSPaolo Bonzini``-virtfs proxy,socket=socket,mount_tag=mount_tag [,writeout=writeout][,readonly=on]`` 165809ce5f2dSPeter Maydell \ 1659991c180dSPaolo Bonzini``-virtfs proxy,sock_fd=sock_fd,mount_tag=mount_tag [,writeout=writeout][,readonly=on]`` 166009ce5f2dSPeter Maydell \ 166109ce5f2dSPeter Maydell``-virtfs synth,mount_tag=mount_tag`` 166265abaa01SChristian Schoenebeck Define a new virtual filesystem device and expose it to the guest using 166365abaa01SChristian Schoenebeck a virtio-9p-device (a.k.a. 9pfs), which essentially means that a certain 166465abaa01SChristian Schoenebeck directory on host is made directly accessible by guest as a pass-through 166565abaa01SChristian Schoenebeck file system by using the 9P network protocol for communication between 166665abaa01SChristian Schoenebeck host and guests, if desired even accessible, shared by several guests 166765abaa01SChristian Schoenebeck simultaniously. 166865abaa01SChristian Schoenebeck 166965abaa01SChristian Schoenebeck Note that ``-virtfs`` is actually just a convenience shortcut for its 167065abaa01SChristian Schoenebeck generalized form ``-fsdev -device virtio-9p-pci``. 167165abaa01SChristian Schoenebeck 167265abaa01SChristian Schoenebeck The general form of pass-through file system options are: 1673e2fcbf42SPeter Maydell 1674e2fcbf42SPeter Maydell ``local`` 1675e2fcbf42SPeter Maydell Accesses to the filesystem are done by QEMU. 1676e2fcbf42SPeter Maydell 1677e2fcbf42SPeter Maydell ``proxy`` 1678e2fcbf42SPeter Maydell Accesses to the filesystem are done by virtfs-proxy-helper(1). 1679e2fcbf42SPeter Maydell 1680e2fcbf42SPeter Maydell ``synth`` 1681e2fcbf42SPeter Maydell Synthetic filesystem, only used by QTests. 1682e2fcbf42SPeter Maydell 1683e2fcbf42SPeter Maydell ``id=id`` 1684e2fcbf42SPeter Maydell Specifies identifier for the filesystem device 1685e2fcbf42SPeter Maydell 1686e2fcbf42SPeter Maydell ``path=path`` 1687e2fcbf42SPeter Maydell Specifies the export path for the file system device. Files 1688e2fcbf42SPeter Maydell under this path will be available to the 9p client on the guest. 1689e2fcbf42SPeter Maydell 1690e2fcbf42SPeter Maydell ``security_model=security_model`` 1691e2fcbf42SPeter Maydell Specifies the security model to be used for this export path. 1692e2fcbf42SPeter Maydell Supported security models are "passthrough", "mapped-xattr", 1693e2fcbf42SPeter Maydell "mapped-file" and "none". In "passthrough" security model, files 1694e2fcbf42SPeter Maydell are stored using the same credentials as they are created on the 1695e2fcbf42SPeter Maydell guest. This requires QEMU to run as root. In "mapped-xattr" 1696e2fcbf42SPeter Maydell security model, some of the file attributes like uid, gid, mode 1697e2fcbf42SPeter Maydell bits and link target are stored as file attributes. For 1698e2fcbf42SPeter Maydell "mapped-file" these attributes are stored in the hidden 1699e2fcbf42SPeter Maydell .virtfs\_metadata directory. Directories exported by this 1700e2fcbf42SPeter Maydell security model cannot interact with other unix tools. "none" 1701e2fcbf42SPeter Maydell security model is same as passthrough except the sever won't 1702e2fcbf42SPeter Maydell report failures if it fails to set file attributes like 1703e2fcbf42SPeter Maydell ownership. Security model is mandatory only for local fsdriver. 1704e2fcbf42SPeter Maydell Other fsdrivers (like proxy) don't take security model as a 1705e2fcbf42SPeter Maydell parameter. 1706e2fcbf42SPeter Maydell 1707e2fcbf42SPeter Maydell ``writeout=writeout`` 1708e2fcbf42SPeter Maydell This is an optional argument. The only supported value is 1709e2fcbf42SPeter Maydell "immediate". This means that host page cache will be used to 1710e2fcbf42SPeter Maydell read and write data but write notification will be sent to the 1711e2fcbf42SPeter Maydell guest only when the data has been reported as written by the 1712e2fcbf42SPeter Maydell storage subsystem. 1713e2fcbf42SPeter Maydell 1714991c180dSPaolo Bonzini ``readonly=on`` 1715e2fcbf42SPeter Maydell Enables exporting 9p share as a readonly mount for guests. By 1716e2fcbf42SPeter Maydell default read-write access is given. 1717e2fcbf42SPeter Maydell 1718e2fcbf42SPeter Maydell ``socket=socket`` 1719e2fcbf42SPeter Maydell Enables proxy filesystem driver to use passed socket file for 1720e2fcbf42SPeter Maydell communicating with virtfs-proxy-helper(1). Usually a helper like 1721e2fcbf42SPeter Maydell libvirt will create socketpair and pass one of the fds as 1722e2fcbf42SPeter Maydell sock\_fd. 1723e2fcbf42SPeter Maydell 1724e2fcbf42SPeter Maydell ``sock_fd`` 1725e2fcbf42SPeter Maydell Enables proxy filesystem driver to use passed 'sock\_fd' as the 1726e2fcbf42SPeter Maydell socket descriptor for interfacing with virtfs-proxy-helper(1). 1727e2fcbf42SPeter Maydell 1728e2fcbf42SPeter Maydell ``fmode=fmode`` 1729e2fcbf42SPeter Maydell Specifies the default mode for newly created files on the host. 1730e2fcbf42SPeter Maydell Works only with security models "mapped-xattr" and 1731e2fcbf42SPeter Maydell "mapped-file". 1732e2fcbf42SPeter Maydell 1733e2fcbf42SPeter Maydell ``dmode=dmode`` 1734e2fcbf42SPeter Maydell Specifies the default mode for newly created directories on the 1735e2fcbf42SPeter Maydell host. Works only with security models "mapped-xattr" and 1736e2fcbf42SPeter Maydell "mapped-file". 1737e2fcbf42SPeter Maydell 1738e2fcbf42SPeter Maydell ``mount_tag=mount_tag`` 1739e2fcbf42SPeter Maydell Specifies the tag name to be used by the guest to mount this 1740e2fcbf42SPeter Maydell export point. 1741e2fcbf42SPeter Maydell 1742e2fcbf42SPeter Maydell ``multidevs=multidevs`` 1743e2fcbf42SPeter Maydell Specifies how to deal with multiple devices being shared with a 1744e2fcbf42SPeter Maydell 9p export. Supported behaviours are either "remap", "forbid" or 1745e2fcbf42SPeter Maydell "warn". The latter is the default behaviour on which virtfs 9p 1746e2fcbf42SPeter Maydell expects only one device to be shared with the same export, and 1747e2fcbf42SPeter Maydell if more than one device is shared and accessed via the same 9p 1748e2fcbf42SPeter Maydell export then only a warning message is logged (once) by qemu on 1749e2fcbf42SPeter Maydell host side. In order to avoid file ID collisions on guest you 1750e2fcbf42SPeter Maydell should either create a separate virtfs export for each device to 1751e2fcbf42SPeter Maydell be shared with guests (recommended way) or you might use "remap" 1752e2fcbf42SPeter Maydell instead which allows you to share multiple devices with only one 1753e2fcbf42SPeter Maydell export instead, which is achieved by remapping the original 1754e2fcbf42SPeter Maydell inode numbers from host to guest in a way that would prevent 1755e2fcbf42SPeter Maydell such collisions. Remapping inodes in such use cases is required 1756e2fcbf42SPeter Maydell because the original device IDs from host are never passed and 1757e2fcbf42SPeter Maydell exposed on guest. Instead all files of an export shared with 1758e2fcbf42SPeter Maydell virtfs always share the same device id on guest. So two files 1759e2fcbf42SPeter Maydell with identical inode numbers but from actually different devices 1760e2fcbf42SPeter Maydell on host would otherwise cause a file ID collision and hence 1761e2fcbf42SPeter Maydell potential misbehaviours on guest. "forbid" on the other hand 1762e2fcbf42SPeter Maydell assumes like "warn" that only one device is shared by the same 1763e2fcbf42SPeter Maydell export, however it will not only log a warning message but also 1764e2fcbf42SPeter Maydell deny access to additional devices on guest. Note though that 1765e2fcbf42SPeter Maydell "forbid" does currently not block all possible file access 1766e2fcbf42SPeter Maydell operations (e.g. readdir() would still return entries from other 1767e2fcbf42SPeter Maydell devices). 1768e2fcbf42SPeter MaydellERST 17693d54abc7SGautham R Shenoy 177061d70487SMarkus ArmbrusterDEF("iscsi", HAS_ARG, QEMU_OPTION_iscsi, 177161d70487SMarkus Armbruster "-iscsi [user=user][,password=password]\n" 177261d70487SMarkus Armbruster " [,header-digest=CRC32C|CR32C-NONE|NONE-CRC32C|NONE\n" 177361d70487SMarkus Armbruster " [,initiator-name=initiator-iqn][,id=target-iqn]\n" 177461d70487SMarkus Armbruster " [,timeout=timeout]\n" 177561d70487SMarkus Armbruster " iSCSI session parameters\n", QEMU_ARCH_ALL) 177661d70487SMarkus Armbruster 1777e2fcbf42SPeter MaydellSRST 1778e2fcbf42SPeter Maydell``-iscsi`` 1779e2fcbf42SPeter Maydell Configure iSCSI session parameters. 1780e2fcbf42SPeter MaydellERST 178144743148SMarkus Armbruster 17825824d651Sblueswir1DEFHEADING() 17835824d651Sblueswir1 1784c2a34ab2SThomas HuthDEFHEADING(USB convenience options:) 178510adb8beSMarkus Armbruster 178610adb8beSMarkus ArmbrusterDEF("usb", 0, QEMU_OPTION_usb, 178773f46fefSStefan Hajnoczi "-usb enable on-board USB host controller (if not enabled by default)\n", 178810adb8beSMarkus Armbruster QEMU_ARCH_ALL) 1789e2fcbf42SPeter MaydellSRST 1790e2fcbf42SPeter Maydell``-usb`` 1791e2fcbf42SPeter Maydell Enable USB emulation on machine types with an on-board USB host 1792e2fcbf42SPeter Maydell controller (if not enabled by default). Note that on-board USB host 1793e2fcbf42SPeter Maydell controllers may not support USB 3.0. In this case 1794e2fcbf42SPeter Maydell ``-device qemu-xhci`` can be used instead on machines with PCI. 1795e2fcbf42SPeter MaydellERST 179610adb8beSMarkus Armbruster 179710adb8beSMarkus ArmbrusterDEF("usbdevice", HAS_ARG, QEMU_OPTION_usbdevice, 179810adb8beSMarkus Armbruster "-usbdevice name add the host or guest USB device 'name'\n", 179910adb8beSMarkus Armbruster QEMU_ARCH_ALL) 1800e2fcbf42SPeter MaydellSRST 1801e2fcbf42SPeter Maydell``-usbdevice devname`` 1802c2a34ab2SThomas Huth Add the USB device devname, and enable an on-board USB controller 1803c2a34ab2SThomas Huth if possible and necessary (just like it can be done via 1804c2a34ab2SThomas Huth ``-machine usb=on``). Note that this option is mainly intended for 1805c2a34ab2SThomas Huth the user's convenience only. More fine-grained control can be 1806c2a34ab2SThomas Huth achieved by selecting a USB host controller (if necessary) and the 1807c2a34ab2SThomas Huth desired USB device via the ``-device`` option instead. For example, 1808c2a34ab2SThomas Huth instead of using ``-usbdevice mouse`` it is possible to use 1809c2a34ab2SThomas Huth ``-device qemu-xhci -device usb-mouse`` to connect the USB mouse 1810c2a34ab2SThomas Huth to a USB 3.0 controller instead (at least on machines that support 1811c2a34ab2SThomas Huth PCI and do not have an USB controller enabled by default yet). 1812c2a34ab2SThomas Huth For more details, see the chapter about 1813923e9311SThomas Huth :ref:`Connecting USB devices` in the System Emulation Users Guide. 1814c2a34ab2SThomas Huth Possible devices for devname are: 1815c2a34ab2SThomas Huth 1816c2a34ab2SThomas Huth ``braille`` 1817c2a34ab2SThomas Huth Braille device. This will use BrlAPI to display the braille 1818c2a34ab2SThomas Huth output on a real or fake device (i.e. it also creates a 1819c2a34ab2SThomas Huth corresponding ``braille`` chardev automatically beside the 1820c2a34ab2SThomas Huth ``usb-braille`` USB device). 1821c2a34ab2SThomas Huth 1822c2a34ab2SThomas Huth ``keyboard`` 1823c2a34ab2SThomas Huth Standard USB keyboard. Will override the PS/2 keyboard (if present). 1824e2fcbf42SPeter Maydell 1825e2fcbf42SPeter Maydell ``mouse`` 1826e2fcbf42SPeter Maydell Virtual Mouse. This will override the PS/2 mouse emulation when 1827e2fcbf42SPeter Maydell activated. 1828e2fcbf42SPeter Maydell 1829e2fcbf42SPeter Maydell ``tablet`` 1830e2fcbf42SPeter Maydell Pointer device that uses absolute coordinates (like a 1831e2fcbf42SPeter Maydell touchscreen). This means QEMU is able to report the mouse 1832e2fcbf42SPeter Maydell position without having to grab the mouse. Also overrides the 1833e2fcbf42SPeter Maydell PS/2 mouse emulation when activated. 1834e2fcbf42SPeter Maydell 1835c2a34ab2SThomas Huth ``wacom-tablet`` 1836c2a34ab2SThomas Huth Wacom PenPartner USB tablet. 1837c2a34ab2SThomas Huth 1838c2a34ab2SThomas Huth 1839e2fcbf42SPeter MaydellERST 184010adb8beSMarkus Armbruster 184110adb8beSMarkus ArmbrusterDEFHEADING() 184210adb8beSMarkus Armbruster 1843de6b4f90SMarkus ArmbrusterDEFHEADING(Display options:) 18445824d651Sblueswir1 18451472a95bSJes SorensenDEF("display", HAS_ARG, QEMU_OPTION_display, 184688b40c68SThomas Huth#if defined(CONFIG_SPICE) 1847d8aec9d9SMarc-André Lureau "-display spice-app[,gl=on|off]\n" 184888b40c68SThomas Huth#endif 184988b40c68SThomas Huth#if defined(CONFIG_SDL) 185095f439bdSThomas Huth "-display sdl[,alt_grab=on|off][,ctrl_grab=on|off][,gl=on|core|es|off]\n" 18518e8e844bSThomas Huth " [,grab-mod=<mod>][,show-cursor=on|off][,window-close=on|off]\n" 185288b40c68SThomas Huth#endif 185388b40c68SThomas Huth#if defined(CONFIG_GTK) 185495f439bdSThomas Huth "-display gtk[,full-screen=on|off][,gl=on|off][,grab-on-hover=on|off]\n" 185595f439bdSThomas Huth " [,show-cursor=on|off][,window-close=on|off]\n" 185688b40c68SThomas Huth#endif 185788b40c68SThomas Huth#if defined(CONFIG_VNC) 1858f04ec5afSRobert Ho "-display vnc=<display>[,<optargs>]\n" 185988b40c68SThomas Huth#endif 186088b40c68SThomas Huth#if defined(CONFIG_CURSES) 18612f8b7cd5SSamuel Thibault "-display curses[,charset=<encoding>]\n" 186288b40c68SThomas Huth#endif 186388b40c68SThomas Huth#if defined(CONFIG_OPENGL) 186488b40c68SThomas Huth "-display egl-headless[,rendernode=<file>]\n" 186588b40c68SThomas Huth#endif 1866144aaa99SErik Skultety "-display none\n" 186788b40c68SThomas Huth " select display backend type\n" 1868f04ec5afSRobert Ho " The default display is equivalent to\n " 1869f04ec5afSRobert Ho#if defined(CONFIG_GTK) 187088b40c68SThomas Huth "\"-display gtk\"\n" 1871f04ec5afSRobert Ho#elif defined(CONFIG_SDL) 187288b40c68SThomas Huth "\"-display sdl\"\n" 1873f04ec5afSRobert Ho#elif defined(CONFIG_COCOA) 187488b40c68SThomas Huth "\"-display cocoa\"\n" 1875f04ec5afSRobert Ho#elif defined(CONFIG_VNC) 187688b40c68SThomas Huth "\"-vnc localhost:0,to=99,id=default\"\n" 1877f04ec5afSRobert Ho#else 187888b40c68SThomas Huth "\"-display none\"\n" 1879f04ec5afSRobert Ho#endif 1880f04ec5afSRobert Ho , QEMU_ARCH_ALL) 1881e2fcbf42SPeter MaydellSRST 1882e2fcbf42SPeter Maydell``-display type`` 1883e2fcbf42SPeter Maydell Select type of display to use. This option is a replacement for the 1884e2fcbf42SPeter Maydell old style -sdl/-curses/... options. Use ``-display help`` to list 1885e2fcbf42SPeter Maydell the available display types. Valid values for type are 1886e2fcbf42SPeter Maydell 1887ddc71758SAhmed Abouzied ``spice-app[,gl=on|off]`` 1888ddc71758SAhmed Abouzied Start QEMU as a Spice server and launch the default Spice client 1889ddc71758SAhmed Abouzied application. The Spice server will redirect the serial consoles 1890ddc71758SAhmed Abouzied and QEMU monitors. (Since 4.0) 1891ddc71758SAhmed Abouzied 189295f439bdSThomas Huth ``sdl`` 1893e2fcbf42SPeter Maydell Display video output via SDL (usually in a separate graphics 1894e2fcbf42SPeter Maydell window; see the SDL documentation for other possibilities). 189595f439bdSThomas Huth Valid parameters are: 1896e2fcbf42SPeter Maydell 18978e8e844bSThomas Huth ``grab-mod=<mods>`` : Used to select the modifier keys for toggling 1898450e0f28SJohn Snow the mouse grabbing in conjunction with the "g" key. ``<mods>`` can be 1899450e0f28SJohn Snow either ``lshift-lctrl-lalt`` or ``rctrl``. 19008e8e844bSThomas Huth 1901d46156fdSThomas Huth ``alt_grab=on|off`` : Use Control+Alt+Shift-g to toggle mouse grabbing. 1902d46156fdSThomas Huth This parameter is deprecated - use ``grab-mod`` instead. 190395f439bdSThomas Huth 1904d46156fdSThomas Huth ``ctrl_grab=on|off`` : Use Right-Control-g to toggle mouse grabbing. 1905d46156fdSThomas Huth This parameter is deprecated - use ``grab-mod`` instead. 190695f439bdSThomas Huth 190795f439bdSThomas Huth ``gl=on|off|core|es`` : Use OpenGL for displaying 190895f439bdSThomas Huth 190995f439bdSThomas Huth ``show-cursor=on|off`` : Force showing the mouse cursor 191095f439bdSThomas Huth 191195f439bdSThomas Huth ``window-close=on|off`` : Allow to quit qemu with window close button 191295f439bdSThomas Huth 191395f439bdSThomas Huth ``gtk`` 1914ddc71758SAhmed Abouzied Display video output in a GTK window. This interface provides 1915ddc71758SAhmed Abouzied drop-down menus and other UI elements to configure and control 191695f439bdSThomas Huth the VM during runtime. Valid parameters are: 191795f439bdSThomas Huth 191895f439bdSThomas Huth ``full-screen=on|off`` : Start in fullscreen mode 191995f439bdSThomas Huth 192095f439bdSThomas Huth ``gl=on|off`` : Use OpenGL for displaying 192195f439bdSThomas Huth 192295f439bdSThomas Huth ``grab-on-hover=on|off`` : Grab keyboard input on mouse hover 192395f439bdSThomas Huth 192495f439bdSThomas Huth ``show-cursor=on|off`` : Force showing the mouse cursor 192595f439bdSThomas Huth 192695f439bdSThomas Huth ``window-close=on|off`` : Allow to quit qemu with window close button 1927ddc71758SAhmed Abouzied 1928ddc71758SAhmed Abouzied ``curses[,charset=<encoding>]`` 1929e2fcbf42SPeter Maydell Display video output via curses. For graphics device models 1930e2fcbf42SPeter Maydell which support a text mode, QEMU can display this output using a 1931e2fcbf42SPeter Maydell curses/ncurses interface. Nothing is displayed when the graphics 1932e2fcbf42SPeter Maydell device is in graphical mode or if the graphics device does not 1933e2fcbf42SPeter Maydell support a text mode. Generally only the VGA device models 1934e2fcbf42SPeter Maydell support text mode. The font charset used by the guest can be 1935e2fcbf42SPeter Maydell specified with the ``charset`` option, for example 1936e2fcbf42SPeter Maydell ``charset=CP850`` for IBM CP850 encoding. The default is 1937e2fcbf42SPeter Maydell ``CP437``. 1938e2fcbf42SPeter Maydell 193995f439bdSThomas Huth ``egl-headless[,rendernode=<file>]`` 1940ddc71758SAhmed Abouzied Offload all OpenGL operations to a local DRI device. For any 1941ddc71758SAhmed Abouzied graphical display, this display needs to be paired with either 1942ddc71758SAhmed Abouzied VNC or SPICE displays. 1943ddc71758SAhmed Abouzied 194495f439bdSThomas Huth ``vnc=<display>`` 194595f439bdSThomas Huth Start a VNC server on display <display> 194695f439bdSThomas Huth 1947e2fcbf42SPeter Maydell ``none`` 1948e2fcbf42SPeter Maydell Do not display video output. The guest will still see an 1949e2fcbf42SPeter Maydell emulated graphics card, but its output will not be displayed to 1950e2fcbf42SPeter Maydell the QEMU user. This option differs from the -nographic option in 1951e2fcbf42SPeter Maydell that it only affects what is done with video output; -nographic 1952e2fcbf42SPeter Maydell also changes the destination of the serial and parallel port 1953e2fcbf42SPeter Maydell data. 1954e2fcbf42SPeter MaydellERST 19551472a95bSJes Sorensen 19565824d651Sblueswir1DEF("nographic", 0, QEMU_OPTION_nographic, 1957ad96090aSBlue Swirl "-nographic disable graphical output and redirect serial I/Os to console\n", 1958ad96090aSBlue Swirl QEMU_ARCH_ALL) 1959e2fcbf42SPeter MaydellSRST 1960e2fcbf42SPeter Maydell``-nographic`` 1961e2fcbf42SPeter Maydell Normally, if QEMU is compiled with graphical window support, it 1962e2fcbf42SPeter Maydell displays output such as guest graphics, guest console, and the QEMU 1963e2fcbf42SPeter Maydell monitor in a window. With this option, you can totally disable 1964e2fcbf42SPeter Maydell graphical output so that QEMU is a simple command line application. 1965e2fcbf42SPeter Maydell The emulated serial port is redirected on the console and muxed with 1966e2fcbf42SPeter Maydell the monitor (unless redirected elsewhere explicitly). Therefore, you 1967e2fcbf42SPeter Maydell can still use QEMU to debug a Linux kernel with a serial console. 1968e2fcbf42SPeter Maydell Use C-a h for help on switching between the console and monitor. 1969e2fcbf42SPeter MaydellERST 19705824d651Sblueswir1 19715824d651Sblueswir1DEF("curses", 0, QEMU_OPTION_curses, 1972f04ec5afSRobert Ho "-curses shorthand for -display curses\n", 1973ad96090aSBlue Swirl QEMU_ARCH_ALL) 1974e2fcbf42SPeter MaydellSRST 1975e2fcbf42SPeter Maydell``-curses`` 1976e2fcbf42SPeter Maydell Normally, if QEMU is compiled with graphical window support, it 1977e2fcbf42SPeter Maydell displays output such as guest graphics, guest console, and the QEMU 1978e2fcbf42SPeter Maydell monitor in a window. With this option, QEMU can display the VGA 1979e2fcbf42SPeter Maydell output when in text mode using a curses/ncurses interface. Nothing 1980e2fcbf42SPeter Maydell is displayed in graphical mode. 1981e2fcbf42SPeter MaydellERST 19825824d651Sblueswir1 19835824d651Sblueswir1DEF("alt-grab", 0, QEMU_OPTION_alt_grab, 1984ad96090aSBlue Swirl "-alt-grab use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt)\n", 1985ad96090aSBlue Swirl QEMU_ARCH_ALL) 1986e2fcbf42SPeter MaydellSRST 1987e2fcbf42SPeter Maydell``-alt-grab`` 1988e2fcbf42SPeter Maydell Use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt). Note that 1989e2fcbf42SPeter Maydell this also affects the special keys (for fullscreen, monitor-mode 1990d46156fdSThomas Huth switching, etc). This option is deprecated - please use 1991d46156fdSThomas Huth ``-display sdl,grab-mod=lshift-lctrl-lalt`` instead. 1992e2fcbf42SPeter MaydellERST 19935824d651Sblueswir1 19940ca9f8a4SDustin KirklandDEF("ctrl-grab", 0, QEMU_OPTION_ctrl_grab, 1995ad96090aSBlue Swirl "-ctrl-grab use Right-Ctrl to grab mouse (instead of Ctrl-Alt)\n", 1996ad96090aSBlue Swirl QEMU_ARCH_ALL) 1997e2fcbf42SPeter MaydellSRST 1998e2fcbf42SPeter Maydell``-ctrl-grab`` 1999e2fcbf42SPeter Maydell Use Right-Ctrl to grab mouse (instead of Ctrl-Alt). Note that this 2000e2fcbf42SPeter Maydell also affects the special keys (for fullscreen, monitor-mode 2001d46156fdSThomas Huth switching, etc). This option is deprecated - please use 2002d46156fdSThomas Huth ``-display sdl,grab-mod=rctrl`` instead. 2003e2fcbf42SPeter MaydellERST 20040ca9f8a4SDustin Kirkland 20055824d651Sblueswir1DEF("no-quit", 0, QEMU_OPTION_no_quit, 2006b6ddc6a2SThomas Huth "-no-quit disable SDL/GTK window close capability (deprecated)\n", QEMU_ARCH_ALL) 2007e2fcbf42SPeter MaydellSRST 2008e2fcbf42SPeter Maydell``-no-quit`` 2009b6ddc6a2SThomas Huth Disable window close capability (SDL and GTK only). This option is 2010b6ddc6a2SThomas Huth deprecated, please use ``-display ...,window-close=off`` instead. 2011e2fcbf42SPeter MaydellERST 20125824d651Sblueswir1 20135824d651Sblueswir1DEF("sdl", 0, QEMU_OPTION_sdl, 2014f04ec5afSRobert Ho "-sdl shorthand for -display sdl\n", QEMU_ARCH_ALL) 2015e2fcbf42SPeter MaydellSRST 2016e2fcbf42SPeter Maydell``-sdl`` 2017e2fcbf42SPeter Maydell Enable SDL. 2018e2fcbf42SPeter MaydellERST 20195824d651Sblueswir1 202029b0040bSGerd HoffmannDEF("spice", HAS_ARG, QEMU_OPTION_spice, 202127af7788SYonit Halperin "-spice [port=port][,tls-port=secured-port][,x509-dir=<dir>]\n" 202227af7788SYonit Halperin " [,x509-key-file=<file>][,x509-key-password=<file>]\n" 202327af7788SYonit Halperin " [,x509-cert-file=<file>][,x509-cacert-file=<file>]\n" 2024a9daa36aSDaniel P. Berrangé " [,x509-dh-key-file=<file>][,addr=addr]\n" 2025a9daa36aSDaniel P. Berrangé " [,ipv4=on|off][,ipv6=on|off][,unix=on|off]\n" 202627af7788SYonit Halperin " [,tls-ciphers=<list>]\n" 202727af7788SYonit Halperin " [,tls-channel=[main|display|cursor|inputs|record|playback]]\n" 202827af7788SYonit Halperin " [,plaintext-channel=[main|display|cursor|inputs|record|playback]]\n" 202999522f69SDaniel P. Berrangé " [,sasl=on|off][,disable-ticketing=on|off]\n" 203099522f69SDaniel P. Berrangé " [,password=<string>][,password-secret=<secret-id>]\n" 203127af7788SYonit Halperin " [,image-compression=[auto_glz|auto_lz|quic|glz|lz|off]]\n" 203227af7788SYonit Halperin " [,jpeg-wan-compression=[auto|never|always]]\n" 203327af7788SYonit Halperin " [,zlib-glz-wan-compression=[auto|never|always]]\n" 2034a9daa36aSDaniel P. Berrangé " [,streaming-video=[off|all|filter]][,disable-copy-paste=on|off]\n" 2035a9daa36aSDaniel P. Berrangé " [,disable-agent-file-xfer=on|off][,agent-mouse=[on|off]]\n" 20365ad24e5fSHans de Goede " [,playback-compression=[on|off]][,seamless-migration=[on|off]]\n" 20377b525508SMarc-André Lureau " [,gl=[on|off]][,rendernode=<file>]\n" 203827af7788SYonit Halperin " enable spice\n" 203927af7788SYonit Halperin " at least one of {port, tls-port} is mandatory\n", 204027af7788SYonit Halperin QEMU_ARCH_ALL) 2041e2fcbf42SPeter MaydellSRST 2042e2fcbf42SPeter Maydell``-spice option[,option[,...]]`` 2043e2fcbf42SPeter Maydell Enable the spice remote desktop protocol. Valid options are 2044e2fcbf42SPeter Maydell 2045e2fcbf42SPeter Maydell ``port=<nr>`` 2046e2fcbf42SPeter Maydell Set the TCP port spice is listening on for plaintext channels. 2047e2fcbf42SPeter Maydell 2048e2fcbf42SPeter Maydell ``addr=<addr>`` 2049e2fcbf42SPeter Maydell Set the IP address spice is listening on. Default is any 2050e2fcbf42SPeter Maydell address. 2051e2fcbf42SPeter Maydell 2052a9daa36aSDaniel P. Berrangé ``ipv4=on|off``; \ ``ipv6=on|off``; \ ``unix=on|off`` 2053e2fcbf42SPeter Maydell Force using the specified IP version. 2054e2fcbf42SPeter Maydell 205599522f69SDaniel P. Berrangé ``password=<string>`` 2056e2fcbf42SPeter Maydell Set the password you need to authenticate. 2057e2fcbf42SPeter Maydell 2058c47c0bcbSDaniel P. Berrangé This option is deprecated and insecure because it leaves the 2059c47c0bcbSDaniel P. Berrangé password visible in the process listing. Use ``password-secret`` 2060c47c0bcbSDaniel P. Berrangé instead. 2061c47c0bcbSDaniel P. Berrangé 206299522f69SDaniel P. Berrangé ``password-secret=<secret-id>`` 206399522f69SDaniel P. Berrangé Set the ID of the ``secret`` object containing the password 206499522f69SDaniel P. Berrangé you need to authenticate. 206599522f69SDaniel P. Berrangé 2066a9daa36aSDaniel P. Berrangé ``sasl=on|off`` 2067e2fcbf42SPeter Maydell Require that the client use SASL to authenticate with the spice. 2068e2fcbf42SPeter Maydell The exact choice of authentication method used is controlled 2069e2fcbf42SPeter Maydell from the system / user's SASL configuration file for the 'qemu' 2070e2fcbf42SPeter Maydell service. This is typically found in /etc/sasl2/qemu.conf. If 2071e2fcbf42SPeter Maydell running QEMU as an unprivileged user, an environment variable 2072e2fcbf42SPeter Maydell SASL\_CONF\_PATH can be used to make it search alternate 2073e2fcbf42SPeter Maydell locations for the service config. While some SASL auth methods 2074e2fcbf42SPeter Maydell can also provide data encryption (eg GSSAPI), it is recommended 2075e2fcbf42SPeter Maydell that SASL always be combined with the 'tls' and 'x509' settings 2076e2fcbf42SPeter Maydell to enable use of SSL and server certificates. This ensures a 2077e2fcbf42SPeter Maydell data encryption preventing compromise of authentication 2078e2fcbf42SPeter Maydell credentials. 2079e2fcbf42SPeter Maydell 2080a9daa36aSDaniel P. Berrangé ``disable-ticketing=on|off`` 2081e2fcbf42SPeter Maydell Allow client connects without authentication. 2082e2fcbf42SPeter Maydell 2083a9daa36aSDaniel P. Berrangé ``disable-copy-paste=on|off`` 2084e2fcbf42SPeter Maydell Disable copy paste between the client and the guest. 2085e2fcbf42SPeter Maydell 2086a9daa36aSDaniel P. Berrangé ``disable-agent-file-xfer=on|off`` 2087e2fcbf42SPeter Maydell Disable spice-vdagent based file-xfer between the client and the 2088e2fcbf42SPeter Maydell guest. 2089e2fcbf42SPeter Maydell 2090e2fcbf42SPeter Maydell ``tls-port=<nr>`` 2091e2fcbf42SPeter Maydell Set the TCP port spice is listening on for encrypted channels. 2092e2fcbf42SPeter Maydell 2093e2fcbf42SPeter Maydell ``x509-dir=<dir>`` 2094e2fcbf42SPeter Maydell Set the x509 file directory. Expects same filenames as -vnc 2095e2fcbf42SPeter Maydell $display,x509=$dir 2096e2fcbf42SPeter Maydell 2097e2fcbf42SPeter Maydell ``x509-key-file=<file>``; \ ``x509-key-password=<file>``; \ ``x509-cert-file=<file>``; \ ``x509-cacert-file=<file>``; \ ``x509-dh-key-file=<file>`` 2098e2fcbf42SPeter Maydell The x509 file names can also be configured individually. 2099e2fcbf42SPeter Maydell 2100e2fcbf42SPeter Maydell ``tls-ciphers=<list>`` 2101e2fcbf42SPeter Maydell Specify which ciphers to use. 2102e2fcbf42SPeter Maydell 2103e2fcbf42SPeter Maydell ``tls-channel=[main|display|cursor|inputs|record|playback]``; \ ``plaintext-channel=[main|display|cursor|inputs|record|playback]`` 2104e2fcbf42SPeter Maydell Force specific channel to be used with or without TLS 2105e2fcbf42SPeter Maydell encryption. The options can be specified multiple times to 2106e2fcbf42SPeter Maydell configure multiple channels. The special name "default" can be 2107e2fcbf42SPeter Maydell used to set the default mode. For channels which are not 2108e2fcbf42SPeter Maydell explicitly forced into one mode the spice client is allowed to 2109e2fcbf42SPeter Maydell pick tls/plaintext as he pleases. 2110e2fcbf42SPeter Maydell 2111e2fcbf42SPeter Maydell ``image-compression=[auto_glz|auto_lz|quic|glz|lz|off]`` 2112e2fcbf42SPeter Maydell Configure image compression (lossless). Default is auto\_glz. 2113e2fcbf42SPeter Maydell 2114e2fcbf42SPeter Maydell ``jpeg-wan-compression=[auto|never|always]``; \ ``zlib-glz-wan-compression=[auto|never|always]`` 2115e2fcbf42SPeter Maydell Configure wan image compression (lossy for slow links). Default 2116e2fcbf42SPeter Maydell is auto. 2117e2fcbf42SPeter Maydell 2118e2fcbf42SPeter Maydell ``streaming-video=[off|all|filter]`` 2119e2fcbf42SPeter Maydell Configure video stream detection. Default is off. 2120e2fcbf42SPeter Maydell 2121e2fcbf42SPeter Maydell ``agent-mouse=[on|off]`` 2122e2fcbf42SPeter Maydell Enable/disable passing mouse events via vdagent. Default is on. 2123e2fcbf42SPeter Maydell 2124e2fcbf42SPeter Maydell ``playback-compression=[on|off]`` 2125e2fcbf42SPeter Maydell Enable/disable audio stream compression (using celt 0.5.1). 2126e2fcbf42SPeter Maydell Default is on. 2127e2fcbf42SPeter Maydell 2128e2fcbf42SPeter Maydell ``seamless-migration=[on|off]`` 2129e2fcbf42SPeter Maydell Enable/disable spice seamless migration. Default is off. 2130e2fcbf42SPeter Maydell 2131e2fcbf42SPeter Maydell ``gl=[on|off]`` 2132e2fcbf42SPeter Maydell Enable/disable OpenGL context. Default is off. 2133e2fcbf42SPeter Maydell 2134e2fcbf42SPeter Maydell ``rendernode=<file>`` 2135e2fcbf42SPeter Maydell DRM render node for OpenGL rendering. If not specified, it will 2136e2fcbf42SPeter Maydell pick the first available. (Since 2.9) 2137e2fcbf42SPeter MaydellERST 213829b0040bSGerd Hoffmann 21395824d651Sblueswir1DEF("portrait", 0, QEMU_OPTION_portrait, 2140ad96090aSBlue Swirl "-portrait rotate graphical output 90 deg left (only PXA LCD)\n", 2141ad96090aSBlue Swirl QEMU_ARCH_ALL) 2142e2fcbf42SPeter MaydellSRST 2143e2fcbf42SPeter Maydell``-portrait`` 2144e2fcbf42SPeter Maydell Rotate graphical output 90 deg left (only PXA LCD). 2145e2fcbf42SPeter MaydellERST 21465824d651Sblueswir1 21479312805dSVasily KhoruzhickDEF("rotate", HAS_ARG, QEMU_OPTION_rotate, 21489312805dSVasily Khoruzhick "-rotate <deg> rotate graphical output some deg left (only PXA LCD)\n", 21499312805dSVasily Khoruzhick QEMU_ARCH_ALL) 2150e2fcbf42SPeter MaydellSRST 2151e2fcbf42SPeter Maydell``-rotate deg`` 2152e2fcbf42SPeter Maydell Rotate graphical output some deg left (only PXA LCD). 2153e2fcbf42SPeter MaydellERST 21549312805dSVasily Khoruzhick 21555824d651Sblueswir1DEF("vga", HAS_ARG, QEMU_OPTION_vga, 2156a94f0c5cSGerd Hoffmann "-vga [std|cirrus|vmware|qxl|xenfb|tcx|cg3|virtio|none]\n" 2157ad96090aSBlue Swirl " select video card type\n", QEMU_ARCH_ALL) 2158e2fcbf42SPeter MaydellSRST 2159e2fcbf42SPeter Maydell``-vga type`` 2160e2fcbf42SPeter Maydell Select type of VGA card to emulate. Valid values for type are 2161e2fcbf42SPeter Maydell 2162e2fcbf42SPeter Maydell ``cirrus`` 2163e2fcbf42SPeter Maydell Cirrus Logic GD5446 Video card. All Windows versions starting 2164e2fcbf42SPeter Maydell from Windows 95 should recognize and use this graphic card. For 2165e2fcbf42SPeter Maydell optimal performances, use 16 bit color depth in the guest and 2166e2fcbf42SPeter Maydell the host OS. (This card was the default before QEMU 2.2) 2167e2fcbf42SPeter Maydell 2168e2fcbf42SPeter Maydell ``std`` 2169e2fcbf42SPeter Maydell Standard VGA card with Bochs VBE extensions. If your guest OS 2170e2fcbf42SPeter Maydell supports the VESA 2.0 VBE extensions (e.g. Windows XP) and if 2171e2fcbf42SPeter Maydell you want to use high resolution modes (>= 1280x1024x16) then you 2172e2fcbf42SPeter Maydell should use this option. (This card is the default since QEMU 2173e2fcbf42SPeter Maydell 2.2) 2174e2fcbf42SPeter Maydell 2175e2fcbf42SPeter Maydell ``vmware`` 2176e2fcbf42SPeter Maydell VMWare SVGA-II compatible adapter. Use it if you have 2177e2fcbf42SPeter Maydell sufficiently recent XFree86/XOrg server or Windows guest with a 2178e2fcbf42SPeter Maydell driver for this card. 2179e2fcbf42SPeter Maydell 2180e2fcbf42SPeter Maydell ``qxl`` 2181e2fcbf42SPeter Maydell QXL paravirtual graphic card. It is VGA compatible (including 2182e2fcbf42SPeter Maydell VESA 2.0 VBE support). Works best with qxl guest drivers 2183e2fcbf42SPeter Maydell installed though. Recommended choice when using the spice 2184e2fcbf42SPeter Maydell protocol. 2185e2fcbf42SPeter Maydell 2186e2fcbf42SPeter Maydell ``tcx`` 2187e2fcbf42SPeter Maydell (sun4m only) Sun TCX framebuffer. This is the default 2188e2fcbf42SPeter Maydell framebuffer for sun4m machines and offers both 8-bit and 24-bit 2189e2fcbf42SPeter Maydell colour depths at a fixed resolution of 1024x768. 2190e2fcbf42SPeter Maydell 2191e2fcbf42SPeter Maydell ``cg3`` 2192e2fcbf42SPeter Maydell (sun4m only) Sun cgthree framebuffer. This is a simple 8-bit 2193e2fcbf42SPeter Maydell framebuffer for sun4m machines available in both 1024x768 2194e2fcbf42SPeter Maydell (OpenBIOS) and 1152x900 (OBP) resolutions aimed at people 2195e2fcbf42SPeter Maydell wishing to run older Solaris versions. 2196e2fcbf42SPeter Maydell 2197e2fcbf42SPeter Maydell ``virtio`` 2198e2fcbf42SPeter Maydell Virtio VGA card. 2199e2fcbf42SPeter Maydell 2200e2fcbf42SPeter Maydell ``none`` 2201e2fcbf42SPeter Maydell Disable VGA card. 2202e2fcbf42SPeter MaydellERST 22035824d651Sblueswir1 22045824d651Sblueswir1DEF("full-screen", 0, QEMU_OPTION_full_screen, 2205ad96090aSBlue Swirl "-full-screen start in full screen\n", QEMU_ARCH_ALL) 2206e2fcbf42SPeter MaydellSRST 2207e2fcbf42SPeter Maydell``-full-screen`` 2208e2fcbf42SPeter Maydell Start in full screen. 2209e2fcbf42SPeter MaydellERST 22105824d651Sblueswir1 221160f9a4efSJohn SnowDEF("g", HAS_ARG, QEMU_OPTION_g , 2212ad96090aSBlue Swirl "-g WxH[xDEPTH] Set the initial graphical resolution and depth\n", 22138ac919a0SLaurent Vivier QEMU_ARCH_PPC | QEMU_ARCH_SPARC | QEMU_ARCH_M68K) 2214e2fcbf42SPeter MaydellSRST 221509ce5f2dSPeter Maydell``-g`` *width*\ ``x``\ *height*\ ``[x``\ *depth*\ ``]`` 2216e2fcbf42SPeter Maydell Set the initial graphical resolution and depth (PPC, SPARC only). 2217e2fcbf42SPeter Maydell 2218e2fcbf42SPeter Maydell For PPC the default is 800x600x32. 2219e2fcbf42SPeter Maydell 2220e2fcbf42SPeter Maydell For SPARC with the TCX graphics device, the default is 1024x768x8 2221e2fcbf42SPeter Maydell with the option of 1024x768x24. For cgthree, the default is 2222e2fcbf42SPeter Maydell 1024x768x8 with the option of 1152x900x8 for people who wish to use 2223e2fcbf42SPeter Maydell OBP. 2224e2fcbf42SPeter MaydellERST 22255824d651Sblueswir1 22265824d651Sblueswir1DEF("vnc", HAS_ARG, QEMU_OPTION_vnc , 2227f04ec5afSRobert Ho "-vnc <display> shorthand for -display vnc=<display>\n", QEMU_ARCH_ALL) 2228e2fcbf42SPeter MaydellSRST 2229e2fcbf42SPeter Maydell``-vnc display[,option[,option[,...]]]`` 2230e2fcbf42SPeter Maydell Normally, if QEMU is compiled with graphical window support, it 2231e2fcbf42SPeter Maydell displays output such as guest graphics, guest console, and the QEMU 2232e2fcbf42SPeter Maydell monitor in a window. With this option, you can have QEMU listen on 2233e2fcbf42SPeter Maydell VNC display display and redirect the VGA display over the VNC 2234e2fcbf42SPeter Maydell session. It is very useful to enable the usb tablet device when 2235e2fcbf42SPeter Maydell using this option (option ``-device usb-tablet``). When using the 2236e2fcbf42SPeter Maydell VNC display, you must use the ``-k`` parameter to set the keyboard 2237e2fcbf42SPeter Maydell layout if you are not using en-us. Valid syntax for the display is 2238e2fcbf42SPeter Maydell 2239e2fcbf42SPeter Maydell ``to=L`` 2240e2fcbf42SPeter Maydell With this option, QEMU will try next available VNC displays, 2241e2fcbf42SPeter Maydell until the number L, if the origianlly defined "-vnc display" is 2242e2fcbf42SPeter Maydell not available, e.g. port 5900+display is already used by another 2243e2fcbf42SPeter Maydell application. By default, to=0. 2244e2fcbf42SPeter Maydell 2245e2fcbf42SPeter Maydell ``host:d`` 2246e2fcbf42SPeter Maydell TCP connections will only be allowed from host on display d. By 2247e2fcbf42SPeter Maydell convention the TCP port is 5900+d. Optionally, host can be 2248e2fcbf42SPeter Maydell omitted in which case the server will accept connections from 2249e2fcbf42SPeter Maydell any host. 2250e2fcbf42SPeter Maydell 2251e2fcbf42SPeter Maydell ``unix:path`` 2252e2fcbf42SPeter Maydell Connections will be allowed over UNIX domain sockets where path 2253e2fcbf42SPeter Maydell is the location of a unix socket to listen for connections on. 2254e2fcbf42SPeter Maydell 2255e2fcbf42SPeter Maydell ``none`` 2256e2fcbf42SPeter Maydell VNC is initialized but not started. The monitor ``change`` 2257e2fcbf42SPeter Maydell command can be used to later start the VNC server. 2258e2fcbf42SPeter Maydell 2259e2fcbf42SPeter Maydell Following the display value there may be one or more option flags 2260e2fcbf42SPeter Maydell separated by commas. Valid options are 2261e2fcbf42SPeter Maydell 226282a17d1dSDaniel P. Berrangé ``reverse=on|off`` 2263e2fcbf42SPeter Maydell Connect to a listening VNC client via a "reverse" connection. 2264e2fcbf42SPeter Maydell The client is specified by the display. For reverse network 2265e2fcbf42SPeter Maydell connections (host:d,``reverse``), the d argument is a TCP port 2266e2fcbf42SPeter Maydell number, not a display number. 2267e2fcbf42SPeter Maydell 226882a17d1dSDaniel P. Berrangé ``websocket=on|off`` 2269e2fcbf42SPeter Maydell Opens an additional TCP listening port dedicated to VNC 2270e2fcbf42SPeter Maydell Websocket connections. If a bare websocket option is given, the 2271e2fcbf42SPeter Maydell Websocket port is 5700+display. An alternative port can be 2272e2fcbf42SPeter Maydell specified with the syntax ``websocket``\ =port. 2273e2fcbf42SPeter Maydell 2274e2fcbf42SPeter Maydell If host is specified connections will only be allowed from this 2275e2fcbf42SPeter Maydell host. It is possible to control the websocket listen address 2276e2fcbf42SPeter Maydell independently, using the syntax ``websocket``\ =host:port. 2277e2fcbf42SPeter Maydell 2278e2fcbf42SPeter Maydell If no TLS credentials are provided, the websocket connection 2279e2fcbf42SPeter Maydell runs in unencrypted mode. If TLS credentials are provided, the 2280e2fcbf42SPeter Maydell websocket connection requires encrypted client connections. 2281e2fcbf42SPeter Maydell 228282a17d1dSDaniel P. Berrangé ``password=on|off`` 2283e2fcbf42SPeter Maydell Require that password based authentication is used for client 2284e2fcbf42SPeter Maydell connections. 2285e2fcbf42SPeter Maydell 2286e2fcbf42SPeter Maydell The password must be set separately using the ``set_password`` 2287923e9311SThomas Huth command in the :ref:`QEMU monitor`. The 2288e2fcbf42SPeter Maydell syntax to change your password is: 2289e2fcbf42SPeter Maydell ``set_password <protocol> <password>`` where <protocol> could be 2290e2fcbf42SPeter Maydell either "vnc" or "spice". 2291e2fcbf42SPeter Maydell 2292e2fcbf42SPeter Maydell If you would like to change <protocol> password expiration, you 2293e2fcbf42SPeter Maydell should use ``expire_password <protocol> <expiration-time>`` 2294e2fcbf42SPeter Maydell where expiration time could be one of the following options: 2295e2fcbf42SPeter Maydell now, never, +seconds or UNIX time of expiration, e.g. +60 to 2296e2fcbf42SPeter Maydell make password expire in 60 seconds, or 1335196800 to make 2297e2fcbf42SPeter Maydell password expire on "Mon Apr 23 12:00:00 EDT 2012" (UNIX time for 2298e2fcbf42SPeter Maydell this date and time). 2299e2fcbf42SPeter Maydell 2300e2fcbf42SPeter Maydell You can also use keywords "now" or "never" for the expiration 2301e2fcbf42SPeter Maydell time to allow <protocol> password to expire immediately or never 2302e2fcbf42SPeter Maydell expire. 2303e2fcbf42SPeter Maydell 23046c6840e9SDaniel P. Berrangé ``password-secret=<secret-id>`` 23056c6840e9SDaniel P. Berrangé Require that password based authentication is used for client 23066c6840e9SDaniel P. Berrangé connections, using the password provided by the ``secret`` 23076c6840e9SDaniel P. Berrangé object identified by ``secret-id``. 23086c6840e9SDaniel P. Berrangé 2309e2fcbf42SPeter Maydell ``tls-creds=ID`` 2310e2fcbf42SPeter Maydell Provides the ID of a set of TLS credentials to use to secure the 2311e2fcbf42SPeter Maydell VNC server. They will apply to both the normal VNC server socket 2312e2fcbf42SPeter Maydell and the websocket socket (if enabled). Setting TLS credentials 2313e2fcbf42SPeter Maydell will cause the VNC server socket to enable the VeNCrypt auth 2314e2fcbf42SPeter Maydell mechanism. The credentials should have been previously created 2315e2fcbf42SPeter Maydell using the ``-object tls-creds`` argument. 2316e2fcbf42SPeter Maydell 2317e2fcbf42SPeter Maydell ``tls-authz=ID`` 2318e2fcbf42SPeter Maydell Provides the ID of the QAuthZ authorization object against which 2319e2fcbf42SPeter Maydell the client's x509 distinguished name will validated. This object 2320e2fcbf42SPeter Maydell is only resolved at time of use, so can be deleted and recreated 2321e2fcbf42SPeter Maydell on the fly while the VNC server is active. If missing, it will 2322e2fcbf42SPeter Maydell default to denying access. 2323e2fcbf42SPeter Maydell 232482a17d1dSDaniel P. Berrangé ``sasl=on|off`` 2325e2fcbf42SPeter Maydell Require that the client use SASL to authenticate with the VNC 2326e2fcbf42SPeter Maydell server. The exact choice of authentication method used is 2327e2fcbf42SPeter Maydell controlled from the system / user's SASL configuration file for 2328e2fcbf42SPeter Maydell the 'qemu' service. This is typically found in 2329e2fcbf42SPeter Maydell /etc/sasl2/qemu.conf. If running QEMU as an unprivileged user, 2330e2fcbf42SPeter Maydell an environment variable SASL\_CONF\_PATH can be used to make it 2331e2fcbf42SPeter Maydell search alternate locations for the service config. While some 2332e2fcbf42SPeter Maydell SASL auth methods can also provide data encryption (eg GSSAPI), 2333e2fcbf42SPeter Maydell it is recommended that SASL always be combined with the 'tls' 2334e2fcbf42SPeter Maydell and 'x509' settings to enable use of SSL and server 2335e2fcbf42SPeter Maydell certificates. This ensures a data encryption preventing 2336e2fcbf42SPeter Maydell compromise of authentication credentials. See the 2337923e9311SThomas Huth :ref:`VNC security` section in the System Emulation Users Guide 2338923e9311SThomas Huth for details on using SASL authentication. 2339e2fcbf42SPeter Maydell 2340e2fcbf42SPeter Maydell ``sasl-authz=ID`` 2341e2fcbf42SPeter Maydell Provides the ID of the QAuthZ authorization object against which 2342e2fcbf42SPeter Maydell the client's SASL username will validated. This object is only 2343e2fcbf42SPeter Maydell resolved at time of use, so can be deleted and recreated on the 2344e2fcbf42SPeter Maydell fly while the VNC server is active. If missing, it will default 2345e2fcbf42SPeter Maydell to denying access. 2346e2fcbf42SPeter Maydell 234782a17d1dSDaniel P. Berrangé ``acl=on|off`` 2348e2fcbf42SPeter Maydell Legacy method for enabling authorization of clients against the 2349e2fcbf42SPeter Maydell x509 distinguished name and SASL username. It results in the 2350e2fcbf42SPeter Maydell creation of two ``authz-list`` objects with IDs of 2351e2fcbf42SPeter Maydell ``vnc.username`` and ``vnc.x509dname``. The rules for these 2352e2fcbf42SPeter Maydell objects must be configured with the HMP ACL commands. 2353e2fcbf42SPeter Maydell 2354e2fcbf42SPeter Maydell This option is deprecated and should no longer be used. The new 2355e2fcbf42SPeter Maydell ``sasl-authz`` and ``tls-authz`` options are a replacement. 2356e2fcbf42SPeter Maydell 235782a17d1dSDaniel P. Berrangé ``lossy=on|off`` 2358e2fcbf42SPeter Maydell Enable lossy compression methods (gradient, JPEG, ...). If this 2359e2fcbf42SPeter Maydell option is set, VNC client may receive lossy framebuffer updates 2360e2fcbf42SPeter Maydell depending on its encoding settings. Enabling this option can 2361e2fcbf42SPeter Maydell save a lot of bandwidth at the expense of quality. 2362e2fcbf42SPeter Maydell 236382a17d1dSDaniel P. Berrangé ``non-adaptive=on|off`` 2364e2fcbf42SPeter Maydell Disable adaptive encodings. Adaptive encodings are enabled by 2365e2fcbf42SPeter Maydell default. An adaptive encoding will try to detect frequently 2366e2fcbf42SPeter Maydell updated screen regions, and send updates in these regions using 2367e2fcbf42SPeter Maydell a lossy encoding (like JPEG). This can be really helpful to save 2368e2fcbf42SPeter Maydell bandwidth when playing videos. Disabling adaptive encodings 2369e2fcbf42SPeter Maydell restores the original static behavior of encodings like Tight. 2370e2fcbf42SPeter Maydell 2371e2fcbf42SPeter Maydell ``share=[allow-exclusive|force-shared|ignore]`` 2372e2fcbf42SPeter Maydell Set display sharing policy. 'allow-exclusive' allows clients to 2373e2fcbf42SPeter Maydell ask for exclusive access. As suggested by the rfb spec this is 2374e2fcbf42SPeter Maydell implemented by dropping other connections. Connecting multiple 2375e2fcbf42SPeter Maydell clients in parallel requires all clients asking for a shared 2376e2fcbf42SPeter Maydell session (vncviewer: -shared switch). This is the default. 2377e2fcbf42SPeter Maydell 'force-shared' disables exclusive client access. Useful for 2378e2fcbf42SPeter Maydell shared desktop sessions, where you don't want someone forgetting 2379e2fcbf42SPeter Maydell specify -shared disconnect everybody else. 'ignore' completely 2380e2fcbf42SPeter Maydell ignores the shared flag and allows everybody connect 2381e2fcbf42SPeter Maydell unconditionally. Doesn't conform to the rfb spec but is 2382e2fcbf42SPeter Maydell traditional QEMU behavior. 2383e2fcbf42SPeter Maydell 2384e2fcbf42SPeter Maydell ``key-delay-ms`` 2385e2fcbf42SPeter Maydell Set keyboard delay, for key down and key up events, in 2386e2fcbf42SPeter Maydell milliseconds. Default is 10. Keyboards are low-bandwidth 2387e2fcbf42SPeter Maydell devices, so this slowdown can help the device and guest to keep 2388e2fcbf42SPeter Maydell up and not lose events in case events are arriving in bulk. 2389e2fcbf42SPeter Maydell Possible causes for the latter are flaky network connections, or 2390e2fcbf42SPeter Maydell scripts for automated testing. 2391e2fcbf42SPeter Maydell 2392e2fcbf42SPeter Maydell ``audiodev=audiodev`` 2393e2fcbf42SPeter Maydell Use the specified audiodev when the VNC client requests audio 2394e2fcbf42SPeter Maydell transmission. When not using an -audiodev argument, this option 2395e2fcbf42SPeter Maydell must be omitted, otherwise is must be present and specify a 2396e2fcbf42SPeter Maydell valid audiodev. 23977b5fa0b5SDaniel P. Berrangé 239882a17d1dSDaniel P. Berrangé ``power-control=on|off`` 23997b5fa0b5SDaniel P. Berrangé Permit the remote client to issue shutdown, reboot or reset power 24007b5fa0b5SDaniel P. Berrangé control requests. 2401e2fcbf42SPeter MaydellERST 24025824d651Sblueswir1 2403a3adb7adSMichael EllermanARCHHEADING(, QEMU_ARCH_I386) 24045824d651Sblueswir1 2405de6b4f90SMarkus ArmbrusterARCHHEADING(i386 target only:, QEMU_ARCH_I386) 24065824d651Sblueswir1 24075824d651Sblueswir1DEF("win2k-hack", 0, QEMU_OPTION_win2k_hack, 2408ad96090aSBlue Swirl "-win2k-hack use it when installing Windows 2000 to avoid a disk full bug\n", 2409ad96090aSBlue Swirl QEMU_ARCH_I386) 2410e2fcbf42SPeter MaydellSRST 2411e2fcbf42SPeter Maydell``-win2k-hack`` 2412e2fcbf42SPeter Maydell Use it when installing Windows 2000 to avoid a disk full bug. After 2413e2fcbf42SPeter Maydell Windows 2000 is installed, you no longer need this option (this 2414e2fcbf42SPeter Maydell option slows down the IDE transfers). 2415e2fcbf42SPeter MaydellERST 24165824d651Sblueswir1 24175824d651Sblueswir1DEF("no-fd-bootchk", 0, QEMU_OPTION_no_fd_bootchk, 2418ad96090aSBlue Swirl "-no-fd-bootchk disable boot signature checking for floppy disks\n", 2419ad96090aSBlue Swirl QEMU_ARCH_I386) 2420e2fcbf42SPeter MaydellSRST 2421e2fcbf42SPeter Maydell``-no-fd-bootchk`` 2422e2fcbf42SPeter Maydell Disable boot signature checking for floppy disks in BIOS. May be 2423e2fcbf42SPeter Maydell needed to boot from old floppy disks. 2424e2fcbf42SPeter MaydellERST 24255824d651Sblueswir1 24265824d651Sblueswir1DEF("no-acpi", 0, QEMU_OPTION_no_acpi, 2427f5d8c8cdSShannon Zhao "-no-acpi disable ACPI\n", QEMU_ARCH_I386 | QEMU_ARCH_ARM) 2428e2fcbf42SPeter MaydellSRST 2429e2fcbf42SPeter Maydell``-no-acpi`` 2430e2fcbf42SPeter Maydell Disable ACPI (Advanced Configuration and Power Interface) support. 2431e2fcbf42SPeter Maydell Use it if your guest OS complains about ACPI problems (PC target 2432e2fcbf42SPeter Maydell machine only). 2433e2fcbf42SPeter MaydellERST 24345824d651Sblueswir1 24355824d651Sblueswir1DEF("no-hpet", 0, QEMU_OPTION_no_hpet, 2436ad96090aSBlue Swirl "-no-hpet disable HPET\n", QEMU_ARCH_I386) 2437e2fcbf42SPeter MaydellSRST 2438e2fcbf42SPeter Maydell``-no-hpet`` 2439e2fcbf42SPeter Maydell Disable HPET support. 2440e2fcbf42SPeter MaydellERST 24415824d651Sblueswir1 24425824d651Sblueswir1DEF("acpitable", HAS_ARG, QEMU_OPTION_acpitable, 2443104bf02eSMichael Tokarev "-acpitable [sig=str][,rev=n][,oem_id=str][,oem_table_id=str][,oem_rev=n][,asl_compiler_id=str][,asl_compiler_rev=n][,{data|file}=file1[:file2]...]\n" 2444ad96090aSBlue Swirl " ACPI table description\n", QEMU_ARCH_I386) 2445e2fcbf42SPeter MaydellSRST 2446e2fcbf42SPeter Maydell``-acpitable [sig=str][,rev=n][,oem_id=str][,oem_table_id=str][,oem_rev=n] [,asl_compiler_id=str][,asl_compiler_rev=n][,data=file1[:file2]...]`` 2447e2fcbf42SPeter Maydell Add ACPI table with specified header fields and context from 2448e2fcbf42SPeter Maydell specified files. For file=, take whole ACPI table from the specified 2449e2fcbf42SPeter Maydell files, including all ACPI headers (possible overridden by other 2450e2fcbf42SPeter Maydell options). For data=, only data portion of the table is used, all 2451e2fcbf42SPeter Maydell header information is specified in the command line. If a SLIC table 2452e2fcbf42SPeter Maydell is supplied to QEMU, then the SLIC's oem\_id and oem\_table\_id 2453e2fcbf42SPeter Maydell fields will override the same in the RSDT and the FADT (a.k.a. 2454e2fcbf42SPeter Maydell FACP), in order to ensure the field matches required by the 2455e2fcbf42SPeter Maydell Microsoft SLIC spec and the ACPI spec. 2456e2fcbf42SPeter MaydellERST 24575824d651Sblueswir1 2458b6f6e3d3SaliguoriDEF("smbios", HAS_ARG, QEMU_OPTION_smbios, 2459b6f6e3d3Saliguori "-smbios file=binary\n" 2460ca1a8a06SBruce Rogers " load SMBIOS entry from binary file\n" 2461b155eb1dSGabriel L. Somlo "-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]\n" 2462b155eb1dSGabriel L. Somlo " [,uefi=on|off]\n" 2463ca1a8a06SBruce Rogers " specify SMBIOS type 0 fields\n" 2464b6f6e3d3Saliguori "-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]\n" 2465b6f6e3d3Saliguori " [,uuid=uuid][,sku=str][,family=str]\n" 2466b155eb1dSGabriel L. Somlo " specify SMBIOS type 1 fields\n" 2467b155eb1dSGabriel L. Somlo "-smbios type=2[,manufacturer=str][,product=str][,version=str][,serial=str]\n" 2468b155eb1dSGabriel L. Somlo " [,asset=str][,location=str]\n" 2469b155eb1dSGabriel L. Somlo " specify SMBIOS type 2 fields\n" 2470b155eb1dSGabriel L. Somlo "-smbios type=3[,manufacturer=str][,version=str][,serial=str][,asset=str]\n" 2471b155eb1dSGabriel L. Somlo " [,sku=str]\n" 2472b155eb1dSGabriel L. Somlo " specify SMBIOS type 3 fields\n" 2473b155eb1dSGabriel L. Somlo "-smbios type=4[,sock_pfx=str][,manufacturer=str][,version=str][,serial=str]\n" 2474c906e039SYing Fang " [,asset=str][,part=str][,max-speed=%d][,current-speed=%d]\n" 2475b155eb1dSGabriel L. Somlo " specify SMBIOS type 4 fields\n" 247648a7ff4dSDaniel P. Berrangé "-smbios type=11[,value=str][,path=filename]\n" 247748a7ff4dSDaniel P. Berrangé " specify SMBIOS type 11 fields\n" 2478b155eb1dSGabriel L. Somlo "-smbios type=17[,loc_pfx=str][,bank=str][,manufacturer=str][,serial=str]\n" 24793ebd6cc8SGabriel L. Somlo " [,asset=str][,part=str][,speed=%d]\n" 248005dfb447SVincent Bernat " specify SMBIOS type 17 fields\n" 248105dfb447SVincent Bernat "-smbios type=41[,designation=str][,kind=str][,instance=%d][,pcidev=str]\n" 248205dfb447SVincent Bernat " specify SMBIOS type 41 fields\n", 2483c30e1565SWei Huang QEMU_ARCH_I386 | QEMU_ARCH_ARM) 2484e2fcbf42SPeter MaydellSRST 2485e2fcbf42SPeter Maydell``-smbios file=binary`` 2486e2fcbf42SPeter Maydell Load SMBIOS entry from binary file. 2487e2fcbf42SPeter Maydell 2488e2fcbf42SPeter Maydell``-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d][,uefi=on|off]`` 2489e2fcbf42SPeter Maydell Specify SMBIOS type 0 fields 2490e2fcbf42SPeter Maydell 2491e2fcbf42SPeter Maydell``-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str][,uuid=uuid][,sku=str][,family=str]`` 2492e2fcbf42SPeter Maydell Specify SMBIOS type 1 fields 2493e2fcbf42SPeter Maydell 2494e2fcbf42SPeter Maydell``-smbios type=2[,manufacturer=str][,product=str][,version=str][,serial=str][,asset=str][,location=str]`` 2495e2fcbf42SPeter Maydell Specify SMBIOS type 2 fields 2496e2fcbf42SPeter Maydell 2497e2fcbf42SPeter Maydell``-smbios type=3[,manufacturer=str][,version=str][,serial=str][,asset=str][,sku=str]`` 2498e2fcbf42SPeter Maydell Specify SMBIOS type 3 fields 2499e2fcbf42SPeter Maydell 2500e2fcbf42SPeter Maydell``-smbios type=4[,sock_pfx=str][,manufacturer=str][,version=str][,serial=str][,asset=str][,part=str]`` 2501e2fcbf42SPeter Maydell Specify SMBIOS type 4 fields 2502e2fcbf42SPeter Maydell 250348a7ff4dSDaniel P. Berrangé``-smbios type=11[,value=str][,path=filename]`` 250448a7ff4dSDaniel P. Berrangé Specify SMBIOS type 11 fields 250548a7ff4dSDaniel P. Berrangé 250648a7ff4dSDaniel P. Berrangé This argument can be repeated multiple times, and values are added in the order they are parsed. 250748a7ff4dSDaniel P. Berrangé Applications intending to use OEM strings data are encouraged to use their application name as 250848a7ff4dSDaniel P. Berrangé a prefix for the value string. This facilitates passing information for multiple applications 250948a7ff4dSDaniel P. Berrangé concurrently. 251048a7ff4dSDaniel P. Berrangé 251148a7ff4dSDaniel P. Berrangé The ``value=str`` syntax provides the string data inline, while the ``path=filename`` syntax 251248a7ff4dSDaniel P. Berrangé loads data from a file on disk. Note that the file is not permitted to contain any NUL bytes. 251348a7ff4dSDaniel P. Berrangé 251448a7ff4dSDaniel P. Berrangé Both the ``value`` and ``path`` options can be repeated multiple times and will be added to 251548a7ff4dSDaniel P. Berrangé the SMBIOS table in the order in which they appear. 251648a7ff4dSDaniel P. Berrangé 251748a7ff4dSDaniel P. Berrangé Note that on the x86 architecture, the total size of all SMBIOS tables is limited to 65535 251848a7ff4dSDaniel P. Berrangé bytes. Thus the OEM strings data is not suitable for passing large amounts of data into the 251948a7ff4dSDaniel P. Berrangé guest. Instead it should be used as a indicator to inform the guest where to locate the real 252048a7ff4dSDaniel P. Berrangé data set, for example, by specifying the serial ID of a block device. 252148a7ff4dSDaniel P. Berrangé 252248a7ff4dSDaniel P. Berrangé An example passing three strings is 252348a7ff4dSDaniel P. Berrangé 252448a7ff4dSDaniel P. Berrangé .. parsed-literal:: 252548a7ff4dSDaniel P. Berrangé 252648a7ff4dSDaniel P. Berrangé -smbios type=11,value=cloud-init:ds=nocloud-net;s=http://10.10.0.1:8000/,\\ 252748a7ff4dSDaniel P. Berrangé value=anaconda:method=http://dl.fedoraproject.org/pub/fedora/linux/releases/25/x86_64/os,\\ 252848a7ff4dSDaniel P. Berrangé path=/some/file/with/oemstringsdata.txt 252948a7ff4dSDaniel P. Berrangé 253048a7ff4dSDaniel P. Berrangé In the guest OS this is visible with the ``dmidecode`` command 253148a7ff4dSDaniel P. Berrangé 253248a7ff4dSDaniel P. Berrangé .. parsed-literal:: 253348a7ff4dSDaniel P. Berrangé 253448a7ff4dSDaniel P. Berrangé $ dmidecode -t 11 253548a7ff4dSDaniel P. Berrangé Handle 0x0E00, DMI type 11, 5 bytes 253648a7ff4dSDaniel P. Berrangé OEM Strings 253748a7ff4dSDaniel P. Berrangé String 1: cloud-init:ds=nocloud-net;s=http://10.10.0.1:8000/ 253848a7ff4dSDaniel P. Berrangé String 2: anaconda:method=http://dl.fedoraproject.org/pub/fedora/linux/releases/25/x86_64/os 253948a7ff4dSDaniel P. Berrangé String 3: myapp:some extra data 254048a7ff4dSDaniel P. Berrangé 254148a7ff4dSDaniel P. Berrangé 2542e2fcbf42SPeter Maydell``-smbios type=17[,loc_pfx=str][,bank=str][,manufacturer=str][,serial=str][,asset=str][,part=str][,speed=%d]`` 2543e2fcbf42SPeter Maydell Specify SMBIOS type 17 fields 254405dfb447SVincent Bernat 254505dfb447SVincent Bernat``-smbios type=41[,designation=str][,kind=str][,instance=%d][,pcidev=str]`` 254605dfb447SVincent Bernat Specify SMBIOS type 41 fields 254705dfb447SVincent Bernat 254805dfb447SVincent Bernat This argument can be repeated multiple times. Its main use is to allow network interfaces be created 254905dfb447SVincent Bernat as ``enoX`` on Linux, with X being the instance number, instead of the name depending on the interface 255005dfb447SVincent Bernat position on the PCI bus. 255105dfb447SVincent Bernat 255205dfb447SVincent Bernat Here is an example of use: 255305dfb447SVincent Bernat 255405dfb447SVincent Bernat .. parsed-literal:: 255505dfb447SVincent Bernat 255605dfb447SVincent Bernat -netdev user,id=internet \\ 255705dfb447SVincent Bernat -device virtio-net-pci,mac=50:54:00:00:00:42,netdev=internet,id=internet-dev \\ 255805dfb447SVincent Bernat -smbios type=41,designation='Onboard LAN',instance=1,kind=ethernet,pcidev=internet-dev 255905dfb447SVincent Bernat 256005dfb447SVincent Bernat In the guest OS, the device should then appear as ``eno1``: 256105dfb447SVincent Bernat 256205dfb447SVincent Bernat ..parsed-literal:: 256305dfb447SVincent Bernat 256405dfb447SVincent Bernat $ ip -brief l 256505dfb447SVincent Bernat lo UNKNOWN 00:00:00:00:00:00 <LOOPBACK,UP,LOWER_UP> 256605dfb447SVincent Bernat eno1 UP 50:54:00:00:00:42 <BROADCAST,MULTICAST,UP,LOWER_UP> 256705dfb447SVincent Bernat 256805dfb447SVincent Bernat Currently, the PCI device has to be attached to the root bus. 256905dfb447SVincent Bernat 2570e2fcbf42SPeter MaydellERST 2571b6f6e3d3Saliguori 2572c70a01e4SMarkus ArmbrusterDEFHEADING() 25735824d651Sblueswir1 2574de6b4f90SMarkus ArmbrusterDEFHEADING(Network options:) 25755824d651Sblueswir1 25766a8b4a5bSThomas HuthDEF("netdev", HAS_ARG, QEMU_OPTION_netdev, 25775824d651Sblueswir1#ifdef CONFIG_SLIRP 25788b0dc246SDaniel P. Berrangé "-netdev user,id=str[,ipv4=on|off][,net=addr[/mask]][,host=addr]\n" 25798b0dc246SDaniel P. Berrangé " [,ipv6=on|off][,ipv6-net=addr[/int]][,ipv6-host=addr]\n" 25800b11c036SSamuel Thibault " [,restrict=on|off][,hostname=host][,dhcpstart=addr]\n" 2581f18d1375SBenjamin Drung " [,dns=addr][,ipv6-dns=addr][,dnssearch=domain][,domainname=domain]\n" 25820fca92b9SFam Zheng " [,tftp=dir][,tftp-server-name=name][,bootfile=f][,hostfwd=rule][,guestfwd=rule]" 2583ad196a9dSJan Kiszka#ifndef _WIN32 2584c92ef6a2SJan Kiszka "[,smb=dir[,smbserver=addr]]\n" 2585ad196a9dSJan Kiszka#endif 25866a8b4a5bSThomas Huth " configure a user mode network backend with ID 'str',\n" 25876a8b4a5bSThomas Huth " its DHCP server and optional services\n" 25885824d651Sblueswir1#endif 25895824d651Sblueswir1#ifdef _WIN32 25906a8b4a5bSThomas Huth "-netdev tap,id=str,ifname=name\n" 25916a8b4a5bSThomas Huth " configure a host TAP network backend with ID 'str'\n" 25925824d651Sblueswir1#else 25936a8b4a5bSThomas Huth "-netdev tap,id=str[,fd=h][,fds=x:y:...:z][,ifname=name][,script=file][,downscript=dfile]\n" 2594584613eaSAlexey Kardashevskiy " [,br=bridge][,helper=helper][,sndbuf=nbytes][,vnet_hdr=on|off][,vhost=on|off]\n" 25956a8b4a5bSThomas Huth " [,vhostfd=h][,vhostfds=x:y:...:z][,vhostforce=on|off][,queues=n]\n" 259669e87b32SJason Wang " [,poll-us=n]\n" 25976a8b4a5bSThomas Huth " configure a host TAP network backend with ID 'str'\n" 2598584613eaSAlexey Kardashevskiy " connected to a bridge (default=" DEFAULT_BRIDGE_INTERFACE ")\n" 2599a7c36ee4SCorey Bryant " use network scripts 'file' (default=" DEFAULT_NETWORK_SCRIPT ")\n" 2600a7c36ee4SCorey Bryant " to configure it and 'dfile' (default=" DEFAULT_NETWORK_DOWN_SCRIPT ")\n" 2601a7c36ee4SCorey Bryant " to deconfigure it\n" 2602ca1a8a06SBruce Rogers " use '[down]script=no' to disable script execution\n" 2603a7c36ee4SCorey Bryant " use network helper 'helper' (default=" DEFAULT_BRIDGE_HELPER ") to\n" 2604a7c36ee4SCorey Bryant " configure it\n" 26055824d651Sblueswir1 " use 'fd=h' to connect to an already opened TAP interface\n" 26062ca81baaSJason Wang " use 'fds=x:y:...:z' to connect to already opened multiqueue capable TAP interfaces\n" 2607ca1a8a06SBruce Rogers " use 'sndbuf=nbytes' to limit the size of the send buffer (the\n" 2608f157ed20SMichael S. Tsirkin " default is disabled 'sndbuf=0' to enable flow control set 'sndbuf=1048576')\n" 2609ca1a8a06SBruce Rogers " use vnet_hdr=off to avoid enabling the IFF_VNET_HDR tap flag\n" 2610ca1a8a06SBruce Rogers " use vnet_hdr=on to make the lack of IFF_VNET_HDR support an error condition\n" 261182b0d80eSMichael S. Tsirkin " use vhost=on to enable experimental in kernel accelerator\n" 26125430a28fSmst@redhat.com " (only has effect for virtio guests which use MSIX)\n" 26135430a28fSmst@redhat.com " use vhostforce=on to force vhost on for non-MSIX virtio guests\n" 261482b0d80eSMichael S. Tsirkin " use 'vhostfd=h' to connect to an already opened vhost net device\n" 26152ca81baaSJason Wang " use 'vhostfds=x:y:...:z to connect to multiple already opened vhost net devices\n" 2616ec396014SJason Wang " use 'queues=n' to specify the number of queues to be created for multiqueue TAP\n" 2617cba42d61SMichael Tokarev " use 'poll-us=n' to specify the maximum number of microseconds that could be\n" 261869e87b32SJason Wang " spent on busy polling for vhost net\n" 26196a8b4a5bSThomas Huth "-netdev bridge,id=str[,br=bridge][,helper=helper]\n" 26206a8b4a5bSThomas Huth " configure a host TAP network backend with ID 'str' that is\n" 26216a8b4a5bSThomas Huth " connected to a bridge (default=" DEFAULT_BRIDGE_INTERFACE ")\n" 26226a8b4a5bSThomas Huth " using the program 'helper (default=" DEFAULT_BRIDGE_HELPER ")\n" 26230df0ff6dSMark McLoughlin#endif 26243fb69aa1SAnton Ivanov#ifdef __linux__ 26256a8b4a5bSThomas Huth "-netdev l2tpv3,id=str,src=srcaddr,dst=dstaddr[,srcport=srcport][,dstport=dstport]\n" 26268b0dc246SDaniel P. Berrangé " [,rxsession=rxsession],txsession=txsession[,ipv6=on|off][,udp=on|off]\n" 26278b0dc246SDaniel P. Berrangé " [,cookie64=on|off][,counter][,pincounter][,txcookie=txcookie]\n" 26286a8b4a5bSThomas Huth " [,rxcookie=rxcookie][,offset=offset]\n" 26296a8b4a5bSThomas Huth " configure a network backend with ID 'str' connected to\n" 26306a8b4a5bSThomas Huth " an Ethernet over L2TPv3 pseudowire.\n" 26313fb69aa1SAnton Ivanov " Linux kernel 3.3+ as well as most routers can talk\n" 26322f47b403SMichael Tokarev " L2TPv3. This transport allows connecting a VM to a VM,\n" 26333fb69aa1SAnton Ivanov " VM to a router and even VM to Host. It is a nearly-universal\n" 263421843dc4SStefan Hajnoczi " standard (RFC3931). Note - this implementation uses static\n" 26353fb69aa1SAnton Ivanov " pre-configured tunnels (same as the Linux kernel).\n" 26363fb69aa1SAnton Ivanov " use 'src=' to specify source address\n" 26373fb69aa1SAnton Ivanov " use 'dst=' to specify destination address\n" 26383fb69aa1SAnton Ivanov " use 'udp=on' to specify udp encapsulation\n" 26393952651aSGonglei " use 'srcport=' to specify source udp port\n" 26403fb69aa1SAnton Ivanov " use 'dstport=' to specify destination udp port\n" 26413fb69aa1SAnton Ivanov " use 'ipv6=on' to force v6\n" 26423fb69aa1SAnton Ivanov " L2TPv3 uses cookies to prevent misconfiguration as\n" 26433fb69aa1SAnton Ivanov " well as a weak security measure\n" 26443fb69aa1SAnton Ivanov " use 'rxcookie=0x012345678' to specify a rxcookie\n" 26453fb69aa1SAnton Ivanov " use 'txcookie=0x012345678' to specify a txcookie\n" 26463fb69aa1SAnton Ivanov " use 'cookie64=on' to set cookie size to 64 bit, otherwise 32\n" 26473fb69aa1SAnton Ivanov " use 'counter=off' to force a 'cut-down' L2TPv3 with no counter\n" 26483fb69aa1SAnton Ivanov " use 'pincounter=on' to work around broken counter handling in peer\n" 26493fb69aa1SAnton Ivanov " use 'offset=X' to add an extra offset between header and data\n" 26503fb69aa1SAnton Ivanov#endif 26516a8b4a5bSThomas Huth "-netdev socket,id=str[,fd=h][,listen=[host]:port][,connect=host:port]\n" 26526a8b4a5bSThomas Huth " configure a network backend to connect to another network\n" 26536a8b4a5bSThomas Huth " using a socket connection\n" 26546a8b4a5bSThomas Huth "-netdev socket,id=str[,fd=h][,mcast=maddr:port[,localaddr=addr]]\n" 26556a8b4a5bSThomas Huth " configure a network backend to connect to a multicast maddr and port\n" 26563a75e74cSMike Ryan " use 'localaddr=addr' to specify the host address to send packets from\n" 26576a8b4a5bSThomas Huth "-netdev socket,id=str[,fd=h][,udp=host:port][,localaddr=host:port]\n" 26586a8b4a5bSThomas Huth " configure a network backend to connect to another network\n" 26596a8b4a5bSThomas Huth " using an UDP tunnel\n" 26605824d651Sblueswir1#ifdef CONFIG_VDE 26616a8b4a5bSThomas Huth "-netdev vde,id=str[,sock=socketpath][,port=n][,group=groupname][,mode=octalmode]\n" 26626a8b4a5bSThomas Huth " configure a network backend to connect to port 'n' of a vde switch\n" 26636a8b4a5bSThomas Huth " running on host and listening for incoming connections on 'socketpath'.\n" 26645824d651Sblueswir1 " Use group 'groupname' and mode 'octalmode' to change default\n" 26655824d651Sblueswir1 " ownership and permissions for communication port.\n" 26665824d651Sblueswir1#endif 266758952137SVincenzo Maffione#ifdef CONFIG_NETMAP 26686a8b4a5bSThomas Huth "-netdev netmap,id=str,ifname=name[,devname=nmname]\n" 266958952137SVincenzo Maffione " attach to the existing netmap-enabled network interface 'name', or to a\n" 267058952137SVincenzo Maffione " VALE port (created on the fly) called 'name' ('nmname' is name of the \n" 267158952137SVincenzo Maffione " netmap device, defaults to '/dev/netmap')\n" 267258952137SVincenzo Maffione#endif 2673253dc14cSThomas Huth#ifdef CONFIG_POSIX 26746a8b4a5bSThomas Huth "-netdev vhost-user,id=str,chardev=dev[,vhostforce=on|off]\n" 26756a8b4a5bSThomas Huth " configure a vhost-user network, backed by a chardev 'dev'\n" 2676253dc14cSThomas Huth#endif 2677108a6481SCindy Lu#ifdef __linux__ 2678108a6481SCindy Lu "-netdev vhost-vdpa,id=str,vhostdev=/path/to/dev\n" 2679108a6481SCindy Lu " configure a vhost-vdpa network,Establish a vhost-vdpa netdev\n" 2680108a6481SCindy Lu#endif 268118d65d22SThomas Huth "-netdev hubport,id=str,hubid=n[,netdev=nd]\n" 2682af1a5c3eSThomas Huth " configure a hub port on the hub with ID 'n'\n", QEMU_ARCH_ALL) 268378cd6f7bSThomas HuthDEF("nic", HAS_ARG, QEMU_OPTION_nic, 2684dfaa7d50SBALATON Zoltan "-nic [tap|bridge|" 268578cd6f7bSThomas Huth#ifdef CONFIG_SLIRP 268678cd6f7bSThomas Huth "user|" 268778cd6f7bSThomas Huth#endif 268878cd6f7bSThomas Huth#ifdef __linux__ 268978cd6f7bSThomas Huth "l2tpv3|" 269078cd6f7bSThomas Huth#endif 269178cd6f7bSThomas Huth#ifdef CONFIG_VDE 269278cd6f7bSThomas Huth "vde|" 269378cd6f7bSThomas Huth#endif 269478cd6f7bSThomas Huth#ifdef CONFIG_NETMAP 269578cd6f7bSThomas Huth "netmap|" 269678cd6f7bSThomas Huth#endif 269778cd6f7bSThomas Huth#ifdef CONFIG_POSIX 269878cd6f7bSThomas Huth "vhost-user|" 269978cd6f7bSThomas Huth#endif 270078cd6f7bSThomas Huth "socket][,option][,...][mac=macaddr]\n" 270178cd6f7bSThomas Huth " initialize an on-board / default host NIC (using MAC address\n" 270278cd6f7bSThomas Huth " macaddr) and connect it to the given host network backend\n" 2703dfaa7d50SBALATON Zoltan "-nic none use it alone to have zero network devices (the default is to\n" 270478cd6f7bSThomas Huth " provided a 'user' network connection)\n", 270578cd6f7bSThomas Huth QEMU_ARCH_ALL) 27066a8b4a5bSThomas HuthDEF("net", HAS_ARG, QEMU_OPTION_net, 2707af1a5c3eSThomas Huth "-net nic[,macaddr=mac][,model=type][,name=str][,addr=str][,vectors=v]\n" 27080e60a82dSThomas Huth " configure or create an on-board (or machine default) NIC and\n" 2709af1a5c3eSThomas Huth " connect it to hub 0 (please use -nic unless you need a hub)\n" 27106a8b4a5bSThomas Huth "-net [" 2711a1ea458fSMark McLoughlin#ifdef CONFIG_SLIRP 2712a1ea458fSMark McLoughlin "user|" 2713a1ea458fSMark McLoughlin#endif 2714a1ea458fSMark McLoughlin "tap|" 2715a7c36ee4SCorey Bryant "bridge|" 2716a1ea458fSMark McLoughlin#ifdef CONFIG_VDE 2717a1ea458fSMark McLoughlin "vde|" 2718a1ea458fSMark McLoughlin#endif 271958952137SVincenzo Maffione#ifdef CONFIG_NETMAP 272058952137SVincenzo Maffione "netmap|" 272158952137SVincenzo Maffione#endif 2722af1a5c3eSThomas Huth "socket][,option][,option][,...]\n" 27236a8b4a5bSThomas Huth " old way to initialize a host network interface\n" 27246a8b4a5bSThomas Huth " (use the -netdev option if possible instead)\n", QEMU_ARCH_ALL) 2725e2fcbf42SPeter MaydellSRST 2726e2fcbf42SPeter Maydell``-nic [tap|bridge|user|l2tpv3|vde|netmap|vhost-user|socket][,...][,mac=macaddr][,model=mn]`` 2727e2fcbf42SPeter Maydell This option is a shortcut for configuring both the on-board 2728e2fcbf42SPeter Maydell (default) guest NIC hardware and the host network backend in one go. 2729e2fcbf42SPeter Maydell The host backend options are the same as with the corresponding 2730e2fcbf42SPeter Maydell ``-netdev`` options below. The guest NIC model can be set with 2731e2fcbf42SPeter Maydell ``model=modelname``. Use ``model=help`` to list the available device 2732e2fcbf42SPeter Maydell types. The hardware MAC address can be set with ``mac=macaddr``. 2733e2fcbf42SPeter Maydell 2734e2fcbf42SPeter Maydell The following two example do exactly the same, to show how ``-nic`` 2735e2fcbf42SPeter Maydell can be used to shorten the command line length: 2736e2fcbf42SPeter Maydell 2737e2fcbf42SPeter Maydell .. parsed-literal:: 2738e2fcbf42SPeter Maydell 2739e2fcbf42SPeter Maydell |qemu_system| -netdev user,id=n1,ipv6=off -device e1000,netdev=n1,mac=52:54:98:76:54:32 2740e2fcbf42SPeter Maydell |qemu_system| -nic user,ipv6=off,model=e1000,mac=52:54:98:76:54:32 2741e2fcbf42SPeter Maydell 2742e2fcbf42SPeter Maydell``-nic none`` 2743e2fcbf42SPeter Maydell Indicate that no network devices should be configured. It is used to 2744e2fcbf42SPeter Maydell override the default configuration (default NIC with "user" host 2745e2fcbf42SPeter Maydell network backend) which is activated if no other networking options 2746e2fcbf42SPeter Maydell are provided. 2747e2fcbf42SPeter Maydell 2748e2fcbf42SPeter Maydell``-netdev user,id=id[,option][,option][,...]`` 2749e2fcbf42SPeter Maydell Configure user mode host network backend which requires no 2750e2fcbf42SPeter Maydell administrator privilege to run. Valid options are: 2751e2fcbf42SPeter Maydell 2752e2fcbf42SPeter Maydell ``id=id`` 2753e2fcbf42SPeter Maydell Assign symbolic name for use in monitor commands. 2754e2fcbf42SPeter Maydell 2755e2fcbf42SPeter Maydell ``ipv4=on|off and ipv6=on|off`` 2756e2fcbf42SPeter Maydell Specify that either IPv4 or IPv6 must be enabled. If neither is 2757e2fcbf42SPeter Maydell specified both protocols are enabled. 2758e2fcbf42SPeter Maydell 2759e2fcbf42SPeter Maydell ``net=addr[/mask]`` 2760e2fcbf42SPeter Maydell Set IP network address the guest will see. Optionally specify 2761e2fcbf42SPeter Maydell the netmask, either in the form a.b.c.d or as number of valid 2762e2fcbf42SPeter Maydell top-most bits. Default is 10.0.2.0/24. 2763e2fcbf42SPeter Maydell 2764e2fcbf42SPeter Maydell ``host=addr`` 2765e2fcbf42SPeter Maydell Specify the guest-visible address of the host. Default is the 2766e2fcbf42SPeter Maydell 2nd IP in the guest network, i.e. x.x.x.2. 2767e2fcbf42SPeter Maydell 2768e2fcbf42SPeter Maydell ``ipv6-net=addr[/int]`` 2769e2fcbf42SPeter Maydell Set IPv6 network address the guest will see (default is 2770e2fcbf42SPeter Maydell fec0::/64). The network prefix is given in the usual hexadecimal 2771e2fcbf42SPeter Maydell IPv6 address notation. The prefix size is optional, and is given 2772e2fcbf42SPeter Maydell as the number of valid top-most bits (default is 64). 2773e2fcbf42SPeter Maydell 2774e2fcbf42SPeter Maydell ``ipv6-host=addr`` 2775e2fcbf42SPeter Maydell Specify the guest-visible IPv6 address of the host. Default is 2776e2fcbf42SPeter Maydell the 2nd IPv6 in the guest network, i.e. xxxx::2. 2777e2fcbf42SPeter Maydell 2778e2fcbf42SPeter Maydell ``restrict=on|off`` 2779e2fcbf42SPeter Maydell If this option is enabled, the guest will be isolated, i.e. it 2780e2fcbf42SPeter Maydell will not be able to contact the host and no guest IP packets 2781e2fcbf42SPeter Maydell will be routed over the host to the outside. This option does 2782e2fcbf42SPeter Maydell not affect any explicitly set forwarding rules. 2783e2fcbf42SPeter Maydell 2784e2fcbf42SPeter Maydell ``hostname=name`` 2785e2fcbf42SPeter Maydell Specifies the client hostname reported by the built-in DHCP 2786e2fcbf42SPeter Maydell server. 2787e2fcbf42SPeter Maydell 2788e2fcbf42SPeter Maydell ``dhcpstart=addr`` 2789e2fcbf42SPeter Maydell Specify the first of the 16 IPs the built-in DHCP server can 2790e2fcbf42SPeter Maydell assign. Default is the 15th to 31st IP in the guest network, 2791e2fcbf42SPeter Maydell i.e. x.x.x.15 to x.x.x.31. 2792e2fcbf42SPeter Maydell 2793e2fcbf42SPeter Maydell ``dns=addr`` 2794e2fcbf42SPeter Maydell Specify the guest-visible address of the virtual nameserver. The 2795e2fcbf42SPeter Maydell address must be different from the host address. Default is the 2796e2fcbf42SPeter Maydell 3rd IP in the guest network, i.e. x.x.x.3. 2797e2fcbf42SPeter Maydell 2798e2fcbf42SPeter Maydell ``ipv6-dns=addr`` 2799e2fcbf42SPeter Maydell Specify the guest-visible address of the IPv6 virtual 2800e2fcbf42SPeter Maydell nameserver. The address must be different from the host address. 2801e2fcbf42SPeter Maydell Default is the 3rd IP in the guest network, i.e. xxxx::3. 2802e2fcbf42SPeter Maydell 2803e2fcbf42SPeter Maydell ``dnssearch=domain`` 2804e2fcbf42SPeter Maydell Provides an entry for the domain-search list sent by the 2805e2fcbf42SPeter Maydell built-in DHCP server. More than one domain suffix can be 2806e2fcbf42SPeter Maydell transmitted by specifying this option multiple times. If 2807e2fcbf42SPeter Maydell supported, this will cause the guest to automatically try to 2808e2fcbf42SPeter Maydell append the given domain suffix(es) in case a domain name can not 2809e2fcbf42SPeter Maydell be resolved. 2810e2fcbf42SPeter Maydell 2811e2fcbf42SPeter Maydell Example: 2812e2fcbf42SPeter Maydell 2813e2fcbf42SPeter Maydell .. parsed-literal:: 2814e2fcbf42SPeter Maydell 2815e2fcbf42SPeter Maydell |qemu_system| -nic user,dnssearch=mgmt.example.org,dnssearch=example.org 2816e2fcbf42SPeter Maydell 2817e2fcbf42SPeter Maydell ``domainname=domain`` 2818e2fcbf42SPeter Maydell Specifies the client domain name reported by the built-in DHCP 2819e2fcbf42SPeter Maydell server. 2820e2fcbf42SPeter Maydell 2821e2fcbf42SPeter Maydell ``tftp=dir`` 2822e2fcbf42SPeter Maydell When using the user mode network stack, activate a built-in TFTP 2823e2fcbf42SPeter Maydell server. The files in dir will be exposed as the root of a TFTP 2824e2fcbf42SPeter Maydell server. The TFTP client on the guest must be configured in 2825e2fcbf42SPeter Maydell binary mode (use the command ``bin`` of the Unix TFTP client). 2826e2fcbf42SPeter Maydell 2827e2fcbf42SPeter Maydell ``tftp-server-name=name`` 2828e2fcbf42SPeter Maydell In BOOTP reply, broadcast name as the "TFTP server name" 2829e2fcbf42SPeter Maydell (RFC2132 option 66). This can be used to advise the guest to 2830e2fcbf42SPeter Maydell load boot files or configurations from a different server than 2831e2fcbf42SPeter Maydell the host address. 2832e2fcbf42SPeter Maydell 2833e2fcbf42SPeter Maydell ``bootfile=file`` 2834e2fcbf42SPeter Maydell When using the user mode network stack, broadcast file as the 2835e2fcbf42SPeter Maydell BOOTP filename. In conjunction with ``tftp``, this can be used 2836e2fcbf42SPeter Maydell to network boot a guest from a local directory. 2837e2fcbf42SPeter Maydell 2838e2fcbf42SPeter Maydell Example (using pxelinux): 2839e2fcbf42SPeter Maydell 2840e2fcbf42SPeter Maydell .. parsed-literal:: 2841e2fcbf42SPeter Maydell 2842353a06b4SLaszlo Ersek |qemu_system| -hda linux.img -boot n -device e1000,netdev=n1 \\ 2843e2fcbf42SPeter Maydell -netdev user,id=n1,tftp=/path/to/tftp/files,bootfile=/pxelinux.0 2844e2fcbf42SPeter Maydell 2845e2fcbf42SPeter Maydell ``smb=dir[,smbserver=addr]`` 2846e2fcbf42SPeter Maydell When using the user mode network stack, activate a built-in SMB 2847e2fcbf42SPeter Maydell server so that Windows OSes can access to the host files in 2848e2fcbf42SPeter Maydell ``dir`` transparently. The IP address of the SMB server can be 2849e2fcbf42SPeter Maydell set to addr. By default the 4th IP in the guest network is used, 2850e2fcbf42SPeter Maydell i.e. x.x.x.4. 2851e2fcbf42SPeter Maydell 2852e2fcbf42SPeter Maydell In the guest Windows OS, the line: 2853e2fcbf42SPeter Maydell 2854e2fcbf42SPeter Maydell :: 2855e2fcbf42SPeter Maydell 2856e2fcbf42SPeter Maydell 10.0.2.4 smbserver 2857e2fcbf42SPeter Maydell 2858e2fcbf42SPeter Maydell must be added in the file ``C:\WINDOWS\LMHOSTS`` (for windows 2859e2fcbf42SPeter Maydell 9x/Me) or ``C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS`` (Windows 2860e2fcbf42SPeter Maydell NT/2000). 2861e2fcbf42SPeter Maydell 2862e2fcbf42SPeter Maydell Then ``dir`` can be accessed in ``\\smbserver\qemu``. 2863e2fcbf42SPeter Maydell 2864e2fcbf42SPeter Maydell Note that a SAMBA server must be installed on the host OS. 2865e2fcbf42SPeter Maydell 2866e2fcbf42SPeter Maydell ``hostfwd=[tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport`` 2867e2fcbf42SPeter Maydell Redirect incoming TCP or UDP connections to the host port 2868e2fcbf42SPeter Maydell hostport to the guest IP address guestaddr on guest port 2869e2fcbf42SPeter Maydell guestport. If guestaddr is not specified, its value is x.x.x.15 2870e2fcbf42SPeter Maydell (default first address given by the built-in DHCP server). By 2871e2fcbf42SPeter Maydell specifying hostaddr, the rule can be bound to a specific host 2872e2fcbf42SPeter Maydell interface. If no connection type is set, TCP is used. This 2873e2fcbf42SPeter Maydell option can be given multiple times. 2874e2fcbf42SPeter Maydell 2875e2fcbf42SPeter Maydell For example, to redirect host X11 connection from screen 1 to 2876e2fcbf42SPeter Maydell guest screen 0, use the following: 2877e2fcbf42SPeter Maydell 287809ce5f2dSPeter Maydell .. parsed-literal:: 2879e2fcbf42SPeter Maydell 2880e2fcbf42SPeter Maydell # on the host 2881e2fcbf42SPeter Maydell |qemu_system| -nic user,hostfwd=tcp:127.0.0.1:6001-:6000 2882e2fcbf42SPeter Maydell # this host xterm should open in the guest X11 server 2883e2fcbf42SPeter Maydell xterm -display :1 2884e2fcbf42SPeter Maydell 2885e2fcbf42SPeter Maydell To redirect telnet connections from host port 5555 to telnet 2886e2fcbf42SPeter Maydell port on the guest, use the following: 2887e2fcbf42SPeter Maydell 288809ce5f2dSPeter Maydell .. parsed-literal:: 2889e2fcbf42SPeter Maydell 2890e2fcbf42SPeter Maydell # on the host 2891e2fcbf42SPeter Maydell |qemu_system| -nic user,hostfwd=tcp::5555-:23 2892e2fcbf42SPeter Maydell telnet localhost 5555 2893e2fcbf42SPeter Maydell 2894e2fcbf42SPeter Maydell Then when you use on the host ``telnet localhost 5555``, you 2895e2fcbf42SPeter Maydell connect to the guest telnet server. 2896e2fcbf42SPeter Maydell 2897e2fcbf42SPeter Maydell ``guestfwd=[tcp]:server:port-dev``; \ ``guestfwd=[tcp]:server:port-cmd:command`` 2898e2fcbf42SPeter Maydell Forward guest TCP connections to the IP address server on port 2899e2fcbf42SPeter Maydell port to the character device dev or to a program executed by 2900e2fcbf42SPeter Maydell cmd:command which gets spawned for each connection. This option 2901e2fcbf42SPeter Maydell can be given multiple times. 2902e2fcbf42SPeter Maydell 2903e2fcbf42SPeter Maydell You can either use a chardev directly and have that one used 2904e2fcbf42SPeter Maydell throughout QEMU's lifetime, like in the following example: 2905e2fcbf42SPeter Maydell 290609ce5f2dSPeter Maydell .. parsed-literal:: 2907e2fcbf42SPeter Maydell 2908e2fcbf42SPeter Maydell # open 10.10.1.1:4321 on bootup, connect 10.0.2.100:1234 to it whenever 2909e2fcbf42SPeter Maydell # the guest accesses it 2910e2fcbf42SPeter Maydell |qemu_system| -nic user,guestfwd=tcp:10.0.2.100:1234-tcp:10.10.1.1:4321 2911e2fcbf42SPeter Maydell 2912e2fcbf42SPeter Maydell Or you can execute a command on every TCP connection established 2913e2fcbf42SPeter Maydell by the guest, so that QEMU behaves similar to an inetd process 2914e2fcbf42SPeter Maydell for that virtual server: 2915e2fcbf42SPeter Maydell 291609ce5f2dSPeter Maydell .. parsed-literal:: 2917e2fcbf42SPeter Maydell 2918e2fcbf42SPeter Maydell # call "netcat 10.10.1.1 4321" on every TCP connection to 10.0.2.100:1234 2919e2fcbf42SPeter Maydell # and connect the TCP stream to its stdin/stdout 2920e2fcbf42SPeter Maydell |qemu_system| -nic 'user,id=n1,guestfwd=tcp:10.0.2.100:1234-cmd:netcat 10.10.1.1 4321' 2921e2fcbf42SPeter Maydell 2922e2fcbf42SPeter Maydell``-netdev tap,id=id[,fd=h][,ifname=name][,script=file][,downscript=dfile][,br=bridge][,helper=helper]`` 2923e2fcbf42SPeter Maydell Configure a host TAP network backend with ID id. 2924e2fcbf42SPeter Maydell 2925e2fcbf42SPeter Maydell Use the network script file to configure it and the network script 2926e2fcbf42SPeter Maydell dfile to deconfigure it. If name is not provided, the OS 2927e2fcbf42SPeter Maydell automatically provides one. The default network configure script is 2928e2fcbf42SPeter Maydell ``/etc/qemu-ifup`` and the default network deconfigure script is 2929e2fcbf42SPeter Maydell ``/etc/qemu-ifdown``. Use ``script=no`` or ``downscript=no`` to 2930e2fcbf42SPeter Maydell disable script execution. 2931e2fcbf42SPeter Maydell 2932e2fcbf42SPeter Maydell If running QEMU as an unprivileged user, use the network helper 29338d73ec89STianjia Zhang to configure the TAP interface and attach it to the bridge. 2934e2fcbf42SPeter Maydell The default network helper executable is 2935e2fcbf42SPeter Maydell ``/path/to/qemu-bridge-helper`` and the default bridge device is 2936e2fcbf42SPeter Maydell ``br0``. 2937e2fcbf42SPeter Maydell 2938e2fcbf42SPeter Maydell ``fd``\ =h can be used to specify the handle of an already opened 2939e2fcbf42SPeter Maydell host TAP interface. 2940e2fcbf42SPeter Maydell 2941e2fcbf42SPeter Maydell Examples: 2942e2fcbf42SPeter Maydell 294309ce5f2dSPeter Maydell .. parsed-literal:: 2944e2fcbf42SPeter Maydell 2945e2fcbf42SPeter Maydell #launch a QEMU instance with the default network script 2946e2fcbf42SPeter Maydell |qemu_system| linux.img -nic tap 2947e2fcbf42SPeter Maydell 294809ce5f2dSPeter Maydell .. parsed-literal:: 2949e2fcbf42SPeter Maydell 2950e2fcbf42SPeter Maydell #launch a QEMU instance with two NICs, each one connected 2951e2fcbf42SPeter Maydell #to a TAP device 2952353a06b4SLaszlo Ersek |qemu_system| linux.img \\ 2953353a06b4SLaszlo Ersek -netdev tap,id=nd0,ifname=tap0 -device e1000,netdev=nd0 \\ 2954e2fcbf42SPeter Maydell -netdev tap,id=nd1,ifname=tap1 -device rtl8139,netdev=nd1 2955e2fcbf42SPeter Maydell 295609ce5f2dSPeter Maydell .. parsed-literal:: 2957e2fcbf42SPeter Maydell 2958e2fcbf42SPeter Maydell #launch a QEMU instance with the default network helper to 2959e2fcbf42SPeter Maydell #connect a TAP device to bridge br0 2960353a06b4SLaszlo Ersek |qemu_system| linux.img -device virtio-net-pci,netdev=n1 \\ 2961e2fcbf42SPeter Maydell -netdev tap,id=n1,"helper=/path/to/qemu-bridge-helper" 2962e2fcbf42SPeter Maydell 2963e2fcbf42SPeter Maydell``-netdev bridge,id=id[,br=bridge][,helper=helper]`` 2964e2fcbf42SPeter Maydell Connect a host TAP network interface to a host bridge device. 2965e2fcbf42SPeter Maydell 2966e2fcbf42SPeter Maydell Use the network helper helper to configure the TAP interface and 2967e2fcbf42SPeter Maydell attach it to the bridge. The default network helper executable is 2968e2fcbf42SPeter Maydell ``/path/to/qemu-bridge-helper`` and the default bridge device is 2969e2fcbf42SPeter Maydell ``br0``. 2970e2fcbf42SPeter Maydell 2971e2fcbf42SPeter Maydell Examples: 2972e2fcbf42SPeter Maydell 297309ce5f2dSPeter Maydell .. parsed-literal:: 2974e2fcbf42SPeter Maydell 2975e2fcbf42SPeter Maydell #launch a QEMU instance with the default network helper to 2976e2fcbf42SPeter Maydell #connect a TAP device to bridge br0 2977e2fcbf42SPeter Maydell |qemu_system| linux.img -netdev bridge,id=n1 -device virtio-net,netdev=n1 2978e2fcbf42SPeter Maydell 297909ce5f2dSPeter Maydell .. parsed-literal:: 2980e2fcbf42SPeter Maydell 2981e2fcbf42SPeter Maydell #launch a QEMU instance with the default network helper to 2982e2fcbf42SPeter Maydell #connect a TAP device to bridge qemubr0 2983e2fcbf42SPeter Maydell |qemu_system| linux.img -netdev bridge,br=qemubr0,id=n1 -device virtio-net,netdev=n1 2984e2fcbf42SPeter Maydell 2985e2fcbf42SPeter Maydell``-netdev socket,id=id[,fd=h][,listen=[host]:port][,connect=host:port]`` 2986e2fcbf42SPeter Maydell This host network backend can be used to connect the guest's network 2987e2fcbf42SPeter Maydell to another QEMU virtual machine using a TCP socket connection. If 2988e2fcbf42SPeter Maydell ``listen`` is specified, QEMU waits for incoming connections on port 2989e2fcbf42SPeter Maydell (host is optional). ``connect`` is used to connect to another QEMU 2990e2fcbf42SPeter Maydell instance using the ``listen`` option. ``fd``\ =h specifies an 2991e2fcbf42SPeter Maydell already opened TCP socket. 2992e2fcbf42SPeter Maydell 2993e2fcbf42SPeter Maydell Example: 2994e2fcbf42SPeter Maydell 299509ce5f2dSPeter Maydell .. parsed-literal:: 2996e2fcbf42SPeter Maydell 2997e2fcbf42SPeter Maydell # launch a first QEMU instance 2998353a06b4SLaszlo Ersek |qemu_system| linux.img \\ 2999353a06b4SLaszlo Ersek -device e1000,netdev=n1,mac=52:54:00:12:34:56 \\ 3000e2fcbf42SPeter Maydell -netdev socket,id=n1,listen=:1234 3001e2fcbf42SPeter Maydell # connect the network of this instance to the network of the first instance 3002353a06b4SLaszlo Ersek |qemu_system| linux.img \\ 3003353a06b4SLaszlo Ersek -device e1000,netdev=n2,mac=52:54:00:12:34:57 \\ 3004e2fcbf42SPeter Maydell -netdev socket,id=n2,connect=127.0.0.1:1234 3005e2fcbf42SPeter Maydell 3006e2fcbf42SPeter Maydell``-netdev socket,id=id[,fd=h][,mcast=maddr:port[,localaddr=addr]]`` 3007e2fcbf42SPeter Maydell Configure a socket host network backend to share the guest's network 3008e2fcbf42SPeter Maydell traffic with another QEMU virtual machines using a UDP multicast 3009e2fcbf42SPeter Maydell socket, effectively making a bus for every QEMU with same multicast 3010e2fcbf42SPeter Maydell address maddr and port. NOTES: 3011e2fcbf42SPeter Maydell 3012e2fcbf42SPeter Maydell 1. Several QEMU can be running on different hosts and share same bus 3013e2fcbf42SPeter Maydell (assuming correct multicast setup for these hosts). 3014e2fcbf42SPeter Maydell 3015e2fcbf42SPeter Maydell 2. mcast support is compatible with User Mode Linux (argument 3016e2fcbf42SPeter Maydell ``ethN=mcast``), see http://user-mode-linux.sf.net. 3017e2fcbf42SPeter Maydell 3018e2fcbf42SPeter Maydell 3. Use ``fd=h`` to specify an already opened UDP multicast socket. 3019e2fcbf42SPeter Maydell 3020e2fcbf42SPeter Maydell Example: 3021e2fcbf42SPeter Maydell 302209ce5f2dSPeter Maydell .. parsed-literal:: 3023e2fcbf42SPeter Maydell 3024e2fcbf42SPeter Maydell # launch one QEMU instance 3025353a06b4SLaszlo Ersek |qemu_system| linux.img \\ 3026353a06b4SLaszlo Ersek -device e1000,netdev=n1,mac=52:54:00:12:34:56 \\ 3027e2fcbf42SPeter Maydell -netdev socket,id=n1,mcast=230.0.0.1:1234 3028e2fcbf42SPeter Maydell # launch another QEMU instance on same "bus" 3029353a06b4SLaszlo Ersek |qemu_system| linux.img \\ 3030353a06b4SLaszlo Ersek -device e1000,netdev=n2,mac=52:54:00:12:34:57 \\ 3031e2fcbf42SPeter Maydell -netdev socket,id=n2,mcast=230.0.0.1:1234 3032e2fcbf42SPeter Maydell # launch yet another QEMU instance on same "bus" 3033353a06b4SLaszlo Ersek |qemu_system| linux.img \\ 3034353a06b4SLaszlo Ersek -device e1000,netdev=n3,mac=52:54:00:12:34:58 \\ 3035e2fcbf42SPeter Maydell -netdev socket,id=n3,mcast=230.0.0.1:1234 3036e2fcbf42SPeter Maydell 3037e2fcbf42SPeter Maydell Example (User Mode Linux compat.): 3038e2fcbf42SPeter Maydell 303909ce5f2dSPeter Maydell .. parsed-literal:: 3040e2fcbf42SPeter Maydell 3041e2fcbf42SPeter Maydell # launch QEMU instance (note mcast address selected is UML's default) 3042353a06b4SLaszlo Ersek |qemu_system| linux.img \\ 3043353a06b4SLaszlo Ersek -device e1000,netdev=n1,mac=52:54:00:12:34:56 \\ 3044e2fcbf42SPeter Maydell -netdev socket,id=n1,mcast=239.192.168.1:1102 3045e2fcbf42SPeter Maydell # launch UML 3046e2fcbf42SPeter Maydell /path/to/linux ubd0=/path/to/root_fs eth0=mcast 3047e2fcbf42SPeter Maydell 3048e2fcbf42SPeter Maydell Example (send packets from host's 1.2.3.4): 3049e2fcbf42SPeter Maydell 3050e2fcbf42SPeter Maydell .. parsed-literal:: 3051e2fcbf42SPeter Maydell 3052353a06b4SLaszlo Ersek |qemu_system| linux.img \\ 3053353a06b4SLaszlo Ersek -device e1000,netdev=n1,mac=52:54:00:12:34:56 \\ 3054e2fcbf42SPeter Maydell -netdev socket,id=n1,mcast=239.192.168.1:1102,localaddr=1.2.3.4 3055e2fcbf42SPeter Maydell 30568b0dc246SDaniel P. Berrangé``-netdev l2tpv3,id=id,src=srcaddr,dst=dstaddr[,srcport=srcport][,dstport=dstport],txsession=txsession[,rxsession=rxsession][,ipv6=on|off][,udp=on|off][,cookie64][,counter][,pincounter][,txcookie=txcookie][,rxcookie=rxcookie][,offset=offset]`` 3057e2fcbf42SPeter Maydell Configure a L2TPv3 pseudowire host network backend. L2TPv3 (RFC3931) 3058e2fcbf42SPeter Maydell is a popular protocol to transport Ethernet (and other Layer 2) data 3059e2fcbf42SPeter Maydell frames between two systems. It is present in routers, firewalls and 3060e2fcbf42SPeter Maydell the Linux kernel (from version 3.3 onwards). 3061e2fcbf42SPeter Maydell 3062e2fcbf42SPeter Maydell This transport allows a VM to communicate to another VM, router or 3063e2fcbf42SPeter Maydell firewall directly. 3064e2fcbf42SPeter Maydell 3065e2fcbf42SPeter Maydell ``src=srcaddr`` 3066e2fcbf42SPeter Maydell source address (mandatory) 3067e2fcbf42SPeter Maydell 3068e2fcbf42SPeter Maydell ``dst=dstaddr`` 3069e2fcbf42SPeter Maydell destination address (mandatory) 3070e2fcbf42SPeter Maydell 3071e2fcbf42SPeter Maydell ``udp`` 3072e2fcbf42SPeter Maydell select udp encapsulation (default is ip). 3073e2fcbf42SPeter Maydell 3074e2fcbf42SPeter Maydell ``srcport=srcport`` 3075e2fcbf42SPeter Maydell source udp port. 3076e2fcbf42SPeter Maydell 3077e2fcbf42SPeter Maydell ``dstport=dstport`` 3078e2fcbf42SPeter Maydell destination udp port. 3079e2fcbf42SPeter Maydell 3080e2fcbf42SPeter Maydell ``ipv6`` 3081e2fcbf42SPeter Maydell force v6, otherwise defaults to v4. 3082e2fcbf42SPeter Maydell 3083e2fcbf42SPeter Maydell ``rxcookie=rxcookie``; \ ``txcookie=txcookie`` 3084e2fcbf42SPeter Maydell Cookies are a weak form of security in the l2tpv3 specification. 3085e2fcbf42SPeter Maydell Their function is mostly to prevent misconfiguration. By default 3086e2fcbf42SPeter Maydell they are 32 bit. 3087e2fcbf42SPeter Maydell 3088e2fcbf42SPeter Maydell ``cookie64`` 3089e2fcbf42SPeter Maydell Set cookie size to 64 bit instead of the default 32 3090e2fcbf42SPeter Maydell 3091e2fcbf42SPeter Maydell ``counter=off`` 3092e2fcbf42SPeter Maydell Force a 'cut-down' L2TPv3 with no counter as in 3093e2fcbf42SPeter Maydell draft-mkonstan-l2tpext-keyed-ipv6-tunnel-00 3094e2fcbf42SPeter Maydell 3095e2fcbf42SPeter Maydell ``pincounter=on`` 3096e2fcbf42SPeter Maydell Work around broken counter handling in peer. This may also help 3097e2fcbf42SPeter Maydell on networks which have packet reorder. 3098e2fcbf42SPeter Maydell 3099e2fcbf42SPeter Maydell ``offset=offset`` 3100e2fcbf42SPeter Maydell Add an extra offset between header and data 3101e2fcbf42SPeter Maydell 3102e2fcbf42SPeter Maydell For example, to attach a VM running on host 4.3.2.1 via L2TPv3 to 3103e2fcbf42SPeter Maydell the bridge br-lan on the remote Linux host 1.2.3.4: 3104e2fcbf42SPeter Maydell 310509ce5f2dSPeter Maydell .. parsed-literal:: 3106e2fcbf42SPeter Maydell 3107e2fcbf42SPeter Maydell # Setup tunnel on linux host using raw ip as encapsulation 3108e2fcbf42SPeter Maydell # on 1.2.3.4 3109353a06b4SLaszlo Ersek ip l2tp add tunnel remote 4.3.2.1 local 1.2.3.4 tunnel_id 1 peer_tunnel_id 1 \\ 3110e2fcbf42SPeter Maydell encap udp udp_sport 16384 udp_dport 16384 3111353a06b4SLaszlo Ersek ip l2tp add session tunnel_id 1 name vmtunnel0 session_id \\ 3112e2fcbf42SPeter Maydell 0xFFFFFFFF peer_session_id 0xFFFFFFFF 3113e2fcbf42SPeter Maydell ifconfig vmtunnel0 mtu 1500 3114e2fcbf42SPeter Maydell ifconfig vmtunnel0 up 3115e2fcbf42SPeter Maydell brctl addif br-lan vmtunnel0 3116e2fcbf42SPeter Maydell 3117e2fcbf42SPeter Maydell 3118e2fcbf42SPeter Maydell # on 4.3.2.1 3119e2fcbf42SPeter Maydell # launch QEMU instance - if your network has reorder or is very lossy add ,pincounter 3120e2fcbf42SPeter Maydell 3121353a06b4SLaszlo Ersek |qemu_system| linux.img -device e1000,netdev=n1 \\ 3122e2fcbf42SPeter Maydell -netdev l2tpv3,id=n1,src=4.2.3.1,dst=1.2.3.4,udp,srcport=16384,dstport=16384,rxsession=0xffffffff,txsession=0xffffffff,counter 3123e2fcbf42SPeter Maydell 3124e2fcbf42SPeter Maydell``-netdev vde,id=id[,sock=socketpath][,port=n][,group=groupname][,mode=octalmode]`` 3125e2fcbf42SPeter Maydell Configure VDE backend to connect to PORT n of a vde switch running 3126e2fcbf42SPeter Maydell on host and listening for incoming connections on socketpath. Use 3127e2fcbf42SPeter Maydell GROUP groupname and MODE octalmode to change default ownership and 3128e2fcbf42SPeter Maydell permissions for communication port. This option is only available if 3129e2fcbf42SPeter Maydell QEMU has been compiled with vde support enabled. 3130e2fcbf42SPeter Maydell 3131e2fcbf42SPeter Maydell Example: 3132e2fcbf42SPeter Maydell 313309ce5f2dSPeter Maydell .. parsed-literal:: 3134e2fcbf42SPeter Maydell 3135e2fcbf42SPeter Maydell # launch vde switch 3136e2fcbf42SPeter Maydell vde_switch -F -sock /tmp/myswitch 3137e2fcbf42SPeter Maydell # launch QEMU instance 3138e2fcbf42SPeter Maydell |qemu_system| linux.img -nic vde,sock=/tmp/myswitch 3139e2fcbf42SPeter Maydell 3140e2fcbf42SPeter Maydell``-netdev vhost-user,chardev=id[,vhostforce=on|off][,queues=n]`` 3141e2fcbf42SPeter Maydell Establish a vhost-user netdev, backed by a chardev id. The chardev 3142e2fcbf42SPeter Maydell should be a unix domain socket backed one. The vhost-user uses a 3143e2fcbf42SPeter Maydell specifically defined protocol to pass vhost ioctl replacement 3144e2fcbf42SPeter Maydell messages to an application on the other end of the socket. On 3145e2fcbf42SPeter Maydell non-MSIX guests, the feature can be forced with vhostforce. Use 3146e2fcbf42SPeter Maydell 'queues=n' to specify the number of queues to be created for 3147e2fcbf42SPeter Maydell multiqueue vhost-user. 3148e2fcbf42SPeter Maydell 3149e2fcbf42SPeter Maydell Example: 3150e2fcbf42SPeter Maydell 3151e2fcbf42SPeter Maydell :: 3152e2fcbf42SPeter Maydell 3153e2fcbf42SPeter Maydell qemu -m 512 -object memory-backend-file,id=mem,size=512M,mem-path=/hugetlbfs,share=on \ 3154e2fcbf42SPeter Maydell -numa node,memdev=mem \ 3155e2fcbf42SPeter Maydell -chardev socket,id=chr0,path=/path/to/socket \ 3156e2fcbf42SPeter Maydell -netdev type=vhost-user,id=net0,chardev=chr0 \ 3157e2fcbf42SPeter Maydell -device virtio-net-pci,netdev=net0 3158e2fcbf42SPeter Maydell 3159108a6481SCindy Lu``-netdev vhost-vdpa,vhostdev=/path/to/dev`` 3160108a6481SCindy Lu Establish a vhost-vdpa netdev. 3161108a6481SCindy Lu 3162108a6481SCindy Lu vDPA device is a device that uses a datapath which complies with 3163108a6481SCindy Lu the virtio specifications with a vendor specific control path. 3164108a6481SCindy Lu vDPA devices can be both physically located on the hardware or 3165108a6481SCindy Lu emulated by software. 3166108a6481SCindy Lu 3167e2fcbf42SPeter Maydell``-netdev hubport,id=id,hubid=hubid[,netdev=nd]`` 3168e2fcbf42SPeter Maydell Create a hub port on the emulated hub with ID hubid. 3169e2fcbf42SPeter Maydell 3170e2fcbf42SPeter Maydell The hubport netdev lets you connect a NIC to a QEMU emulated hub 3171e2fcbf42SPeter Maydell instead of a single netdev. Alternatively, you can also connect the 3172e2fcbf42SPeter Maydell hubport to another netdev with ID nd by using the ``netdev=nd`` 3173e2fcbf42SPeter Maydell option. 3174e2fcbf42SPeter Maydell 3175e2fcbf42SPeter Maydell``-net nic[,netdev=nd][,macaddr=mac][,model=type] [,name=name][,addr=addr][,vectors=v]`` 3176e2fcbf42SPeter Maydell Legacy option to configure or create an on-board (or machine 3177e2fcbf42SPeter Maydell default) Network Interface Card(NIC) and connect it either to the 3178e2fcbf42SPeter Maydell emulated hub with ID 0 (i.e. the default hub), or to the netdev nd. 3179e2fcbf42SPeter Maydell If model is omitted, then the default NIC model associated with the 3180e2fcbf42SPeter Maydell machine type is used. Note that the default NIC model may change in 3181e2fcbf42SPeter Maydell future QEMU releases, so it is highly recommended to always specify 3182e2fcbf42SPeter Maydell a model. Optionally, the MAC address can be changed to mac, the 3183e2fcbf42SPeter Maydell device address set to addr (PCI cards only), and a name can be 3184e2fcbf42SPeter Maydell assigned for use in monitor commands. Optionally, for PCI cards, you 3185e2fcbf42SPeter Maydell can specify the number v of MSI-X vectors that the card should have; 3186e2fcbf42SPeter Maydell this option currently only affects virtio cards; set v = 0 to 3187e2fcbf42SPeter Maydell disable MSI-X. If no ``-net`` option is specified, a single NIC is 3188e2fcbf42SPeter Maydell created. QEMU can emulate several different models of network card. 3189e2fcbf42SPeter Maydell Use ``-net nic,model=help`` for a list of available devices for your 3190e2fcbf42SPeter Maydell target. 3191e2fcbf42SPeter Maydell 3192e2fcbf42SPeter Maydell``-net user|tap|bridge|socket|l2tpv3|vde[,...][,name=name]`` 3193e2fcbf42SPeter Maydell Configure a host network backend (with the options corresponding to 3194e2fcbf42SPeter Maydell the same ``-netdev`` option) and connect it to the emulated hub 0 3195e2fcbf42SPeter Maydell (the default hub). Use name to specify the name of the hub port. 3196e2fcbf42SPeter MaydellERST 31975824d651Sblueswir1 31987273a2dbSMatthew BoothDEFHEADING() 31997273a2dbSMatthew Booth 3200de6b4f90SMarkus ArmbrusterDEFHEADING(Character device options:) 32017273a2dbSMatthew Booth 32027273a2dbSMatthew BoothDEF("chardev", HAS_ARG, QEMU_OPTION_chardev, 3203517b3d40SLin Ma "-chardev help\n" 3204d0d7708bSDaniel P. Berrange "-chardev null,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" 3205ba858d1fSMarkus Armbruster "-chardev socket,id=id[,host=host],port=port[,to=to][,ipv4=on|off][,ipv6=on|off][,nodelay=on|off]\n" 3206bfdc1267SDaniel P. Berrangé " [,server=on|off][,wait=on|off][,telnet=on|off][,websocket=on|off][,reconnect=seconds][,mux=on|off]\n" 3207fd4a5fd4SDaniel P. Berrange " [,logfile=PATH][,logappend=on|off][,tls-creds=ID][,tls-authz=ID] (tcp)\n" 3208bfdc1267SDaniel P. Berrangé "-chardev socket,id=id,path=path[,server=on|off][,wait=on|off][,telnet=on|off][,websocket=on|off][,reconnect=seconds]\n" 3209e339273bSxiaoqiang zhao " [,mux=on|off][,logfile=PATH][,logappend=on|off][,abstract=on|off][,tight=on|off] (unix)\n" 32107273a2dbSMatthew Booth "-chardev udp,id=id[,host=host],port=port[,localaddr=localaddr]\n" 3211bfdc1267SDaniel P. Berrangé " [,localport=localport][,ipv4=on|off][,ipv6=on|off][,mux=on|off]\n" 3212d0d7708bSDaniel P. Berrange " [,logfile=PATH][,logappend=on|off]\n" 3213d0d7708bSDaniel P. Berrange "-chardev msmouse,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" 32147273a2dbSMatthew Booth "-chardev vc,id=id[[,width=width][,height=height]][[,cols=cols][,rows=rows]]\n" 3215d0d7708bSDaniel P. Berrange " [,mux=on|off][,logfile=PATH][,logappend=on|off]\n" 3216d0d7708bSDaniel P. Berrange "-chardev ringbuf,id=id[,size=size][,logfile=PATH][,logappend=on|off]\n" 3217d0d7708bSDaniel P. Berrange "-chardev file,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" 3218d0d7708bSDaniel P. Berrange "-chardev pipe,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" 32197273a2dbSMatthew Booth#ifdef _WIN32 3220d0d7708bSDaniel P. Berrange "-chardev console,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" 3221d0d7708bSDaniel P. Berrange "-chardev serial,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" 32227273a2dbSMatthew Booth#else 3223d0d7708bSDaniel P. Berrange "-chardev pty,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" 3224d0d7708bSDaniel P. Berrange "-chardev stdio,id=id[,mux=on|off][,signal=on|off][,logfile=PATH][,logappend=on|off]\n" 32257273a2dbSMatthew Booth#endif 32267273a2dbSMatthew Booth#ifdef CONFIG_BRLAPI 3227d0d7708bSDaniel P. Berrange "-chardev braille,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" 32287273a2dbSMatthew Booth#endif 32297273a2dbSMatthew Booth#if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \ 32307273a2dbSMatthew Booth || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) 3231d0d7708bSDaniel P. Berrange "-chardev serial,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" 3232d0d7708bSDaniel P. Berrange "-chardev tty,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" 32337273a2dbSMatthew Booth#endif 32347273a2dbSMatthew Booth#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__) 3235d0d7708bSDaniel P. Berrange "-chardev parallel,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" 3236d0d7708bSDaniel P. Berrange "-chardev parport,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" 32377273a2dbSMatthew Booth#endif 3238cbcc6336SAlon Levy#if defined(CONFIG_SPICE) 3239d0d7708bSDaniel P. Berrange "-chardev spicevmc,id=id,name=name[,debug=debug][,logfile=PATH][,logappend=on|off]\n" 3240d0d7708bSDaniel P. Berrange "-chardev spiceport,id=id,name=name[,debug=debug][,logfile=PATH][,logappend=on|off]\n" 3241cbcc6336SAlon Levy#endif 3242ad96090aSBlue Swirl , QEMU_ARCH_ALL 32437273a2dbSMatthew Booth) 32447273a2dbSMatthew Booth 3245e2fcbf42SPeter MaydellSRST 3246e2fcbf42SPeter MaydellThe general form of a character device option is: 3247e2fcbf42SPeter Maydell 3248e2fcbf42SPeter Maydell``-chardev backend,id=id[,mux=on|off][,options]`` 3249e2fcbf42SPeter Maydell Backend is one of: ``null``, ``socket``, ``udp``, ``msmouse``, 3250e2fcbf42SPeter Maydell ``vc``, ``ringbuf``, ``file``, ``pipe``, ``console``, ``serial``, 3251e2fcbf42SPeter Maydell ``pty``, ``stdio``, ``braille``, ``tty``, ``parallel``, ``parport``, 3252e2fcbf42SPeter Maydell ``spicevmc``, ``spiceport``. The specific backend will determine the 3253e2fcbf42SPeter Maydell applicable options. 3254e2fcbf42SPeter Maydell 3255e2fcbf42SPeter Maydell Use ``-chardev help`` to print all available chardev backend types. 3256e2fcbf42SPeter Maydell 3257e2fcbf42SPeter Maydell All devices must have an id, which can be any string up to 127 3258e2fcbf42SPeter Maydell characters long. It is used to uniquely identify this device in 3259e2fcbf42SPeter Maydell other command line directives. 3260e2fcbf42SPeter Maydell 3261e2fcbf42SPeter Maydell A character device may be used in multiplexing mode by multiple 3262e2fcbf42SPeter Maydell front-ends. Specify ``mux=on`` to enable this mode. A multiplexer is 3263e2fcbf42SPeter Maydell a "1:N" device, and here the "1" end is your specified chardev 3264e2fcbf42SPeter Maydell backend, and the "N" end is the various parts of QEMU that can talk 3265e2fcbf42SPeter Maydell to a chardev. If you create a chardev with ``id=myid`` and 3266e2fcbf42SPeter Maydell ``mux=on``, QEMU will create a multiplexer with your specified ID, 3267e2fcbf42SPeter Maydell and you can then configure multiple front ends to use that chardev 3268e2fcbf42SPeter Maydell ID for their input/output. Up to four different front ends can be 3269e2fcbf42SPeter Maydell connected to a single multiplexed chardev. (Without multiplexing 3270e2fcbf42SPeter Maydell enabled, a chardev can only be used by a single front end.) For 3271e2fcbf42SPeter Maydell instance you could use this to allow a single stdio chardev to be 3272e2fcbf42SPeter Maydell used by two serial ports and the QEMU monitor: 3273e2fcbf42SPeter Maydell 3274e2fcbf42SPeter Maydell :: 3275e2fcbf42SPeter Maydell 3276e2fcbf42SPeter Maydell -chardev stdio,mux=on,id=char0 \ 3277e2fcbf42SPeter Maydell -mon chardev=char0,mode=readline \ 3278e2fcbf42SPeter Maydell -serial chardev:char0 \ 3279e2fcbf42SPeter Maydell -serial chardev:char0 3280e2fcbf42SPeter Maydell 3281e2fcbf42SPeter Maydell You can have more than one multiplexer in a system configuration; 3282e2fcbf42SPeter Maydell for instance you could have a TCP port multiplexed between UART 0 3283e2fcbf42SPeter Maydell and UART 1, and stdio multiplexed between the QEMU monitor and a 3284e2fcbf42SPeter Maydell parallel port: 3285e2fcbf42SPeter Maydell 3286e2fcbf42SPeter Maydell :: 3287e2fcbf42SPeter Maydell 3288e2fcbf42SPeter Maydell -chardev stdio,mux=on,id=char0 \ 3289e2fcbf42SPeter Maydell -mon chardev=char0,mode=readline \ 3290e2fcbf42SPeter Maydell -parallel chardev:char0 \ 3291e2fcbf42SPeter Maydell -chardev tcp,...,mux=on,id=char1 \ 3292e2fcbf42SPeter Maydell -serial chardev:char1 \ 3293e2fcbf42SPeter Maydell -serial chardev:char1 3294e2fcbf42SPeter Maydell 3295e2fcbf42SPeter Maydell When you're using a multiplexed character device, some escape 3296923e9311SThomas Huth sequences are interpreted in the input. See the chapter about 3297923e9311SThomas Huth :ref:`keys in the character backend multiplexer` in the 3298923e9311SThomas Huth System Emulation Users Guide for more details. 3299e2fcbf42SPeter Maydell 3300e2fcbf42SPeter Maydell Note that some other command line options may implicitly create 3301e2fcbf42SPeter Maydell multiplexed character backends; for instance ``-serial mon:stdio`` 3302e2fcbf42SPeter Maydell creates a multiplexed stdio backend connected to the serial port and 3303e2fcbf42SPeter Maydell the QEMU monitor, and ``-nographic`` also multiplexes the console 3304e2fcbf42SPeter Maydell and the monitor to stdio. 3305e2fcbf42SPeter Maydell 3306e2fcbf42SPeter Maydell There is currently no support for multiplexing in the other 3307e2fcbf42SPeter Maydell direction (where a single QEMU front end takes input and output from 3308e2fcbf42SPeter Maydell multiple chardevs). 3309e2fcbf42SPeter Maydell 3310e2fcbf42SPeter Maydell Every backend supports the ``logfile`` option, which supplies the 3311e2fcbf42SPeter Maydell path to a file to record all data transmitted via the backend. The 3312e2fcbf42SPeter Maydell ``logappend`` option controls whether the log file will be truncated 3313e2fcbf42SPeter Maydell or appended to when opened. 3314e2fcbf42SPeter Maydell 3315e2fcbf42SPeter MaydellThe available backends are: 3316e2fcbf42SPeter Maydell 3317e2fcbf42SPeter Maydell``-chardev null,id=id`` 3318e2fcbf42SPeter Maydell A void device. This device will not emit any data, and will drop any 3319e2fcbf42SPeter Maydell data it receives. The null backend does not take any options. 3320e2fcbf42SPeter Maydell 3321bfdc1267SDaniel P. Berrangé``-chardev socket,id=id[,TCP options or unix options][,server=on|off][,wait=on|off][,telnet=on|off][,websocket=on|off][,reconnect=seconds][,tls-creds=id][,tls-authz=id]`` 3322e2fcbf42SPeter Maydell Create a two-way stream socket, which can be either a TCP or a unix 3323e2fcbf42SPeter Maydell socket. A unix socket will be created if ``path`` is specified. 3324e2fcbf42SPeter Maydell Behaviour is undefined if TCP options are specified for a unix 3325e2fcbf42SPeter Maydell socket. 3326e2fcbf42SPeter Maydell 3327bfdc1267SDaniel P. Berrangé ``server=on|off`` specifies that the socket shall be a listening socket. 3328e2fcbf42SPeter Maydell 3329bfdc1267SDaniel P. Berrangé ``wait=on|off`` specifies that QEMU should not block waiting for a client 3330e2fcbf42SPeter Maydell to connect to a listening socket. 3331e2fcbf42SPeter Maydell 3332bfdc1267SDaniel P. Berrangé ``telnet=on|off`` specifies that traffic on the socket should interpret 3333e2fcbf42SPeter Maydell telnet escape sequences. 3334e2fcbf42SPeter Maydell 3335bfdc1267SDaniel P. Berrangé ``websocket=on|off`` specifies that the socket uses WebSocket protocol for 3336e2fcbf42SPeter Maydell communication. 3337e2fcbf42SPeter Maydell 3338e2fcbf42SPeter Maydell ``reconnect`` sets the timeout for reconnecting on non-server 3339e2fcbf42SPeter Maydell sockets when the remote end goes away. qemu will delay this many 3340e2fcbf42SPeter Maydell seconds and then attempt to reconnect. Zero disables reconnecting, 3341e2fcbf42SPeter Maydell and is the default. 3342e2fcbf42SPeter Maydell 3343e2fcbf42SPeter Maydell ``tls-creds`` requests enablement of the TLS protocol for 3344e2fcbf42SPeter Maydell encryption, and specifies the id of the TLS credentials to use for 3345e2fcbf42SPeter Maydell the handshake. The credentials must be previously created with the 3346e2fcbf42SPeter Maydell ``-object tls-creds`` argument. 3347e2fcbf42SPeter Maydell 3348e2fcbf42SPeter Maydell ``tls-auth`` provides the ID of the QAuthZ authorization object 3349e2fcbf42SPeter Maydell against which the client's x509 distinguished name will be 3350e2fcbf42SPeter Maydell validated. This object is only resolved at time of use, so can be 3351e2fcbf42SPeter Maydell deleted and recreated on the fly while the chardev server is active. 3352e2fcbf42SPeter Maydell If missing, it will default to denying access. 3353e2fcbf42SPeter Maydell 3354e2fcbf42SPeter Maydell TCP and unix socket options are given below: 3355e2fcbf42SPeter Maydell 3356a9b1315fSPaolo Bonzini ``TCP options: port=port[,host=host][,to=to][,ipv4=on|off][,ipv6=on|off][,nodelay=on|off]`` 3357e2fcbf42SPeter Maydell ``host`` for a listening socket specifies the local address to 3358e2fcbf42SPeter Maydell be bound. For a connecting socket species the remote host to 3359e2fcbf42SPeter Maydell connect to. ``host`` is optional for listening sockets. If not 3360e2fcbf42SPeter Maydell specified it defaults to ``0.0.0.0``. 3361e2fcbf42SPeter Maydell 3362e2fcbf42SPeter Maydell ``port`` for a listening socket specifies the local port to be 3363e2fcbf42SPeter Maydell bound. For a connecting socket specifies the port on the remote 3364e2fcbf42SPeter Maydell host to connect to. ``port`` can be given as either a port 3365e2fcbf42SPeter Maydell number or a service name. ``port`` is required. 3366e2fcbf42SPeter Maydell 3367e2fcbf42SPeter Maydell ``to`` is only relevant to listening sockets. If it is 3368e2fcbf42SPeter Maydell specified, and ``port`` cannot be bound, QEMU will attempt to 3369e2fcbf42SPeter Maydell bind to subsequent ports up to and including ``to`` until it 3370e2fcbf42SPeter Maydell succeeds. ``to`` must be specified as a port number. 3371e2fcbf42SPeter Maydell 3372bfdc1267SDaniel P. Berrangé ``ipv4=on|off`` and ``ipv6=on|off`` specify that either IPv4 3373bfdc1267SDaniel P. Berrangé or IPv6 must be used. If neither is specified the socket may 3374bfdc1267SDaniel P. Berrangé use either protocol. 3375e2fcbf42SPeter Maydell 3376a9b1315fSPaolo Bonzini ``nodelay=on|off`` disables the Nagle algorithm. 3377e2fcbf42SPeter Maydell 3378e339273bSxiaoqiang zhao ``unix options: path=path[,abstract=on|off][,tight=on|off]`` 3379e2fcbf42SPeter Maydell ``path`` specifies the local path of the unix socket. ``path`` 3380e2fcbf42SPeter Maydell is required. 3381bfdc1267SDaniel P. Berrangé ``abstract=on|off`` specifies the use of the abstract socket namespace, 3382e339273bSxiaoqiang zhao rather than the filesystem. Optional, defaults to false. 3383bfdc1267SDaniel P. Berrangé ``tight=on|off`` sets the socket length of abstract sockets to their minimum, 3384e339273bSxiaoqiang zhao rather than the full sun_path length. Optional, defaults to true. 3385e2fcbf42SPeter Maydell 3386bfdc1267SDaniel P. Berrangé``-chardev udp,id=id[,host=host],port=port[,localaddr=localaddr][,localport=localport][,ipv4=on|off][,ipv6=on|off]`` 3387e2fcbf42SPeter Maydell Sends all traffic from the guest to a remote host over UDP. 3388e2fcbf42SPeter Maydell 3389e2fcbf42SPeter Maydell ``host`` specifies the remote host to connect to. If not specified 3390e2fcbf42SPeter Maydell it defaults to ``localhost``. 3391e2fcbf42SPeter Maydell 3392e2fcbf42SPeter Maydell ``port`` specifies the port on the remote host to connect to. 3393e2fcbf42SPeter Maydell ``port`` is required. 3394e2fcbf42SPeter Maydell 3395e2fcbf42SPeter Maydell ``localaddr`` specifies the local address to bind to. If not 3396e2fcbf42SPeter Maydell specified it defaults to ``0.0.0.0``. 3397e2fcbf42SPeter Maydell 3398e2fcbf42SPeter Maydell ``localport`` specifies the local port to bind to. If not specified 3399e2fcbf42SPeter Maydell any available local port will be used. 3400e2fcbf42SPeter Maydell 3401bfdc1267SDaniel P. Berrangé ``ipv4=on|off`` and ``ipv6=on|off`` specify that either IPv4 or IPv6 must be used. 3402e2fcbf42SPeter Maydell If neither is specified the device may use either protocol. 3403e2fcbf42SPeter Maydell 3404e2fcbf42SPeter Maydell``-chardev msmouse,id=id`` 3405e2fcbf42SPeter Maydell Forward QEMU's emulated msmouse events to the guest. ``msmouse`` 3406e2fcbf42SPeter Maydell does not take any options. 3407e2fcbf42SPeter Maydell 3408e2fcbf42SPeter Maydell``-chardev vc,id=id[[,width=width][,height=height]][[,cols=cols][,rows=rows]]`` 3409e2fcbf42SPeter Maydell Connect to a QEMU text console. ``vc`` may optionally be given a 3410e2fcbf42SPeter Maydell specific size. 3411e2fcbf42SPeter Maydell 3412e2fcbf42SPeter Maydell ``width`` and ``height`` specify the width and height respectively 3413e2fcbf42SPeter Maydell of the console, in pixels. 3414e2fcbf42SPeter Maydell 3415e2fcbf42SPeter Maydell ``cols`` and ``rows`` specify that the console be sized to fit a 3416e2fcbf42SPeter Maydell text console with the given dimensions. 3417e2fcbf42SPeter Maydell 3418e2fcbf42SPeter Maydell``-chardev ringbuf,id=id[,size=size]`` 3419e2fcbf42SPeter Maydell Create a ring buffer with fixed size ``size``. size must be a power 3420e2fcbf42SPeter Maydell of two and defaults to ``64K``. 3421e2fcbf42SPeter Maydell 3422e2fcbf42SPeter Maydell``-chardev file,id=id,path=path`` 3423e2fcbf42SPeter Maydell Log all traffic received from the guest to a file. 3424e2fcbf42SPeter Maydell 3425e2fcbf42SPeter Maydell ``path`` specifies the path of the file to be opened. This file will 3426e2fcbf42SPeter Maydell be created if it does not already exist, and overwritten if it does. 3427e2fcbf42SPeter Maydell ``path`` is required. 3428e2fcbf42SPeter Maydell 3429e2fcbf42SPeter Maydell``-chardev pipe,id=id,path=path`` 3430e2fcbf42SPeter Maydell Create a two-way connection to the guest. The behaviour differs 3431e2fcbf42SPeter Maydell slightly between Windows hosts and other hosts: 3432e2fcbf42SPeter Maydell 3433e2fcbf42SPeter Maydell On Windows, a single duplex pipe will be created at 3434e2fcbf42SPeter Maydell ``\\.pipe\path``. 3435e2fcbf42SPeter Maydell 3436e2fcbf42SPeter Maydell On other hosts, 2 pipes will be created called ``path.in`` and 3437e2fcbf42SPeter Maydell ``path.out``. Data written to ``path.in`` will be received by the 3438e2fcbf42SPeter Maydell guest. Data written by the guest can be read from ``path.out``. QEMU 3439e2fcbf42SPeter Maydell will not create these fifos, and requires them to be present. 3440e2fcbf42SPeter Maydell 3441e2fcbf42SPeter Maydell ``path`` forms part of the pipe path as described above. ``path`` is 3442e2fcbf42SPeter Maydell required. 3443e2fcbf42SPeter Maydell 3444e2fcbf42SPeter Maydell``-chardev console,id=id`` 3445e2fcbf42SPeter Maydell Send traffic from the guest to QEMU's standard output. ``console`` 3446e2fcbf42SPeter Maydell does not take any options. 3447e2fcbf42SPeter Maydell 3448e2fcbf42SPeter Maydell ``console`` is only available on Windows hosts. 3449e2fcbf42SPeter Maydell 3450e2fcbf42SPeter Maydell``-chardev serial,id=id,path=path`` 3451e2fcbf42SPeter Maydell Send traffic from the guest to a serial device on the host. 3452e2fcbf42SPeter Maydell 3453e2fcbf42SPeter Maydell On Unix hosts serial will actually accept any tty device, not only 3454e2fcbf42SPeter Maydell serial lines. 3455e2fcbf42SPeter Maydell 3456e2fcbf42SPeter Maydell ``path`` specifies the name of the serial device to open. 3457e2fcbf42SPeter Maydell 3458e2fcbf42SPeter Maydell``-chardev pty,id=id`` 3459e2fcbf42SPeter Maydell Create a new pseudo-terminal on the host and connect to it. ``pty`` 3460e2fcbf42SPeter Maydell does not take any options. 3461e2fcbf42SPeter Maydell 3462e2fcbf42SPeter Maydell ``pty`` is not available on Windows hosts. 3463e2fcbf42SPeter Maydell 3464e2fcbf42SPeter Maydell``-chardev stdio,id=id[,signal=on|off]`` 3465e2fcbf42SPeter Maydell Connect to standard input and standard output of the QEMU process. 3466e2fcbf42SPeter Maydell 3467e2fcbf42SPeter Maydell ``signal`` controls if signals are enabled on the terminal, that 3468e2fcbf42SPeter Maydell includes exiting QEMU with the key sequence Control-c. This option 3469e2fcbf42SPeter Maydell is enabled by default, use ``signal=off`` to disable it. 3470e2fcbf42SPeter Maydell 3471e2fcbf42SPeter Maydell``-chardev braille,id=id`` 3472e2fcbf42SPeter Maydell Connect to a local BrlAPI server. ``braille`` does not take any 3473e2fcbf42SPeter Maydell options. 3474e2fcbf42SPeter Maydell 3475e2fcbf42SPeter Maydell``-chardev tty,id=id,path=path`` 3476e2fcbf42SPeter Maydell ``tty`` is only available on Linux, Sun, FreeBSD, NetBSD, OpenBSD 3477e2fcbf42SPeter Maydell and DragonFlyBSD hosts. It is an alias for ``serial``. 3478e2fcbf42SPeter Maydell 3479e2fcbf42SPeter Maydell ``path`` specifies the path to the tty. ``path`` is required. 3480e2fcbf42SPeter Maydell 348109ce5f2dSPeter Maydell``-chardev parallel,id=id,path=path`` 348209ce5f2dSPeter Maydell \ 348309ce5f2dSPeter Maydell``-chardev parport,id=id,path=path`` 3484e2fcbf42SPeter Maydell ``parallel`` is only available on Linux, FreeBSD and DragonFlyBSD 3485e2fcbf42SPeter Maydell hosts. 3486e2fcbf42SPeter Maydell 3487e2fcbf42SPeter Maydell Connect to a local parallel port. 3488e2fcbf42SPeter Maydell 3489e2fcbf42SPeter Maydell ``path`` specifies the path to the parallel port device. ``path`` is 3490e2fcbf42SPeter Maydell required. 3491e2fcbf42SPeter Maydell 3492e2fcbf42SPeter Maydell``-chardev spicevmc,id=id,debug=debug,name=name`` 3493e2fcbf42SPeter Maydell ``spicevmc`` is only available when spice support is built in. 3494e2fcbf42SPeter Maydell 3495e2fcbf42SPeter Maydell ``debug`` debug level for spicevmc 3496e2fcbf42SPeter Maydell 3497e2fcbf42SPeter Maydell ``name`` name of spice channel to connect to 3498e2fcbf42SPeter Maydell 3499e2fcbf42SPeter Maydell Connect to a spice virtual machine channel, such as vdiport. 3500e2fcbf42SPeter Maydell 3501e2fcbf42SPeter Maydell``-chardev spiceport,id=id,debug=debug,name=name`` 3502e2fcbf42SPeter Maydell ``spiceport`` is only available when spice support is built in. 3503e2fcbf42SPeter Maydell 3504e2fcbf42SPeter Maydell ``debug`` debug level for spicevmc 3505e2fcbf42SPeter Maydell 3506e2fcbf42SPeter Maydell ``name`` name of spice port to connect to 3507e2fcbf42SPeter Maydell 3508e2fcbf42SPeter Maydell Connect to a spice port, allowing a Spice client to handle the 3509e2fcbf42SPeter Maydell traffic identified by a name (preferably a fqdn). 3510e2fcbf42SPeter MaydellERST 35117273a2dbSMatthew Booth 35127273a2dbSMatthew BoothDEFHEADING() 35137273a2dbSMatthew Booth 3514d1a0cf73SStefan Berger#ifdef CONFIG_TPM 3515de6b4f90SMarkus ArmbrusterDEFHEADING(TPM device options:) 3516d1a0cf73SStefan Berger 3517d1a0cf73SStefan BergerDEF("tpmdev", HAS_ARG, QEMU_OPTION_tpmdev, \ 351892dcc234SStefan Berger "-tpmdev passthrough,id=id[,path=path][,cancel-path=path]\n" 351992dcc234SStefan Berger " use path to provide path to a character device; default is /dev/tpm0\n" 352092dcc234SStefan Berger " use cancel-path to provide path to TPM's cancel sysfs entry; if\n" 3521f4ede81eSAmarnath Valluri " not provided it will be searched for in /sys/class/misc/tpm?/device\n" 3522f4ede81eSAmarnath Valluri "-tpmdev emulator,id=id,chardev=dev\n" 3523f4ede81eSAmarnath Valluri " configure the TPM device using chardev backend\n", 3524d1a0cf73SStefan Berger QEMU_ARCH_ALL) 3525e2fcbf42SPeter MaydellSRST 3526e2fcbf42SPeter MaydellThe general form of a TPM device option is: 3527e2fcbf42SPeter Maydell 3528e2fcbf42SPeter Maydell``-tpmdev backend,id=id[,options]`` 3529e2fcbf42SPeter Maydell The specific backend type will determine the applicable options. The 3530e2fcbf42SPeter Maydell ``-tpmdev`` option creates the TPM backend and requires a 3531e2fcbf42SPeter Maydell ``-device`` option that specifies the TPM frontend interface model. 3532e2fcbf42SPeter Maydell 3533e2fcbf42SPeter Maydell Use ``-tpmdev help`` to print all available TPM backend types. 3534e2fcbf42SPeter Maydell 3535e2fcbf42SPeter MaydellThe available backends are: 3536e2fcbf42SPeter Maydell 3537e2fcbf42SPeter Maydell``-tpmdev passthrough,id=id,path=path,cancel-path=cancel-path`` 3538e2fcbf42SPeter Maydell (Linux-host only) Enable access to the host's TPM using the 3539e2fcbf42SPeter Maydell passthrough driver. 3540e2fcbf42SPeter Maydell 3541e2fcbf42SPeter Maydell ``path`` specifies the path to the host's TPM device, i.e., on a 3542e2fcbf42SPeter Maydell Linux host this would be ``/dev/tpm0``. ``path`` is optional and by 3543e2fcbf42SPeter Maydell default ``/dev/tpm0`` is used. 3544e2fcbf42SPeter Maydell 3545e2fcbf42SPeter Maydell ``cancel-path`` specifies the path to the host TPM device's sysfs 3546e2fcbf42SPeter Maydell entry allowing for cancellation of an ongoing TPM command. 3547e2fcbf42SPeter Maydell ``cancel-path`` is optional and by default QEMU will search for the 3548e2fcbf42SPeter Maydell sysfs entry to use. 3549e2fcbf42SPeter Maydell 3550e2fcbf42SPeter Maydell Some notes about using the host's TPM with the passthrough driver: 3551e2fcbf42SPeter Maydell 3552e2fcbf42SPeter Maydell The TPM device accessed by the passthrough driver must not be used 3553e2fcbf42SPeter Maydell by any other application on the host. 3554e2fcbf42SPeter Maydell 3555e2fcbf42SPeter Maydell Since the host's firmware (BIOS/UEFI) has already initialized the 3556e2fcbf42SPeter Maydell TPM, the VM's firmware (BIOS/UEFI) will not be able to initialize 3557e2fcbf42SPeter Maydell the TPM again and may therefore not show a TPM-specific menu that 3558e2fcbf42SPeter Maydell would otherwise allow the user to configure the TPM, e.g., allow the 3559e2fcbf42SPeter Maydell user to enable/disable or activate/deactivate the TPM. Further, if 3560e2fcbf42SPeter Maydell TPM ownership is released from within a VM then the host's TPM will 3561e2fcbf42SPeter Maydell get disabled and deactivated. To enable and activate the TPM again 3562e2fcbf42SPeter Maydell afterwards, the host has to be rebooted and the user is required to 3563e2fcbf42SPeter Maydell enter the firmware's menu to enable and activate the TPM. If the TPM 3564e2fcbf42SPeter Maydell is left disabled and/or deactivated most TPM commands will fail. 3565e2fcbf42SPeter Maydell 3566e2fcbf42SPeter Maydell To create a passthrough TPM use the following two options: 3567e2fcbf42SPeter Maydell 3568e2fcbf42SPeter Maydell :: 3569e2fcbf42SPeter Maydell 3570e2fcbf42SPeter Maydell -tpmdev passthrough,id=tpm0 -device tpm-tis,tpmdev=tpm0 3571e2fcbf42SPeter Maydell 3572e2fcbf42SPeter Maydell Note that the ``-tpmdev`` id is ``tpm0`` and is referenced by 3573e2fcbf42SPeter Maydell ``tpmdev=tpm0`` in the device option. 3574e2fcbf42SPeter Maydell 3575e2fcbf42SPeter Maydell``-tpmdev emulator,id=id,chardev=dev`` 3576e2fcbf42SPeter Maydell (Linux-host only) Enable access to a TPM emulator using Unix domain 3577e2fcbf42SPeter Maydell socket based chardev backend. 3578e2fcbf42SPeter Maydell 3579e2fcbf42SPeter Maydell ``chardev`` specifies the unique ID of a character device backend 3580e2fcbf42SPeter Maydell that provides connection to the software TPM server. 3581e2fcbf42SPeter Maydell 3582e2fcbf42SPeter Maydell To create a TPM emulator backend device with chardev socket backend: 3583e2fcbf42SPeter Maydell 3584e2fcbf42SPeter Maydell :: 3585e2fcbf42SPeter Maydell 3586e2fcbf42SPeter Maydell -chardev socket,id=chrtpm,path=/tmp/swtpm-sock -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis,tpmdev=tpm0 3587e2fcbf42SPeter MaydellERST 3588d1a0cf73SStefan Berger 3589d1a0cf73SStefan BergerDEFHEADING() 3590d1a0cf73SStefan Berger 3591d1a0cf73SStefan Berger#endif 3592d1a0cf73SStefan Berger 3593de6b4f90SMarkus ArmbrusterDEFHEADING(Linux/Multiboot boot specific:) 3594e2fcbf42SPeter MaydellSRST 3595e2fcbf42SPeter MaydellWhen using these options, you can use a given Linux or Multiboot kernel 3596e2fcbf42SPeter Maydellwithout installing it in the disk image. It can be useful for easier 3597e2fcbf42SPeter Maydelltesting of various kernels. 3598e2fcbf42SPeter Maydell 3599e2fcbf42SPeter Maydell 3600e2fcbf42SPeter MaydellERST 36015824d651Sblueswir1 36025824d651Sblueswir1DEF("kernel", HAS_ARG, QEMU_OPTION_kernel, \ 3603ad96090aSBlue Swirl "-kernel bzImage use 'bzImage' as kernel image\n", QEMU_ARCH_ALL) 3604e2fcbf42SPeter MaydellSRST 3605e2fcbf42SPeter Maydell``-kernel bzImage`` 3606e2fcbf42SPeter Maydell Use bzImage as kernel image. The kernel can be either a Linux kernel 3607e2fcbf42SPeter Maydell or in multiboot format. 3608e2fcbf42SPeter MaydellERST 36095824d651Sblueswir1 36105824d651Sblueswir1DEF("append", HAS_ARG, QEMU_OPTION_append, \ 3611ad96090aSBlue Swirl "-append cmdline use 'cmdline' as kernel command line\n", QEMU_ARCH_ALL) 3612e2fcbf42SPeter MaydellSRST 3613e2fcbf42SPeter Maydell``-append cmdline`` 3614e2fcbf42SPeter Maydell Use cmdline as kernel command line 3615e2fcbf42SPeter MaydellERST 36165824d651Sblueswir1 36175824d651Sblueswir1DEF("initrd", HAS_ARG, QEMU_OPTION_initrd, \ 3618ad96090aSBlue Swirl "-initrd file use 'file' as initial ram disk\n", QEMU_ARCH_ALL) 3619e2fcbf42SPeter MaydellSRST 3620e2fcbf42SPeter Maydell``-initrd file`` 3621e2fcbf42SPeter Maydell Use file as initial ram disk. 3622e2fcbf42SPeter Maydell 3623e2fcbf42SPeter Maydell``-initrd "file1 arg=foo,file2"`` 3624e2fcbf42SPeter Maydell This syntax is only available with multiboot. 3625e2fcbf42SPeter Maydell 3626e2fcbf42SPeter Maydell Use file1 and file2 as modules and pass arg=foo as parameter to the 3627e2fcbf42SPeter Maydell first module. 3628e2fcbf42SPeter MaydellERST 36295824d651Sblueswir1 3630412beee6SGrant LikelyDEF("dtb", HAS_ARG, QEMU_OPTION_dtb, \ 3631379b5c7cSPeter A. G. Crosthwaite "-dtb file use 'file' as device tree image\n", QEMU_ARCH_ALL) 3632e2fcbf42SPeter MaydellSRST 3633e2fcbf42SPeter Maydell``-dtb file`` 3634e2fcbf42SPeter Maydell Use file as a device tree binary (dtb) image and pass it to the 3635e2fcbf42SPeter Maydell kernel on boot. 3636e2fcbf42SPeter MaydellERST 3637412beee6SGrant Likely 36385824d651Sblueswir1DEFHEADING() 36395824d651Sblueswir1 3640de6b4f90SMarkus ArmbrusterDEFHEADING(Debug/Expert options:) 36415824d651Sblueswir1 36426dd75472SMarkus ArmbrusterDEF("compat", HAS_ARG, QEMU_OPTION_compat, 3643dbb675c1SMarkus Armbruster "-compat [deprecated-input=accept|reject|crash][,deprecated-output=accept|hide]\n" 364457df0dffSMarkus Armbruster " Policy for handling deprecated management interfaces\n" 364557df0dffSMarkus Armbruster "-compat [unstable-input=accept|reject|crash][,unstable-output=accept|hide]\n" 364657df0dffSMarkus Armbruster " Policy for handling unstable management interfaces\n", 36476dd75472SMarkus Armbruster QEMU_ARCH_ALL) 36486dd75472SMarkus ArmbrusterSRST 36496dd75472SMarkus Armbruster``-compat [deprecated-input=@var{input-policy}][,deprecated-output=@var{output-policy}]`` 36506dd75472SMarkus Armbruster Set policy for handling deprecated management interfaces (experimental): 36516dd75472SMarkus Armbruster 36526dd75472SMarkus Armbruster ``deprecated-input=accept`` (default) 36536dd75472SMarkus Armbruster Accept deprecated commands and arguments 36546dd75472SMarkus Armbruster ``deprecated-input=reject`` 36556dd75472SMarkus Armbruster Reject deprecated commands and arguments 3656dbb675c1SMarkus Armbruster ``deprecated-input=crash`` 3657dbb675c1SMarkus Armbruster Crash on deprecated commands and arguments 36586dd75472SMarkus Armbruster ``deprecated-output=accept`` (default) 36596dd75472SMarkus Armbruster Emit deprecated command results and events 36606dd75472SMarkus Armbruster ``deprecated-output=hide`` 36616dd75472SMarkus Armbruster Suppress deprecated command results and events 36626dd75472SMarkus Armbruster 36636dd75472SMarkus Armbruster Limitation: covers only syntactic aspects of QMP. 366457df0dffSMarkus Armbruster 366557df0dffSMarkus Armbruster``-compat [unstable-input=@var{input-policy}][,unstable-output=@var{output-policy}]`` 366657df0dffSMarkus Armbruster Set policy for handling unstable management interfaces (experimental): 366757df0dffSMarkus Armbruster 366857df0dffSMarkus Armbruster ``unstable-input=accept`` (default) 366957df0dffSMarkus Armbruster Accept unstable commands and arguments 367057df0dffSMarkus Armbruster ``unstable-input=reject`` 367157df0dffSMarkus Armbruster Reject unstable commands and arguments 367257df0dffSMarkus Armbruster ``unstable-input=crash`` 367357df0dffSMarkus Armbruster Crash on unstable commands and arguments 367457df0dffSMarkus Armbruster ``unstable-output=accept`` (default) 367557df0dffSMarkus Armbruster Emit unstable command results and events 367657df0dffSMarkus Armbruster ``unstable-output=hide`` 367757df0dffSMarkus Armbruster Suppress unstable command results and events 367857df0dffSMarkus Armbruster 367957df0dffSMarkus Armbruster Limitation: covers only syntactic aspects of QMP. 36806dd75472SMarkus ArmbrusterERST 36816dd75472SMarkus Armbruster 368281b2b810SGabriel L. SomloDEF("fw_cfg", HAS_ARG, QEMU_OPTION_fwcfg, 368381b2b810SGabriel L. Somlo "-fw_cfg [name=]<name>,file=<file>\n" 368463d3145aSMarkus Armbruster " add named fw_cfg entry with contents from file\n" 36856407d76eSGabriel L. Somlo "-fw_cfg [name=]<name>,string=<str>\n" 368663d3145aSMarkus Armbruster " add named fw_cfg entry with contents from string\n", 368781b2b810SGabriel L. Somlo QEMU_ARCH_ALL) 3688e2fcbf42SPeter MaydellSRST 3689e2fcbf42SPeter Maydell``-fw_cfg [name=]name,file=file`` 3690e2fcbf42SPeter Maydell Add named fw\_cfg entry with contents from file file. 3691e2fcbf42SPeter Maydell 3692e2fcbf42SPeter Maydell``-fw_cfg [name=]name,string=str`` 3693e2fcbf42SPeter Maydell Add named fw\_cfg entry with contents from string str. 3694e2fcbf42SPeter Maydell 3695e2fcbf42SPeter Maydell The terminating NUL character of the contents of str will not be 3696e2fcbf42SPeter Maydell included as part of the fw\_cfg item data. To insert contents with 3697e2fcbf42SPeter Maydell embedded NUL characters, you have to use the file parameter. 3698e2fcbf42SPeter Maydell 3699e2fcbf42SPeter Maydell The fw\_cfg entries are passed by QEMU through to the guest. 3700e2fcbf42SPeter Maydell 3701e2fcbf42SPeter Maydell Example: 3702e2fcbf42SPeter Maydell 3703e2fcbf42SPeter Maydell :: 3704e2fcbf42SPeter Maydell 3705e2fcbf42SPeter Maydell -fw_cfg name=opt/com.mycompany/blob,file=./my_blob.bin 3706e2fcbf42SPeter Maydell 3707e2fcbf42SPeter Maydell creates an fw\_cfg entry named opt/com.mycompany/blob with contents 3708e2fcbf42SPeter Maydell from ./my\_blob.bin. 3709e2fcbf42SPeter MaydellERST 371081b2b810SGabriel L. Somlo 37115824d651Sblueswir1DEF("serial", HAS_ARG, QEMU_OPTION_serial, \ 3712ad96090aSBlue Swirl "-serial dev redirect the serial port to char device 'dev'\n", 3713ad96090aSBlue Swirl QEMU_ARCH_ALL) 3714e2fcbf42SPeter MaydellSRST 3715e2fcbf42SPeter Maydell``-serial dev`` 3716e2fcbf42SPeter Maydell Redirect the virtual serial port to host character device dev. The 3717e2fcbf42SPeter Maydell default device is ``vc`` in graphical mode and ``stdio`` in non 3718e2fcbf42SPeter Maydell graphical mode. 3719e2fcbf42SPeter Maydell 3720e2fcbf42SPeter Maydell This option can be used several times to simulate up to 4 serial 3721e2fcbf42SPeter Maydell ports. 3722e2fcbf42SPeter Maydell 3723e2fcbf42SPeter Maydell Use ``-serial none`` to disable all serial ports. 3724e2fcbf42SPeter Maydell 3725e2fcbf42SPeter Maydell Available character devices are: 3726e2fcbf42SPeter Maydell 3727e2fcbf42SPeter Maydell ``vc[:WxH]`` 3728e2fcbf42SPeter Maydell Virtual console. Optionally, a width and height can be given in 3729e2fcbf42SPeter Maydell pixel with 3730e2fcbf42SPeter Maydell 3731e2fcbf42SPeter Maydell :: 3732e2fcbf42SPeter Maydell 3733e2fcbf42SPeter Maydell vc:800x600 3734e2fcbf42SPeter Maydell 3735e2fcbf42SPeter Maydell It is also possible to specify width or height in characters: 3736e2fcbf42SPeter Maydell 3737e2fcbf42SPeter Maydell :: 3738e2fcbf42SPeter Maydell 3739e2fcbf42SPeter Maydell vc:80Cx24C 3740e2fcbf42SPeter Maydell 3741e2fcbf42SPeter Maydell ``pty`` 3742e2fcbf42SPeter Maydell [Linux only] Pseudo TTY (a new PTY is automatically allocated) 3743e2fcbf42SPeter Maydell 3744e2fcbf42SPeter Maydell ``none`` 3745e2fcbf42SPeter Maydell No device is allocated. 3746e2fcbf42SPeter Maydell 3747e2fcbf42SPeter Maydell ``null`` 3748e2fcbf42SPeter Maydell void device 3749e2fcbf42SPeter Maydell 3750e2fcbf42SPeter Maydell ``chardev:id`` 3751e2fcbf42SPeter Maydell Use a named character device defined with the ``-chardev`` 3752e2fcbf42SPeter Maydell option. 3753e2fcbf42SPeter Maydell 3754e2fcbf42SPeter Maydell ``/dev/XXX`` 3755e2fcbf42SPeter Maydell [Linux only] Use host tty, e.g. ``/dev/ttyS0``. The host serial 3756e2fcbf42SPeter Maydell port parameters are set according to the emulated ones. 3757e2fcbf42SPeter Maydell 3758e2fcbf42SPeter Maydell ``/dev/parportN`` 3759e2fcbf42SPeter Maydell [Linux only, parallel port only] Use host parallel port N. 3760e2fcbf42SPeter Maydell Currently SPP and EPP parallel port features can be used. 3761e2fcbf42SPeter Maydell 3762e2fcbf42SPeter Maydell ``file:filename`` 3763e2fcbf42SPeter Maydell Write output to filename. No character can be read. 3764e2fcbf42SPeter Maydell 3765e2fcbf42SPeter Maydell ``stdio`` 3766e2fcbf42SPeter Maydell [Unix only] standard input/output 3767e2fcbf42SPeter Maydell 3768e2fcbf42SPeter Maydell ``pipe:filename`` 3769e2fcbf42SPeter Maydell name pipe filename 3770e2fcbf42SPeter Maydell 3771e2fcbf42SPeter Maydell ``COMn`` 3772e2fcbf42SPeter Maydell [Windows only] Use host serial port n 3773e2fcbf42SPeter Maydell 3774e2fcbf42SPeter Maydell ``udp:[remote_host]:remote_port[@[src_ip]:src_port]`` 3775e2fcbf42SPeter Maydell This implements UDP Net Console. When remote\_host or src\_ip 3776e2fcbf42SPeter Maydell are not specified they default to ``0.0.0.0``. When not using a 3777e2fcbf42SPeter Maydell specified src\_port a random port is automatically chosen. 3778e2fcbf42SPeter Maydell 3779e2fcbf42SPeter Maydell If you just want a simple readonly console you can use 3780e2fcbf42SPeter Maydell ``netcat`` or ``nc``, by starting QEMU with: 3781e2fcbf42SPeter Maydell ``-serial udp::4555`` and nc as: ``nc -u -l -p 4555``. Any time 3782e2fcbf42SPeter Maydell QEMU writes something to that port it will appear in the 3783e2fcbf42SPeter Maydell netconsole session. 3784e2fcbf42SPeter Maydell 3785e2fcbf42SPeter Maydell If you plan to send characters back via netconsole or you want 3786e2fcbf42SPeter Maydell to stop and start QEMU a lot of times, you should have QEMU use 3787e2fcbf42SPeter Maydell the same source port each time by using something like ``-serial 3788e2fcbf42SPeter Maydell udp::4555@:4556`` to QEMU. Another approach is to use a patched 3789e2fcbf42SPeter Maydell version of netcat which can listen to a TCP port and send and 3790e2fcbf42SPeter Maydell receive characters via udp. If you have a patched version of 3791e2fcbf42SPeter Maydell netcat which activates telnet remote echo and single char 3792e2fcbf42SPeter Maydell transfer, then you can use the following options to set up a 3793e2fcbf42SPeter Maydell netcat redirector to allow telnet on port 5555 to access the 3794e2fcbf42SPeter Maydell QEMU port. 3795e2fcbf42SPeter Maydell 3796e2fcbf42SPeter Maydell ``QEMU Options:`` 3797e2fcbf42SPeter Maydell -serial udp::4555@:4556 3798e2fcbf42SPeter Maydell 3799e2fcbf42SPeter Maydell ``netcat options:`` 3800e2fcbf42SPeter Maydell -u -P 4555 -L 0.0.0.0:4556 -t -p 5555 -I -T 3801e2fcbf42SPeter Maydell 3802e2fcbf42SPeter Maydell ``telnet options:`` 3803e2fcbf42SPeter Maydell localhost 5555 3804e2fcbf42SPeter Maydell 3805a9b1315fSPaolo Bonzini ``tcp:[host]:port[,server=on|off][,wait=on|off][,nodelay=on|off][,reconnect=seconds]`` 3806e2fcbf42SPeter Maydell The TCP Net Console has two modes of operation. It can send the 3807e2fcbf42SPeter Maydell serial I/O to a location or wait for a connection from a 3808e2fcbf42SPeter Maydell location. By default the TCP Net Console is sent to host at the 3809bfdc1267SDaniel P. Berrangé port. If you use the ``server=on`` option QEMU will wait for a client 3810e2fcbf42SPeter Maydell socket application to connect to the port before continuing, 3811a9b1315fSPaolo Bonzini unless the ``wait=on|off`` option was specified. The ``nodelay=on|off`` 3812bfdc1267SDaniel P. Berrangé option disables the Nagle buffering algorithm. The ``reconnect=on`` 3813bfdc1267SDaniel P. Berrangé option only applies if ``server=no`` is set, if the connection goes 3814e2fcbf42SPeter Maydell down it will attempt to reconnect at the given interval. If host 3815e2fcbf42SPeter Maydell is omitted, 0.0.0.0 is assumed. Only one TCP connection at a 3816bfdc1267SDaniel P. Berrangé time is accepted. You can use ``telnet=on`` to connect to the 3817e2fcbf42SPeter Maydell corresponding character device. 3818e2fcbf42SPeter Maydell 3819e2fcbf42SPeter Maydell ``Example to send tcp console to 192.168.0.2 port 4444`` 3820e2fcbf42SPeter Maydell -serial tcp:192.168.0.2:4444 3821e2fcbf42SPeter Maydell 3822e2fcbf42SPeter Maydell ``Example to listen and wait on port 4444 for connection`` 3823bfdc1267SDaniel P. Berrangé -serial tcp::4444,server=on 3824e2fcbf42SPeter Maydell 3825e2fcbf42SPeter Maydell ``Example to not wait and listen on ip 192.168.0.100 port 4444`` 3826bfdc1267SDaniel P. Berrangé -serial tcp:192.168.0.100:4444,server=on,wait=off 3827e2fcbf42SPeter Maydell 3828a9b1315fSPaolo Bonzini ``telnet:host:port[,server=on|off][,wait=on|off][,nodelay=on|off]`` 3829e2fcbf42SPeter Maydell The telnet protocol is used instead of raw tcp sockets. The 3830e2fcbf42SPeter Maydell options work the same as if you had specified ``-serial tcp``. 3831e2fcbf42SPeter Maydell The difference is that the port acts like a telnet server or 3832e2fcbf42SPeter Maydell client using telnet option negotiation. This will also allow you 3833e2fcbf42SPeter Maydell to send the MAGIC\_SYSRQ sequence if you use a telnet that 3834e2fcbf42SPeter Maydell supports sending the break sequence. Typically in unix telnet 3835e2fcbf42SPeter Maydell you do it with Control-] and then type "send break" followed by 3836e2fcbf42SPeter Maydell pressing the enter key. 3837e2fcbf42SPeter Maydell 3838a9b1315fSPaolo Bonzini ``websocket:host:port,server=on[,wait=on|off][,nodelay=on|off]`` 3839e2fcbf42SPeter Maydell The WebSocket protocol is used instead of raw tcp socket. The 3840e2fcbf42SPeter Maydell port acts as a WebSocket server. Client mode is not supported. 3841e2fcbf42SPeter Maydell 3842bfdc1267SDaniel P. Berrangé ``unix:path[,server=on|off][,wait=on|off][,reconnect=seconds]`` 3843e2fcbf42SPeter Maydell A unix domain socket is used instead of a tcp socket. The option 3844e2fcbf42SPeter Maydell works the same as if you had specified ``-serial tcp`` except 3845e2fcbf42SPeter Maydell the unix domain socket path is used for connections. 3846e2fcbf42SPeter Maydell 3847e2fcbf42SPeter Maydell ``mon:dev_string`` 3848e2fcbf42SPeter Maydell This is a special option to allow the monitor to be multiplexed 3849e2fcbf42SPeter Maydell onto another serial port. The monitor is accessed with key 3850e2fcbf42SPeter Maydell sequence of Control-a and then pressing c. dev\_string should be 3851e2fcbf42SPeter Maydell any one of the serial devices specified above. An example to 3852e2fcbf42SPeter Maydell multiplex the monitor onto a telnet server listening on port 3853e2fcbf42SPeter Maydell 4444 would be: 3854e2fcbf42SPeter Maydell 3855bfdc1267SDaniel P. Berrangé ``-serial mon:telnet::4444,server=on,wait=off`` 3856e2fcbf42SPeter Maydell 3857e2fcbf42SPeter Maydell When the monitor is multiplexed to stdio in this way, Ctrl+C 3858e2fcbf42SPeter Maydell will not terminate QEMU any more but will be passed to the guest 3859e2fcbf42SPeter Maydell instead. 3860e2fcbf42SPeter Maydell 3861e2fcbf42SPeter Maydell ``braille`` 3862e2fcbf42SPeter Maydell Braille device. This will use BrlAPI to display the braille 3863e2fcbf42SPeter Maydell output on a real or fake device. 3864e2fcbf42SPeter Maydell 3865e2fcbf42SPeter Maydell ``msmouse`` 3866e2fcbf42SPeter Maydell Three button serial mouse. Configure the guest to use Microsoft 3867e2fcbf42SPeter Maydell protocol. 3868e2fcbf42SPeter MaydellERST 38695824d651Sblueswir1 38705824d651Sblueswir1DEF("parallel", HAS_ARG, QEMU_OPTION_parallel, \ 3871ad96090aSBlue Swirl "-parallel dev redirect the parallel port to char device 'dev'\n", 3872ad96090aSBlue Swirl QEMU_ARCH_ALL) 3873e2fcbf42SPeter MaydellSRST 3874e2fcbf42SPeter Maydell``-parallel dev`` 3875e2fcbf42SPeter Maydell Redirect the virtual parallel port to host device dev (same devices 3876e2fcbf42SPeter Maydell as the serial port). On Linux hosts, ``/dev/parportN`` can be used 3877e2fcbf42SPeter Maydell to use hardware devices connected on the corresponding host parallel 3878e2fcbf42SPeter Maydell port. 3879e2fcbf42SPeter Maydell 3880e2fcbf42SPeter Maydell This option can be used several times to simulate up to 3 parallel 3881e2fcbf42SPeter Maydell ports. 3882e2fcbf42SPeter Maydell 3883e2fcbf42SPeter Maydell Use ``-parallel none`` to disable all parallel ports. 3884e2fcbf42SPeter MaydellERST 38855824d651Sblueswir1 38865824d651Sblueswir1DEF("monitor", HAS_ARG, QEMU_OPTION_monitor, \ 3887ad96090aSBlue Swirl "-monitor dev redirect the monitor to char device 'dev'\n", 3888ad96090aSBlue Swirl QEMU_ARCH_ALL) 3889e2fcbf42SPeter MaydellSRST 3890e2fcbf42SPeter Maydell``-monitor dev`` 3891e2fcbf42SPeter Maydell Redirect the monitor to host device dev (same devices as the serial 3892e2fcbf42SPeter Maydell port). The default device is ``vc`` in graphical mode and ``stdio`` 3893e2fcbf42SPeter Maydell in non graphical mode. Use ``-monitor none`` to disable the default 3894e2fcbf42SPeter Maydell monitor. 3895e2fcbf42SPeter MaydellERST 38966ca5582dSGerd HoffmannDEF("qmp", HAS_ARG, QEMU_OPTION_qmp, \ 3897ad96090aSBlue Swirl "-qmp dev like -monitor but opens in 'control' mode\n", 3898ad96090aSBlue Swirl QEMU_ARCH_ALL) 3899e2fcbf42SPeter MaydellSRST 3900e2fcbf42SPeter Maydell``-qmp dev`` 3901e2fcbf42SPeter Maydell Like -monitor but opens in 'control' mode. 3902e2fcbf42SPeter MaydellERST 39034821cd4cSMax ReitzDEF("qmp-pretty", HAS_ARG, QEMU_OPTION_qmp_pretty, \ 39044821cd4cSMax Reitz "-qmp-pretty dev like -qmp but uses pretty JSON formatting\n", 39054821cd4cSMax Reitz QEMU_ARCH_ALL) 3906e2fcbf42SPeter MaydellSRST 3907e2fcbf42SPeter Maydell``-qmp-pretty dev`` 3908e2fcbf42SPeter Maydell Like -qmp but uses pretty JSON formatting. 3909e2fcbf42SPeter MaydellERST 39105824d651Sblueswir1 391122a0e04bSGerd HoffmannDEF("mon", HAS_ARG, QEMU_OPTION_mon, \ 3912ef670726SVicente Jimenez Aguilar "-mon [chardev=]name[,mode=readline|control][,pretty[=on|off]]\n", QEMU_ARCH_ALL) 3913e2fcbf42SPeter MaydellSRST 3914e2fcbf42SPeter Maydell``-mon [chardev=]name[,mode=readline|control][,pretty[=on|off]]`` 391516b3f3bbSAli Shirvani Setup monitor on chardev name. ``mode=control`` configures 391616b3f3bbSAli Shirvani a QMP monitor (a JSON RPC-style protocol) and it is not the 391716b3f3bbSAli Shirvani same as HMP, the human monitor that has a "(qemu)" prompt. 391816b3f3bbSAli Shirvani ``pretty`` is only valid when ``mode=control``, 391916b3f3bbSAli Shirvani turning on JSON pretty printing to ease 3920283d845cSDaniel P. Berrangé human reading and debugging. 3921e2fcbf42SPeter MaydellERST 392222a0e04bSGerd Hoffmann 3923c9f398e5SH. Peter AnvinDEF("debugcon", HAS_ARG, QEMU_OPTION_debugcon, \ 3924ad96090aSBlue Swirl "-debugcon dev redirect the debug console to char device 'dev'\n", 3925ad96090aSBlue Swirl QEMU_ARCH_ALL) 3926e2fcbf42SPeter MaydellSRST 3927e2fcbf42SPeter Maydell``-debugcon dev`` 3928e2fcbf42SPeter Maydell Redirect the debug console to host device dev (same devices as the 3929e2fcbf42SPeter Maydell serial port). The debug console is an I/O port which is typically 3930e2fcbf42SPeter Maydell port 0xe9; writing to that I/O port sends output to this device. The 3931e2fcbf42SPeter Maydell default device is ``vc`` in graphical mode and ``stdio`` in non 3932e2fcbf42SPeter Maydell graphical mode. 3933e2fcbf42SPeter MaydellERST 3934c9f398e5SH. Peter Anvin 39355824d651Sblueswir1DEF("pidfile", HAS_ARG, QEMU_OPTION_pidfile, \ 3936ad96090aSBlue Swirl "-pidfile file write PID to 'file'\n", QEMU_ARCH_ALL) 3937e2fcbf42SPeter MaydellSRST 3938e2fcbf42SPeter Maydell``-pidfile file`` 3939e2fcbf42SPeter Maydell Store the QEMU process PID in file. It is useful if you launch QEMU 3940e2fcbf42SPeter Maydell from a script. 3941e2fcbf42SPeter MaydellERST 39425824d651Sblueswir1 39431b530a6dSaurel32DEF("singlestep", 0, QEMU_OPTION_singlestep, \ 3944ad96090aSBlue Swirl "-singlestep always run in singlestep mode\n", QEMU_ARCH_ALL) 3945e2fcbf42SPeter MaydellSRST 3946e2fcbf42SPeter Maydell``-singlestep`` 3947e2fcbf42SPeter Maydell Run the emulation in single step mode. 3948e2fcbf42SPeter MaydellERST 39491b530a6dSaurel32 3950047f7038SIgor MammedovDEF("preconfig", 0, QEMU_OPTION_preconfig, \ 3951361ac948SMarkus Armbruster "--preconfig pause QEMU before machine is initialized (experimental)\n", 3952047f7038SIgor Mammedov QEMU_ARCH_ALL) 3953e2fcbf42SPeter MaydellSRST 3954e2fcbf42SPeter Maydell``--preconfig`` 3955e2fcbf42SPeter Maydell Pause QEMU for interactive configuration before the machine is 3956e2fcbf42SPeter Maydell created, which allows querying and configuring properties that will 3957e2fcbf42SPeter Maydell affect machine initialization. Use QMP command 'x-exit-preconfig' to 3958e2fcbf42SPeter Maydell exit the preconfig state and move to the next state (i.e. run guest 3959e2fcbf42SPeter Maydell if -S isn't used or pause the second time if -S is used). This 3960e2fcbf42SPeter Maydell option is experimental. 3961e2fcbf42SPeter MaydellERST 3962047f7038SIgor Mammedov 39635824d651Sblueswir1DEF("S", 0, QEMU_OPTION_S, \ 3964ad96090aSBlue Swirl "-S freeze CPU at startup (use 'c' to start execution)\n", 3965ad96090aSBlue Swirl QEMU_ARCH_ALL) 3966e2fcbf42SPeter MaydellSRST 3967e2fcbf42SPeter Maydell``-S`` 3968e2fcbf42SPeter Maydell Do not start CPU at startup (you must type 'c' in the monitor). 3969e2fcbf42SPeter MaydellERST 39705824d651Sblueswir1 39716f131f13SMichael S. TsirkinDEF("overcommit", HAS_ARG, QEMU_OPTION_overcommit, 3972dfaa7d50SBALATON Zoltan "-overcommit [mem-lock=on|off][cpu-pm=on|off]\n" 39736f131f13SMichael S. Tsirkin " run qemu with overcommit hints\n" 39746f131f13SMichael S. Tsirkin " mem-lock=on|off controls memory lock support (default: off)\n" 39756f131f13SMichael S. Tsirkin " cpu-pm=on|off controls cpu power management (default: off)\n", 39766f131f13SMichael S. Tsirkin QEMU_ARCH_ALL) 3977e2fcbf42SPeter MaydellSRST 3978e2fcbf42SPeter Maydell``-overcommit mem-lock=on|off`` 397909ce5f2dSPeter Maydell \ 3980e2fcbf42SPeter Maydell``-overcommit cpu-pm=on|off`` 3981e2fcbf42SPeter Maydell Run qemu with hints about host resource overcommit. The default is 3982e2fcbf42SPeter Maydell to assume that host overcommits all resources. 3983e2fcbf42SPeter Maydell 3984e2fcbf42SPeter Maydell Locking qemu and guest memory can be enabled via ``mem-lock=on`` 3985e2fcbf42SPeter Maydell (disabled by default). This works when host memory is not 3986c8c9dc42SThomas Huth overcommitted and reduces the worst-case latency for guest. 3987e2fcbf42SPeter Maydell 3988e2fcbf42SPeter Maydell Guest ability to manage power state of host cpus (increasing latency 3989e2fcbf42SPeter Maydell for other processes on the same host cpu, but decreasing latency for 3990e2fcbf42SPeter Maydell guest) can be enabled via ``cpu-pm=on`` (disabled by default). This 3991e2fcbf42SPeter Maydell works best when host CPU is not overcommitted. When used, host 3992e2fcbf42SPeter Maydell estimates of CPU cycle and power utilization will be incorrect, not 3993e2fcbf42SPeter Maydell taking into account guest idle time. 3994e2fcbf42SPeter MaydellERST 39956f131f13SMichael S. Tsirkin 399659030a8cSaliguoriDEF("gdb", HAS_ARG, QEMU_OPTION_gdb, \ 3997e5910d42SPeter Maydell "-gdb dev accept gdb connection on 'dev'. (QEMU defaults to starting\n" 3998e5910d42SPeter Maydell " the guest without waiting for gdb to connect; use -S too\n" 3999e5910d42SPeter Maydell " if you want it to not start execution.)\n", 4000e5910d42SPeter Maydell QEMU_ARCH_ALL) 4001e2fcbf42SPeter MaydellSRST 4002e2fcbf42SPeter Maydell``-gdb dev`` 4003923e9311SThomas Huth Accept a gdb connection on device dev (see the :ref:`GDB usage` chapter 4004923e9311SThomas Huth in the System Emulation Users Guide). Note that this option does not pause QEMU 4005e5910d42SPeter Maydell execution -- if you want QEMU to not start the guest until you 4006e5910d42SPeter Maydell connect with gdb and issue a ``continue`` command, you will need to 4007e5910d42SPeter Maydell also pass the ``-S`` option to QEMU. 4008e5910d42SPeter Maydell 4009e5910d42SPeter Maydell The most usual configuration is to listen on a local TCP socket:: 4010e5910d42SPeter Maydell 4011e5910d42SPeter Maydell -gdb tcp::3117 4012e5910d42SPeter Maydell 4013e5910d42SPeter Maydell but you can specify other backends; UDP, pseudo TTY, or even stdio 4014e5910d42SPeter Maydell are all reasonable use cases. For example, a stdio connection 4015e5910d42SPeter Maydell allows you to start QEMU from within gdb and establish the 4016e5910d42SPeter Maydell connection via a pipe: 4017e2fcbf42SPeter Maydell 401809ce5f2dSPeter Maydell .. parsed-literal:: 4019e2fcbf42SPeter Maydell 4020e2fcbf42SPeter Maydell (gdb) target remote | exec |qemu_system| -gdb stdio ... 4021e2fcbf42SPeter MaydellERST 40225824d651Sblueswir1 402359030a8cSaliguoriDEF("s", 0, QEMU_OPTION_s, \ 4024ad96090aSBlue Swirl "-s shorthand for -gdb tcp::" DEFAULT_GDBSTUB_PORT "\n", 4025ad96090aSBlue Swirl QEMU_ARCH_ALL) 4026e2fcbf42SPeter MaydellSRST 4027e2fcbf42SPeter Maydell``-s`` 4028e2fcbf42SPeter Maydell Shorthand for -gdb tcp::1234, i.e. open a gdbserver on TCP port 1234 4029923e9311SThomas Huth (see the :ref:`GDB usage` chapter in the System Emulation Users Guide). 4030e2fcbf42SPeter MaydellERST 40315824d651Sblueswir1 40325824d651Sblueswir1DEF("d", HAS_ARG, QEMU_OPTION_d, \ 4033989b697dSPeter Maydell "-d item1,... enable logging of specified items (use '-d help' for a list of log items)\n", 4034ad96090aSBlue Swirl QEMU_ARCH_ALL) 4035e2fcbf42SPeter MaydellSRST 4036e2fcbf42SPeter Maydell``-d item1[,...]`` 4037e2fcbf42SPeter Maydell Enable logging of specified items. Use '-d help' for a list of log 4038e2fcbf42SPeter Maydell items. 4039e2fcbf42SPeter MaydellERST 40405824d651Sblueswir1 4041c235d738SMatthew FernandezDEF("D", HAS_ARG, QEMU_OPTION_D, \ 4042989b697dSPeter Maydell "-D logfile output log to logfile (default stderr)\n", 4043c235d738SMatthew Fernandez QEMU_ARCH_ALL) 4044e2fcbf42SPeter MaydellSRST 4045e2fcbf42SPeter Maydell``-D logfile`` 4046e2fcbf42SPeter Maydell Output log in logfile instead of to stderr 4047e2fcbf42SPeter MaydellERST 4048c235d738SMatthew Fernandez 40493514552eSAlex BennéeDEF("dfilter", HAS_ARG, QEMU_OPTION_DFILTER, \ 40503514552eSAlex Bennée "-dfilter range,.. filter debug output to range of addresses (useful for -d cpu,exec,etc..)\n", 40513514552eSAlex Bennée QEMU_ARCH_ALL) 4052e2fcbf42SPeter MaydellSRST 4053e2fcbf42SPeter Maydell``-dfilter range1[,...]`` 4054e2fcbf42SPeter Maydell Filter debug output to that relevant to a range of target addresses. 4055e2fcbf42SPeter Maydell The filter spec can be either start+size, start-size or start..end 4056e2fcbf42SPeter Maydell where start end and size are the addresses and sizes required. For 4057e2fcbf42SPeter Maydell example: 4058e2fcbf42SPeter Maydell 4059e2fcbf42SPeter Maydell :: 4060e2fcbf42SPeter Maydell 4061e2fcbf42SPeter Maydell -dfilter 0x8000..0x8fff,0xffffffc000080000+0x200,0xffffffc000060000-0x1000 4062e2fcbf42SPeter Maydell 4063e2fcbf42SPeter Maydell Will dump output for any code in the 0x1000 sized block starting at 4064e2fcbf42SPeter Maydell 0x8000 and the 0x200 sized block starting at 0xffffffc000080000 and 4065e2fcbf42SPeter Maydell another 0x1000 sized block starting at 0xffffffc00005f000. 4066e2fcbf42SPeter MaydellERST 40673514552eSAlex Bennée 40689c09a251SRichard HendersonDEF("seed", HAS_ARG, QEMU_OPTION_seed, \ 40699c09a251SRichard Henderson "-seed number seed the pseudo-random number generator\n", 40709c09a251SRichard Henderson QEMU_ARCH_ALL) 4071e2fcbf42SPeter MaydellSRST 4072e2fcbf42SPeter Maydell``-seed number`` 4073e2fcbf42SPeter Maydell Force the guest to use a deterministic pseudo-random number 4074e2fcbf42SPeter Maydell generator, seeded with number. This does not affect crypto routines 4075e2fcbf42SPeter Maydell within the host. 4076e2fcbf42SPeter MaydellERST 40779c09a251SRichard Henderson 40785824d651Sblueswir1DEF("L", HAS_ARG, QEMU_OPTION_L, \ 4079ad96090aSBlue Swirl "-L path set the directory for the BIOS, VGA BIOS and keymaps\n", 4080ad96090aSBlue Swirl QEMU_ARCH_ALL) 4081e2fcbf42SPeter MaydellSRST 4082e2fcbf42SPeter Maydell``-L path`` 4083e2fcbf42SPeter Maydell Set the directory for the BIOS, VGA BIOS and keymaps. 4084e2fcbf42SPeter Maydell 4085e2fcbf42SPeter Maydell To list all the data directories, use ``-L help``. 4086e2fcbf42SPeter MaydellERST 40875824d651Sblueswir1 40885824d651Sblueswir1DEF("bios", HAS_ARG, QEMU_OPTION_bios, \ 4089ad96090aSBlue Swirl "-bios file set the filename for the BIOS\n", QEMU_ARCH_ALL) 4090e2fcbf42SPeter MaydellSRST 4091e2fcbf42SPeter Maydell``-bios file`` 4092e2fcbf42SPeter Maydell Set the filename for the BIOS. 4093e2fcbf42SPeter MaydellERST 40945824d651Sblueswir1 40955824d651Sblueswir1DEF("enable-kvm", 0, QEMU_OPTION_enable_kvm, \ 4096ad96090aSBlue Swirl "-enable-kvm enable KVM full virtualization support\n", QEMU_ARCH_ALL) 4097e2fcbf42SPeter MaydellSRST 4098e2fcbf42SPeter Maydell``-enable-kvm`` 4099e2fcbf42SPeter Maydell Enable KVM full virtualization support. This option is only 4100e2fcbf42SPeter Maydell available if KVM support is enabled when compiling. 4101e2fcbf42SPeter MaydellERST 41025824d651Sblueswir1 4103e37630caSaliguoriDEF("xen-domid", HAS_ARG, QEMU_OPTION_xen_domid, 4104ad96090aSBlue Swirl "-xen-domid id specify xen guest domain id\n", QEMU_ARCH_ALL) 4105e37630caSaliguoriDEF("xen-attach", 0, QEMU_OPTION_xen_attach, 4106e37630caSaliguori "-xen-attach attach to existing xen domain\n" 41071077bcacSAnthony PERARD " libxl will use this when starting QEMU\n", 4108ad96090aSBlue Swirl QEMU_ARCH_ALL) 41091c599472SPaul DurrantDEF("xen-domid-restrict", 0, QEMU_OPTION_xen_domid_restrict, 41101c599472SPaul Durrant "-xen-domid-restrict restrict set of available xen operations\n" 41111c599472SPaul Durrant " to specified domain id. (Does not affect\n" 41121c599472SPaul Durrant " xenpv machine type).\n", 41131c599472SPaul Durrant QEMU_ARCH_ALL) 4114e2fcbf42SPeter MaydellSRST 4115e2fcbf42SPeter Maydell``-xen-domid id`` 4116e2fcbf42SPeter Maydell Specify xen guest domain id (XEN only). 4117e2fcbf42SPeter Maydell 4118e2fcbf42SPeter Maydell``-xen-attach`` 4119e2fcbf42SPeter Maydell Attach to existing xen domain. libxl will use this when starting 4120e2fcbf42SPeter Maydell QEMU (XEN only). Restrict set of available xen operations to 4121e2fcbf42SPeter Maydell specified domain id (XEN only). 4122e2fcbf42SPeter MaydellERST 4123e37630caSaliguori 41245824d651Sblueswir1DEF("no-reboot", 0, QEMU_OPTION_no_reboot, \ 4125ad96090aSBlue Swirl "-no-reboot exit instead of rebooting\n", QEMU_ARCH_ALL) 4126e2fcbf42SPeter MaydellSRST 4127e2fcbf42SPeter Maydell``-no-reboot`` 4128e2fcbf42SPeter Maydell Exit instead of rebooting. 4129e2fcbf42SPeter MaydellERST 41305824d651Sblueswir1 41315824d651Sblueswir1DEF("no-shutdown", 0, QEMU_OPTION_no_shutdown, \ 4132ad96090aSBlue Swirl "-no-shutdown stop before shutdown\n", QEMU_ARCH_ALL) 4133e2fcbf42SPeter MaydellSRST 4134e2fcbf42SPeter Maydell``-no-shutdown`` 4135e2fcbf42SPeter Maydell Don't exit QEMU on guest shutdown, but instead only stop the 4136e2fcbf42SPeter Maydell emulation. This allows for instance switching to monitor to commit 4137e2fcbf42SPeter Maydell changes to the disk image. 4138e2fcbf42SPeter MaydellERST 41395824d651Sblueswir1 41402a5ad60bSAlejandro JimenezDEF("action", HAS_ARG, QEMU_OPTION_action, 4141c27025e0SPaolo Bonzini "-action reboot=reset|shutdown\n" 4142c27025e0SPaolo Bonzini " action when guest reboots [default=reset]\n" 41432a5ad60bSAlejandro Jimenez "-action shutdown=poweroff|pause\n" 41442a5ad60bSAlejandro Jimenez " action when guest shuts down [default=poweroff]\n" 4145c27025e0SPaolo Bonzini "-action panic=pause|shutdown|none\n" 4146c27025e0SPaolo Bonzini " action when guest panics [default=shutdown]\n" 41472a5ad60bSAlejandro Jimenez "-action watchdog=reset|shutdown|poweroff|inject-nmi|pause|debug|none\n" 41482a5ad60bSAlejandro Jimenez " action when watchdog fires [default=reset]\n", 41492a5ad60bSAlejandro Jimenez QEMU_ARCH_ALL) 41502a5ad60bSAlejandro JimenezSRST 41512a5ad60bSAlejandro Jimenez``-action event=action`` 41522a5ad60bSAlejandro Jimenez The action parameter serves to modify QEMU's default behavior when 41532a5ad60bSAlejandro Jimenez certain guest events occur. It provides a generic method for specifying the 41542a5ad60bSAlejandro Jimenez same behaviors that are modified by the ``-no-reboot`` and ``-no-shutdown`` 41552a5ad60bSAlejandro Jimenez parameters. 41562a5ad60bSAlejandro Jimenez 41572a5ad60bSAlejandro Jimenez Examples: 41582a5ad60bSAlejandro Jimenez 4159c753e8e7SAlejandro Jimenez ``-action panic=none`` 41602a5ad60bSAlejandro Jimenez ``-action reboot=shutdown,shutdown=pause`` 41612a5ad60bSAlejandro Jimenez ``-watchdog i6300esb -action watchdog=pause`` 41622a5ad60bSAlejandro Jimenez 41632a5ad60bSAlejandro JimenezERST 41642a5ad60bSAlejandro Jimenez 41655824d651Sblueswir1DEF("loadvm", HAS_ARG, QEMU_OPTION_loadvm, \ 41665824d651Sblueswir1 "-loadvm [tag|id]\n" \ 4167ad96090aSBlue Swirl " start right away with a saved state (loadvm in monitor)\n", 4168ad96090aSBlue Swirl QEMU_ARCH_ALL) 4169e2fcbf42SPeter MaydellSRST 4170e2fcbf42SPeter Maydell``-loadvm file`` 4171e2fcbf42SPeter Maydell Start right away with a saved state (``loadvm`` in monitor) 4172e2fcbf42SPeter MaydellERST 41735824d651Sblueswir1 41745824d651Sblueswir1#ifndef _WIN32 41755824d651Sblueswir1DEF("daemonize", 0, QEMU_OPTION_daemonize, \ 4176ad96090aSBlue Swirl "-daemonize daemonize QEMU after initializing\n", QEMU_ARCH_ALL) 41775824d651Sblueswir1#endif 4178e2fcbf42SPeter MaydellSRST 4179e2fcbf42SPeter Maydell``-daemonize`` 4180e2fcbf42SPeter Maydell Daemonize the QEMU process after initialization. QEMU will not 4181e2fcbf42SPeter Maydell detach from standard IO until it is ready to receive connections on 4182e2fcbf42SPeter Maydell any of its devices. This option is a useful way for external 4183e2fcbf42SPeter Maydell programs to launch QEMU without having to cope with initialization 4184e2fcbf42SPeter Maydell race conditions. 4185e2fcbf42SPeter MaydellERST 41865824d651Sblueswir1 41875824d651Sblueswir1DEF("option-rom", HAS_ARG, QEMU_OPTION_option_rom, \ 4188ad96090aSBlue Swirl "-option-rom rom load a file, rom, into the option ROM space\n", 4189ad96090aSBlue Swirl QEMU_ARCH_ALL) 4190e2fcbf42SPeter MaydellSRST 4191e2fcbf42SPeter Maydell``-option-rom file`` 4192e2fcbf42SPeter Maydell Load the contents of file as an option ROM. This option is useful to 4193e2fcbf42SPeter Maydell load things like EtherBoot. 4194e2fcbf42SPeter MaydellERST 41955824d651Sblueswir1 41961ed2fc1fSJan KiszkaDEF("rtc", HAS_ARG, QEMU_OPTION_rtc, \ 4197238d1240SArtem Pisarenko "-rtc [base=utc|localtime|<datetime>][,clock=host|rt|vm][,driftfix=none|slew]\n" \ 4198ad96090aSBlue Swirl " set the RTC base and clock, enable drift fix for clock ticks (x86 only)\n", 4199ad96090aSBlue Swirl QEMU_ARCH_ALL) 42001ed2fc1fSJan Kiszka 4201e2fcbf42SPeter MaydellSRST 4202e2fcbf42SPeter Maydell``-rtc [base=utc|localtime|datetime][,clock=host|rt|vm][,driftfix=none|slew]`` 4203e2fcbf42SPeter Maydell Specify ``base`` as ``utc`` or ``localtime`` to let the RTC start at 4204e2fcbf42SPeter Maydell the current UTC or local time, respectively. ``localtime`` is 4205e2fcbf42SPeter Maydell required for correct date in MS-DOS or Windows. To start at a 4206e2fcbf42SPeter Maydell specific point in time, provide datetime in the format 4207e2fcbf42SPeter Maydell ``2006-06-17T16:01:21`` or ``2006-06-17``. The default base is UTC. 4208e2fcbf42SPeter Maydell 4209e2fcbf42SPeter Maydell By default the RTC is driven by the host system time. This allows 4210e2fcbf42SPeter Maydell using of the RTC as accurate reference clock inside the guest, 4211e2fcbf42SPeter Maydell specifically if the host time is smoothly following an accurate 4212e2fcbf42SPeter Maydell external reference clock, e.g. via NTP. If you want to isolate the 4213e2fcbf42SPeter Maydell guest time from the host, you can set ``clock`` to ``rt`` instead, 4214e2fcbf42SPeter Maydell which provides a host monotonic clock if host support it. To even 4215e2fcbf42SPeter Maydell prevent the RTC from progressing during suspension, you can set 4216e2fcbf42SPeter Maydell ``clock`` to ``vm`` (virtual clock). '\ ``clock=vm``\ ' is 4217e2fcbf42SPeter Maydell recommended especially in icount mode in order to preserve 4218e2fcbf42SPeter Maydell determinism; however, note that in icount mode the speed of the 4219e2fcbf42SPeter Maydell virtual clock is variable and can in general differ from the host 4220e2fcbf42SPeter Maydell clock. 4221e2fcbf42SPeter Maydell 4222e2fcbf42SPeter Maydell Enable ``driftfix`` (i386 targets only) if you experience time drift 4223e2fcbf42SPeter Maydell problems, specifically with Windows' ACPI HAL. This option will try 4224e2fcbf42SPeter Maydell to figure out how many timer interrupts were not processed by the 4225e2fcbf42SPeter Maydell Windows guest and will re-inject them. 4226e2fcbf42SPeter MaydellERST 42275824d651Sblueswir1 42285824d651Sblueswir1DEF("icount", HAS_ARG, QEMU_OPTION_icount, \ 4229fa647905SPeter Maydell "-icount [shift=N|auto][,align=on|off][,sleep=on|off][,rr=record|replay,rrfile=<filename>[,rrsnapshot=<snapshot>]]\n" \ 4230bc14ca24Saliguori " enable virtual instruction counter with 2^N clock ticks per\n" \ 4231f1f4b57eSVictor CLEMENT " instruction, enable aligning the host and virtual clocks\n" \ 4232fa647905SPeter Maydell " or disable real time cpu sleeping, and optionally enable\n" \ 4233fa647905SPeter Maydell " record-and-replay mode\n", QEMU_ARCH_ALL) 4234e2fcbf42SPeter MaydellSRST 4235fa647905SPeter Maydell``-icount [shift=N|auto][,align=on|off][,sleep=on|off][,rr=record|replay,rrfile=filename[,rrsnapshot=snapshot]]`` 4236e2fcbf42SPeter Maydell Enable virtual instruction counter. The virtual cpu will execute one 4237e2fcbf42SPeter Maydell instruction every 2^N ns of virtual time. If ``auto`` is specified 4238e2fcbf42SPeter Maydell then the virtual cpu speed will be automatically adjusted to keep 4239e2fcbf42SPeter Maydell virtual time within a few seconds of real time. 4240e2fcbf42SPeter Maydell 4241e2fcbf42SPeter Maydell Note that while this option can give deterministic behavior, it does 4242e2fcbf42SPeter Maydell not provide cycle accurate emulation. Modern CPUs contain 4243e2fcbf42SPeter Maydell superscalar out of order cores with complex cache hierarchies. The 4244e2fcbf42SPeter Maydell number of instructions executed often has little or no correlation 4245e2fcbf42SPeter Maydell with actual performance. 4246e2fcbf42SPeter Maydell 4247fa647905SPeter Maydell When the virtual cpu is sleeping, the virtual time will advance at 4248fa647905SPeter Maydell default speed unless ``sleep=on`` is specified. With 4249fa647905SPeter Maydell ``sleep=on``, the virtual time will jump to the next timer 4250fa647905SPeter Maydell deadline instantly whenever the virtual cpu goes to sleep mode and 4251fa647905SPeter Maydell will not advance if no timer is enabled. This behavior gives 4252fa647905SPeter Maydell deterministic execution times from the guest point of view. 4253fa647905SPeter Maydell The default if icount is enabled is ``sleep=off``. 4254fa647905SPeter Maydell ``sleep=on`` cannot be used together with either ``shift=auto`` 4255fa647905SPeter Maydell or ``align=on``. 4256fa647905SPeter Maydell 4257e2fcbf42SPeter Maydell ``align=on`` will activate the delay algorithm which will try to 4258e2fcbf42SPeter Maydell synchronise the host clock and the virtual clock. The goal is to 4259e2fcbf42SPeter Maydell have a guest running at the real frequency imposed by the shift 4260e2fcbf42SPeter Maydell option. Whenever the guest clock is behind the host clock and if 4261e2fcbf42SPeter Maydell ``align=on`` is specified then we print a message to the user to 4262e2fcbf42SPeter Maydell inform about the delay. Currently this option does not work when 4263e2fcbf42SPeter Maydell ``shift`` is ``auto``. Note: The sync algorithm will work for those 4264e2fcbf42SPeter Maydell shift values for which the guest clock runs ahead of the host clock. 4265e2fcbf42SPeter Maydell Typically this happens when the shift value is high (how high 4266fa647905SPeter Maydell depends on the host machine). The default if icount is enabled 4267fa647905SPeter Maydell is ``align=off``. 4268e2fcbf42SPeter Maydell 4269fa647905SPeter Maydell When the ``rr`` option is specified deterministic record/replay is 4270fa647905SPeter Maydell enabled. The ``rrfile=`` option must also be provided to 4271fa647905SPeter Maydell specify the path to the replay log. In record mode data is written 4272fa647905SPeter Maydell to this file, and in replay mode it is read back. 4273fa647905SPeter Maydell If the ``rrsnapshot`` option is given then it specifies a VM snapshot 4274fa647905SPeter Maydell name. In record mode, a new VM snapshot with the given name is created 4275fa647905SPeter Maydell at the start of execution recording. In replay mode this option 4276fa647905SPeter Maydell specifies the snapshot name used to load the initial VM state. 4277e2fcbf42SPeter MaydellERST 42785824d651Sblueswir1 42799dd986ccSRichard W.M. JonesDEF("watchdog", HAS_ARG, QEMU_OPTION_watchdog, \ 4280d7933ef3SXu Wang "-watchdog model\n" \ 4281ad96090aSBlue Swirl " enable virtual hardware watchdog [default=none]\n", 4282ad96090aSBlue Swirl QEMU_ARCH_ALL) 4283e2fcbf42SPeter MaydellSRST 4284e2fcbf42SPeter Maydell``-watchdog model`` 4285e2fcbf42SPeter Maydell Create a virtual hardware watchdog device. Once enabled (by a guest 4286e2fcbf42SPeter Maydell action), the watchdog must be periodically polled by an agent inside 4287e2fcbf42SPeter Maydell the guest or else the guest will be restarted. Choose a model for 4288e2fcbf42SPeter Maydell which your guest has drivers. 4289e2fcbf42SPeter Maydell 4290e2fcbf42SPeter Maydell The model is the model of hardware watchdog to emulate. Use 4291e2fcbf42SPeter Maydell ``-watchdog help`` to list available hardware models. Only one 4292e2fcbf42SPeter Maydell watchdog can be enabled for a guest. 4293e2fcbf42SPeter Maydell 4294e2fcbf42SPeter Maydell The following models may be available: 4295e2fcbf42SPeter Maydell 4296e2fcbf42SPeter Maydell ``ib700`` 4297e2fcbf42SPeter Maydell iBASE 700 is a very simple ISA watchdog with a single timer. 4298e2fcbf42SPeter Maydell 4299e2fcbf42SPeter Maydell ``i6300esb`` 4300e2fcbf42SPeter Maydell Intel 6300ESB I/O controller hub is a much more featureful 4301e2fcbf42SPeter Maydell PCI-based dual-timer watchdog. 4302e2fcbf42SPeter Maydell 4303e2fcbf42SPeter Maydell ``diag288`` 4304e2fcbf42SPeter Maydell A virtual watchdog for s390x backed by the diagnose 288 4305e2fcbf42SPeter Maydell hypercall (currently KVM only). 4306e2fcbf42SPeter MaydellERST 43079dd986ccSRichard W.M. Jones 43089dd986ccSRichard W.M. JonesDEF("watchdog-action", HAS_ARG, QEMU_OPTION_watchdog_action, \ 43097ad9270eSMarkus Armbruster "-watchdog-action reset|shutdown|poweroff|inject-nmi|pause|debug|none\n" \ 4310ad96090aSBlue Swirl " action when watchdog fires [default=reset]\n", 4311ad96090aSBlue Swirl QEMU_ARCH_ALL) 4312e2fcbf42SPeter MaydellSRST 4313e2fcbf42SPeter Maydell``-watchdog-action action`` 4314e2fcbf42SPeter Maydell The action controls what QEMU will do when the watchdog timer 4315e2fcbf42SPeter Maydell expires. The default is ``reset`` (forcefully reset the guest). 4316e2fcbf42SPeter Maydell Other possible actions are: ``shutdown`` (attempt to gracefully 4317e2fcbf42SPeter Maydell shutdown the guest), ``poweroff`` (forcefully poweroff the guest), 4318e2fcbf42SPeter Maydell ``inject-nmi`` (inject a NMI into the guest), ``pause`` (pause the 4319e2fcbf42SPeter Maydell guest), ``debug`` (print a debug message and continue), or ``none`` 4320e2fcbf42SPeter Maydell (do nothing). 4321e2fcbf42SPeter Maydell 4322e2fcbf42SPeter Maydell Note that the ``shutdown`` action requires that the guest responds 4323e2fcbf42SPeter Maydell to ACPI signals, which it may not be able to do in the sort of 4324e2fcbf42SPeter Maydell situations where the watchdog would have expired, and thus 4325e2fcbf42SPeter Maydell ``-watchdog-action shutdown`` is not recommended for production use. 4326e2fcbf42SPeter Maydell 4327e2fcbf42SPeter Maydell Examples: 4328e2fcbf42SPeter Maydell 4329e2fcbf42SPeter Maydell ``-watchdog i6300esb -watchdog-action pause``; \ ``-watchdog ib700`` 4330e2fcbf42SPeter Maydell 4331e2fcbf42SPeter MaydellERST 43329dd986ccSRichard W.M. Jones 43335824d651Sblueswir1DEF("echr", HAS_ARG, QEMU_OPTION_echr, \ 4334ad96090aSBlue Swirl "-echr chr set terminal escape character instead of ctrl-a\n", 4335ad96090aSBlue Swirl QEMU_ARCH_ALL) 4336e2fcbf42SPeter MaydellSRST 4337e2fcbf42SPeter Maydell``-echr numeric_ascii_value`` 4338e2fcbf42SPeter Maydell Change the escape character used for switching to the monitor when 4339e2fcbf42SPeter Maydell using monitor and serial sharing. The default is ``0x01`` when using 4340e2fcbf42SPeter Maydell the ``-nographic`` option. ``0x01`` is equal to pressing 4341e2fcbf42SPeter Maydell ``Control-a``. You can select a different character from the ascii 4342e2fcbf42SPeter Maydell control keys where 1 through 26 map to Control-a through Control-z. 4343e2fcbf42SPeter Maydell For instance you could use the either of the following to change the 4344e2fcbf42SPeter Maydell escape character to Control-t. 4345e2fcbf42SPeter Maydell 4346e2fcbf42SPeter Maydell ``-echr 0x14``; \ ``-echr 20`` 4347e2fcbf42SPeter Maydell 4348e2fcbf42SPeter MaydellERST 43495824d651Sblueswir1 43505824d651Sblueswir1DEF("incoming", HAS_ARG, QEMU_OPTION_incoming, \ 4351bf24095fSDaniel P. Berrangé "-incoming tcp:[host]:port[,to=maxport][,ipv4=on|off][,ipv6=on|off]\n" \ 4352bf24095fSDaniel P. Berrangé "-incoming rdma:host:port[,ipv4=on|off][,ipv6=on|off]\n" \ 43537c601803SMichael Tokarev "-incoming unix:socketpath\n" \ 43547c601803SMichael Tokarev " prepare for incoming migration, listen on\n" \ 43557c601803SMichael Tokarev " specified protocol and socket address\n" \ 43567c601803SMichael Tokarev "-incoming fd:fd\n" \ 43577c601803SMichael Tokarev "-incoming exec:cmdline\n" \ 43587c601803SMichael Tokarev " accept incoming migration on given file descriptor\n" \ 43591597051bSDr. David Alan Gilbert " or from given external command\n" \ 43601597051bSDr. David Alan Gilbert "-incoming defer\n" \ 43611597051bSDr. David Alan Gilbert " wait for the URI to be specified via migrate_incoming\n", 4362ad96090aSBlue Swirl QEMU_ARCH_ALL) 4363e2fcbf42SPeter MaydellSRST 4364bf24095fSDaniel P. Berrangé``-incoming tcp:[host]:port[,to=maxport][,ipv4=on|off][,ipv6=on|off]`` 436509ce5f2dSPeter Maydell \ 4366bf24095fSDaniel P. Berrangé``-incoming rdma:host:port[,ipv4=on|off][,ipv6=on|off]`` 4367e2fcbf42SPeter Maydell Prepare for incoming migration, listen on a given tcp port. 4368e2fcbf42SPeter Maydell 4369e2fcbf42SPeter Maydell``-incoming unix:socketpath`` 4370e2fcbf42SPeter Maydell Prepare for incoming migration, listen on a given unix socket. 4371e2fcbf42SPeter Maydell 4372e2fcbf42SPeter Maydell``-incoming fd:fd`` 4373e2fcbf42SPeter Maydell Accept incoming migration from a given filedescriptor. 4374e2fcbf42SPeter Maydell 4375e2fcbf42SPeter Maydell``-incoming exec:cmdline`` 4376e2fcbf42SPeter Maydell Accept incoming migration as an output from specified external 4377e2fcbf42SPeter Maydell command. 4378e2fcbf42SPeter Maydell 4379e2fcbf42SPeter Maydell``-incoming defer`` 4380e2fcbf42SPeter Maydell Wait for the URI to be specified via migrate\_incoming. The monitor 4381e2fcbf42SPeter Maydell can be used to change settings (such as migration parameters) prior 4382e2fcbf42SPeter Maydell to issuing the migrate\_incoming to allow the migration to begin. 4383e2fcbf42SPeter MaydellERST 43845824d651Sblueswir1 4385d15c05fcSAshijeet AcharyaDEF("only-migratable", 0, QEMU_OPTION_only_migratable, \ 4386d15c05fcSAshijeet Acharya "-only-migratable allow only migratable devices\n", QEMU_ARCH_ALL) 4387e2fcbf42SPeter MaydellSRST 4388e2fcbf42SPeter Maydell``-only-migratable`` 4389e2fcbf42SPeter Maydell Only allow migratable devices. Devices will not be allowed to enter 4390e2fcbf42SPeter Maydell an unmigratable state. 4391e2fcbf42SPeter MaydellERST 4392d15c05fcSAshijeet Acharya 4393d8c208ddSGerd HoffmannDEF("nodefaults", 0, QEMU_OPTION_nodefaults, \ 4394ad96090aSBlue Swirl "-nodefaults don't create default devices\n", QEMU_ARCH_ALL) 4395e2fcbf42SPeter MaydellSRST 4396e2fcbf42SPeter Maydell``-nodefaults`` 4397e2fcbf42SPeter Maydell Don't create default devices. Normally, QEMU sets the default 4398e2fcbf42SPeter Maydell devices like serial port, parallel port, virtual console, monitor 4399e2fcbf42SPeter Maydell device, VGA adapter, floppy and CD-ROM drive and others. The 4400e2fcbf42SPeter Maydell ``-nodefaults`` option will disable all those default devices. 4401e2fcbf42SPeter MaydellERST 4402d8c208ddSGerd Hoffmann 44035824d651Sblueswir1#ifndef _WIN32 44045824d651Sblueswir1DEF("chroot", HAS_ARG, QEMU_OPTION_chroot, \ 4405ad96090aSBlue Swirl "-chroot dir chroot to dir just before starting the VM\n", 4406ad96090aSBlue Swirl QEMU_ARCH_ALL) 44075824d651Sblueswir1#endif 4408e2fcbf42SPeter MaydellSRST 4409e2fcbf42SPeter Maydell``-chroot dir`` 4410e2fcbf42SPeter Maydell Immediately before starting guest execution, chroot to the specified 4411e2fcbf42SPeter Maydell directory. Especially useful in combination with -runas. 4412e2fcbf42SPeter MaydellERST 44135824d651Sblueswir1 44145824d651Sblueswir1#ifndef _WIN32 44155824d651Sblueswir1DEF("runas", HAS_ARG, QEMU_OPTION_runas, \ 44162c42f1e8SIan Jackson "-runas user change to user id user just before starting the VM\n" \ 44172c42f1e8SIan Jackson " user can be numeric uid:gid instead\n", 4418ad96090aSBlue Swirl QEMU_ARCH_ALL) 44195824d651Sblueswir1#endif 4420e2fcbf42SPeter MaydellSRST 4421e2fcbf42SPeter Maydell``-runas user`` 4422e2fcbf42SPeter Maydell Immediately before starting guest execution, drop root privileges, 4423e2fcbf42SPeter Maydell switching to the specified user. 4424e2fcbf42SPeter MaydellERST 44255824d651Sblueswir1 44265824d651Sblueswir1DEF("prom-env", HAS_ARG, QEMU_OPTION_prom_env, 44275824d651Sblueswir1 "-prom-env variable=value\n" 4428ad96090aSBlue Swirl " set OpenBIOS nvram variables\n", 4429ad96090aSBlue Swirl QEMU_ARCH_PPC | QEMU_ARCH_SPARC) 4430e2fcbf42SPeter MaydellSRST 4431e2fcbf42SPeter Maydell``-prom-env variable=value`` 4432e2fcbf42SPeter Maydell Set OpenBIOS nvram variable to given value (PPC, SPARC only). 4433e2fcbf42SPeter Maydell 4434e2fcbf42SPeter Maydell :: 4435e2fcbf42SPeter Maydell 4436e2fcbf42SPeter Maydell qemu-system-sparc -prom-env 'auto-boot?=false' \ 4437e2fcbf42SPeter Maydell -prom-env 'boot-device=sd(0,2,0):d' -prom-env 'boot-args=linux single' 4438e2fcbf42SPeter Maydell 4439e2fcbf42SPeter Maydell :: 4440e2fcbf42SPeter Maydell 4441e2fcbf42SPeter Maydell qemu-system-ppc -prom-env 'auto-boot?=false' \ 4442e2fcbf42SPeter Maydell -prom-env 'boot-device=hd:2,\yaboot' \ 4443e2fcbf42SPeter Maydell -prom-env 'boot-args=conf=hd:2,\yaboot.conf' 4444e2fcbf42SPeter MaydellERST 44455824d651Sblueswir1DEF("semihosting", 0, QEMU_OPTION_semihosting, 4446f7bbcfb5SMichael Walle "-semihosting semihosting mode\n", 44479d49bcf6SMarkus Armbruster QEMU_ARCH_ARM | QEMU_ARCH_M68K | QEMU_ARCH_XTENSA | 4448a10b9d93SKeith Packard QEMU_ARCH_MIPS | QEMU_ARCH_NIOS2 | QEMU_ARCH_RISCV) 4449e2fcbf42SPeter MaydellSRST 4450e2fcbf42SPeter Maydell``-semihosting`` 4451a10b9d93SKeith Packard Enable semihosting mode (ARM, M68K, Xtensa, MIPS, Nios II, RISC-V only). 4452e2fcbf42SPeter Maydell 4453e2fcbf42SPeter Maydell Note that this allows guest direct access to the host filesystem, so 4454e2fcbf42SPeter Maydell should only be used with a trusted guest OS. 4455e2fcbf42SPeter Maydell 4456e2fcbf42SPeter Maydell See the -semihosting-config option documentation for further 4457e2fcbf42SPeter Maydell information about the facilities this enables. 4458e2fcbf42SPeter MaydellERST 4459a38bb079SLiviu IonescuDEF("semihosting-config", HAS_ARG, QEMU_OPTION_semihosting_config, 44604e7f9032SAlex Bennée "-semihosting-config [enable=on|off][,target=native|gdb|auto][,chardev=id][,arg=str[,...]]\n" \ 4461a59d31a1SLeon Alrae " semihosting configuration\n", 44629d49bcf6SMarkus ArmbrusterQEMU_ARCH_ARM | QEMU_ARCH_M68K | QEMU_ARCH_XTENSA | 4463a10b9d93SKeith PackardQEMU_ARCH_MIPS | QEMU_ARCH_NIOS2 | QEMU_ARCH_RISCV) 4464e2fcbf42SPeter MaydellSRST 4465e2fcbf42SPeter Maydell``-semihosting-config [enable=on|off][,target=native|gdb|auto][,chardev=id][,arg=str[,...]]`` 4466a10b9d93SKeith Packard Enable and configure semihosting (ARM, M68K, Xtensa, MIPS, Nios II, RISC-V 4467e2fcbf42SPeter Maydell only). 4468e2fcbf42SPeter Maydell 4469e2fcbf42SPeter Maydell Note that this allows guest direct access to the host filesystem, so 4470e2fcbf42SPeter Maydell should only be used with a trusted guest OS. 4471e2fcbf42SPeter Maydell 4472e2fcbf42SPeter Maydell On Arm this implements the standard semihosting API, version 2.0. 4473e2fcbf42SPeter Maydell 4474e2fcbf42SPeter Maydell On M68K this implements the "ColdFire GDB" interface used by 4475e2fcbf42SPeter Maydell libgloss. 4476e2fcbf42SPeter Maydell 4477e2fcbf42SPeter Maydell Xtensa semihosting provides basic file IO calls, such as 4478e2fcbf42SPeter Maydell open/read/write/seek/select. Tensilica baremetal libc for ISS and 4479e2fcbf42SPeter Maydell linux platform "sim" use this interface. 4480e2fcbf42SPeter Maydell 4481a10b9d93SKeith Packard On RISC-V this implements the standard semihosting API, version 0.2. 4482a10b9d93SKeith Packard 4483e2fcbf42SPeter Maydell ``target=native|gdb|auto`` 4484e2fcbf42SPeter Maydell Defines where the semihosting calls will be addressed, to QEMU 4485e2fcbf42SPeter Maydell (``native``) or to GDB (``gdb``). The default is ``auto``, which 4486e2fcbf42SPeter Maydell means ``gdb`` during debug sessions and ``native`` otherwise. 4487e2fcbf42SPeter Maydell 4488e2fcbf42SPeter Maydell ``chardev=str1`` 4489e2fcbf42SPeter Maydell Send the output to a chardev backend output for native or auto 4490e2fcbf42SPeter Maydell output when not in gdb 4491e2fcbf42SPeter Maydell 4492e2fcbf42SPeter Maydell ``arg=str1,arg=str2,...`` 4493e2fcbf42SPeter Maydell Allows the user to pass input arguments, and can be used 4494e2fcbf42SPeter Maydell multiple times to build up a list. The old-style 4495e2fcbf42SPeter Maydell ``-kernel``/``-append`` method of passing a command line is 4496e2fcbf42SPeter Maydell still supported for backward compatibility. If both the 4497e2fcbf42SPeter Maydell ``--semihosting-config arg`` and the ``-kernel``/``-append`` are 4498e2fcbf42SPeter Maydell specified, the former is passed to semihosting as it always 4499e2fcbf42SPeter Maydell takes precedence. 4500e2fcbf42SPeter MaydellERST 45015824d651Sblueswir1DEF("old-param", 0, QEMU_OPTION_old_param, 4502ad96090aSBlue Swirl "-old-param old param mode\n", QEMU_ARCH_ARM) 4503e2fcbf42SPeter MaydellSRST 4504e2fcbf42SPeter Maydell``-old-param`` 4505e2fcbf42SPeter Maydell Old param mode (ARM only). 4506e2fcbf42SPeter MaydellERST 450795d5f08bSStefan Weil 45087d76ad4fSEduardo OtuboDEF("sandbox", HAS_ARG, QEMU_OPTION_sandbox, \ 450973a1e647SEduardo Otubo "-sandbox on[,obsolete=allow|deny][,elevateprivileges=allow|deny|children]\n" \ 451024f8cdc5SEduardo Otubo " [,spawn=allow|deny][,resourcecontrol=allow|deny]\n" \ 45112b716fa6SEduardo Otubo " Enable seccomp mode 2 system call filter (default 'off').\n" \ 45122b716fa6SEduardo Otubo " use 'obsolete' to allow obsolete system calls that are provided\n" \ 45132b716fa6SEduardo Otubo " by the kernel, but typically no longer used by modern\n" \ 451473a1e647SEduardo Otubo " C library implementations.\n" \ 4515d42304b1SPhilippe Mathieu-Daudé " use 'elevateprivileges' to allow or deny the QEMU process ability\n" \ 4516d42304b1SPhilippe Mathieu-Daudé " to elevate privileges using set*uid|gid system calls.\n" \ 451773a1e647SEduardo Otubo " The value 'children' will deny set*uid|gid system calls for\n" \ 4518995a226fSEduardo Otubo " main QEMU process but will allow forks and execves to run unprivileged\n" \ 4519995a226fSEduardo Otubo " use 'spawn' to avoid QEMU to spawn new threads or processes by\n" \ 4520d42304b1SPhilippe Mathieu-Daudé " blocking *fork and execve\n" \ 452124f8cdc5SEduardo Otubo " use 'resourcecontrol' to disable process affinity and schedular priority\n", 45227d76ad4fSEduardo Otubo QEMU_ARCH_ALL) 4523e2fcbf42SPeter MaydellSRST 4524e2fcbf42SPeter Maydell``-sandbox arg[,obsolete=string][,elevateprivileges=string][,spawn=string][,resourcecontrol=string]`` 4525e2fcbf42SPeter Maydell Enable Seccomp mode 2 system call filter. 'on' will enable syscall 4526e2fcbf42SPeter Maydell filtering and 'off' will disable it. The default is 'off'. 4527e2fcbf42SPeter Maydell 4528e2fcbf42SPeter Maydell ``obsolete=string`` 4529e2fcbf42SPeter Maydell Enable Obsolete system calls 4530e2fcbf42SPeter Maydell 4531e2fcbf42SPeter Maydell ``elevateprivileges=string`` 4532e2fcbf42SPeter Maydell Disable set\*uid\|gid system calls 4533e2fcbf42SPeter Maydell 4534e2fcbf42SPeter Maydell ``spawn=string`` 4535e2fcbf42SPeter Maydell Disable \*fork and execve 4536e2fcbf42SPeter Maydell 4537e2fcbf42SPeter Maydell ``resourcecontrol=string`` 4538e2fcbf42SPeter Maydell Disable process affinity and schedular priority 4539e2fcbf42SPeter MaydellERST 45407d76ad4fSEduardo Otubo 4541715a664aSGerd HoffmannDEF("readconfig", HAS_ARG, QEMU_OPTION_readconfig, 4542ad96090aSBlue Swirl "-readconfig <file>\n", QEMU_ARCH_ALL) 4543e2fcbf42SPeter MaydellSRST 4544e2fcbf42SPeter Maydell``-readconfig file`` 4545e2fcbf42SPeter Maydell Read device configuration from file. This approach is useful when 4546e2fcbf42SPeter Maydell you want to spawn QEMU process with many command line options but 4547e2fcbf42SPeter Maydell you don't want to exceed the command line character limit. 4548e2fcbf42SPeter MaydellERST 4549715a664aSGerd HoffmannDEF("writeconfig", HAS_ARG, QEMU_OPTION_writeconfig, 4550715a664aSGerd Hoffmann "-writeconfig <file>\n" 4551b979c931SPaolo Bonzini " read/write config file (deprecated)\n", QEMU_ARCH_ALL) 4552e2fcbf42SPeter MaydellSRST 4553e2fcbf42SPeter MaydellERST 45542feac451SThomas Huth 4555f29a5614SEduardo HabkostDEF("no-user-config", 0, QEMU_OPTION_nouserconfig, 4556f29a5614SEduardo Habkost "-no-user-config\n" 45573478eae9SEduardo Habkost " do not load default user-provided config files at startup\n", 4558f29a5614SEduardo Habkost QEMU_ARCH_ALL) 4559e2fcbf42SPeter MaydellSRST 4560e2fcbf42SPeter Maydell``-no-user-config`` 4561e2fcbf42SPeter Maydell The ``-no-user-config`` option makes QEMU not load any of the 4562e2fcbf42SPeter Maydell user-provided config files on sysconfdir. 4563e2fcbf42SPeter MaydellERST 45642feac451SThomas Huth 4565ab6540d5SPrerna SaxenaDEF("trace", HAS_ARG, QEMU_OPTION_trace, 456610578a25SPaolo Bonzini "-trace [[enable=]<pattern>][,events=<file>][,file=<file>]\n" 456723d15e86SLluís " specify tracing options\n", 4568ab6540d5SPrerna Saxena QEMU_ARCH_ALL) 4569e2fcbf42SPeter MaydellSRST 4570e2fcbf42SPeter Maydell``-trace [[enable=]pattern][,events=file][,file=file]`` 457109ce5f2dSPeter Maydell .. include:: ../qemu-option-trace.rst.inc 4572e2fcbf42SPeter Maydell 4573e2fcbf42SPeter MaydellERST 457442229a75SLluís VilanovaDEF("plugin", HAS_ARG, QEMU_OPTION_plugin, 45753a445acbSMahmoud Mandour "-plugin [file=]<file>[,<argname>=<argvalue>]\n" 457642229a75SLluís Vilanova " load a plugin\n", 457742229a75SLluís Vilanova QEMU_ARCH_ALL) 4578e2fcbf42SPeter MaydellSRST 45793a445acbSMahmoud Mandour``-plugin file=file[,argname=argvalue]`` 4580e2fcbf42SPeter Maydell Load a plugin. 4581e2fcbf42SPeter Maydell 4582e2fcbf42SPeter Maydell ``file=file`` 4583e2fcbf42SPeter Maydell Load the given plugin from a shared library file. 4584e2fcbf42SPeter Maydell 45853a445acbSMahmoud Mandour ``argname=argvalue`` 45863a445acbSMahmoud Mandour Argument passed to the plugin. (Can be given multiple times.) 4587e2fcbf42SPeter MaydellERST 45883dbf2c7fSStefan Weil 458931e70d6cSMarkus ArmbrusterHXCOMM Internal use 459031e70d6cSMarkus ArmbrusterDEF("qtest", HAS_ARG, QEMU_OPTION_qtest, "", QEMU_ARCH_ALL) 459131e70d6cSMarkus ArmbrusterDEF("qtest-log", HAS_ARG, QEMU_OPTION_qtest_log, "", QEMU_ARCH_ALL) 4592c7f0f3b1SAnthony Liguori 45930f66998fSPaul Moore#ifdef __linux__ 45940f66998fSPaul MooreDEF("enable-fips", 0, QEMU_OPTION_enablefips, 45950f66998fSPaul Moore "-enable-fips enable FIPS 140-2 compliance\n", 45960f66998fSPaul Moore QEMU_ARCH_ALL) 45970f66998fSPaul Moore#endif 4598e2fcbf42SPeter MaydellSRST 4599e2fcbf42SPeter Maydell``-enable-fips`` 4600e2fcbf42SPeter Maydell Enable FIPS 140-2 compliance mode. 4601e2fcbf42SPeter MaydellERST 46020f66998fSPaul Moore 46035e2ac519SSeiji AguchiDEF("msg", HAS_ARG, QEMU_OPTION_msg, 46042880ffb0SMario Smarduch "-msg [timestamp[=on|off]][,guest-name=[on|off]]\n" 4605deda497bSMarkus Armbruster " control error message format\n" 46062880ffb0SMario Smarduch " timestamp=on enables timestamps (default: off)\n" 46072880ffb0SMario Smarduch " guest-name=on enables guest name prefix but only if\n" 46082880ffb0SMario Smarduch " -name guest option is set (default: off)\n", 46095e2ac519SSeiji Aguchi QEMU_ARCH_ALL) 4610e2fcbf42SPeter MaydellSRST 46112880ffb0SMario Smarduch``-msg [timestamp[=on|off]][,guest-name[=on|off]]`` 4612e2fcbf42SPeter Maydell Control error message format. 4613e2fcbf42SPeter Maydell 4614e2fcbf42SPeter Maydell ``timestamp=on|off`` 4615e2fcbf42SPeter Maydell Prefix messages with a timestamp. Default is off. 46162880ffb0SMario Smarduch 46172880ffb0SMario Smarduch ``guest-name=on|off`` 46182880ffb0SMario Smarduch Prefix messages with guest name but only if -name guest option is set 46192880ffb0SMario Smarduch otherwise the option is ignored. Default is off. 4620e2fcbf42SPeter MaydellERST 46215e2ac519SSeiji Aguchi 4622abfd9ce3SAmit ShahDEF("dump-vmstate", HAS_ARG, QEMU_OPTION_dump_vmstate, 4623abfd9ce3SAmit Shah "-dump-vmstate <file>\n" 4624abfd9ce3SAmit Shah " Output vmstate information in JSON format to file.\n" 4625abfd9ce3SAmit Shah " Use the scripts/vmstate-static-checker.py file to\n" 4626abfd9ce3SAmit Shah " check for possible regressions in migration code\n" 46272382053fSLaurent Vivier " by comparing two such vmstate dumps.\n", 4628abfd9ce3SAmit Shah QEMU_ARCH_ALL) 4629e2fcbf42SPeter MaydellSRST 4630e2fcbf42SPeter Maydell``-dump-vmstate file`` 4631e2fcbf42SPeter Maydell Dump json-encoded vmstate information for current machine type to 4632e2fcbf42SPeter Maydell file in file 4633e2fcbf42SPeter MaydellERST 4634abfd9ce3SAmit Shah 463512df189dSEmilio G. CotaDEF("enable-sync-profile", 0, QEMU_OPTION_enable_sync_profile, 463612df189dSEmilio G. Cota "-enable-sync-profile\n" 463712df189dSEmilio G. Cota " enable synchronization profiling\n", 463812df189dSEmilio G. Cota QEMU_ARCH_ALL) 4639e2fcbf42SPeter MaydellSRST 4640e2fcbf42SPeter Maydell``-enable-sync-profile`` 4641e2fcbf42SPeter Maydell Enable synchronization profiling. 4642e2fcbf42SPeter MaydellERST 464312df189dSEmilio G. Cota 464443f187a5SPaolo BonziniDEFHEADING() 4645de6b4f90SMarkus Armbruster 4646de6b4f90SMarkus ArmbrusterDEFHEADING(Generic object creation:) 4647b9174d4fSDaniel P. Berrange 4648b9174d4fSDaniel P. BerrangeDEF("object", HAS_ARG, QEMU_OPTION_object, 4649b9174d4fSDaniel P. Berrange "-object TYPENAME[,PROP1=VALUE1,...]\n" 4650b9174d4fSDaniel P. Berrange " create a new object of type TYPENAME setting properties\n" 4651b9174d4fSDaniel P. Berrange " in the order they are specified. Note that the 'id'\n" 4652b9174d4fSDaniel P. Berrange " property must be set. These objects are placed in the\n" 4653b9174d4fSDaniel P. Berrange " '/objects' path.\n", 4654b9174d4fSDaniel P. Berrange QEMU_ARCH_ALL) 4655e2fcbf42SPeter MaydellSRST 4656e2fcbf42SPeter Maydell``-object typename[,prop1=value1,...]`` 4657e2fcbf42SPeter Maydell Create a new object of type typename setting properties in the order 4658e2fcbf42SPeter Maydell they are specified. Note that the 'id' property must be set. These 4659e2fcbf42SPeter Maydell objects are placed in the '/objects' path. 4660e2fcbf42SPeter Maydell 466186635aa4SStefan Hajnoczi ``-object memory-backend-file,id=id,size=size,mem-path=dir,share=on|off,discard-data=on|off,merge=on|off,dump=on|off,prealloc=on|off,host-nodes=host-nodes,policy=default|preferred|bind|interleave,align=align,readonly=on|off`` 4662e2fcbf42SPeter Maydell Creates a memory file backend object, which can be used to back 4663e2fcbf42SPeter Maydell the guest RAM with huge pages. 4664e2fcbf42SPeter Maydell 4665e2fcbf42SPeter Maydell The ``id`` parameter is a unique ID that will be used to 466656c9f00eSRobert Hoo reference this memory region in other parameters, e.g. ``-numa``, 466756c9f00eSRobert Hoo ``-device nvdimm``, etc. 4668e2fcbf42SPeter Maydell 4669e2fcbf42SPeter Maydell The ``size`` option provides the size of the memory region, and 467056c9f00eSRobert Hoo accepts common suffixes, e.g. ``500M``. 4671e2fcbf42SPeter Maydell 4672e2fcbf42SPeter Maydell The ``mem-path`` provides the path to either a shared memory or 4673e2fcbf42SPeter Maydell huge page filesystem mount. 4674e2fcbf42SPeter Maydell 4675e2fcbf42SPeter Maydell The ``share`` boolean option determines whether the memory 4676e2fcbf42SPeter Maydell region is marked as private to QEMU, or shared. The latter 4677e2fcbf42SPeter Maydell allows a co-operating external process to access the QEMU memory 4678e2fcbf42SPeter Maydell region. 4679e2fcbf42SPeter Maydell 4680e2fcbf42SPeter Maydell The ``share`` is also required for pvrdma devices due to 4681e2fcbf42SPeter Maydell limitations in the RDMA API provided by Linux. 4682e2fcbf42SPeter Maydell 4683e2fcbf42SPeter Maydell Setting share=on might affect the ability to configure NUMA 4684e2fcbf42SPeter Maydell bindings for the memory backend under some circumstances, see 4685e2fcbf42SPeter Maydell Documentation/vm/numa\_memory\_policy.txt on the Linux kernel 4686e2fcbf42SPeter Maydell source tree for additional details. 4687e2fcbf42SPeter Maydell 4688e2fcbf42SPeter Maydell Setting the ``discard-data`` boolean option to on indicates that 4689e2fcbf42SPeter Maydell file contents can be destroyed when QEMU exits, to avoid 4690e2fcbf42SPeter Maydell unnecessarily flushing data to the backing file. Note that 4691e2fcbf42SPeter Maydell ``discard-data`` is only an optimization, and QEMU might not 4692e2fcbf42SPeter Maydell discard file contents if it aborts unexpectedly or is terminated 4693e2fcbf42SPeter Maydell using SIGKILL. 4694e2fcbf42SPeter Maydell 4695e2fcbf42SPeter Maydell The ``merge`` boolean option enables memory merge, also known as 4696e2fcbf42SPeter Maydell MADV\_MERGEABLE, so that Kernel Samepage Merging will consider 4697e2fcbf42SPeter Maydell the pages for memory deduplication. 4698e2fcbf42SPeter Maydell 4699e2fcbf42SPeter Maydell Setting the ``dump`` boolean option to off excludes the memory 4700e2fcbf42SPeter Maydell from core dumps. This feature is also known as MADV\_DONTDUMP. 4701e2fcbf42SPeter Maydell 4702e2fcbf42SPeter Maydell The ``prealloc`` boolean option enables memory preallocation. 4703e2fcbf42SPeter Maydell 4704e2fcbf42SPeter Maydell The ``host-nodes`` option binds the memory range to a list of 4705e2fcbf42SPeter Maydell NUMA host nodes. 4706e2fcbf42SPeter Maydell 4707e2fcbf42SPeter Maydell The ``policy`` option sets the NUMA policy to one of the 4708e2fcbf42SPeter Maydell following values: 4709e2fcbf42SPeter Maydell 4710e2fcbf42SPeter Maydell ``default`` 4711e2fcbf42SPeter Maydell default host policy 4712e2fcbf42SPeter Maydell 4713e2fcbf42SPeter Maydell ``preferred`` 4714e2fcbf42SPeter Maydell prefer the given host node list for allocation 4715e2fcbf42SPeter Maydell 4716e2fcbf42SPeter Maydell ``bind`` 4717e2fcbf42SPeter Maydell restrict memory allocation to the given host node list 4718e2fcbf42SPeter Maydell 4719e2fcbf42SPeter Maydell ``interleave`` 4720e2fcbf42SPeter Maydell interleave memory allocations across the given host node 4721e2fcbf42SPeter Maydell list 4722e2fcbf42SPeter Maydell 4723e2fcbf42SPeter Maydell The ``align`` option specifies the base address alignment when 4724e2fcbf42SPeter Maydell QEMU mmap(2) ``mem-path``, and accepts common suffixes, eg 4725e2fcbf42SPeter Maydell ``2M``. Some backend store specified by ``mem-path`` requires an 4726e2fcbf42SPeter Maydell alignment different than the default one used by QEMU, eg the 4727e2fcbf42SPeter Maydell device DAX /dev/dax0.0 requires 2M alignment rather than 4K. In 4728e2fcbf42SPeter Maydell such cases, users can specify the required alignment via this 4729e2fcbf42SPeter Maydell option. 4730e2fcbf42SPeter Maydell 4731e2fcbf42SPeter Maydell The ``pmem`` option specifies whether the backing file specified 4732e2fcbf42SPeter Maydell by ``mem-path`` is in host persistent memory that can be 4733e2fcbf42SPeter Maydell accessed using the SNIA NVM programming model (e.g. Intel 4734e2fcbf42SPeter Maydell NVDIMM). If ``pmem`` is set to 'on', QEMU will take necessary 4735e2fcbf42SPeter Maydell operations to guarantee the persistence of its own writes to 4736e2fcbf42SPeter Maydell ``mem-path`` (e.g. in vNVDIMM label emulation and live 4737e2fcbf42SPeter Maydell migration). Also, we will map the backend-file with MAP\_SYNC 4738e2fcbf42SPeter Maydell flag, which ensures the file metadata is in sync for 4739e2fcbf42SPeter Maydell ``mem-path`` in case of host crash or a power failure. MAP\_SYNC 4740e2fcbf42SPeter Maydell requires support from both the host kernel (since Linux kernel 4741e2fcbf42SPeter Maydell 4.15) and the filesystem of ``mem-path`` mounted with DAX 4742e2fcbf42SPeter Maydell option. 4743e2fcbf42SPeter Maydell 474486635aa4SStefan Hajnoczi The ``readonly`` option specifies whether the backing file is opened 474586635aa4SStefan Hajnoczi read-only or read-write (default). 474686635aa4SStefan Hajnoczi 4747e2fcbf42SPeter Maydell ``-object memory-backend-ram,id=id,merge=on|off,dump=on|off,share=on|off,prealloc=on|off,size=size,host-nodes=host-nodes,policy=default|preferred|bind|interleave`` 4748e2fcbf42SPeter Maydell Creates a memory backend object, which can be used to back the 4749e2fcbf42SPeter Maydell guest RAM. Memory backend objects offer more control than the 4750e2fcbf42SPeter Maydell ``-m`` option that is traditionally used to define guest RAM. 4751e2fcbf42SPeter Maydell Please refer to ``memory-backend-file`` for a description of the 4752e2fcbf42SPeter Maydell options. 4753e2fcbf42SPeter Maydell 4754e2fcbf42SPeter Maydell ``-object memory-backend-memfd,id=id,merge=on|off,dump=on|off,share=on|off,prealloc=on|off,size=size,host-nodes=host-nodes,policy=default|preferred|bind|interleave,seal=on|off,hugetlb=on|off,hugetlbsize=size`` 4755e2fcbf42SPeter Maydell Creates an anonymous memory file backend object, which allows 4756e2fcbf42SPeter Maydell QEMU to share the memory with an external process (e.g. when 4757e2fcbf42SPeter Maydell using vhost-user). The memory is allocated with memfd and 4758e2fcbf42SPeter Maydell optional sealing. (Linux only) 4759e2fcbf42SPeter Maydell 4760e2fcbf42SPeter Maydell The ``seal`` option creates a sealed-file, that will block 4761e2fcbf42SPeter Maydell further resizing the memory ('on' by default). 4762e2fcbf42SPeter Maydell 4763e2fcbf42SPeter Maydell The ``hugetlb`` option specify the file to be created resides in 4764e2fcbf42SPeter Maydell the hugetlbfs filesystem (since Linux 4.14). Used in conjunction 4765e2fcbf42SPeter Maydell with the ``hugetlb`` option, the ``hugetlbsize`` option specify 4766e2fcbf42SPeter Maydell the hugetlb page size on systems that support multiple hugetlb 4767e2fcbf42SPeter Maydell page sizes (it must be a power of 2 value supported by the 4768e2fcbf42SPeter Maydell system). 4769e2fcbf42SPeter Maydell 4770e2fcbf42SPeter Maydell In some versions of Linux, the ``hugetlb`` option is 4771e2fcbf42SPeter Maydell incompatible with the ``seal`` option (requires at least Linux 4772e2fcbf42SPeter Maydell 4.16). 4773e2fcbf42SPeter Maydell 4774e2fcbf42SPeter Maydell Please refer to ``memory-backend-file`` for a description of the 4775e2fcbf42SPeter Maydell other options. 4776e2fcbf42SPeter Maydell 4777e2fcbf42SPeter Maydell The ``share`` boolean option is on by default with memfd. 4778e2fcbf42SPeter Maydell 4779e2fcbf42SPeter Maydell ``-object rng-builtin,id=id`` 4780e2fcbf42SPeter Maydell Creates a random number generator backend which obtains entropy 4781e2fcbf42SPeter Maydell from QEMU builtin functions. The ``id`` parameter is a unique ID 4782e2fcbf42SPeter Maydell that will be used to reference this entropy backend from the 4783e2fcbf42SPeter Maydell ``virtio-rng`` device. By default, the ``virtio-rng`` device 4784e2fcbf42SPeter Maydell uses this RNG backend. 4785e2fcbf42SPeter Maydell 4786e2fcbf42SPeter Maydell ``-object rng-random,id=id,filename=/dev/random`` 4787e2fcbf42SPeter Maydell Creates a random number generator backend which obtains entropy 4788e2fcbf42SPeter Maydell from a device on the host. The ``id`` parameter is a unique ID 4789e2fcbf42SPeter Maydell that will be used to reference this entropy backend from the 4790e2fcbf42SPeter Maydell ``virtio-rng`` device. The ``filename`` parameter specifies 4791e2fcbf42SPeter Maydell which file to obtain entropy from and if omitted defaults to 4792e2fcbf42SPeter Maydell ``/dev/urandom``. 4793e2fcbf42SPeter Maydell 4794e2fcbf42SPeter Maydell ``-object rng-egd,id=id,chardev=chardevid`` 4795e2fcbf42SPeter Maydell Creates a random number generator backend which obtains entropy 4796e2fcbf42SPeter Maydell from an external daemon running on the host. The ``id`` 4797e2fcbf42SPeter Maydell parameter is a unique ID that will be used to reference this 4798e2fcbf42SPeter Maydell entropy backend from the ``virtio-rng`` device. The ``chardev`` 4799e2fcbf42SPeter Maydell parameter is the unique ID of a character device backend that 4800e2fcbf42SPeter Maydell provides the connection to the RNG daemon. 4801e2fcbf42SPeter Maydell 4802e2fcbf42SPeter Maydell ``-object tls-creds-anon,id=id,endpoint=endpoint,dir=/path/to/cred/dir,verify-peer=on|off`` 4803e2fcbf42SPeter Maydell Creates a TLS anonymous credentials object, which can be used to 4804e2fcbf42SPeter Maydell provide TLS support on network backends. The ``id`` parameter is 4805e2fcbf42SPeter Maydell a unique ID which network backends will use to access the 4806e2fcbf42SPeter Maydell credentials. The ``endpoint`` is either ``server`` or ``client`` 4807e2fcbf42SPeter Maydell depending on whether the QEMU network backend that uses the 4808e2fcbf42SPeter Maydell credentials will be acting as a client or as a server. If 4809e2fcbf42SPeter Maydell ``verify-peer`` is enabled (the default) then once the handshake 4810e2fcbf42SPeter Maydell is completed, the peer credentials will be verified, though this 4811e2fcbf42SPeter Maydell is a no-op for anonymous credentials. 4812e2fcbf42SPeter Maydell 4813e2fcbf42SPeter Maydell The dir parameter tells QEMU where to find the credential files. 4814e2fcbf42SPeter Maydell For server endpoints, this directory may contain a file 4815e2fcbf42SPeter Maydell dh-params.pem providing diffie-hellman parameters to use for the 4816e2fcbf42SPeter Maydell TLS server. If the file is missing, QEMU will generate a set of 4817e2fcbf42SPeter Maydell DH parameters at startup. This is a computationally expensive 4818e2fcbf42SPeter Maydell operation that consumes random pool entropy, so it is 4819e2fcbf42SPeter Maydell recommended that a persistent set of parameters be generated 4820e2fcbf42SPeter Maydell upfront and saved. 4821e2fcbf42SPeter Maydell 4822e2fcbf42SPeter Maydell ``-object tls-creds-psk,id=id,endpoint=endpoint,dir=/path/to/keys/dir[,username=username]`` 4823e2fcbf42SPeter Maydell Creates a TLS Pre-Shared Keys (PSK) credentials object, which 4824e2fcbf42SPeter Maydell can be used to provide TLS support on network backends. The 4825e2fcbf42SPeter Maydell ``id`` parameter is a unique ID which network backends will use 4826e2fcbf42SPeter Maydell to access the credentials. The ``endpoint`` is either ``server`` 4827e2fcbf42SPeter Maydell or ``client`` depending on whether the QEMU network backend that 4828e2fcbf42SPeter Maydell uses the credentials will be acting as a client or as a server. 4829e2fcbf42SPeter Maydell For clients only, ``username`` is the username which will be 4830e2fcbf42SPeter Maydell sent to the server. If omitted it defaults to "qemu". 4831e2fcbf42SPeter Maydell 4832e2fcbf42SPeter Maydell The dir parameter tells QEMU where to find the keys file. It is 4833e2fcbf42SPeter Maydell called "dir/keys.psk" and contains "username:key" pairs. This 4834e2fcbf42SPeter Maydell file can most easily be created using the GnuTLS ``psktool`` 4835e2fcbf42SPeter Maydell program. 4836e2fcbf42SPeter Maydell 4837e2fcbf42SPeter Maydell For server endpoints, dir may also contain a file dh-params.pem 4838e2fcbf42SPeter Maydell providing diffie-hellman parameters to use for the TLS server. 4839e2fcbf42SPeter Maydell If the file is missing, QEMU will generate a set of DH 4840e2fcbf42SPeter Maydell parameters at startup. This is a computationally expensive 4841e2fcbf42SPeter Maydell operation that consumes random pool entropy, so it is 4842e2fcbf42SPeter Maydell recommended that a persistent set of parameters be generated up 4843e2fcbf42SPeter Maydell front and saved. 4844e2fcbf42SPeter Maydell 4845e2fcbf42SPeter Maydell ``-object tls-creds-x509,id=id,endpoint=endpoint,dir=/path/to/cred/dir,priority=priority,verify-peer=on|off,passwordid=id`` 4846e2fcbf42SPeter Maydell Creates a TLS anonymous credentials object, which can be used to 4847e2fcbf42SPeter Maydell provide TLS support on network backends. The ``id`` parameter is 4848e2fcbf42SPeter Maydell a unique ID which network backends will use to access the 4849e2fcbf42SPeter Maydell credentials. The ``endpoint`` is either ``server`` or ``client`` 4850e2fcbf42SPeter Maydell depending on whether the QEMU network backend that uses the 4851e2fcbf42SPeter Maydell credentials will be acting as a client or as a server. If 4852e2fcbf42SPeter Maydell ``verify-peer`` is enabled (the default) then once the handshake 4853e2fcbf42SPeter Maydell is completed, the peer credentials will be verified. With x509 4854e2fcbf42SPeter Maydell certificates, this implies that the clients must be provided 4855e2fcbf42SPeter Maydell with valid client certificates too. 4856e2fcbf42SPeter Maydell 4857e2fcbf42SPeter Maydell The dir parameter tells QEMU where to find the credential files. 4858e2fcbf42SPeter Maydell For server endpoints, this directory may contain a file 4859e2fcbf42SPeter Maydell dh-params.pem providing diffie-hellman parameters to use for the 4860e2fcbf42SPeter Maydell TLS server. If the file is missing, QEMU will generate a set of 4861e2fcbf42SPeter Maydell DH parameters at startup. This is a computationally expensive 4862e2fcbf42SPeter Maydell operation that consumes random pool entropy, so it is 4863e2fcbf42SPeter Maydell recommended that a persistent set of parameters be generated 4864e2fcbf42SPeter Maydell upfront and saved. 4865e2fcbf42SPeter Maydell 4866e2fcbf42SPeter Maydell For x509 certificate credentials the directory will contain 4867e2fcbf42SPeter Maydell further files providing the x509 certificates. The certificates 4868e2fcbf42SPeter Maydell must be stored in PEM format, in filenames ca-cert.pem, 4869e2fcbf42SPeter Maydell ca-crl.pem (optional), server-cert.pem (only servers), 4870e2fcbf42SPeter Maydell server-key.pem (only servers), client-cert.pem (only clients), 4871e2fcbf42SPeter Maydell and client-key.pem (only clients). 4872e2fcbf42SPeter Maydell 4873e2fcbf42SPeter Maydell For the server-key.pem and client-key.pem files which contain 4874e2fcbf42SPeter Maydell sensitive private keys, it is possible to use an encrypted 4875e2fcbf42SPeter Maydell version by providing the passwordid parameter. This provides the 4876e2fcbf42SPeter Maydell ID of a previously created ``secret`` object containing the 4877e2fcbf42SPeter Maydell password for decryption. 4878e2fcbf42SPeter Maydell 4879e2fcbf42SPeter Maydell The priority parameter allows to override the global default 4880e2fcbf42SPeter Maydell priority used by gnutls. This can be useful if the system 4881e2fcbf42SPeter Maydell administrator needs to use a weaker set of crypto priorities for 4882e2fcbf42SPeter Maydell QEMU without potentially forcing the weakness onto all 4883e2fcbf42SPeter Maydell applications. Or conversely if one wants wants a stronger 4884e2fcbf42SPeter Maydell default for QEMU than for all other applications, they can do 4885e2fcbf42SPeter Maydell this through this parameter. Its format is a gnutls priority 4886e2fcbf42SPeter Maydell string as described at 4887e2fcbf42SPeter Maydell https://gnutls.org/manual/html_node/Priority-Strings.html. 4888e2fcbf42SPeter Maydell 4889993aec27SPhilippe Mathieu-Daudé ``-object tls-cipher-suites,id=id,priority=priority`` 4890993aec27SPhilippe Mathieu-Daudé Creates a TLS cipher suites object, which can be used to control 4891993aec27SPhilippe Mathieu-Daudé the TLS cipher/protocol algorithms that applications are permitted 4892993aec27SPhilippe Mathieu-Daudé to use. 4893993aec27SPhilippe Mathieu-Daudé 4894993aec27SPhilippe Mathieu-Daudé The ``id`` parameter is a unique ID which frontends will use to 4895993aec27SPhilippe Mathieu-Daudé access the ordered list of permitted TLS cipher suites from the 4896993aec27SPhilippe Mathieu-Daudé host. 4897993aec27SPhilippe Mathieu-Daudé 4898993aec27SPhilippe Mathieu-Daudé The ``priority`` parameter allows to override the global default 4899993aec27SPhilippe Mathieu-Daudé priority used by gnutls. This can be useful if the system 4900993aec27SPhilippe Mathieu-Daudé administrator needs to use a weaker set of crypto priorities for 4901993aec27SPhilippe Mathieu-Daudé QEMU without potentially forcing the weakness onto all 4902993aec27SPhilippe Mathieu-Daudé applications. Or conversely if one wants wants a stronger 4903993aec27SPhilippe Mathieu-Daudé default for QEMU than for all other applications, they can do 4904993aec27SPhilippe Mathieu-Daudé this through this parameter. Its format is a gnutls priority 4905993aec27SPhilippe Mathieu-Daudé string as described at 4906993aec27SPhilippe Mathieu-Daudé https://gnutls.org/manual/html_node/Priority-Strings.html. 4907993aec27SPhilippe Mathieu-Daudé 490869699f30SPhilippe Mathieu-Daudé An example of use of this object is to control UEFI HTTPS Boot. 490969699f30SPhilippe Mathieu-Daudé The tls-cipher-suites object exposes the ordered list of permitted 491069699f30SPhilippe Mathieu-Daudé TLS cipher suites from the host side to the guest firmware, via 491169699f30SPhilippe Mathieu-Daudé fw_cfg. The list is represented as an array of IANA_TLS_CIPHER 491269699f30SPhilippe Mathieu-Daudé objects. The firmware uses the IANA_TLS_CIPHER array for configuring 491369699f30SPhilippe Mathieu-Daudé guest-side TLS. 491469699f30SPhilippe Mathieu-Daudé 491569699f30SPhilippe Mathieu-Daudé In the following example, the priority at which the host-side policy 491669699f30SPhilippe Mathieu-Daudé is retrieved is given by the ``priority`` property. 491769699f30SPhilippe Mathieu-Daudé Given that QEMU uses GNUTLS, ``priority=@SYSTEM`` may be used to 491869699f30SPhilippe Mathieu-Daudé refer to /etc/crypto-policies/back-ends/gnutls.config. 491969699f30SPhilippe Mathieu-Daudé 492069699f30SPhilippe Mathieu-Daudé .. parsed-literal:: 492169699f30SPhilippe Mathieu-Daudé 4922353a06b4SLaszlo Ersek # |qemu_system| \\ 4923353a06b4SLaszlo Ersek -object tls-cipher-suites,id=mysuite0,priority=@SYSTEM \\ 492469699f30SPhilippe Mathieu-Daudé -fw_cfg name=etc/edk2/https/ciphers,gen_id=mysuite0 492569699f30SPhilippe Mathieu-Daudé 4926e2fcbf42SPeter Maydell ``-object filter-buffer,id=id,netdev=netdevid,interval=t[,queue=all|rx|tx][,status=on|off][,position=head|tail|id=<id>][,insert=behind|before]`` 4927e2fcbf42SPeter Maydell Interval t can't be 0, this filter batches the packet delivery: 4928e2fcbf42SPeter Maydell all packets arriving in a given interval on netdev netdevid are 4929e2fcbf42SPeter Maydell delayed until the end of the interval. Interval is in 4930e2fcbf42SPeter Maydell microseconds. ``status`` is optional that indicate whether the 4931e2fcbf42SPeter Maydell netfilter is on (enabled) or off (disabled), the default status 4932e2fcbf42SPeter Maydell for netfilter will be 'on'. 4933e2fcbf42SPeter Maydell 4934e2fcbf42SPeter Maydell queue all\|rx\|tx is an option that can be applied to any 4935e2fcbf42SPeter Maydell netfilter. 4936e2fcbf42SPeter Maydell 4937e2fcbf42SPeter Maydell ``all``: the filter is attached both to the receive and the 4938e2fcbf42SPeter Maydell transmit queue of the netdev (default). 4939e2fcbf42SPeter Maydell 4940e2fcbf42SPeter Maydell ``rx``: the filter is attached to the receive queue of the 4941e2fcbf42SPeter Maydell netdev, where it will receive packets sent to the netdev. 4942e2fcbf42SPeter Maydell 4943e2fcbf42SPeter Maydell ``tx``: the filter is attached to the transmit queue of the 4944e2fcbf42SPeter Maydell netdev, where it will receive packets sent by the netdev. 4945e2fcbf42SPeter Maydell 4946e2fcbf42SPeter Maydell position head\|tail\|id=<id> is an option to specify where the 4947e2fcbf42SPeter Maydell filter should be inserted in the filter list. It can be applied 4948e2fcbf42SPeter Maydell to any netfilter. 4949e2fcbf42SPeter Maydell 4950e2fcbf42SPeter Maydell ``head``: the filter is inserted at the head of the filter list, 4951e2fcbf42SPeter Maydell before any existing filters. 4952e2fcbf42SPeter Maydell 4953e2fcbf42SPeter Maydell ``tail``: the filter is inserted at the tail of the filter list, 4954e2fcbf42SPeter Maydell behind any existing filters (default). 4955e2fcbf42SPeter Maydell 4956e2fcbf42SPeter Maydell ``id=<id>``: the filter is inserted before or behind the filter 4957e2fcbf42SPeter Maydell specified by <id>, see the insert option below. 4958e2fcbf42SPeter Maydell 4959e2fcbf42SPeter Maydell insert behind\|before is an option to specify where to insert 4960e2fcbf42SPeter Maydell the new filter relative to the one specified with 4961e2fcbf42SPeter Maydell position=id=<id>. It can be applied to any netfilter. 4962e2fcbf42SPeter Maydell 4963e2fcbf42SPeter Maydell ``before``: insert before the specified filter. 4964e2fcbf42SPeter Maydell 4965e2fcbf42SPeter Maydell ``behind``: insert behind the specified filter (default). 4966e2fcbf42SPeter Maydell 4967e2fcbf42SPeter Maydell ``-object filter-mirror,id=id,netdev=netdevid,outdev=chardevid,queue=all|rx|tx[,vnet_hdr_support][,position=head|tail|id=<id>][,insert=behind|before]`` 4968e2fcbf42SPeter Maydell filter-mirror on netdev netdevid,mirror net packet to 4969e2fcbf42SPeter Maydell chardevchardevid, if it has the vnet\_hdr\_support flag, 4970e2fcbf42SPeter Maydell filter-mirror will mirror packet with vnet\_hdr\_len. 4971e2fcbf42SPeter Maydell 4972e2fcbf42SPeter Maydell ``-object filter-redirector,id=id,netdev=netdevid,indev=chardevid,outdev=chardevid,queue=all|rx|tx[,vnet_hdr_support][,position=head|tail|id=<id>][,insert=behind|before]`` 4973e2fcbf42SPeter Maydell filter-redirector on netdev netdevid,redirect filter's net 4974e2fcbf42SPeter Maydell packet to chardev chardevid,and redirect indev's packet to 4975e2fcbf42SPeter Maydell filter.if it has the vnet\_hdr\_support flag, filter-redirector 4976e2fcbf42SPeter Maydell will redirect packet with vnet\_hdr\_len. Create a 4977e2fcbf42SPeter Maydell filter-redirector we need to differ outdev id from indev id, id 4978e2fcbf42SPeter Maydell can not be the same. we can just use indev or outdev, but at 4979e2fcbf42SPeter Maydell least one of indev or outdev need to be specified. 4980e2fcbf42SPeter Maydell 4981e2fcbf42SPeter Maydell ``-object filter-rewriter,id=id,netdev=netdevid,queue=all|rx|tx,[vnet_hdr_support][,position=head|tail|id=<id>][,insert=behind|before]`` 4982e2fcbf42SPeter Maydell Filter-rewriter is a part of COLO project.It will rewrite tcp 4983e2fcbf42SPeter Maydell packet to secondary from primary to keep secondary tcp 4984e2fcbf42SPeter Maydell connection,and rewrite tcp packet to primary from secondary make 4985e2fcbf42SPeter Maydell tcp packet can be handled by client.if it has the 4986e2fcbf42SPeter Maydell vnet\_hdr\_support flag, we can parse packet with vnet header. 4987e2fcbf42SPeter Maydell 4988e2fcbf42SPeter Maydell usage: colo secondary: -object 4989e2fcbf42SPeter Maydell filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0 -object 4990e2fcbf42SPeter Maydell filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1 -object 4991e2fcbf42SPeter Maydell filter-rewriter,id=rew0,netdev=hn0,queue=all 4992e2fcbf42SPeter Maydell 4993e2fcbf42SPeter Maydell ``-object filter-dump,id=id,netdev=dev[,file=filename][,maxlen=len][,position=head|tail|id=<id>][,insert=behind|before]`` 4994e2fcbf42SPeter Maydell Dump the network traffic on netdev dev to the file specified by 4995e2fcbf42SPeter Maydell filename. At most len bytes (64k by default) per packet are 4996e2fcbf42SPeter Maydell stored. The file format is libpcap, so it can be analyzed with 4997e2fcbf42SPeter Maydell tools such as tcpdump or Wireshark. 4998e2fcbf42SPeter Maydell 4999a2e5cb7aSZhang Chen ``-object colo-compare,id=id,primary_in=chardevid,secondary_in=chardevid,outdev=chardevid,iothread=id[,vnet_hdr_support][,notify_dev=id][,compare_timeout=@var{ms}][,expired_scan_cycle=@var{ms}][,max_queue_size=@var{size}]`` 5000e2fcbf42SPeter Maydell Colo-compare gets packet from primary\_in chardevid and 50012b28a7efSZhang Chen secondary\_in, then compare whether the payload of primary packet 50022b28a7efSZhang Chen and secondary packet are the same. If same, it will output 50032b28a7efSZhang Chen primary packet to out\_dev, else it will notify COLO-framework to do 50042b28a7efSZhang Chen checkpoint and send primary packet to out\_dev. In order to 50052b28a7efSZhang Chen improve efficiency, we need to put the task of comparison in 50062b28a7efSZhang Chen another iothread. If it has the vnet\_hdr\_support flag, 50072b28a7efSZhang Chen colo compare will send/recv packet with vnet\_hdr\_len. 50082b28a7efSZhang Chen The compare\_timeout=@var{ms} determines the maximum time of the 50092b28a7efSZhang Chen colo-compare hold the packet. The expired\_scan\_cycle=@var{ms} 50102b28a7efSZhang Chen is to set the period of scanning expired primary node network packets. 50112b28a7efSZhang Chen The max\_queue\_size=@var{size} is to set the max compare queue 50122b28a7efSZhang Chen size depend on user environment. 50132b28a7efSZhang Chen If user want to use Xen COLO, need to add the notify\_dev to 50149cc43c94SZhang Chen notify Xen colo-frame to do checkpoint. 5015e2fcbf42SPeter Maydell 50162b28a7efSZhang Chen COLO-compare must be used with the help of filter-mirror, 50172b28a7efSZhang Chen filter-redirector and filter-rewriter. 5018e2fcbf42SPeter Maydell 5019e2fcbf42SPeter Maydell :: 5020e2fcbf42SPeter Maydell 5021e2fcbf42SPeter Maydell KVM COLO 5022e2fcbf42SPeter Maydell 5023e2fcbf42SPeter Maydell primary: 5024e2fcbf42SPeter Maydell -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown 5025e2fcbf42SPeter Maydell -device e1000,id=e0,netdev=hn0,mac=52:a4:00:12:78:66 5026bfdc1267SDaniel P. Berrangé -chardev socket,id=mirror0,host=3.3.3.3,port=9003,server=on,wait=off 5027bfdc1267SDaniel P. Berrangé -chardev socket,id=compare1,host=3.3.3.3,port=9004,server=on,wait=off 5028bfdc1267SDaniel P. Berrangé -chardev socket,id=compare0,host=3.3.3.3,port=9001,server=on,wait=off 5029e2fcbf42SPeter Maydell -chardev socket,id=compare0-0,host=3.3.3.3,port=9001 5030bfdc1267SDaniel P. Berrangé -chardev socket,id=compare_out,host=3.3.3.3,port=9005,server=on,wait=off 5031e2fcbf42SPeter Maydell -chardev socket,id=compare_out0,host=3.3.3.3,port=9005 5032e2fcbf42SPeter Maydell -object iothread,id=iothread1 5033e2fcbf42SPeter Maydell -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0 5034e2fcbf42SPeter Maydell -object filter-redirector,netdev=hn0,id=redire0,queue=rx,indev=compare_out 5035e2fcbf42SPeter Maydell -object filter-redirector,netdev=hn0,id=redire1,queue=rx,outdev=compare0 5036e2fcbf42SPeter Maydell -object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0,iothread=iothread1 5037e2fcbf42SPeter Maydell 5038e2fcbf42SPeter Maydell secondary: 5039e2fcbf42SPeter Maydell -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,down script=/etc/qemu-ifdown 5040e2fcbf42SPeter Maydell -device e1000,netdev=hn0,mac=52:a4:00:12:78:66 5041e2fcbf42SPeter Maydell -chardev socket,id=red0,host=3.3.3.3,port=9003 5042e2fcbf42SPeter Maydell -chardev socket,id=red1,host=3.3.3.3,port=9004 5043e2fcbf42SPeter Maydell -object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0 5044e2fcbf42SPeter Maydell -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1 5045e2fcbf42SPeter Maydell 5046e2fcbf42SPeter Maydell 5047e2fcbf42SPeter Maydell Xen COLO 5048e2fcbf42SPeter Maydell 5049e2fcbf42SPeter Maydell primary: 5050e2fcbf42SPeter Maydell -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown 5051e2fcbf42SPeter Maydell -device e1000,id=e0,netdev=hn0,mac=52:a4:00:12:78:66 5052bfdc1267SDaniel P. Berrangé -chardev socket,id=mirror0,host=3.3.3.3,port=9003,server=on,wait=off 5053bfdc1267SDaniel P. Berrangé -chardev socket,id=compare1,host=3.3.3.3,port=9004,server=on,wait=off 5054bfdc1267SDaniel P. Berrangé -chardev socket,id=compare0,host=3.3.3.3,port=9001,server=on,wait=off 5055e2fcbf42SPeter Maydell -chardev socket,id=compare0-0,host=3.3.3.3,port=9001 5056bfdc1267SDaniel P. Berrangé -chardev socket,id=compare_out,host=3.3.3.3,port=9005,server=on,wait=off 5057e2fcbf42SPeter Maydell -chardev socket,id=compare_out0,host=3.3.3.3,port=9005 5058bfdc1267SDaniel P. Berrangé -chardev socket,id=notify_way,host=3.3.3.3,port=9009,server=on,wait=off 5059e2fcbf42SPeter Maydell -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0 5060e2fcbf42SPeter Maydell -object filter-redirector,netdev=hn0,id=redire0,queue=rx,indev=compare_out 5061e2fcbf42SPeter Maydell -object filter-redirector,netdev=hn0,id=redire1,queue=rx,outdev=compare0 5062e2fcbf42SPeter Maydell -object iothread,id=iothread1 5063e2fcbf42SPeter Maydell -object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0,notify_dev=nofity_way,iothread=iothread1 5064e2fcbf42SPeter Maydell 5065e2fcbf42SPeter Maydell secondary: 5066e2fcbf42SPeter Maydell -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,down script=/etc/qemu-ifdown 5067e2fcbf42SPeter Maydell -device e1000,netdev=hn0,mac=52:a4:00:12:78:66 5068e2fcbf42SPeter Maydell -chardev socket,id=red0,host=3.3.3.3,port=9003 5069e2fcbf42SPeter Maydell -chardev socket,id=red1,host=3.3.3.3,port=9004 5070e2fcbf42SPeter Maydell -object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0 5071e2fcbf42SPeter Maydell -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1 5072e2fcbf42SPeter Maydell 5073e2fcbf42SPeter Maydell If you want to know the detail of above command line, you can 5074e2fcbf42SPeter Maydell read the colo-compare git log. 5075e2fcbf42SPeter Maydell 5076e2fcbf42SPeter Maydell ``-object cryptodev-backend-builtin,id=id[,queues=queues]`` 5077e2fcbf42SPeter Maydell Creates a cryptodev backend which executes crypto opreation from 5078e2fcbf42SPeter Maydell the QEMU cipher APIS. The id parameter is a unique ID that will 5079e2fcbf42SPeter Maydell be used to reference this cryptodev backend from the 5080e2fcbf42SPeter Maydell ``virtio-crypto`` device. The queues parameter is optional, 5081e2fcbf42SPeter Maydell which specify the queue number of cryptodev backend, the default 5082e2fcbf42SPeter Maydell of queues is 1. 5083e2fcbf42SPeter Maydell 508409ce5f2dSPeter Maydell .. parsed-literal:: 5085e2fcbf42SPeter Maydell 5086353a06b4SLaszlo Ersek # |qemu_system| \\ 5087353a06b4SLaszlo Ersek [...] \\ 5088353a06b4SLaszlo Ersek -object cryptodev-backend-builtin,id=cryptodev0 \\ 5089353a06b4SLaszlo Ersek -device virtio-crypto-pci,id=crypto0,cryptodev=cryptodev0 \\ 5090e2fcbf42SPeter Maydell [...] 5091e2fcbf42SPeter Maydell 5092e2fcbf42SPeter Maydell ``-object cryptodev-vhost-user,id=id,chardev=chardevid[,queues=queues]`` 5093e2fcbf42SPeter Maydell Creates a vhost-user cryptodev backend, backed by a chardev 5094e2fcbf42SPeter Maydell chardevid. The id parameter is a unique ID that will be used to 5095e2fcbf42SPeter Maydell reference this cryptodev backend from the ``virtio-crypto`` 5096e2fcbf42SPeter Maydell device. The chardev should be a unix domain socket backed one. 5097e2fcbf42SPeter Maydell The vhost-user uses a specifically defined protocol to pass 5098e2fcbf42SPeter Maydell vhost ioctl replacement messages to an application on the other 5099e2fcbf42SPeter Maydell end of the socket. The queues parameter is optional, which 5100e2fcbf42SPeter Maydell specify the queue number of cryptodev backend for multiqueue 5101e2fcbf42SPeter Maydell vhost-user, the default of queues is 1. 5102e2fcbf42SPeter Maydell 510309ce5f2dSPeter Maydell .. parsed-literal:: 5104e2fcbf42SPeter Maydell 5105353a06b4SLaszlo Ersek # |qemu_system| \\ 5106353a06b4SLaszlo Ersek [...] \\ 5107353a06b4SLaszlo Ersek -chardev socket,id=chardev0,path=/path/to/socket \\ 5108353a06b4SLaszlo Ersek -object cryptodev-vhost-user,id=cryptodev0,chardev=chardev0 \\ 5109353a06b4SLaszlo Ersek -device virtio-crypto-pci,id=crypto0,cryptodev=cryptodev0 \\ 5110e2fcbf42SPeter Maydell [...] 5111e2fcbf42SPeter Maydell 5112e2fcbf42SPeter Maydell ``-object secret,id=id,data=string,format=raw|base64[,keyid=secretid,iv=string]`` 511309ce5f2dSPeter Maydell \ 5114e2fcbf42SPeter Maydell ``-object secret,id=id,file=filename,format=raw|base64[,keyid=secretid,iv=string]`` 5115e2fcbf42SPeter Maydell Defines a secret to store a password, encryption key, or some 5116e2fcbf42SPeter Maydell other sensitive data. The sensitive data can either be passed 5117e2fcbf42SPeter Maydell directly via the data parameter, or indirectly via the file 5118e2fcbf42SPeter Maydell parameter. Using the data parameter is insecure unless the 5119e2fcbf42SPeter Maydell sensitive data is encrypted. 5120e2fcbf42SPeter Maydell 5121e2fcbf42SPeter Maydell The sensitive data can be provided in raw format (the default), 5122e2fcbf42SPeter Maydell or base64. When encoded as JSON, the raw format only supports 5123e2fcbf42SPeter Maydell valid UTF-8 characters, so base64 is recommended for sending 5124e2fcbf42SPeter Maydell binary data. QEMU will convert from which ever format is 5125e2fcbf42SPeter Maydell provided to the format it needs internally. eg, an RBD password 5126e2fcbf42SPeter Maydell can be provided in raw format, even though it will be base64 5127e2fcbf42SPeter Maydell encoded when passed onto the RBD sever. 5128e2fcbf42SPeter Maydell 5129e2fcbf42SPeter Maydell For added protection, it is possible to encrypt the data 5130e2fcbf42SPeter Maydell associated with a secret using the AES-256-CBC cipher. Use of 5131e2fcbf42SPeter Maydell encryption is indicated by providing the keyid and iv 5132e2fcbf42SPeter Maydell parameters. The keyid parameter provides the ID of a previously 5133e2fcbf42SPeter Maydell defined secret that contains the AES-256 decryption key. This 5134e2fcbf42SPeter Maydell key should be 32-bytes long and be base64 encoded. The iv 5135e2fcbf42SPeter Maydell parameter provides the random initialization vector used for 5136e2fcbf42SPeter Maydell encryption of this particular secret and should be a base64 5137e2fcbf42SPeter Maydell encrypted string of the 16-byte IV. 5138e2fcbf42SPeter Maydell 5139e2fcbf42SPeter Maydell The simplest (insecure) usage is to provide the secret inline 5140e2fcbf42SPeter Maydell 514109ce5f2dSPeter Maydell .. parsed-literal:: 5142e2fcbf42SPeter Maydell 5143e2fcbf42SPeter Maydell # |qemu_system| -object secret,id=sec0,data=letmein,format=raw 5144e2fcbf42SPeter Maydell 5145e2fcbf42SPeter Maydell The simplest secure usage is to provide the secret via a file 5146e2fcbf42SPeter Maydell 5147e2fcbf42SPeter Maydell # printf "letmein" > mypasswd.txt # QEMU\_SYSTEM\_MACRO -object 5148e2fcbf42SPeter Maydell secret,id=sec0,file=mypasswd.txt,format=raw 5149e2fcbf42SPeter Maydell 5150e2fcbf42SPeter Maydell For greater security, AES-256-CBC should be used. To illustrate 5151e2fcbf42SPeter Maydell usage, consider the openssl command line tool which can encrypt 5152e2fcbf42SPeter Maydell the data. Note that when encrypting, the plaintext must be 5153e2fcbf42SPeter Maydell padded to the cipher block size (32 bytes) using the standard 5154e2fcbf42SPeter Maydell PKCS#5/6 compatible padding algorithm. 5155e2fcbf42SPeter Maydell 5156e2fcbf42SPeter Maydell First a master key needs to be created in base64 encoding: 5157e2fcbf42SPeter Maydell 5158e2fcbf42SPeter Maydell :: 5159e2fcbf42SPeter Maydell 5160e2fcbf42SPeter Maydell # openssl rand -base64 32 > key.b64 5161e2fcbf42SPeter Maydell # KEY=$(base64 -d key.b64 | hexdump -v -e '/1 "%02X"') 5162e2fcbf42SPeter Maydell 5163e2fcbf42SPeter Maydell Each secret to be encrypted needs to have a random 5164e2fcbf42SPeter Maydell initialization vector generated. These do not need to be kept 5165e2fcbf42SPeter Maydell secret 5166e2fcbf42SPeter Maydell 5167e2fcbf42SPeter Maydell :: 5168e2fcbf42SPeter Maydell 5169e2fcbf42SPeter Maydell # openssl rand -base64 16 > iv.b64 5170e2fcbf42SPeter Maydell # IV=$(base64 -d iv.b64 | hexdump -v -e '/1 "%02X"') 5171e2fcbf42SPeter Maydell 5172e2fcbf42SPeter Maydell The secret to be defined can now be encrypted, in this case 5173e2fcbf42SPeter Maydell we're telling openssl to base64 encode the result, but it could 5174e2fcbf42SPeter Maydell be left as raw bytes if desired. 5175e2fcbf42SPeter Maydell 5176e2fcbf42SPeter Maydell :: 5177e2fcbf42SPeter Maydell 5178e2fcbf42SPeter Maydell # SECRET=$(printf "letmein" | 5179e2fcbf42SPeter Maydell openssl enc -aes-256-cbc -a -K $KEY -iv $IV) 5180e2fcbf42SPeter Maydell 5181e2fcbf42SPeter Maydell When launching QEMU, create a master secret pointing to 5182e2fcbf42SPeter Maydell ``key.b64`` and specify that to be used to decrypt the user 5183e2fcbf42SPeter Maydell password. Pass the contents of ``iv.b64`` to the second secret 5184e2fcbf42SPeter Maydell 518509ce5f2dSPeter Maydell .. parsed-literal:: 5186e2fcbf42SPeter Maydell 5187353a06b4SLaszlo Ersek # |qemu_system| \\ 5188353a06b4SLaszlo Ersek -object secret,id=secmaster0,format=base64,file=key.b64 \\ 5189353a06b4SLaszlo Ersek -object secret,id=sec0,keyid=secmaster0,format=base64,\\ 5190e2fcbf42SPeter Maydell data=$SECRET,iv=$(<iv.b64) 5191e2fcbf42SPeter Maydell 5192*55cdf566SDov Murik ``-object sev-guest,id=id,cbitpos=cbitpos,reduced-phys-bits=val,[sev-device=string,policy=policy,handle=handle,dh-cert-file=file,session-file=file,kernel-hashes=on|off]`` 5193e2fcbf42SPeter Maydell Create a Secure Encrypted Virtualization (SEV) guest object, 5194e2fcbf42SPeter Maydell which can be used to provide the guest memory encryption support 5195e2fcbf42SPeter Maydell on AMD processors. 5196e2fcbf42SPeter Maydell 5197e2fcbf42SPeter Maydell When memory encryption is enabled, one of the physical address 5198e2fcbf42SPeter Maydell bit (aka the C-bit) is utilized to mark if a memory page is 5199e2fcbf42SPeter Maydell protected. The ``cbitpos`` is used to provide the C-bit 5200e2fcbf42SPeter Maydell position. The C-bit position is Host family dependent hence user 5201e2fcbf42SPeter Maydell must provide this value. On EPYC, the value should be 47. 5202e2fcbf42SPeter Maydell 5203e2fcbf42SPeter Maydell When memory encryption is enabled, we loose certain bits in 5204e2fcbf42SPeter Maydell physical address space. The ``reduced-phys-bits`` is used to 5205e2fcbf42SPeter Maydell provide the number of bits we loose in physical address space. 5206e2fcbf42SPeter Maydell Similar to C-bit, the value is Host family dependent. On EPYC, 5207e2fcbf42SPeter Maydell the value should be 5. 5208e2fcbf42SPeter Maydell 5209e2fcbf42SPeter Maydell The ``sev-device`` provides the device file to use for 5210e2fcbf42SPeter Maydell communicating with the SEV firmware running inside AMD Secure 5211e2fcbf42SPeter Maydell Processor. The default device is '/dev/sev'. If hardware 5212e2fcbf42SPeter Maydell supports memory encryption then /dev/sev devices are created by 5213e2fcbf42SPeter Maydell CCP driver. 5214e2fcbf42SPeter Maydell 5215e2fcbf42SPeter Maydell The ``policy`` provides the guest policy to be enforced by the 5216e2fcbf42SPeter Maydell SEV firmware and restrict what configuration and operational 5217e2fcbf42SPeter Maydell commands can be performed on this guest by the hypervisor. The 5218e2fcbf42SPeter Maydell policy should be provided by the guest owner and is bound to the 5219e2fcbf42SPeter Maydell guest and cannot be changed throughout the lifetime of the 5220e2fcbf42SPeter Maydell guest. The default is 0. 5221e2fcbf42SPeter Maydell 5222e2fcbf42SPeter Maydell If guest ``policy`` allows sharing the key with another SEV 5223e2fcbf42SPeter Maydell guest then ``handle`` can be use to provide handle of the guest 5224e2fcbf42SPeter Maydell from which to share the key. 5225e2fcbf42SPeter Maydell 5226e2fcbf42SPeter Maydell The ``dh-cert-file`` and ``session-file`` provides the guest 5227e2fcbf42SPeter Maydell owner's Public Diffie-Hillman key defined in SEV spec. The PDH 5228e2fcbf42SPeter Maydell and session parameters are used for establishing a cryptographic 5229e2fcbf42SPeter Maydell session with the guest owner to negotiate keys used for 5230e2fcbf42SPeter Maydell attestation. The file must be encoded in base64. 5231e2fcbf42SPeter Maydell 5232*55cdf566SDov Murik The ``kernel-hashes`` adds the hashes of given kernel/initrd/ 5233*55cdf566SDov Murik cmdline to a designated guest firmware page for measured Linux 5234*55cdf566SDov Murik boot with -kernel. The default is off. (Since 6.2) 5235*55cdf566SDov Murik 5236e2fcbf42SPeter Maydell e.g to launch a SEV guest 5237e2fcbf42SPeter Maydell 523809ce5f2dSPeter Maydell .. parsed-literal:: 5239e2fcbf42SPeter Maydell 5240353a06b4SLaszlo Ersek # |qemu_system_x86| \\ 5241353a06b4SLaszlo Ersek ...... \\ 5242353a06b4SLaszlo Ersek -object sev-guest,id=sev0,cbitpos=47,reduced-phys-bits=5 \\ 5243353a06b4SLaszlo Ersek -machine ...,memory-encryption=sev0 \\ 5244e2fcbf42SPeter Maydell ..... 5245e2fcbf42SPeter Maydell 5246e2fcbf42SPeter Maydell ``-object authz-simple,id=id,identity=string`` 5247e2fcbf42SPeter Maydell Create an authorization object that will control access to 5248e2fcbf42SPeter Maydell network services. 5249e2fcbf42SPeter Maydell 5250e2fcbf42SPeter Maydell The ``identity`` parameter is identifies the user and its format 5251e2fcbf42SPeter Maydell depends on the network service that authorization object is 5252e2fcbf42SPeter Maydell associated with. For authorizing based on TLS x509 certificates, 5253e2fcbf42SPeter Maydell the identity must be the x509 distinguished name. Note that care 5254e2fcbf42SPeter Maydell must be taken to escape any commas in the distinguished name. 5255e2fcbf42SPeter Maydell 5256e2fcbf42SPeter Maydell An example authorization object to validate a x509 distinguished 5257e2fcbf42SPeter Maydell name would look like: 5258e2fcbf42SPeter Maydell 525909ce5f2dSPeter Maydell .. parsed-literal:: 5260e2fcbf42SPeter Maydell 5261353a06b4SLaszlo Ersek # |qemu_system| \\ 5262353a06b4SLaszlo Ersek ... \\ 5263353a06b4SLaszlo Ersek -object 'authz-simple,id=auth0,identity=CN=laptop.example.com,,O=Example Org,,L=London,,ST=London,,C=GB' \\ 5264e2fcbf42SPeter Maydell ... 5265e2fcbf42SPeter Maydell 5266e2fcbf42SPeter Maydell Note the use of quotes due to the x509 distinguished name 5267e2fcbf42SPeter Maydell containing whitespace, and escaping of ','. 5268e2fcbf42SPeter Maydell 52694d7beeabSDaniel P. Berrangé ``-object authz-listfile,id=id,filename=path,refresh=on|off`` 5270e2fcbf42SPeter Maydell Create an authorization object that will control access to 5271e2fcbf42SPeter Maydell network services. 5272e2fcbf42SPeter Maydell 5273e2fcbf42SPeter Maydell The ``filename`` parameter is the fully qualified path to a file 5274e2fcbf42SPeter Maydell containing the access control list rules in JSON format. 5275e2fcbf42SPeter Maydell 5276e2fcbf42SPeter Maydell An example set of rules that match against SASL usernames might 5277e2fcbf42SPeter Maydell look like: 5278e2fcbf42SPeter Maydell 5279e2fcbf42SPeter Maydell :: 5280e2fcbf42SPeter Maydell 5281e2fcbf42SPeter Maydell { 5282e2fcbf42SPeter Maydell "rules": [ 5283e2fcbf42SPeter Maydell { "match": "fred", "policy": "allow", "format": "exact" }, 5284e2fcbf42SPeter Maydell { "match": "bob", "policy": "allow", "format": "exact" }, 5285e2fcbf42SPeter Maydell { "match": "danb", "policy": "deny", "format": "glob" }, 5286e2fcbf42SPeter Maydell { "match": "dan*", "policy": "allow", "format": "exact" }, 5287e2fcbf42SPeter Maydell ], 5288e2fcbf42SPeter Maydell "policy": "deny" 5289e2fcbf42SPeter Maydell } 5290e2fcbf42SPeter Maydell 5291e2fcbf42SPeter Maydell When checking access the object will iterate over all the rules 5292e2fcbf42SPeter Maydell and the first rule to match will have its ``policy`` value 5293e2fcbf42SPeter Maydell returned as the result. If no rules match, then the default 5294e2fcbf42SPeter Maydell ``policy`` value is returned. 5295e2fcbf42SPeter Maydell 5296e2fcbf42SPeter Maydell The rules can either be an exact string match, or they can use 5297e2fcbf42SPeter Maydell the simple UNIX glob pattern matching to allow wildcards to be 5298e2fcbf42SPeter Maydell used. 5299e2fcbf42SPeter Maydell 5300e2fcbf42SPeter Maydell If ``refresh`` is set to true the file will be monitored and 5301e2fcbf42SPeter Maydell automatically reloaded whenever its content changes. 5302e2fcbf42SPeter Maydell 5303e2fcbf42SPeter Maydell As with the ``authz-simple`` object, the format of the identity 5304e2fcbf42SPeter Maydell strings being matched depends on the network service, but is 5305e2fcbf42SPeter Maydell usually a TLS x509 distinguished name, or a SASL username. 5306e2fcbf42SPeter Maydell 5307e2fcbf42SPeter Maydell An example authorization object to validate a SASL username 5308e2fcbf42SPeter Maydell would look like: 5309e2fcbf42SPeter Maydell 531009ce5f2dSPeter Maydell .. parsed-literal:: 5311e2fcbf42SPeter Maydell 5312353a06b4SLaszlo Ersek # |qemu_system| \\ 5313353a06b4SLaszlo Ersek ... \\ 53144d7beeabSDaniel P. Berrangé -object authz-simple,id=auth0,filename=/etc/qemu/vnc-sasl.acl,refresh=on \\ 5315e2fcbf42SPeter Maydell ... 5316e2fcbf42SPeter Maydell 5317e2fcbf42SPeter Maydell ``-object authz-pam,id=id,service=string`` 5318e2fcbf42SPeter Maydell Create an authorization object that will control access to 5319e2fcbf42SPeter Maydell network services. 5320e2fcbf42SPeter Maydell 5321e2fcbf42SPeter Maydell The ``service`` parameter provides the name of a PAM service to 5322e2fcbf42SPeter Maydell use for authorization. It requires that a file 5323e2fcbf42SPeter Maydell ``/etc/pam.d/service`` exist to provide the configuration for 5324e2fcbf42SPeter Maydell the ``account`` subsystem. 5325e2fcbf42SPeter Maydell 5326e2fcbf42SPeter Maydell An example authorization object to validate a TLS x509 5327e2fcbf42SPeter Maydell distinguished name would look like: 5328e2fcbf42SPeter Maydell 532909ce5f2dSPeter Maydell .. parsed-literal:: 5330e2fcbf42SPeter Maydell 5331353a06b4SLaszlo Ersek # |qemu_system| \\ 5332353a06b4SLaszlo Ersek ... \\ 5333353a06b4SLaszlo Ersek -object authz-pam,id=auth0,service=qemu-vnc \\ 5334e2fcbf42SPeter Maydell ... 5335e2fcbf42SPeter Maydell 5336e2fcbf42SPeter Maydell There would then be a corresponding config file for PAM at 5337e2fcbf42SPeter Maydell ``/etc/pam.d/qemu-vnc`` that contains: 5338e2fcbf42SPeter Maydell 5339e2fcbf42SPeter Maydell :: 5340e2fcbf42SPeter Maydell 5341e2fcbf42SPeter Maydell account requisite pam_listfile.so item=user sense=allow \ 5342e2fcbf42SPeter Maydell file=/etc/qemu/vnc.allow 5343e2fcbf42SPeter Maydell 5344e2fcbf42SPeter Maydell Finally the ``/etc/qemu/vnc.allow`` file would contain the list 5345e2fcbf42SPeter Maydell of x509 distingished names that are permitted access 5346e2fcbf42SPeter Maydell 5347e2fcbf42SPeter Maydell :: 5348e2fcbf42SPeter Maydell 5349e2fcbf42SPeter Maydell CN=laptop.example.com,O=Example Home,L=London,ST=London,C=GB 5350e2fcbf42SPeter Maydell 53511793ad02SStefano Garzarella ``-object iothread,id=id,poll-max-ns=poll-max-ns,poll-grow=poll-grow,poll-shrink=poll-shrink,aio-max-batch=aio-max-batch`` 5352e2fcbf42SPeter Maydell Creates a dedicated event loop thread that devices can be 5353e2fcbf42SPeter Maydell assigned to. This is known as an IOThread. By default device 5354e2fcbf42SPeter Maydell emulation happens in vCPU threads or the main event loop thread. 5355e2fcbf42SPeter Maydell This can become a scalability bottleneck. IOThreads allow device 5356e2fcbf42SPeter Maydell emulation and I/O to run on other host CPUs. 5357e2fcbf42SPeter Maydell 5358e2fcbf42SPeter Maydell The ``id`` parameter is a unique ID that will be used to 5359e2fcbf42SPeter Maydell reference this IOThread from ``-device ...,iothread=id``. 5360e2fcbf42SPeter Maydell Multiple devices can be assigned to an IOThread. Note that not 5361e2fcbf42SPeter Maydell all devices support an ``iothread`` parameter. 5362e2fcbf42SPeter Maydell 5363e2fcbf42SPeter Maydell The ``query-iothreads`` QMP command lists IOThreads and reports 5364e2fcbf42SPeter Maydell their thread IDs so that the user can configure host CPU 5365e2fcbf42SPeter Maydell pinning/affinity. 5366e2fcbf42SPeter Maydell 5367e2fcbf42SPeter Maydell IOThreads use an adaptive polling algorithm to reduce event loop 5368e2fcbf42SPeter Maydell latency. Instead of entering a blocking system call to monitor 5369e2fcbf42SPeter Maydell file descriptors and then pay the cost of being woken up when an 5370e2fcbf42SPeter Maydell event occurs, the polling algorithm spins waiting for events for 5371e2fcbf42SPeter Maydell a short time. The algorithm's default parameters are suitable 5372e2fcbf42SPeter Maydell for many cases but can be adjusted based on knowledge of the 5373e2fcbf42SPeter Maydell workload and/or host device latency. 5374e2fcbf42SPeter Maydell 5375e2fcbf42SPeter Maydell The ``poll-max-ns`` parameter is the maximum number of 5376e2fcbf42SPeter Maydell nanoseconds to busy wait for events. Polling can be disabled by 5377e2fcbf42SPeter Maydell setting this value to 0. 5378e2fcbf42SPeter Maydell 5379e2fcbf42SPeter Maydell The ``poll-grow`` parameter is the multiplier used to increase 5380e2fcbf42SPeter Maydell the polling time when the algorithm detects it is missing events 5381e2fcbf42SPeter Maydell due to not polling long enough. 5382e2fcbf42SPeter Maydell 5383e2fcbf42SPeter Maydell The ``poll-shrink`` parameter is the divisor used to decrease 5384e2fcbf42SPeter Maydell the polling time when the algorithm detects it is spending too 5385e2fcbf42SPeter Maydell long polling without encountering events. 5386e2fcbf42SPeter Maydell 53871793ad02SStefano Garzarella The ``aio-max-batch`` parameter is the maximum number of requests 53881793ad02SStefano Garzarella in a batch for the AIO engine, 0 means that the engine will use 53891793ad02SStefano Garzarella its default. 53901793ad02SStefano Garzarella 53911793ad02SStefano Garzarella The IOThread parameters can be modified at run-time using the 5392e2fcbf42SPeter Maydell ``qom-set`` command (where ``iothread1`` is the IOThread's 5393e2fcbf42SPeter Maydell ``id``): 5394e2fcbf42SPeter Maydell 5395e2fcbf42SPeter Maydell :: 5396e2fcbf42SPeter Maydell 5397e2fcbf42SPeter Maydell (qemu) qom-set /objects/iothread1 poll-max-ns 100000 5398e2fcbf42SPeter MaydellERST 5399b9174d4fSDaniel P. Berrange 5400b9174d4fSDaniel P. Berrange 54013dbf2c7fSStefan WeilHXCOMM This is the last statement. Insert new options before this line! 5402fd5fc4b1SPaolo Bonzini 5403fd5fc4b1SPaolo Bonzini#undef DEF 5404fd5fc4b1SPaolo Bonzini#undef DEFHEADING 5405fd5fc4b1SPaolo Bonzini#undef ARCHHEADING 5406