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" 29b91b0fc1SPhilippe Mathieu-Daudé " supported accelerators are kvm, xen, 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" 3903b39fcfSJonathan Cameron " memory-backend='backend-id' specifies explicitly provided backend for main RAM (default=none)\n" 4057702891SCédric Le Goater " cxl-fmw.0.targets.0=firsttarget,cxl-fmw.0.targets.1=secondtarget,cxl-fmw.0.size=size[,cxl-fmw.0.interleave-granularity=granularity]\n", 4180f52a66SJan Kiszka QEMU_ARCH_ALL) 42e2fcbf42SPeter MaydellSRST 43e2fcbf42SPeter Maydell``-machine [type=]name[,prop=value[,...]]`` 44e2fcbf42SPeter Maydell Select the emulated machine by name. Use ``-machine help`` to list 45e2fcbf42SPeter Maydell available machines. 46e2fcbf42SPeter Maydell 47e2fcbf42SPeter Maydell For architectures which aim to support live migration compatibility 48e2fcbf42SPeter Maydell across releases, each release will introduce a new versioned machine 49e2fcbf42SPeter Maydell type. For example, the 2.8.0 release introduced machine types 50e2fcbf42SPeter Maydell "pc-i440fx-2.8" and "pc-q35-2.8" for the x86\_64/i686 architectures. 51e2fcbf42SPeter Maydell 52e2fcbf42SPeter Maydell To allow live migration of guests from QEMU version 2.8.0, to QEMU 53e2fcbf42SPeter Maydell version 2.9.0, the 2.9.0 version must support the "pc-i440fx-2.8" 54e2fcbf42SPeter Maydell and "pc-q35-2.8" machines too. To allow users live migrating VMs to 55e2fcbf42SPeter Maydell skip multiple intermediate releases when upgrading, new releases of 56e2fcbf42SPeter Maydell QEMU will support machine types from many previous versions. 57e2fcbf42SPeter Maydell 58e2fcbf42SPeter Maydell Supported machine properties are: 59e2fcbf42SPeter Maydell 60e2fcbf42SPeter Maydell ``accel=accels1[:accels2[:...]]`` 61e2fcbf42SPeter Maydell This is used to enable an accelerator. Depending on the target 62b91b0fc1SPhilippe Mathieu-Daudé architecture, kvm, xen, hvf, nvmm, whpx or tcg can be available. 63e2fcbf42SPeter Maydell By default, tcg is used. If there is more than one accelerator 64e2fcbf42SPeter Maydell specified, the next one is used if the previous one fails to 65e2fcbf42SPeter Maydell initialize. 66e2fcbf42SPeter Maydell 67e2fcbf42SPeter Maydell ``vmport=on|off|auto`` 68e2fcbf42SPeter Maydell Enables emulation of VMWare IO port, for vmmouse etc. auto says 69e2fcbf42SPeter Maydell to select the value based on accel. For accel=xen the default is 70e2fcbf42SPeter Maydell off otherwise the default is on. 71e2fcbf42SPeter Maydell 72e2fcbf42SPeter Maydell ``dump-guest-core=on|off`` 73e2fcbf42SPeter Maydell Include guest memory in a core dump. The default is on. 74e2fcbf42SPeter Maydell 75e2fcbf42SPeter Maydell ``mem-merge=on|off`` 76e2fcbf42SPeter Maydell Enables or disables memory merge support. This feature, when 77e2fcbf42SPeter Maydell supported by the host, de-duplicates identical memory pages 78e2fcbf42SPeter Maydell among VMs instances (enabled by default). 79e2fcbf42SPeter Maydell 80e2fcbf42SPeter Maydell ``aes-key-wrap=on|off`` 81e2fcbf42SPeter Maydell Enables or disables AES key wrapping support on s390-ccw hosts. 82e2fcbf42SPeter Maydell This feature controls whether AES wrapping keys will be created 83e2fcbf42SPeter Maydell to allow execution of AES cryptographic functions. The default 84e2fcbf42SPeter Maydell is on. 85e2fcbf42SPeter Maydell 86e2fcbf42SPeter Maydell ``dea-key-wrap=on|off`` 87e2fcbf42SPeter Maydell Enables or disables DEA key wrapping support on s390-ccw hosts. 88e2fcbf42SPeter Maydell This feature controls whether DEA wrapping keys will be created 89e2fcbf42SPeter Maydell to allow execution of DEA cryptographic functions. The default 90e2fcbf42SPeter Maydell is on. 91e2fcbf42SPeter Maydell 92e2fcbf42SPeter Maydell ``nvdimm=on|off`` 93e2fcbf42SPeter Maydell Enables or disables NVDIMM support. The default is off. 94e2fcbf42SPeter Maydell 95e2fcbf42SPeter Maydell ``memory-encryption=`` 96e2fcbf42SPeter Maydell Memory encryption object to use. The default is none. 97e2fcbf42SPeter Maydell 98e2fcbf42SPeter Maydell ``hmat=on|off`` 99e2fcbf42SPeter Maydell Enables or disables ACPI Heterogeneous Memory Attribute Table 100e2fcbf42SPeter Maydell (HMAT) support. The default is off. 1018db0b204SIgor Mammedov 1028db0b204SIgor Mammedov ``memory-backend='id'`` 1038db0b204SIgor Mammedov An alternative to legacy ``-mem-path`` and ``mem-prealloc`` options. 1048db0b204SIgor Mammedov Allows to use a memory backend as main RAM. 1058db0b204SIgor Mammedov 1068db0b204SIgor Mammedov For example: 1078db0b204SIgor Mammedov :: 10895355829SPeter Maydell 1098db0b204SIgor Mammedov -object memory-backend-file,id=pc.ram,size=512M,mem-path=/hugetlbfs,prealloc=on,share=on 1108db0b204SIgor Mammedov -machine memory-backend=pc.ram 1118db0b204SIgor Mammedov -m 512M 1128db0b204SIgor Mammedov 1138db0b204SIgor Mammedov Migration compatibility note: 11495355829SPeter Maydell 11595355829SPeter Maydell * as backend id one shall use value of 'default-ram-id', advertised by 1168db0b204SIgor Mammedov machine type (available via ``query-machines`` QMP command), if migration 1178db0b204SIgor Mammedov to/from old QEMU (<5.0) is expected. 11895355829SPeter Maydell * for machine types 4.0 and older, user shall 1198db0b204SIgor Mammedov use ``x-use-canonical-path-for-ramblock-id=off`` backend option 1208db0b204SIgor Mammedov if migration to/from old QEMU (<5.0) is expected. 12195355829SPeter Maydell 1228db0b204SIgor Mammedov For example: 1238db0b204SIgor Mammedov :: 12495355829SPeter Maydell 1258db0b204SIgor Mammedov -object memory-backend-ram,id=pc.ram,size=512M,x-use-canonical-path-for-ramblock-id=off 1268db0b204SIgor Mammedov -machine memory-backend=pc.ram 1278db0b204SIgor Mammedov -m 512M 12803b39fcfSJonathan Cameron 12903b39fcfSJonathan Cameron ``cxl-fmw.0.targets.0=firsttarget,cxl-fmw.0.targets.1=secondtarget,cxl-fmw.0.size=size[,cxl-fmw.0.interleave-granularity=granularity]`` 13003b39fcfSJonathan Cameron Define a CXL Fixed Memory Window (CFMW). 13103b39fcfSJonathan Cameron 13203b39fcfSJonathan Cameron Described in the CXL 2.0 ECN: CEDT CFMWS & QTG _DSM. 13303b39fcfSJonathan Cameron 13403b39fcfSJonathan Cameron They are regions of Host Physical Addresses (HPA) on a system which 13503b39fcfSJonathan Cameron may be interleaved across one or more CXL host bridges. The system 13603b39fcfSJonathan Cameron software will assign particular devices into these windows and 13703b39fcfSJonathan Cameron configure the downstream Host-managed Device Memory (HDM) decoders 13803b39fcfSJonathan Cameron in root ports, switch ports and devices appropriately to meet the 13903b39fcfSJonathan Cameron interleave requirements before enabling the memory devices. 14003b39fcfSJonathan Cameron 14103b39fcfSJonathan Cameron ``targets.X=target`` provides the mapping to CXL host bridges 1422cb40d44SStefan Weil which may be identified by the id provided in the -device entry. 14303b39fcfSJonathan Cameron Multiple entries are needed to specify all the targets when 14403b39fcfSJonathan Cameron the fixed memory window represents interleaved memory. X is the 14503b39fcfSJonathan Cameron target index from 0. 14603b39fcfSJonathan Cameron 14703b39fcfSJonathan Cameron ``size=size`` sets the size of the CFMW. This must be a multiple of 14803b39fcfSJonathan Cameron 256MiB. The region will be aligned to 256MiB but the location is 14903b39fcfSJonathan Cameron platform and configuration dependent. 15003b39fcfSJonathan Cameron 15103b39fcfSJonathan Cameron ``interleave-granularity=granularity`` sets the granularity of 15203b39fcfSJonathan Cameron interleave. Default 256KiB. Only 256KiB, 512KiB, 1024KiB, 2048KiB 15303b39fcfSJonathan Cameron 4096KiB, 8192KiB and 16384KiB granularities supported. 15403b39fcfSJonathan Cameron 15503b39fcfSJonathan Cameron Example: 15603b39fcfSJonathan Cameron 15703b39fcfSJonathan Cameron :: 15803b39fcfSJonathan Cameron 15903b39fcfSJonathan Cameron -machine cxl-fmw.0.targets.0=cxl.0,cxl-fmw.0.targets.1=cxl.1,cxl-fmw.0.size=128G,cxl-fmw.0.interleave-granularity=512k 160e2fcbf42SPeter MaydellERST 1615824d651Sblueswir1 162dfce81f1SSean ChristophersonDEF("M", HAS_ARG, QEMU_OPTION_M, 16311058123SYang Zhong " sgx-epc.0.memdev=memid,sgx-epc.0.node=numaid\n", 164dfce81f1SSean Christopherson QEMU_ARCH_ALL) 165dfce81f1SSean Christopherson 166dfce81f1SSean ChristophersonSRST 16711058123SYang Zhong``sgx-epc.0.memdev=@var{memid},sgx-epc.0.node=@var{numaid}`` 168dfce81f1SSean Christopherson Define an SGX EPC section. 169dfce81f1SSean ChristophersonERST 17080f52a66SJan Kiszka 1715824d651Sblueswir1DEF("cpu", HAS_ARG, QEMU_OPTION_cpu, 172585f6036SPeter Maydell "-cpu cpu select CPU ('-cpu help' for list)\n", QEMU_ARCH_ALL) 173e2fcbf42SPeter MaydellSRST 174e2fcbf42SPeter Maydell``-cpu model`` 175e2fcbf42SPeter Maydell Select CPU model (``-cpu help`` for list and additional feature 176e2fcbf42SPeter Maydell selection) 177e2fcbf42SPeter MaydellERST 1785824d651Sblueswir1 1798d4e9146SKONRAD FredericDEF("accel", HAS_ARG, QEMU_OPTION_accel, 180fe174132SPaolo Bonzini "-accel [accel=]accelerator[,prop[=value][,...]]\n" 181b91b0fc1SPhilippe Mathieu-Daudé " select accelerator (kvm, xen, hvf, nvmm, whpx or tcg; use 'help' for a list)\n" 18246472d82SPaolo Bonzini " igd-passthru=on|off (enable Xen integrated Intel graphics passthrough, default=off)\n" 18311bc4a13SPaolo Bonzini " kernel-irqchip=on|off|split controls accelerated irqchip support (default=on)\n" 18423b0898eSPaolo Bonzini " kvm-shadow-mem=size of KVM shadow MMU in bytes\n" 1853cfb0456SPeter Maydell " one-insn-per-tb=on|off (one guest instruction per TCG translation block)\n" 186a35b3e14SRichard Henderson " split-wx=on|off (enable TCG split w^x mapping)\n" 187fe174132SPaolo Bonzini " tb-size=n (TCG translation block cache size)\n" 1882ea5cb0aSPeter Xu " dirty-ring-size=n (KVM dirty ring GFN count, default 0)\n" 189c8f2eb5dSShameer Kolothum " eager-split-size=n (KVM Eager Page Split chunk size, default 0, disabled. ARM only)\n" 190e2e69f6bSChenyi Qiang " notify-vmexit=run|internal-error|disable,notify-window=n (enable notify VM exit and set notify window, x86 only)\n" 1910b3c5c81SEduardo Habkost " thread=single|multi (enable multi-threaded TCG)\n", QEMU_ARCH_ALL) 192e2fcbf42SPeter MaydellSRST 193e2fcbf42SPeter Maydell``-accel name[,prop=value[,...]]`` 194e2fcbf42SPeter Maydell This is used to enable an accelerator. Depending on the target 195b91b0fc1SPhilippe Mathieu-Daudé architecture, kvm, xen, hvf, nvmm, whpx or tcg can be available. By 196e2fcbf42SPeter Maydell default, tcg is used. If there is more than one accelerator 197e2fcbf42SPeter Maydell specified, the next one is used if the previous one fails to 198e2fcbf42SPeter Maydell initialize. 199e2fcbf42SPeter Maydell 200e2fcbf42SPeter Maydell ``igd-passthru=on|off`` 201e2fcbf42SPeter Maydell When Xen is in use, this option controls whether Intel 202e2fcbf42SPeter Maydell integrated graphics devices can be passed through to the guest 203e2fcbf42SPeter Maydell (default=off) 204e2fcbf42SPeter Maydell 205e2fcbf42SPeter Maydell ``kernel-irqchip=on|off|split`` 206e2fcbf42SPeter Maydell Controls KVM in-kernel irqchip support. The default is full 207e2fcbf42SPeter Maydell acceleration of the interrupt controllers. On x86, split irqchip 208e2fcbf42SPeter Maydell reduces the kernel attack surface, at a performance cost for 209e2fcbf42SPeter Maydell non-MSI interrupts. Disabling the in-kernel irqchip completely 210e2fcbf42SPeter Maydell is not recommended except for debugging purposes. 211e2fcbf42SPeter Maydell 212e2fcbf42SPeter Maydell ``kvm-shadow-mem=size`` 213e2fcbf42SPeter Maydell Defines the size of the KVM shadow MMU. 214e2fcbf42SPeter Maydell 2153cfb0456SPeter Maydell ``one-insn-per-tb=on|off`` 2163cfb0456SPeter Maydell Makes the TCG accelerator put only one guest instruction into 2173cfb0456SPeter Maydell each translation block. This slows down emulation a lot, but 2183cfb0456SPeter Maydell can be useful in some situations, such as when trying to analyse 2193cfb0456SPeter Maydell the logs produced by the ``-d`` option. 2203cfb0456SPeter Maydell 221a35b3e14SRichard Henderson ``split-wx=on|off`` 222a35b3e14SRichard Henderson Controls the use of split w^x mapping for the TCG code generation 223a35b3e14SRichard Henderson buffer. Some operating systems require this to be enabled, and in 224a35b3e14SRichard Henderson such a case this will default on. On other operating systems, this 225a35b3e14SRichard Henderson will default off, but one may enable this for testing or debugging. 226a35b3e14SRichard Henderson 227e2fcbf42SPeter Maydell ``tb-size=n`` 228e2fcbf42SPeter Maydell Controls the size (in MiB) of the TCG translation block cache. 229e2fcbf42SPeter Maydell 230e2fcbf42SPeter Maydell ``thread=single|multi`` 231e2fcbf42SPeter Maydell Controls number of TCG threads. When the TCG is multi-threaded 232cba42d61SMichael Tokarev there will be one thread per vCPU therefore taking advantage of 233e2fcbf42SPeter Maydell additional host cores. The default is to enable multi-threading 234e2fcbf42SPeter Maydell where both the back-end and front-ends support it and no 235e2fcbf42SPeter Maydell incompatible TCG features have been enabled (e.g. 236e2fcbf42SPeter Maydell icount/replay). 2372ea5cb0aSPeter Xu 2382ea5cb0aSPeter Xu ``dirty-ring-size=n`` 2392ea5cb0aSPeter Xu When the KVM accelerator is used, it controls the size of the per-vCPU 2402ea5cb0aSPeter Xu dirty page ring buffer (number of entries for each vCPU). It should 2412ea5cb0aSPeter Xu be a value that is power of two, and it should be 1024 or bigger (but 2422ea5cb0aSPeter Xu still less than the maximum value that the kernel supports). 4096 2432ea5cb0aSPeter Xu could be a good initial value if you have no idea which is the best. 2442ea5cb0aSPeter Xu Set this value to 0 to disable the feature. By default, this feature 2452ea5cb0aSPeter Xu is disabled (dirty-ring-size=0). When enabled, KVM will instead 2462ea5cb0aSPeter Xu record dirty pages in a bitmap. 2472ea5cb0aSPeter Xu 248c8f2eb5dSShameer Kolothum ``eager-split-size=n`` 249c8f2eb5dSShameer Kolothum KVM implements dirty page logging at the PAGE_SIZE granularity and 250c8f2eb5dSShameer Kolothum enabling dirty-logging on a huge-page requires breaking it into 251c8f2eb5dSShameer Kolothum PAGE_SIZE pages in the first place. KVM on ARM does this splitting 252c8f2eb5dSShameer Kolothum lazily by default. There are performance benefits in doing huge-page 253c8f2eb5dSShameer Kolothum split eagerly, especially in situations where TLBI costs associated 254c8f2eb5dSShameer Kolothum with break-before-make sequences are considerable and also if guest 255c8f2eb5dSShameer Kolothum workloads are read intensive. The size here specifies how many pages 256c8f2eb5dSShameer Kolothum to break at a time and needs to be a valid block size which is 257c8f2eb5dSShameer Kolothum 1GB/2MB/4KB, 32MB/16KB and 512MB/64KB for 4KB/16KB/64KB PAGE_SIZE 258c8f2eb5dSShameer Kolothum respectively. Be wary of specifying a higher size as it will have an 259c8f2eb5dSShameer Kolothum impact on the memory. By default, this feature is disabled 260c8f2eb5dSShameer Kolothum (eager-split-size=0). 261c8f2eb5dSShameer Kolothum 262e2e69f6bSChenyi Qiang ``notify-vmexit=run|internal-error|disable,notify-window=n`` 263e2e69f6bSChenyi Qiang Enables or disables notify VM exit support on x86 host and specify 264e2e69f6bSChenyi Qiang the corresponding notify window to trigger the VM exit if enabled. 265e2e69f6bSChenyi Qiang ``run`` option enables the feature. It does nothing and continue 266e2e69f6bSChenyi Qiang if the exit happens. ``internal-error`` option enables the feature. 267e2e69f6bSChenyi Qiang It raises a internal error. ``disable`` option doesn't enable the feature. 268e2e69f6bSChenyi Qiang This feature can mitigate the CPU stuck issue due to event windows don't 269e2e69f6bSChenyi Qiang open up for a specified of time (i.e. notify-window). 270e2e69f6bSChenyi Qiang Default: notify-vmexit=run,notify-window=0. 271e2e69f6bSChenyi Qiang 272e2fcbf42SPeter MaydellERST 2738d4e9146SKONRAD Frederic 2745824d651Sblueswir1DEF("smp", HAS_ARG, QEMU_OPTION_smp, 275864c3b5cSYanan Wang "-smp [[cpus=]n][,maxcpus=maxcpus][,sockets=sockets][,dies=dies][,clusters=clusters][,cores=cores][,threads=threads]\n" 2760d871785SYanan Wang " set the number of initial CPUs to 'n' [default=1]\n" 277ce8ee7c6SDaniel P. Berrangé " maxcpus= maximum number of total CPUs, including\n" 278ca1a8a06SBruce Rogers " offline CPUs for hotplug, etc\n" 2790d871785SYanan Wang " sockets= number of sockets on the machine board\n" 2800d871785SYanan Wang " dies= number of dies in one socket\n" 281864c3b5cSYanan Wang " clusters= number of clusters in one die\n" 282864c3b5cSYanan Wang " cores= number of cores in one cluster\n" 2830d871785SYanan Wang " threads= number of threads in one core\n" 2840d871785SYanan Wang "Note: Different machines may have different subsets of the CPU topology\n" 2850d871785SYanan Wang " parameters supported, so the actual meaning of the supported parameters\n" 2860d871785SYanan Wang " will vary accordingly. For example, for a machine type that supports a\n" 2870d871785SYanan Wang " three-level CPU hierarchy of sockets/cores/threads, the parameters will\n" 2880d871785SYanan Wang " sequentially mean as below:\n" 2890d871785SYanan Wang " sockets means the number of sockets on the machine board\n" 2900d871785SYanan Wang " cores means the number of cores in one socket\n" 2910d871785SYanan Wang " threads means the number of threads in one core\n" 2920d871785SYanan Wang " For a particular machine type board, an expected CPU topology hierarchy\n" 2930d871785SYanan Wang " can be defined through the supported sub-option. Unsupported parameters\n" 2940d871785SYanan Wang " can also be provided in addition to the sub-option, but their values\n" 2950d871785SYanan Wang " must be set as 1 in the purpose of correct parsing.\n", 296ad96090aSBlue Swirl QEMU_ARCH_ALL) 297e2fcbf42SPeter MaydellSRST 298864c3b5cSYanan Wang``-smp [[cpus=]n][,maxcpus=maxcpus][,sockets=sockets][,dies=dies][,clusters=clusters][,cores=cores][,threads=threads]`` 29980d78357SDaniel P. Berrangé Simulate a SMP system with '\ ``n``\ ' CPUs initially present on 30080d78357SDaniel P. Berrangé the machine type board. On boards supporting CPU hotplug, the optional 30180d78357SDaniel P. Berrangé '\ ``maxcpus``\ ' parameter can be set to enable further CPUs to be 3027d8c5a39SYanan Wang added at runtime. When both parameters are omitted, the maximum number 3037d8c5a39SYanan Wang of CPUs will be calculated from the provided topology members and the 3047d8c5a39SYanan Wang initial CPU count will match the maximum number. When only one of them 3057d8c5a39SYanan Wang is given then the omitted one will be set to its counterpart's value. 3067d8c5a39SYanan Wang Both parameters may be specified, but the maximum number of CPUs must 3070d871785SYanan Wang be equal to or greater than the initial CPU count. Product of the 3080d871785SYanan Wang CPU topology hierarchy must be equal to the maximum number of CPUs. 3090d871785SYanan Wang Both parameters are subject to an upper limit that is determined by 3100d871785SYanan Wang the specific machine type chosen. 31180d78357SDaniel P. Berrangé 3120d871785SYanan Wang To control reporting of CPU topology information, values of the topology 3130d871785SYanan Wang parameters can be specified. Machines may only support a subset of the 3140d871785SYanan Wang parameters and different machines may have different subsets supported 3150d871785SYanan Wang which vary depending on capacity of the corresponding CPU targets. So 3160d871785SYanan Wang for a particular machine type board, an expected topology hierarchy can 3170d871785SYanan Wang be defined through the supported sub-option. Unsupported parameters can 3180d871785SYanan Wang also be provided in addition to the sub-option, but their values must be 3190d871785SYanan Wang set as 1 in the purpose of correct parsing. 32080d78357SDaniel P. Berrangé 32180d78357SDaniel P. Berrangé Either the initial CPU count, or at least one of the topology parameters 322c2511b16SYanan Wang must be specified. The specified parameters must be greater than zero, 323c2511b16SYanan Wang explicit configuration like "cpus=0" is not allowed. Values for any 324c2511b16SYanan Wang omitted parameters will be computed from those which are given. 3250d871785SYanan Wang 3260d871785SYanan Wang For example, the following sub-option defines a CPU topology hierarchy 3270d871785SYanan Wang (2 sockets totally on the machine, 2 cores per socket, 2 threads per 3280d871785SYanan Wang core) for a machine that only supports sockets/cores/threads. 3290d871785SYanan Wang Some members of the option can be omitted but their values will be 3300d871785SYanan Wang automatically computed: 3310d871785SYanan Wang 3320d871785SYanan Wang :: 3330d871785SYanan Wang 3340d871785SYanan Wang -smp 8,sockets=2,cores=2,threads=2,maxcpus=8 3350d871785SYanan Wang 3360d871785SYanan Wang The following sub-option defines a CPU topology hierarchy (2 sockets 3370d871785SYanan Wang totally on the machine, 2 dies per socket, 2 cores per die, 2 threads 3380d871785SYanan Wang per core) for PC machines which support sockets/dies/cores/threads. 3390d871785SYanan Wang Some members of the option can be omitted but their values will be 3400d871785SYanan Wang automatically computed: 3410d871785SYanan Wang 3420d871785SYanan Wang :: 3430d871785SYanan Wang 3440d871785SYanan Wang -smp 16,sockets=2,dies=2,cores=2,threads=2,maxcpus=16 3450d871785SYanan Wang 346d55c316fSYanan Wang The following sub-option defines a CPU topology hierarchy (2 sockets 347d55c316fSYanan Wang totally on the machine, 2 clusters per socket, 2 cores per cluster, 348d55c316fSYanan Wang 2 threads per core) for ARM virt machines which support sockets/clusters 349d55c316fSYanan Wang /cores/threads. Some members of the option can be omitted but their values 350d55c316fSYanan Wang will be automatically computed: 351d55c316fSYanan Wang 352d55c316fSYanan Wang :: 353d55c316fSYanan Wang 354d55c316fSYanan Wang -smp 16,sockets=2,clusters=2,cores=2,threads=2,maxcpus=16 355d55c316fSYanan Wang 356c2511b16SYanan Wang Historically preference was given to the coarsest topology parameters 357c2511b16SYanan Wang when computing missing values (ie sockets preferred over cores, which 358c2511b16SYanan Wang were preferred over threads), however, this behaviour is considered 3594a0af293SYanan Wang liable to change. Prior to 6.2 the preference was sockets over cores 3604a0af293SYanan Wang over threads. Since 6.2 the preference is cores over sockets over threads. 3610d871785SYanan Wang 3620d871785SYanan Wang For example, the following option defines a machine board with 2 sockets 3630d871785SYanan Wang of 1 core before 6.2 and 1 socket of 2 cores after 6.2: 3640d871785SYanan Wang 3650d871785SYanan Wang :: 3660d871785SYanan Wang 3670d871785SYanan Wang -smp 2 36897f4effeSYicong Yang 36997f4effeSYicong Yang Note: The cluster topology will only be generated in ACPI and exposed 37097f4effeSYicong Yang to guest if it's explicitly specified in -smp. 371e2fcbf42SPeter MaydellERST 3725824d651Sblueswir1 373268a362cSaliguoriDEF("numa", HAS_ARG, QEMU_OPTION_numa, 374244b3f44STao Xu "-numa node[,mem=size][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=node]\n" 375244b3f44STao Xu "-numa node[,memdev=id][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=node]\n" 3762d19c656SIgor Mammedov "-numa dist,src=source,dst=destination,val=distance\n" 3779b12dfa0SLiu Jingqi "-numa cpu,node-id=node[,socket-id=x][,core-id=y][,thread-id=z]\n" 378c412a48dSLiu 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" 379c412a48dSLiu Jingqi "-numa hmat-cache,node-id=node,size=size,level=level[,associativity=none|direct|complex][,policy=none|write-back|write-through][,line=size]\n", 3802d19c656SIgor Mammedov QEMU_ARCH_ALL) 381e2fcbf42SPeter MaydellSRST 38209ce5f2dSPeter Maydell``-numa node[,mem=size][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=initiator]`` 38309ce5f2dSPeter Maydell \ 38409ce5f2dSPeter Maydell``-numa node[,memdev=id][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=initiator]`` 38509ce5f2dSPeter Maydell \ 38609ce5f2dSPeter Maydell``-numa dist,src=source,dst=destination,val=distance`` 38709ce5f2dSPeter Maydell \ 38809ce5f2dSPeter Maydell``-numa cpu,node-id=node[,socket-id=x][,core-id=y][,thread-id=z]`` 38909ce5f2dSPeter Maydell \ 3902cb40d44SStefan Weil``-numa hmat-lb,initiator=node,target=node,hierarchy=hierarchy,data-type=type[,latency=lat][,bandwidth=bw]`` 39109ce5f2dSPeter Maydell \ 39209ce5f2dSPeter Maydell``-numa hmat-cache,node-id=node,size=size,level=level[,associativity=str][,policy=str][,line=size]`` 393e2fcbf42SPeter Maydell Define a NUMA node and assign RAM and VCPUs to it. Set the NUMA 394e2fcbf42SPeter Maydell distance from a source node to a destination node. Set the ACPI 395e2fcbf42SPeter Maydell Heterogeneous Memory Attributes for the given nodes. 396e2fcbf42SPeter Maydell 397e2fcbf42SPeter Maydell Legacy VCPU assignment uses '\ ``cpus``\ ' option where firstcpu and 398e2fcbf42SPeter Maydell lastcpu are CPU indexes. Each '\ ``cpus``\ ' option represent a 399e2fcbf42SPeter Maydell contiguous range of CPU indexes (or a single VCPU if lastcpu is 400e2fcbf42SPeter Maydell omitted). A non-contiguous set of VCPUs can be represented by 401e2fcbf42SPeter Maydell providing multiple '\ ``cpus``\ ' options. If '\ ``cpus``\ ' is 402e2fcbf42SPeter Maydell omitted on all nodes, VCPUs are automatically split between them. 403e2fcbf42SPeter Maydell 404e2fcbf42SPeter Maydell For example, the following option assigns VCPUs 0, 1, 2 and 5 to a 405e2fcbf42SPeter Maydell NUMA node: 406e2fcbf42SPeter Maydell 407e2fcbf42SPeter Maydell :: 408e2fcbf42SPeter Maydell 409e2fcbf42SPeter Maydell -numa node,cpus=0-2,cpus=5 410e2fcbf42SPeter Maydell 411e2fcbf42SPeter Maydell '\ ``cpu``\ ' option is a new alternative to '\ ``cpus``\ ' option 412e2fcbf42SPeter Maydell which uses '\ ``socket-id|core-id|thread-id``\ ' properties to 413e2fcbf42SPeter Maydell assign CPU objects to a node using topology layout properties of 414e2fcbf42SPeter Maydell CPU. The set of properties is machine specific, and depends on used 415e2fcbf42SPeter Maydell machine type/'\ ``smp``\ ' options. It could be queried with 416e2fcbf42SPeter Maydell '\ ``hotpluggable-cpus``\ ' monitor command. '\ ``node-id``\ ' 417e2fcbf42SPeter Maydell property specifies node to which CPU object will be assigned, it's 418e2fcbf42SPeter Maydell required for node to be declared with '\ ``node``\ ' option before 419e2fcbf42SPeter Maydell it's used with '\ ``cpu``\ ' option. 420e2fcbf42SPeter Maydell 421e2fcbf42SPeter Maydell For example: 422e2fcbf42SPeter Maydell 423e2fcbf42SPeter Maydell :: 424e2fcbf42SPeter Maydell 425e2fcbf42SPeter Maydell -M pc \ 426e2fcbf42SPeter Maydell -smp 1,sockets=2,maxcpus=2 \ 427e2fcbf42SPeter Maydell -numa node,nodeid=0 -numa node,nodeid=1 \ 428e2fcbf42SPeter Maydell -numa cpu,node-id=0,socket-id=0 -numa cpu,node-id=1,socket-id=1 429e2fcbf42SPeter Maydell 4304f513984SYohei Kojima '\ ``memdev``\ ' option assigns RAM from a given memory backend 4314f513984SYohei Kojima device to a node. It is recommended to use '\ ``memdev``\ ' option 4324f513984SYohei Kojima over legacy '\ ``mem``\ ' option. This is because '\ ``memdev``\ ' 4334f513984SYohei Kojima option provides better performance and more control over the 4344f513984SYohei Kojima backend's RAM (e.g. '\ ``prealloc``\ ' parameter of 4354f513984SYohei Kojima '\ ``-memory-backend-ram``\ ' allows memory preallocation). 43632a354dcSIgor Mammedov 4374f513984SYohei Kojima For compatibility reasons, legacy '\ ``mem``\ ' option is 4384f513984SYohei Kojima supported in 5.0 and older machine types. Note that '\ ``mem``\ ' 4394f513984SYohei Kojima and '\ ``memdev``\ ' are mutually exclusive. If one node uses 4404f513984SYohei Kojima '\ ``memdev``\ ', the rest nodes have to use '\ ``memdev``\ ' 4414f513984SYohei Kojima option, and vice versa. 442e2fcbf42SPeter Maydell 4434f513984SYohei Kojima Users must specify memory for all NUMA nodes by '\ ``memdev``\ ' 4444f513984SYohei Kojima (or legacy '\ ``mem``\ ' if available). In QEMU 5.2, the support 4454f513984SYohei Kojima for '\ ``-numa node``\ ' without memory specified was removed. 446e2fcbf42SPeter Maydell 447e2fcbf42SPeter Maydell '\ ``initiator``\ ' is an additional option that points to an 448e2fcbf42SPeter Maydell initiator NUMA node that has best performance (the lowest latency or 449e2fcbf42SPeter Maydell largest bandwidth) to this NUMA node. Note that this option can be 450e2fcbf42SPeter Maydell set only when the machine property 'hmat' is set to 'on'. 451e2fcbf42SPeter Maydell 452e2fcbf42SPeter Maydell Following example creates a machine with 2 NUMA nodes, node 0 has 453e2fcbf42SPeter Maydell CPU. node 1 has only memory, and its initiator is node 0. Note that 454e2fcbf42SPeter Maydell because node 0 has CPU, by default the initiator of node 0 is itself 455e2fcbf42SPeter Maydell and must be itself. 456e2fcbf42SPeter Maydell 457e2fcbf42SPeter Maydell :: 458e2fcbf42SPeter Maydell 459e2fcbf42SPeter Maydell -machine hmat=on \ 460e2fcbf42SPeter Maydell -m 2G,slots=2,maxmem=4G \ 461e2fcbf42SPeter Maydell -object memory-backend-ram,size=1G,id=m0 \ 462e2fcbf42SPeter Maydell -object memory-backend-ram,size=1G,id=m1 \ 463e2fcbf42SPeter Maydell -numa node,nodeid=0,memdev=m0 \ 464e2fcbf42SPeter Maydell -numa node,nodeid=1,memdev=m1,initiator=0 \ 465e2fcbf42SPeter Maydell -smp 2,sockets=2,maxcpus=2 \ 466e2fcbf42SPeter Maydell -numa cpu,node-id=0,socket-id=0 \ 467e2fcbf42SPeter Maydell -numa cpu,node-id=0,socket-id=1 468e2fcbf42SPeter Maydell 469e2fcbf42SPeter Maydell source and destination are NUMA node IDs. distance is the NUMA 470e2fcbf42SPeter Maydell distance from source to destination. The distance from a node to 471e2fcbf42SPeter Maydell itself is always 10. If any pair of nodes is given a distance, then 472e2fcbf42SPeter Maydell all pairs must be given distances. Although, when distances are only 473e2fcbf42SPeter Maydell given in one direction for each pair of nodes, then the distances in 474e2fcbf42SPeter Maydell the opposite directions are assumed to be the same. If, however, an 475e2fcbf42SPeter Maydell asymmetrical pair of distances is given for even one node pair, then 476e2fcbf42SPeter Maydell all node pairs must be provided distance values for both directions, 477e2fcbf42SPeter Maydell even when they are symmetrical. When a node is unreachable from 478e2fcbf42SPeter Maydell another node, set the pair's distance to 255. 479e2fcbf42SPeter Maydell 480e2fcbf42SPeter Maydell Note that the -``numa`` option doesn't allocate any of the specified 481e2fcbf42SPeter Maydell resources, it just assigns existing resources to NUMA nodes. This 482e2fcbf42SPeter Maydell means that one still has to use the ``-m``, ``-smp`` options to 483e2fcbf42SPeter Maydell allocate RAM and VCPUs respectively. 484e2fcbf42SPeter Maydell 485e2fcbf42SPeter Maydell Use '\ ``hmat-lb``\ ' to set System Locality Latency and Bandwidth 486e2fcbf42SPeter Maydell Information between initiator and target NUMA nodes in ACPI 487e2fcbf42SPeter Maydell Heterogeneous Attribute Memory Table (HMAT). Initiator NUMA node can 488e2fcbf42SPeter Maydell create memory requests, usually it has one or more processors. 489e2fcbf42SPeter Maydell Target NUMA node contains addressable memory. 490e2fcbf42SPeter Maydell 491e2fcbf42SPeter Maydell In '\ ``hmat-lb``\ ' option, node are NUMA node IDs. hierarchy is 492e2fcbf42SPeter Maydell the memory hierarchy of the target NUMA node: if hierarchy is 493e2fcbf42SPeter Maydell 'memory', the structure represents the memory performance; if 494e2fcbf42SPeter Maydell hierarchy is 'first-level\|second-level\|third-level', this 495e2fcbf42SPeter Maydell structure represents aggregated performance of memory side caches 496e2fcbf42SPeter Maydell for each domain. type of 'data-type' is type of data represented by 497e2fcbf42SPeter Maydell this structure instance: if 'hierarchy' is 'memory', 'data-type' is 498e2fcbf42SPeter Maydell 'access\|read\|write' latency or 'access\|read\|write' bandwidth of 499e2fcbf42SPeter Maydell the target memory; if 'hierarchy' is 500e2fcbf42SPeter Maydell 'first-level\|second-level\|third-level', 'data-type' is 501e2fcbf42SPeter Maydell 'access\|read\|write' hit latency or 'access\|read\|write' hit 502e2fcbf42SPeter Maydell bandwidth of the target memory side cache. 503e2fcbf42SPeter Maydell 504e2fcbf42SPeter Maydell lat is latency value in nanoseconds. bw is bandwidth value, the 505e2fcbf42SPeter Maydell possible value and units are NUM[M\|G\|T], mean that the bandwidth 506e2fcbf42SPeter Maydell value are NUM byte per second (or MB/s, GB/s or TB/s depending on 507e2fcbf42SPeter Maydell used suffix). Note that if latency or bandwidth value is 0, means 508e2fcbf42SPeter Maydell the corresponding latency or bandwidth information is not provided. 509e2fcbf42SPeter Maydell 510e2fcbf42SPeter Maydell In '\ ``hmat-cache``\ ' option, node-id is the NUMA-id of the memory 511e2fcbf42SPeter Maydell belongs. size is the size of memory side cache in bytes. level is 512e2fcbf42SPeter Maydell the cache level described in this structure, note that the cache 513e2fcbf42SPeter Maydell level 0 should not be used with '\ ``hmat-cache``\ ' option. 514e2fcbf42SPeter Maydell associativity is the cache associativity, the possible value is 515e2fcbf42SPeter Maydell 'none/direct(direct-mapped)/complex(complex cache indexing)'. policy 516e2fcbf42SPeter Maydell is the write policy. line is the cache Line size in bytes. 517e2fcbf42SPeter Maydell 518e2fcbf42SPeter Maydell For example, the following options describe 2 NUMA nodes. Node 0 has 519e2fcbf42SPeter Maydell 2 cpus and a ram, node 1 has only a ram. The processors in node 0 520e2fcbf42SPeter Maydell access memory in node 0 with access-latency 5 nanoseconds, 521e2fcbf42SPeter Maydell access-bandwidth is 200 MB/s; The processors in NUMA node 0 access 522e2fcbf42SPeter Maydell memory in NUMA node 1 with access-latency 10 nanoseconds, 523e2fcbf42SPeter Maydell access-bandwidth is 100 MB/s. And for memory side cache information, 524e2fcbf42SPeter Maydell NUMA node 0 and 1 both have 1 level memory cache, size is 10KB, 525e2fcbf42SPeter Maydell policy is write-back, the cache Line size is 8 bytes: 526e2fcbf42SPeter Maydell 527e2fcbf42SPeter Maydell :: 528e2fcbf42SPeter Maydell 529e2fcbf42SPeter Maydell -machine hmat=on \ 530e2fcbf42SPeter Maydell -m 2G \ 531e2fcbf42SPeter Maydell -object memory-backend-ram,size=1G,id=m0 \ 532e2fcbf42SPeter Maydell -object memory-backend-ram,size=1G,id=m1 \ 533848dd269SYanan Wang -smp 2,sockets=2,maxcpus=2 \ 534e2fcbf42SPeter Maydell -numa node,nodeid=0,memdev=m0 \ 535e2fcbf42SPeter Maydell -numa node,nodeid=1,memdev=m1,initiator=0 \ 536e2fcbf42SPeter Maydell -numa cpu,node-id=0,socket-id=0 \ 537e2fcbf42SPeter Maydell -numa cpu,node-id=0,socket-id=1 \ 538e2fcbf42SPeter Maydell -numa hmat-lb,initiator=0,target=0,hierarchy=memory,data-type=access-latency,latency=5 \ 539e2fcbf42SPeter Maydell -numa hmat-lb,initiator=0,target=0,hierarchy=memory,data-type=access-bandwidth,bandwidth=200M \ 540e2fcbf42SPeter Maydell -numa hmat-lb,initiator=0,target=1,hierarchy=memory,data-type=access-latency,latency=10 \ 541e2fcbf42SPeter Maydell -numa hmat-lb,initiator=0,target=1,hierarchy=memory,data-type=access-bandwidth,bandwidth=100M \ 542e2fcbf42SPeter Maydell -numa hmat-cache,node-id=0,size=10K,level=1,associativity=direct,policy=write-back,line=8 \ 543e2fcbf42SPeter Maydell -numa hmat-cache,node-id=1,size=10K,level=1,associativity=direct,policy=write-back,line=8 544e2fcbf42SPeter MaydellERST 545268a362cSaliguori 54610adb8beSMarkus ArmbrusterDEF("add-fd", HAS_ARG, QEMU_OPTION_add_fd, 54710adb8beSMarkus Armbruster "-add-fd fd=fd,set=set[,opaque=opaque]\n" 54810adb8beSMarkus Armbruster " Add 'fd' to fd 'set'\n", QEMU_ARCH_ALL) 549e2fcbf42SPeter MaydellSRST 550e2fcbf42SPeter Maydell``-add-fd fd=fd,set=set[,opaque=opaque]`` 551e2fcbf42SPeter Maydell Add a file descriptor to an fd set. Valid options are: 552e2fcbf42SPeter Maydell 553e2fcbf42SPeter Maydell ``fd=fd`` 554e2fcbf42SPeter Maydell This option defines the file descriptor of which a duplicate is 555e2fcbf42SPeter Maydell added to fd set. The file descriptor cannot be stdin, stdout, or 556e2fcbf42SPeter Maydell stderr. 557e2fcbf42SPeter Maydell 558e2fcbf42SPeter Maydell ``set=set`` 559e2fcbf42SPeter Maydell This option defines the ID of the fd set to add the file 560e2fcbf42SPeter Maydell descriptor to. 561e2fcbf42SPeter Maydell 562e2fcbf42SPeter Maydell ``opaque=opaque`` 563e2fcbf42SPeter Maydell This option defines a free-form string that can be used to 564e2fcbf42SPeter Maydell describe fd. 565e2fcbf42SPeter Maydell 566e2fcbf42SPeter Maydell You can open an image using pre-opened file descriptors from an fd 567e2fcbf42SPeter Maydell set: 568e2fcbf42SPeter Maydell 569e2fcbf42SPeter Maydell .. parsed-literal:: 570e2fcbf42SPeter Maydell 571353a06b4SLaszlo Ersek |qemu_system| \\ 572353a06b4SLaszlo Ersek -add-fd fd=3,set=2,opaque="rdwr:/path/to/file" \\ 573353a06b4SLaszlo Ersek -add-fd fd=4,set=2,opaque="rdonly:/path/to/file" \\ 574e2fcbf42SPeter Maydell -drive file=/dev/fdset/2,index=0,media=disk 575e2fcbf42SPeter MaydellERST 57610adb8beSMarkus Armbruster 57710adb8beSMarkus ArmbrusterDEF("set", HAS_ARG, QEMU_OPTION_set, 57810adb8beSMarkus Armbruster "-set group.id.arg=value\n" 57910adb8beSMarkus Armbruster " set <arg> parameter for item <id> of type <group>\n" 58010adb8beSMarkus Armbruster " i.e. -set drive.$id.file=/path/to/image\n", QEMU_ARCH_ALL) 581e2fcbf42SPeter MaydellSRST 582e2fcbf42SPeter Maydell``-set group.id.arg=value`` 583e2fcbf42SPeter Maydell Set parameter arg for item id of type group 584e2fcbf42SPeter MaydellERST 58510adb8beSMarkus Armbruster 58610adb8beSMarkus ArmbrusterDEF("global", HAS_ARG, QEMU_OPTION_global, 5873751d7c4SPaolo Bonzini "-global driver.property=value\n" 5883751d7c4SPaolo Bonzini "-global driver=driver,property=property,value=value\n" 58910adb8beSMarkus Armbruster " set a global default for a driver property\n", 59010adb8beSMarkus Armbruster QEMU_ARCH_ALL) 591e2fcbf42SPeter MaydellSRST 59209ce5f2dSPeter Maydell``-global driver.prop=value`` 59309ce5f2dSPeter Maydell \ 59409ce5f2dSPeter Maydell``-global driver=driver,property=property,value=value`` 595e2fcbf42SPeter Maydell Set default value of driver's property prop to value, e.g.: 596e2fcbf42SPeter Maydell 597e2fcbf42SPeter Maydell .. parsed-literal:: 598e2fcbf42SPeter Maydell 599e2fcbf42SPeter Maydell |qemu_system_x86| -global ide-hd.physical_block_size=4096 disk-image.img 600e2fcbf42SPeter Maydell 601e2fcbf42SPeter Maydell In particular, you can use this to set driver properties for devices 602e2fcbf42SPeter Maydell which are created automatically by the machine model. To create a 603e2fcbf42SPeter Maydell device which is not created automatically and set properties on it, 604e2fcbf42SPeter Maydell use -``device``. 605e2fcbf42SPeter Maydell 606e2fcbf42SPeter Maydell -global driver.prop=value is shorthand for -global 607e2fcbf42SPeter Maydell driver=driver,property=prop,value=value. The longhand syntax works 608e2fcbf42SPeter Maydell even when driver contains a dot. 609e2fcbf42SPeter MaydellERST 61010adb8beSMarkus Armbruster 61110adb8beSMarkus ArmbrusterDEF("boot", HAS_ARG, QEMU_OPTION_boot, 61210adb8beSMarkus Armbruster "-boot [order=drives][,once=drives][,menu=on|off]\n" 613c8a6ae8bSAmos Kong " [,splash=sp_name][,splash-time=sp_time][,reboot-timeout=rb_time][,strict=on|off]\n" 61410adb8beSMarkus Armbruster " 'drives': floppy (a), hard disk (c), CD-ROM (d), network (n)\n" 61510adb8beSMarkus Armbruster " 'sp_name': the file's name that would be passed to bios as logo picture, if menu=on\n" 61610adb8beSMarkus Armbruster " 'sp_time': the period that splash picture last if menu=on, unit is ms\n" 61710adb8beSMarkus Armbruster " 'rb_timeout': the timeout before guest reboot when boot failed, unit is ms\n", 61810adb8beSMarkus Armbruster QEMU_ARCH_ALL) 619e2fcbf42SPeter MaydellSRST 620e2fcbf42SPeter Maydell``-boot [order=drives][,once=drives][,menu=on|off][,splash=sp_name][,splash-time=sp_time][,reboot-timeout=rb_timeout][,strict=on|off]`` 621e2fcbf42SPeter Maydell Specify boot order drives as a string of drive letters. Valid drive 622e2fcbf42SPeter Maydell letters depend on the target architecture. The x86 PC uses: a, b 623e2fcbf42SPeter Maydell (floppy 1 and 2), c (first hard disk), d (first CD-ROM), n-p 624e2fcbf42SPeter Maydell (Etherboot from network adapter 1-4), hard disk boot is the default. 625e2fcbf42SPeter Maydell To apply a particular boot order only on the first startup, specify 626e2fcbf42SPeter Maydell it via ``once``. Note that the ``order`` or ``once`` parameter 627e2fcbf42SPeter Maydell should not be used together with the ``bootindex`` property of 628e2fcbf42SPeter Maydell devices, since the firmware implementations normally do not support 629e2fcbf42SPeter Maydell both at the same time. 630e2fcbf42SPeter Maydell 631e2fcbf42SPeter Maydell Interactive boot menus/prompts can be enabled via ``menu=on`` as far 632e2fcbf42SPeter Maydell as firmware/BIOS supports them. The default is non-interactive boot. 633e2fcbf42SPeter Maydell 634e2fcbf42SPeter Maydell A splash picture could be passed to bios, enabling user to show it 635e2fcbf42SPeter Maydell as logo, when option splash=sp\_name is given and menu=on, If 636e2fcbf42SPeter Maydell firmware/BIOS supports them. Currently Seabios for X86 system 637e2fcbf42SPeter Maydell support it. limitation: The splash file could be a jpeg file or a 638e2fcbf42SPeter Maydell BMP file in 24 BPP format(true color). The resolution should be 639e2fcbf42SPeter Maydell supported by the SVGA mode, so the recommended is 320x240, 640x480, 640e2fcbf42SPeter Maydell 800x640. 641e2fcbf42SPeter Maydell 642e2fcbf42SPeter Maydell A timeout could be passed to bios, guest will pause for rb\_timeout 643e2fcbf42SPeter Maydell ms when boot failed, then reboot. If rb\_timeout is '-1', guest will 644e2fcbf42SPeter Maydell not reboot, qemu passes '-1' to bios by default. Currently Seabios 645e2fcbf42SPeter Maydell for X86 system support it. 646e2fcbf42SPeter Maydell 647e2fcbf42SPeter Maydell Do strict boot via ``strict=on`` as far as firmware/BIOS supports 648e2fcbf42SPeter Maydell it. This only effects when boot priority is changed by bootindex 649e2fcbf42SPeter Maydell options. The default is non-strict boot. 650e2fcbf42SPeter Maydell 65109ce5f2dSPeter Maydell .. parsed-literal:: 652e2fcbf42SPeter Maydell 653e2fcbf42SPeter Maydell # try to boot from network first, then from hard disk 654e2fcbf42SPeter Maydell |qemu_system_x86| -boot order=nc 655e2fcbf42SPeter Maydell # boot from CD-ROM first, switch back to default order after reboot 656e2fcbf42SPeter Maydell |qemu_system_x86| -boot once=d 657e2fcbf42SPeter Maydell # boot with a splash picture for 5 seconds. 658e2fcbf42SPeter Maydell |qemu_system_x86| -boot menu=on,splash=/root/boot.bmp,splash-time=5000 659e2fcbf42SPeter Maydell 660e2fcbf42SPeter Maydell Note: The legacy format '-boot drives' is still supported but its 661e2fcbf42SPeter Maydell use is discouraged as it may be removed from future versions. 662e2fcbf42SPeter MaydellERST 66310adb8beSMarkus Armbruster 66410adb8beSMarkus ArmbrusterDEF("m", HAS_ARG, QEMU_OPTION_m, 66589f3ea2bSMichael Tokarev "-m [size=]megs[,slots=n,maxmem=size]\n" 6666e1d3c1cSIgor Mammedov " configure guest RAM\n" 6670daba1f0SAlexander Graf " size: initial amount of guest memory\n" 668c270fb9eSIgor Mammedov " slots: number of hotplug slots (default: none)\n" 669b6fe0124SMatthew Rosato " maxmem: maximum amount of guest memory (default: none)\n" 670a635bcfcSThomas Huth " Note: Some architectures might enforce a specific granularity\n", 6716e1d3c1cSIgor Mammedov QEMU_ARCH_ALL) 672e2fcbf42SPeter MaydellSRST 673e2fcbf42SPeter Maydell``-m [size=]megs[,slots=n,maxmem=size]`` 674e2fcbf42SPeter Maydell Sets guest startup RAM size to megs megabytes. Default is 128 MiB. 675e2fcbf42SPeter Maydell Optionally, a suffix of "M" or "G" can be used to signify a value in 676e2fcbf42SPeter Maydell megabytes or gigabytes respectively. Optional pair slots, maxmem 677e2fcbf42SPeter Maydell could be used to set amount of hotpluggable memory slots and maximum 678e2fcbf42SPeter Maydell amount of memory. Note that maxmem must be aligned to the page size. 679e2fcbf42SPeter Maydell 680e2fcbf42SPeter Maydell For example, the following command-line sets the guest startup RAM 681e2fcbf42SPeter Maydell size to 1GB, creates 3 slots to hotplug additional memory and sets 682e2fcbf42SPeter Maydell the maximum memory the guest can reach to 4GB: 683e2fcbf42SPeter Maydell 684e2fcbf42SPeter Maydell .. parsed-literal:: 685e2fcbf42SPeter Maydell 686e2fcbf42SPeter Maydell |qemu_system| -m 1G,slots=3,maxmem=4G 687e2fcbf42SPeter Maydell 688e2fcbf42SPeter Maydell If slots and maxmem are not specified, memory hotplug won't be 689e2fcbf42SPeter Maydell enabled and the guest startup RAM will never increase. 690e2fcbf42SPeter MaydellERST 69110adb8beSMarkus Armbruster 69210adb8beSMarkus ArmbrusterDEF("mem-path", HAS_ARG, QEMU_OPTION_mempath, 69310adb8beSMarkus Armbruster "-mem-path FILE provide backing storage for guest RAM\n", QEMU_ARCH_ALL) 694e2fcbf42SPeter MaydellSRST 695e2fcbf42SPeter Maydell``-mem-path path`` 696e2fcbf42SPeter Maydell Allocate guest RAM from a temporarily created file in path. 697e2fcbf42SPeter MaydellERST 69810adb8beSMarkus Armbruster 69910adb8beSMarkus ArmbrusterDEF("mem-prealloc", 0, QEMU_OPTION_mem_prealloc, 70010adb8beSMarkus Armbruster "-mem-prealloc preallocate guest memory (use with -mem-path)\n", 70110adb8beSMarkus Armbruster QEMU_ARCH_ALL) 702e2fcbf42SPeter MaydellSRST 703e2fcbf42SPeter Maydell``-mem-prealloc`` 704e2fcbf42SPeter Maydell Preallocate memory when using -mem-path. 705e2fcbf42SPeter MaydellERST 70610adb8beSMarkus Armbruster 70710adb8beSMarkus ArmbrusterDEF("k", HAS_ARG, QEMU_OPTION_k, 70810adb8beSMarkus Armbruster "-k language use keyboard layout (for example 'fr' for French)\n", 70910adb8beSMarkus Armbruster QEMU_ARCH_ALL) 710e2fcbf42SPeter MaydellSRST 711e2fcbf42SPeter Maydell``-k language`` 712e2fcbf42SPeter Maydell Use keyboard layout language (for example ``fr`` for French). This 713e2fcbf42SPeter Maydell option is only needed where it is not easy to get raw PC keycodes 714e2fcbf42SPeter Maydell (e.g. on Macs, with some X11 servers or with a VNC or curses 715e2fcbf42SPeter Maydell display). You don't normally need to use it on PC/Linux or 716e2fcbf42SPeter Maydell PC/Windows hosts. 717e2fcbf42SPeter Maydell 718e2fcbf42SPeter Maydell The available layouts are: 719e2fcbf42SPeter Maydell 720e2fcbf42SPeter Maydell :: 721e2fcbf42SPeter Maydell 722e2fcbf42SPeter Maydell ar de-ch es fo fr-ca hu ja mk no pt-br sv 723e2fcbf42SPeter Maydell da en-gb et fr fr-ch is lt nl pl ru th 724e2fcbf42SPeter Maydell de en-us fi fr-be hr it lv nl-be pt sl tr 725e2fcbf42SPeter Maydell 726e2fcbf42SPeter Maydell The default is ``en-us``. 727e2fcbf42SPeter MaydellERST 72810adb8beSMarkus Armbruster 72910adb8beSMarkus Armbruster 730039a6837SPaolo BonziniDEF("audio", HAS_ARG, QEMU_OPTION_audio, 731039a6837SPaolo Bonzini "-audio [driver=]driver,model=value[,prop[=value][,...]]\n" 732039a6837SPaolo Bonzini " specifies the audio backend and device to use;\n" 733039a6837SPaolo Bonzini " apart from 'model', options are the same as for -audiodev.\n" 734039a6837SPaolo Bonzini " use '-audio model=help' to show possible devices.\n", 735039a6837SPaolo Bonzini QEMU_ARCH_ALL) 736039a6837SPaolo BonziniSRST 737039a6837SPaolo Bonzini``-audio [driver=]driver,model=value[,prop[=value][,...]]`` 738039a6837SPaolo Bonzini This option is a shortcut for configuring both the guest audio 739039a6837SPaolo Bonzini hardware and the host audio backend in one go. 7405e03b6daSClaudio Fontana The driver option is the same as with the corresponding ``-audiodev`` option below. 7415e03b6daSClaudio Fontana The guest hardware model can be set with ``model=modelname``. 7425e03b6daSClaudio Fontana 7435e03b6daSClaudio Fontana Use ``driver=help`` to list the available drivers, 7445e03b6daSClaudio Fontana and ``model=help`` to list the available device types. 745039a6837SPaolo Bonzini 746039a6837SPaolo Bonzini The following two example do exactly the same, to show how ``-audio`` 747039a6837SPaolo Bonzini can be used to shorten the command line length: 748039a6837SPaolo Bonzini 749039a6837SPaolo Bonzini .. parsed-literal:: 750039a6837SPaolo Bonzini 751039a6837SPaolo Bonzini |qemu_system| -audiodev pa,id=pa -device sb16,audiodev=pa 752039a6837SPaolo Bonzini |qemu_system| -audio pa,model=sb16 753039a6837SPaolo BonziniERST 754039a6837SPaolo Bonzini 755f0b3d811SKővágó, ZoltánDEF("audiodev", HAS_ARG, QEMU_OPTION_audiodev, 756f0b3d811SKővágó, Zoltán "-audiodev [driver=]driver,id=id[,prop[=value][,...]]\n" 757f0b3d811SKővágó, Zoltán " specifies the audio backend to use\n" 7585e03b6daSClaudio Fontana " Use ``-audiodev help`` to list the available drivers\n" 759f0b3d811SKővágó, Zoltán " id= identifier of the backend\n" 760f0b3d811SKővágó, Zoltán " timer-period= timer period in microseconds\n" 7618efac073SKővágó, Zoltán " in|out.mixing-engine= use mixing engine to mix streams inside QEMU\n" 762f0b3d811SKővágó, Zoltán " in|out.fixed-settings= use fixed settings for host audio\n" 763f0b3d811SKővágó, Zoltán " in|out.frequency= frequency to use with fixed settings\n" 764f0b3d811SKővágó, Zoltán " in|out.channels= number of channels to use with fixed settings\n" 765f0b3d811SKővágó, Zoltán " in|out.format= sample format to use with fixed settings\n" 76649f77e6fSVolker Rümelin " valid values: s8, s16, s32, u8, u16, u32, f32\n" 767f0b3d811SKővágó, Zoltán " in|out.voices= number of voices to use\n" 7688624725bSStefan Hajnoczi " in|out.buffer-length= length of buffer in microseconds\n" 769f0b3d811SKővágó, Zoltán "-audiodev none,id=id,[,prop[=value][,...]]\n" 770f0b3d811SKővágó, Zoltán " dummy driver that discards all output\n" 771f0b3d811SKővágó, Zoltán#ifdef CONFIG_AUDIO_ALSA 772f0b3d811SKővágó, Zoltán "-audiodev alsa,id=id[,prop[=value][,...]]\n" 773f0b3d811SKővágó, Zoltán " in|out.dev= name of the audio device to use\n" 774dfc54343SStefan Hajnoczi " in|out.period-length= length of period in microseconds\n" 775f0b3d811SKővágó, Zoltán " in|out.try-poll= attempt to use poll mode\n" 776f0b3d811SKővágó, Zoltán " threshold= threshold (in microseconds) when playback starts\n" 777f0b3d811SKővágó, Zoltán#endif 778f0b3d811SKővágó, Zoltán#ifdef CONFIG_AUDIO_COREAUDIO 779f0b3d811SKővágó, Zoltán "-audiodev coreaudio,id=id[,prop[=value][,...]]\n" 780f0b3d811SKővágó, Zoltán " in|out.buffer-count= number of buffers\n" 781f0b3d811SKővágó, Zoltán#endif 782f0b3d811SKővágó, Zoltán#ifdef CONFIG_AUDIO_DSOUND 783f0b3d811SKővágó, Zoltán "-audiodev dsound,id=id[,prop[=value][,...]]\n" 784f0b3d811SKővágó, Zoltán " latency= add extra latency to playback in microseconds\n" 785f0b3d811SKővágó, Zoltán#endif 786f0b3d811SKővágó, Zoltán#ifdef CONFIG_AUDIO_OSS 787f0b3d811SKővágó, Zoltán "-audiodev oss,id=id[,prop[=value][,...]]\n" 788f0b3d811SKővágó, Zoltán " in|out.dev= path of the audio device to use\n" 789f0b3d811SKővágó, Zoltán " in|out.buffer-count= number of buffers\n" 790f0b3d811SKővágó, Zoltán " in|out.try-poll= attempt to use poll mode\n" 791f0b3d811SKővágó, Zoltán " try-mmap= try using memory mapped access\n" 792f0b3d811SKővágó, Zoltán " exclusive= open device in exclusive mode\n" 793f0b3d811SKővágó, Zoltán " dsp-policy= set timing policy (0..10), -1 to use fragment mode\n" 794f0b3d811SKővágó, Zoltán#endif 795f0b3d811SKővágó, Zoltán#ifdef CONFIG_AUDIO_PA 796f0b3d811SKővágó, Zoltán "-audiodev pa,id=id[,prop[=value][,...]]\n" 797f0b3d811SKővágó, Zoltán " server= PulseAudio server address\n" 798f0b3d811SKővágó, Zoltán " in|out.name= source/sink device name\n" 79914d4f011SStefan Hajnoczi " in|out.latency= desired latency in microseconds\n" 800f0b3d811SKővágó, Zoltán#endif 801c2d3d1c2SDorinda Bassey#ifdef CONFIG_AUDIO_PIPEWIRE 802c2d3d1c2SDorinda Bassey "-audiodev pipewire,id=id[,prop[=value][,...]]\n" 803c2d3d1c2SDorinda Bassey " in|out.name= source/sink device name\n" 804c2d3d1c2SDorinda Bassey " in|out.stream-name= name of pipewire stream\n" 805c2d3d1c2SDorinda Bassey " in|out.latency= desired latency in microseconds\n" 806c2d3d1c2SDorinda Bassey#endif 807f0b3d811SKővágó, Zoltán#ifdef CONFIG_AUDIO_SDL 808f0b3d811SKővágó, Zoltán "-audiodev sdl,id=id[,prop[=value][,...]]\n" 8095a0926c2SVolker Rümelin " in|out.buffer-count= number of buffers\n" 810f0b3d811SKővágó, Zoltán#endif 811663df1ccSAlexandre Ratchov#ifdef CONFIG_AUDIO_SNDIO 812663df1ccSAlexandre Ratchov "-audiodev sndio,id=id[,prop[=value][,...]]\n" 813663df1ccSAlexandre Ratchov#endif 814f0b3d811SKővágó, Zoltán#ifdef CONFIG_SPICE 815f0b3d811SKővágó, Zoltán "-audiodev spice,id=id[,prop[=value][,...]]\n" 816f0b3d811SKővágó, Zoltán#endif 817739362d4SMarc-André Lureau#ifdef CONFIG_DBUS_DISPLAY 818739362d4SMarc-André Lureau "-audiodev dbus,id=id[,prop[=value][,...]]\n" 819739362d4SMarc-André Lureau#endif 820f0b3d811SKővágó, Zoltán "-audiodev wav,id=id[,prop[=value][,...]]\n" 821f0b3d811SKővágó, Zoltán " path= path of wav file to record\n", 822f0b3d811SKővágó, Zoltán QEMU_ARCH_ALL) 823e2fcbf42SPeter MaydellSRST 824e2fcbf42SPeter Maydell``-audiodev [driver=]driver,id=id[,prop[=value][,...]]`` 825e2fcbf42SPeter Maydell Adds a new audio backend driver identified by id. There are global 826e2fcbf42SPeter Maydell and driver specific properties. Some values can be set differently 827e2fcbf42SPeter Maydell for input and output, they're marked with ``in|out.``. You can set 828e2fcbf42SPeter Maydell the input's property with ``in.prop`` and the output's property with 829e2fcbf42SPeter Maydell ``out.prop``. For example: 830e2fcbf42SPeter Maydell 831e2fcbf42SPeter Maydell :: 832e2fcbf42SPeter Maydell 833e2fcbf42SPeter Maydell -audiodev alsa,id=example,in.frequency=44110,out.frequency=8000 834e2fcbf42SPeter Maydell -audiodev alsa,id=example,out.channels=1 # leaves in.channels unspecified 835e2fcbf42SPeter Maydell 836e2fcbf42SPeter Maydell NOTE: parameter validation is known to be incomplete, in many cases 837e2fcbf42SPeter Maydell specifying an invalid option causes QEMU to print an error message 838e2fcbf42SPeter Maydell and continue emulation without sound. 839e2fcbf42SPeter Maydell 840e2fcbf42SPeter Maydell Valid global options are: 841e2fcbf42SPeter Maydell 842e2fcbf42SPeter Maydell ``id=identifier`` 843e2fcbf42SPeter Maydell Identifies the audio backend. 844e2fcbf42SPeter Maydell 845e2fcbf42SPeter Maydell ``timer-period=period`` 846e2fcbf42SPeter Maydell Sets the timer period used by the audio subsystem in 847e2fcbf42SPeter Maydell microseconds. Default is 10000 (10 ms). 848e2fcbf42SPeter Maydell 849e2fcbf42SPeter Maydell ``in|out.mixing-engine=on|off`` 850e2fcbf42SPeter Maydell Use QEMU's mixing engine to mix all streams inside QEMU and 851e2fcbf42SPeter Maydell convert audio formats when not supported by the backend. When 852e2fcbf42SPeter Maydell off, fixed-settings must be off too. Note that disabling this 853e2fcbf42SPeter Maydell option means that the selected backend must support multiple 854e2fcbf42SPeter Maydell streams and the audio formats used by the virtual cards, 855e2fcbf42SPeter Maydell otherwise you'll get no sound. It's not recommended to disable 856e2fcbf42SPeter Maydell this option unless you want to use 5.1 or 7.1 audio, as mixing 857e2fcbf42SPeter Maydell engine only supports mono and stereo audio. Default is on. 858e2fcbf42SPeter Maydell 859e2fcbf42SPeter Maydell ``in|out.fixed-settings=on|off`` 860e2fcbf42SPeter Maydell Use fixed settings for host audio. When off, it will change 861e2fcbf42SPeter Maydell based on how the guest opens the sound card. In this case you 862e2fcbf42SPeter Maydell must not specify frequency, channels or format. Default is on. 863e2fcbf42SPeter Maydell 864e2fcbf42SPeter Maydell ``in|out.frequency=frequency`` 865e2fcbf42SPeter Maydell Specify the frequency to use when using fixed-settings. Default 866e2fcbf42SPeter Maydell is 44100Hz. 867e2fcbf42SPeter Maydell 868e2fcbf42SPeter Maydell ``in|out.channels=channels`` 869e2fcbf42SPeter Maydell Specify the number of channels to use when using fixed-settings. 870e2fcbf42SPeter Maydell Default is 2 (stereo). 871e2fcbf42SPeter Maydell 872e2fcbf42SPeter Maydell ``in|out.format=format`` 873e2fcbf42SPeter Maydell Specify the sample format to use when using fixed-settings. 874e2fcbf42SPeter Maydell Valid values are: ``s8``, ``s16``, ``s32``, ``u8``, ``u16``, 87549f77e6fSVolker Rümelin ``u32``, ``f32``. Default is ``s16``. 876e2fcbf42SPeter Maydell 877e2fcbf42SPeter Maydell ``in|out.voices=voices`` 878e2fcbf42SPeter Maydell Specify the number of voices to use. Default is 1. 879e2fcbf42SPeter Maydell 880e2fcbf42SPeter Maydell ``in|out.buffer-length=usecs`` 881e2fcbf42SPeter Maydell Sets the size of the buffer in microseconds. 882e2fcbf42SPeter Maydell 883e2fcbf42SPeter Maydell``-audiodev none,id=id[,prop[=value][,...]]`` 884e2fcbf42SPeter Maydell Creates a dummy backend that discards all outputs. This backend has 885e2fcbf42SPeter Maydell no backend specific properties. 886e2fcbf42SPeter Maydell 887e2fcbf42SPeter Maydell``-audiodev alsa,id=id[,prop[=value][,...]]`` 888e2fcbf42SPeter Maydell Creates backend using the ALSA. This backend is only available on 889e2fcbf42SPeter Maydell Linux. 890e2fcbf42SPeter Maydell 891e2fcbf42SPeter Maydell ALSA specific options are: 892e2fcbf42SPeter Maydell 893e2fcbf42SPeter Maydell ``in|out.dev=device`` 894e2fcbf42SPeter Maydell Specify the ALSA device to use for input and/or output. Default 895e2fcbf42SPeter Maydell is ``default``. 896e2fcbf42SPeter Maydell 897e2fcbf42SPeter Maydell ``in|out.period-length=usecs`` 898e2fcbf42SPeter Maydell Sets the period length in microseconds. 899e2fcbf42SPeter Maydell 900e2fcbf42SPeter Maydell ``in|out.try-poll=on|off`` 901e2fcbf42SPeter Maydell Attempt to use poll mode with the device. Default is on. 902e2fcbf42SPeter Maydell 903e2fcbf42SPeter Maydell ``threshold=threshold`` 904e2fcbf42SPeter Maydell Threshold (in microseconds) when playback starts. Default is 0. 905e2fcbf42SPeter Maydell 906e2fcbf42SPeter Maydell``-audiodev coreaudio,id=id[,prop[=value][,...]]`` 907e2fcbf42SPeter Maydell Creates a backend using Apple's Core Audio. This backend is only 908e2fcbf42SPeter Maydell available on Mac OS and only supports playback. 909e2fcbf42SPeter Maydell 910e2fcbf42SPeter Maydell Core Audio specific options are: 911e2fcbf42SPeter Maydell 912e2fcbf42SPeter Maydell ``in|out.buffer-count=count`` 913e2fcbf42SPeter Maydell Sets the count of the buffers. 914e2fcbf42SPeter Maydell 915e2fcbf42SPeter Maydell``-audiodev dsound,id=id[,prop[=value][,...]]`` 916e2fcbf42SPeter Maydell Creates a backend using Microsoft's DirectSound. This backend is 917e2fcbf42SPeter Maydell only available on Windows and only supports playback. 918e2fcbf42SPeter Maydell 919e2fcbf42SPeter Maydell DirectSound specific options are: 920e2fcbf42SPeter Maydell 921e2fcbf42SPeter Maydell ``latency=usecs`` 922e2fcbf42SPeter Maydell Add extra usecs microseconds latency to playback. Default is 923e2fcbf42SPeter Maydell 10000 (10 ms). 924e2fcbf42SPeter Maydell 925e2fcbf42SPeter Maydell``-audiodev oss,id=id[,prop[=value][,...]]`` 926e2fcbf42SPeter Maydell Creates a backend using OSS. This backend is available on most 927e2fcbf42SPeter Maydell Unix-like systems. 928e2fcbf42SPeter Maydell 929e2fcbf42SPeter Maydell OSS specific options are: 930e2fcbf42SPeter Maydell 931e2fcbf42SPeter Maydell ``in|out.dev=device`` 932e2fcbf42SPeter Maydell Specify the file name of the OSS device to use. Default is 933e2fcbf42SPeter Maydell ``/dev/dsp``. 934e2fcbf42SPeter Maydell 935e2fcbf42SPeter Maydell ``in|out.buffer-count=count`` 936e2fcbf42SPeter Maydell Sets the count of the buffers. 937e2fcbf42SPeter Maydell 938e2fcbf42SPeter Maydell ``in|out.try-poll=on|of`` 939e2fcbf42SPeter Maydell Attempt to use poll mode with the device. Default is on. 940e2fcbf42SPeter Maydell 941e2fcbf42SPeter Maydell ``try-mmap=on|off`` 942e2fcbf42SPeter Maydell Try using memory mapped device access. Default is off. 943e2fcbf42SPeter Maydell 944e2fcbf42SPeter Maydell ``exclusive=on|off`` 945e2fcbf42SPeter Maydell Open the device in exclusive mode (vmix won't work in this 946e2fcbf42SPeter Maydell case). Default is off. 947e2fcbf42SPeter Maydell 948e2fcbf42SPeter Maydell ``dsp-policy=policy`` 949e2fcbf42SPeter Maydell Sets the timing policy (between 0 and 10, where smaller number 950e2fcbf42SPeter Maydell means smaller latency but higher CPU usage). Use -1 to use 951e2fcbf42SPeter Maydell buffer sizes specified by ``buffer`` and ``buffer-count``. This 952e2fcbf42SPeter Maydell option is ignored if you do not have OSS 4. Default is 5. 953e2fcbf42SPeter Maydell 954e2fcbf42SPeter Maydell``-audiodev pa,id=id[,prop[=value][,...]]`` 955e2fcbf42SPeter Maydell Creates a backend using PulseAudio. This backend is available on 956e2fcbf42SPeter Maydell most systems. 957e2fcbf42SPeter Maydell 958e2fcbf42SPeter Maydell PulseAudio specific options are: 959e2fcbf42SPeter Maydell 960e2fcbf42SPeter Maydell ``server=server`` 961e2fcbf42SPeter Maydell Sets the PulseAudio server to connect to. 962e2fcbf42SPeter Maydell 963e2fcbf42SPeter Maydell ``in|out.name=sink`` 964e2fcbf42SPeter Maydell Use the specified source/sink for recording/playback. 965e2fcbf42SPeter Maydell 966e2fcbf42SPeter Maydell ``in|out.latency=usecs`` 967e2fcbf42SPeter Maydell Desired latency in microseconds. The PulseAudio server will try 968e2fcbf42SPeter Maydell to honor this value but actual latencies may be lower or higher. 969e2fcbf42SPeter Maydell 970c2d3d1c2SDorinda Bassey``-audiodev pipewire,id=id[,prop[=value][,...]]`` 97120c51248SMarc-André Lureau Creates a backend using PipeWire. This backend is available on 972c2d3d1c2SDorinda Bassey most systems. 973c2d3d1c2SDorinda Bassey 97420c51248SMarc-André Lureau PipeWire specific options are: 975c2d3d1c2SDorinda Bassey 976c2d3d1c2SDorinda Bassey ``in|out.latency=usecs`` 977c2d3d1c2SDorinda Bassey Desired latency in microseconds. 978c2d3d1c2SDorinda Bassey 979c2d3d1c2SDorinda Bassey ``in|out.name=sink`` 980c2d3d1c2SDorinda Bassey Use the specified source/sink for recording/playback. 981c2d3d1c2SDorinda Bassey 982c2d3d1c2SDorinda Bassey ``in|out.stream-name`` 983c2d3d1c2SDorinda Bassey Specify the name of pipewire stream. 984c2d3d1c2SDorinda Bassey 985e2fcbf42SPeter Maydell``-audiodev sdl,id=id[,prop[=value][,...]]`` 986e2fcbf42SPeter Maydell Creates a backend using SDL. This backend is available on most 987e2fcbf42SPeter Maydell systems, but you should use your platform's native backend if 9885a0926c2SVolker Rümelin possible. 9895a0926c2SVolker Rümelin 9905a0926c2SVolker Rümelin SDL specific options are: 9915a0926c2SVolker Rümelin 9925a0926c2SVolker Rümelin ``in|out.buffer-count=count`` 9935a0926c2SVolker Rümelin Sets the count of the buffers. 994e2fcbf42SPeter Maydell 995663df1ccSAlexandre Ratchov``-audiodev sndio,id=id[,prop[=value][,...]]`` 996663df1ccSAlexandre Ratchov Creates a backend using SNDIO. This backend is available on 997663df1ccSAlexandre Ratchov OpenBSD and most other Unix-like systems. 998663df1ccSAlexandre Ratchov 999663df1ccSAlexandre Ratchov Sndio specific options are: 1000663df1ccSAlexandre Ratchov 1001663df1ccSAlexandre Ratchov ``in|out.dev=device`` 1002663df1ccSAlexandre Ratchov Specify the sndio device to use for input and/or output. Default 1003663df1ccSAlexandre Ratchov is ``default``. 1004663df1ccSAlexandre Ratchov 1005663df1ccSAlexandre Ratchov ``in|out.latency=usecs`` 1006663df1ccSAlexandre Ratchov Sets the desired period length in microseconds. 1007663df1ccSAlexandre Ratchov 1008e2fcbf42SPeter Maydell``-audiodev spice,id=id[,prop[=value][,...]]`` 1009e2fcbf42SPeter Maydell Creates a backend that sends audio through SPICE. This backend 1010e2fcbf42SPeter Maydell requires ``-spice`` and automatically selected in that case, so 1011e2fcbf42SPeter Maydell usually you can ignore this option. This backend has no backend 1012e2fcbf42SPeter Maydell specific properties. 1013e2fcbf42SPeter Maydell 1014e2fcbf42SPeter Maydell``-audiodev wav,id=id[,prop[=value][,...]]`` 1015e2fcbf42SPeter Maydell Creates a backend that writes audio to a WAV file. 1016e2fcbf42SPeter Maydell 1017e2fcbf42SPeter Maydell Backend specific options are: 1018e2fcbf42SPeter Maydell 1019e2fcbf42SPeter Maydell ``path=path`` 1020e2fcbf42SPeter Maydell Write recorded audio into the specified file. Default is 1021e2fcbf42SPeter Maydell ``qemu.wav``. 1022e2fcbf42SPeter MaydellERST 102310adb8beSMarkus Armbruster 102410adb8beSMarkus ArmbrusterDEF("device", HAS_ARG, QEMU_OPTION_device, 102510adb8beSMarkus Armbruster "-device driver[,prop[=value][,...]]\n" 102610adb8beSMarkus Armbruster " add device (based on driver)\n" 102710adb8beSMarkus Armbruster " prop=value,... sets driver properties\n" 102810adb8beSMarkus Armbruster " use '-device help' to print all possible drivers\n" 102910adb8beSMarkus Armbruster " use '-device driver,help' to print all possible properties\n", 103010adb8beSMarkus Armbruster QEMU_ARCH_ALL) 1031e2fcbf42SPeter MaydellSRST 1032e2fcbf42SPeter Maydell``-device driver[,prop[=value][,...]]`` 1033e2fcbf42SPeter Maydell Add device driver. prop=value sets driver properties. Valid 1034e2fcbf42SPeter Maydell properties depend on the driver. To get help on possible drivers and 1035e2fcbf42SPeter Maydell properties, use ``-device help`` and ``-device driver,help``. 1036e2fcbf42SPeter Maydell 1037e2fcbf42SPeter Maydell Some drivers are: 1038e2fcbf42SPeter Maydell 1039789101b7SCorey Minyard``-device ipmi-bmc-sim,id=id[,prop[=value][,...]]`` 1040e2fcbf42SPeter Maydell Add an IPMI BMC. This is a simulation of a hardware management 1041e2fcbf42SPeter Maydell interface processor that normally sits on a system. It provides a 1042e2fcbf42SPeter Maydell watchdog and the ability to reset and power control the system. You 1043e2fcbf42SPeter Maydell need to connect this to an IPMI interface to make it useful 1044e2fcbf42SPeter Maydell 1045e2fcbf42SPeter Maydell The IPMI slave address to use for the BMC. The default is 0x20. This 1046e2fcbf42SPeter Maydell address is the BMC's address on the I2C network of management 1047e2fcbf42SPeter Maydell controllers. If you don't know what this means, it is safe to ignore 1048e2fcbf42SPeter Maydell it. 1049e2fcbf42SPeter Maydell 1050e2fcbf42SPeter Maydell ``id=id`` 1051e2fcbf42SPeter Maydell The BMC id for interfaces to use this device. 1052e2fcbf42SPeter Maydell 1053e2fcbf42SPeter Maydell ``slave_addr=val`` 1054e2fcbf42SPeter Maydell Define slave address to use for the BMC. The default is 0x20. 1055e2fcbf42SPeter Maydell 1056e2fcbf42SPeter Maydell ``sdrfile=file`` 1057e2fcbf42SPeter Maydell file containing raw Sensor Data Records (SDR) data. The default 1058e2fcbf42SPeter Maydell is none. 1059e2fcbf42SPeter Maydell 1060e2fcbf42SPeter Maydell ``fruareasize=val`` 1061e2fcbf42SPeter Maydell size of a Field Replaceable Unit (FRU) area. The default is 1062e2fcbf42SPeter Maydell 1024. 1063e2fcbf42SPeter Maydell 1064e2fcbf42SPeter Maydell ``frudatafile=file`` 1065e2fcbf42SPeter Maydell file containing raw Field Replaceable Unit (FRU) inventory data. 1066e2fcbf42SPeter Maydell The default is none. 1067e2fcbf42SPeter Maydell 1068e2fcbf42SPeter Maydell ``guid=uuid`` 1069e2fcbf42SPeter Maydell value for the GUID for the BMC, in standard UUID format. If this 1070e2fcbf42SPeter Maydell is set, get "Get GUID" command to the BMC will return it. 1071e2fcbf42SPeter Maydell Otherwise "Get GUID" will return an error. 1072e2fcbf42SPeter Maydell 1073e2fcbf42SPeter Maydell``-device ipmi-bmc-extern,id=id,chardev=id[,slave_addr=val]`` 1074e2fcbf42SPeter Maydell Add a connection to an external IPMI BMC simulator. Instead of 1075e2fcbf42SPeter Maydell locally emulating the BMC like the above item, instead connect to an 1076e2fcbf42SPeter Maydell external entity that provides the IPMI services. 1077e2fcbf42SPeter Maydell 1078e2fcbf42SPeter Maydell A connection is made to an external BMC simulator. If you do this, 1079e2fcbf42SPeter Maydell it is strongly recommended that you use the "reconnect=" chardev 1080e2fcbf42SPeter Maydell option to reconnect to the simulator if the connection is lost. Note 1081e2fcbf42SPeter Maydell that if this is not used carefully, it can be a security issue, as 1082e2fcbf42SPeter Maydell the interface has the ability to send resets, NMIs, and power off 1083e2fcbf42SPeter Maydell the VM. It's best if QEMU makes a connection to an external 1084e2fcbf42SPeter Maydell simulator running on a secure port on localhost, so neither the 1085e2fcbf42SPeter Maydell simulator nor QEMU is exposed to any outside network. 1086e2fcbf42SPeter Maydell 1087e2fcbf42SPeter Maydell See the "lanserv/README.vm" file in the OpenIPMI library for more 1088e2fcbf42SPeter Maydell details on the external interface. 1089e2fcbf42SPeter Maydell 1090e2fcbf42SPeter Maydell``-device isa-ipmi-kcs,bmc=id[,ioport=val][,irq=val]`` 10911e458f11SStefan Weil Add a KCS IPMI interface on the ISA bus. This also adds a 1092e2fcbf42SPeter Maydell corresponding ACPI and SMBIOS entries, if appropriate. 1093e2fcbf42SPeter Maydell 1094e2fcbf42SPeter Maydell ``bmc=id`` 1095e2fcbf42SPeter Maydell The BMC to connect to, one of ipmi-bmc-sim or ipmi-bmc-extern 1096e2fcbf42SPeter Maydell above. 1097e2fcbf42SPeter Maydell 1098e2fcbf42SPeter Maydell ``ioport=val`` 1099e2fcbf42SPeter Maydell Define the I/O address of the interface. The default is 0xca0 1100e2fcbf42SPeter Maydell for KCS. 1101e2fcbf42SPeter Maydell 1102e2fcbf42SPeter Maydell ``irq=val`` 1103e2fcbf42SPeter Maydell Define the interrupt to use. The default is 5. To disable 1104e2fcbf42SPeter Maydell interrupts, set this to 0. 1105e2fcbf42SPeter Maydell 1106e2fcbf42SPeter Maydell``-device isa-ipmi-bt,bmc=id[,ioport=val][,irq=val]`` 1107e2fcbf42SPeter Maydell Like the KCS interface, but defines a BT interface. The default port 1108e2fcbf42SPeter Maydell is 0xe4 and the default interrupt is 5. 1109323679daSCorey Minyard 1110323679daSCorey Minyard``-device pci-ipmi-kcs,bmc=id`` 11111e458f11SStefan Weil Add a KCS IPMI interface on the PCI bus. 1112323679daSCorey Minyard 1113323679daSCorey Minyard ``bmc=id`` 1114323679daSCorey Minyard The BMC to connect to, one of ipmi-bmc-sim or ipmi-bmc-extern above. 1115323679daSCorey Minyard 1116323679daSCorey Minyard``-device pci-ipmi-bt,bmc=id`` 1117323679daSCorey Minyard Like the KCS interface, but defines a BT interface on the PCI bus. 11187395b3e3SPeter Xu 11197395b3e3SPeter Xu``-device intel-iommu[,option=...]`` 11207395b3e3SPeter Xu This is only supported by ``-machine q35``, which will enable Intel VT-d 11217395b3e3SPeter Xu emulation within the guest. It supports below options: 11227395b3e3SPeter Xu 11237395b3e3SPeter Xu ``intremap=on|off`` (default: auto) 11247395b3e3SPeter Xu This enables interrupt remapping feature. It's required to enable 11257395b3e3SPeter Xu complete x2apic. Currently it only supports kvm kernel-irqchip modes 11267395b3e3SPeter Xu ``off`` or ``split``, while full kernel-irqchip is not yet supported. 11277395b3e3SPeter Xu The default value is "auto", which will be decided by the mode of 11287395b3e3SPeter Xu kernel-irqchip. 11297395b3e3SPeter Xu 11307395b3e3SPeter Xu ``caching-mode=on|off`` (default: off) 11317395b3e3SPeter Xu This enables caching mode for the VT-d emulated device. When 11327395b3e3SPeter Xu caching-mode is enabled, each guest DMA buffer mapping will generate an 11337395b3e3SPeter Xu IOTLB invalidation from the guest IOMMU driver to the vIOMMU device in 11347395b3e3SPeter Xu a synchronous way. It is required for ``-device vfio-pci`` to work 11357395b3e3SPeter Xu with the VT-d device, because host assigned devices requires to setup 11367395b3e3SPeter Xu the DMA mapping on the host before guest DMA starts. 11377395b3e3SPeter Xu 11387395b3e3SPeter Xu ``device-iotlb=on|off`` (default: off) 11397395b3e3SPeter Xu This enables device-iotlb capability for the emulated VT-d device. So 11407395b3e3SPeter Xu far virtio/vhost should be the only real user for this parameter, 11417395b3e3SPeter Xu paired with ats=on configured for the device. 11427395b3e3SPeter Xu 11437395b3e3SPeter Xu ``aw-bits=39|48`` (default: 39) 11447395b3e3SPeter Xu This decides the address width of IOVA address space. The address 11457395b3e3SPeter Xu space has 39 bits width for 3-level IOMMU page tables, and 48 bits for 11467395b3e3SPeter Xu 4-level IOMMU page tables. 11477395b3e3SPeter Xu 11487395b3e3SPeter Xu Please also refer to the wiki page for general scenarios of VT-d 11497395b3e3SPeter Xu emulation in QEMU: https://wiki.qemu.org/Features/VT-d. 11507395b3e3SPeter Xu 1151e2fcbf42SPeter MaydellERST 115210adb8beSMarkus Armbruster 115310adb8beSMarkus ArmbrusterDEF("name", HAS_ARG, QEMU_OPTION_name, 11548f480de0SDr. David Alan Gilbert "-name string1[,process=string2][,debug-threads=on|off]\n" 115510adb8beSMarkus Armbruster " set the name of the guest\n" 1156479a5747SRoman Bolshakov " string1 sets the window title and string2 the process name\n" 1157479a5747SRoman Bolshakov " When debug-threads is enabled, individual threads are given a separate name\n" 11588f480de0SDr. David Alan Gilbert " NOTE: The thread names are for debugging and not a stable API.\n", 115910adb8beSMarkus Armbruster QEMU_ARCH_ALL) 1160e2fcbf42SPeter MaydellSRST 1161e2fcbf42SPeter Maydell``-name name`` 1162e2fcbf42SPeter Maydell Sets the name of the guest. This name will be displayed in the SDL 1163e2fcbf42SPeter Maydell window caption. The name will also be used for the VNC server. Also 1164e2fcbf42SPeter Maydell optionally set the top visible process name in Linux. Naming of 1165e2fcbf42SPeter Maydell individual threads can also be enabled on Linux to aid debugging. 1166e2fcbf42SPeter MaydellERST 116710adb8beSMarkus Armbruster 116810adb8beSMarkus ArmbrusterDEF("uuid", HAS_ARG, QEMU_OPTION_uuid, 116910adb8beSMarkus Armbruster "-uuid %08x-%04x-%04x-%04x-%012x\n" 117010adb8beSMarkus Armbruster " specify machine UUID\n", QEMU_ARCH_ALL) 1171e2fcbf42SPeter MaydellSRST 1172e2fcbf42SPeter Maydell``-uuid uuid`` 1173e2fcbf42SPeter Maydell Set system UUID. 1174e2fcbf42SPeter MaydellERST 117510adb8beSMarkus Armbruster 117610adb8beSMarkus ArmbrusterDEFHEADING() 117710adb8beSMarkus Armbruster 1178de6b4f90SMarkus ArmbrusterDEFHEADING(Block device options:) 117910adb8beSMarkus Armbruster 11805af2b0f6SAlex BennéeSRST 11815af2b0f6SAlex BennéeThe QEMU block device handling options have a long history and 11825af2b0f6SAlex Bennéehave gone through several iterations as the feature set and complexity 11835af2b0f6SAlex Bennéeof the block layer have grown. Many online guides to QEMU often 11845af2b0f6SAlex Bennéereference older and deprecated options, which can lead to confusion. 11855af2b0f6SAlex Bennée 1186c1654c3eSAlex BennéeThe most explicit way to describe disks is to use a combination of 11875af2b0f6SAlex Bennée``-device`` to specify the hardware device and ``-blockdev`` to 11885af2b0f6SAlex Bennéedescribe the backend. The device defines what the guest sees and the 1189c1654c3eSAlex Bennéebackend describes how QEMU handles the data. It is the only guaranteed 1190c1654c3eSAlex Bennéestable interface for describing block devices and as such is 1191c1654c3eSAlex Bennéerecommended for management tools and scripting. 1192c1654c3eSAlex Bennée 1193c1654c3eSAlex BennéeThe ``-drive`` option combines the device and backend into a single 1194c1654c3eSAlex Bennéecommand line option which is a more human friendly. There is however no 1195c1654c3eSAlex Bennéeinterface stability guarantee although some older board models still 1196c1654c3eSAlex Bennéeneed updating to work with the modern blockdev forms. 1197c1654c3eSAlex Bennée 1198c1654c3eSAlex BennéeOlder options like ``-hda`` are essentially macros which expand into 1199c1654c3eSAlex Bennée``-drive`` options for various drive interfaces. The original forms 1200c1654c3eSAlex Bennéebake in a lot of assumptions from the days when QEMU was emulating a 1201c1654c3eSAlex Bennéelegacy PC, they are not recommended for modern configurations. 12025af2b0f6SAlex Bennée 12035af2b0f6SAlex BennéeERST 12045af2b0f6SAlex Bennée 12055824d651Sblueswir1DEF("fda", HAS_ARG, QEMU_OPTION_fda, 1206ad96090aSBlue Swirl "-fda/-fdb file use 'file' as floppy disk 0/1 image\n", QEMU_ARCH_ALL) 1207ad96090aSBlue SwirlDEF("fdb", HAS_ARG, QEMU_OPTION_fdb, "", QEMU_ARCH_ALL) 1208e2fcbf42SPeter MaydellSRST 120909ce5f2dSPeter Maydell``-fda file`` 121009ce5f2dSPeter Maydell \ 121109ce5f2dSPeter Maydell``-fdb file`` 1212923e9311SThomas Huth Use file as floppy disk 0/1 image (see the :ref:`disk images` chapter in 1213923e9311SThomas Huth the System Emulation Users Guide). 1214e2fcbf42SPeter MaydellERST 12155824d651Sblueswir1 12165824d651Sblueswir1DEF("hda", HAS_ARG, QEMU_OPTION_hda, 1217bcd8e243SThomas Huth "-hda/-hdb file use 'file' as hard disk 0/1 image\n", QEMU_ARCH_ALL) 1218ad96090aSBlue SwirlDEF("hdb", HAS_ARG, QEMU_OPTION_hdb, "", QEMU_ARCH_ALL) 12195824d651Sblueswir1DEF("hdc", HAS_ARG, QEMU_OPTION_hdc, 1220bcd8e243SThomas Huth "-hdc/-hdd file use 'file' as hard disk 2/3 image\n", QEMU_ARCH_ALL) 1221ad96090aSBlue SwirlDEF("hdd", HAS_ARG, QEMU_OPTION_hdd, "", QEMU_ARCH_ALL) 1222e2fcbf42SPeter MaydellSRST 122309ce5f2dSPeter Maydell``-hda file`` 122409ce5f2dSPeter Maydell \ 122509ce5f2dSPeter Maydell``-hdb file`` 122609ce5f2dSPeter Maydell \ 122709ce5f2dSPeter Maydell``-hdc file`` 122809ce5f2dSPeter Maydell \ 122909ce5f2dSPeter Maydell``-hdd file`` 1230bcd8e243SThomas Huth Use file as hard disk 0, 1, 2 or 3 image on the default bus of the 1231bcd8e243SThomas Huth emulated machine (this is for example the IDE bus on most x86 machines, 1232bcd8e243SThomas Huth but it can also be SCSI, virtio or something else on other target 1233bcd8e243SThomas Huth architectures). See also the :ref:`disk images` chapter in the System 1234bcd8e243SThomas Huth Emulation Users Guide. 1235e2fcbf42SPeter MaydellERST 12365824d651Sblueswir1 12375824d651Sblueswir1DEF("cdrom", HAS_ARG, QEMU_OPTION_cdrom, 1238bcd8e243SThomas Huth "-cdrom file use 'file' as CD-ROM image\n", 1239ad96090aSBlue Swirl QEMU_ARCH_ALL) 1240e2fcbf42SPeter MaydellSRST 1241e2fcbf42SPeter Maydell``-cdrom file`` 1242bcd8e243SThomas Huth Use file as CD-ROM image on the default bus of the emulated machine 1243bcd8e243SThomas Huth (which is IDE1 master on x86, so you cannot use ``-hdc`` and ``-cdrom`` 1244bcd8e243SThomas Huth at the same time there). On systems that support it, you can use the 1245bcd8e243SThomas Huth host CD-ROM by using ``/dev/cdrom`` as filename. 1246e2fcbf42SPeter MaydellERST 12475824d651Sblueswir1 124842e5f393SMarkus ArmbrusterDEF("blockdev", HAS_ARG, QEMU_OPTION_blockdev, 124942e5f393SMarkus Armbruster "-blockdev [driver=]driver[,node-name=N][,discard=ignore|unmap]\n" 125042e5f393SMarkus Armbruster " [,cache.direct=on|off][,cache.no-flush=on|off]\n" 1251c9b749d7SKevin Wolf " [,read-only=on|off][,auto-read-only=on|off]\n" 1252c9b749d7SKevin Wolf " [,force-share=on|off][,detect-zeroes=on|off|unmap]\n" 125342e5f393SMarkus Armbruster " [,driver specific parameters...]\n" 125442e5f393SMarkus Armbruster " configure a block backend\n", QEMU_ARCH_ALL) 1255e2fcbf42SPeter MaydellSRST 1256e2fcbf42SPeter Maydell``-blockdev option[,option[,option[,...]]]`` 1257e2fcbf42SPeter Maydell Define a new block driver node. Some of the options apply to all 1258e2fcbf42SPeter Maydell block drivers, other options are only accepted for a specific block 1259e2fcbf42SPeter Maydell driver. See below for a list of generic options and options for the 1260e2fcbf42SPeter Maydell most common block drivers. 1261e2fcbf42SPeter Maydell 1262e2fcbf42SPeter Maydell Options that expect a reference to another node (e.g. ``file``) can 1263e2fcbf42SPeter Maydell be given in two ways. Either you specify the node name of an already 1264e2fcbf42SPeter Maydell existing node (file=node-name), or you define a new node inline, 1265e2fcbf42SPeter Maydell adding options for the referenced node after a dot 1266e2fcbf42SPeter Maydell (file.filename=path,file.aio=native). 1267e2fcbf42SPeter Maydell 1268e2fcbf42SPeter Maydell A block driver node created with ``-blockdev`` can be used for a 1269e2fcbf42SPeter Maydell guest device by specifying its node name for the ``drive`` property 1270e2fcbf42SPeter Maydell in a ``-device`` argument that defines a block device. 1271e2fcbf42SPeter Maydell 1272e2fcbf42SPeter Maydell ``Valid options for any block driver node:`` 1273e2fcbf42SPeter Maydell ``driver`` 1274e2fcbf42SPeter Maydell Specifies the block driver to use for the given node. 1275e2fcbf42SPeter Maydell 1276e2fcbf42SPeter Maydell ``node-name`` 1277e2fcbf42SPeter Maydell This defines the name of the block driver node by which it 1278e2fcbf42SPeter Maydell will be referenced later. The name must be unique, i.e. it 1279e2fcbf42SPeter Maydell must not match the name of a different block driver node, or 1280e2fcbf42SPeter Maydell (if you use ``-drive`` as well) the ID of a drive. 1281e2fcbf42SPeter Maydell 1282e2fcbf42SPeter Maydell If no node name is specified, it is automatically generated. 1283e2fcbf42SPeter Maydell The generated node name is not intended to be predictable 1284e2fcbf42SPeter Maydell and changes between QEMU invocations. For the top level, an 1285e2fcbf42SPeter Maydell explicit node name must be specified. 1286e2fcbf42SPeter Maydell 1287e2fcbf42SPeter Maydell ``read-only`` 1288e2fcbf42SPeter Maydell Open the node read-only. Guest write attempts will fail. 1289e2fcbf42SPeter Maydell 1290e2fcbf42SPeter Maydell Note that some block drivers support only read-only access, 1291e2fcbf42SPeter Maydell either generally or in certain configurations. In this case, 1292e2fcbf42SPeter Maydell the default value ``read-only=off`` does not work and the 1293e2fcbf42SPeter Maydell option must be specified explicitly. 1294e2fcbf42SPeter Maydell 1295e2fcbf42SPeter Maydell ``auto-read-only`` 1296e2fcbf42SPeter Maydell If ``auto-read-only=on`` is set, QEMU may fall back to 1297e2fcbf42SPeter Maydell read-only usage even when ``read-only=off`` is requested, or 1298e2fcbf42SPeter Maydell even switch between modes as needed, e.g. depending on 1299e2fcbf42SPeter Maydell whether the image file is writable or whether a writing user 1300e2fcbf42SPeter Maydell is attached to the node. 1301e2fcbf42SPeter Maydell 1302e2fcbf42SPeter Maydell ``force-share`` 1303e2fcbf42SPeter Maydell Override the image locking system of QEMU by forcing the 1304e2fcbf42SPeter Maydell node to utilize weaker shared access for permissions where 1305e2fcbf42SPeter Maydell it would normally request exclusive access. When there is 1306e2fcbf42SPeter Maydell the potential for multiple instances to have the same file 1307e2fcbf42SPeter Maydell open (whether this invocation of QEMU is the first or the 1308e2fcbf42SPeter Maydell second instance), both instances must permit shared access 1309e2fcbf42SPeter Maydell for the second instance to succeed at opening the file. 1310e2fcbf42SPeter Maydell 1311e2fcbf42SPeter Maydell Enabling ``force-share=on`` requires ``read-only=on``. 1312e2fcbf42SPeter Maydell 1313e2fcbf42SPeter Maydell ``cache.direct`` 1314e2fcbf42SPeter Maydell The host page cache can be avoided with ``cache.direct=on``. 1315e2fcbf42SPeter Maydell This will attempt to do disk IO directly to the guest's 1316e2fcbf42SPeter Maydell memory. QEMU may still perform an internal copy of the data. 1317e2fcbf42SPeter Maydell 1318e2fcbf42SPeter Maydell ``cache.no-flush`` 1319e2fcbf42SPeter Maydell In case you don't care about data integrity over host 1320e2fcbf42SPeter Maydell failures, you can use ``cache.no-flush=on``. This option 1321e2fcbf42SPeter Maydell tells QEMU that it never needs to write any data to the disk 1322e2fcbf42SPeter Maydell but can instead keep things in cache. If anything goes 1323e2fcbf42SPeter Maydell wrong, like your host losing power, the disk storage getting 1324e2fcbf42SPeter Maydell disconnected accidentally, etc. your image will most 1325e2fcbf42SPeter Maydell probably be rendered unusable. 1326e2fcbf42SPeter Maydell 1327e2fcbf42SPeter Maydell ``discard=discard`` 1328e2fcbf42SPeter Maydell discard is one of "ignore" (or "off") or "unmap" (or "on") 1329e2fcbf42SPeter Maydell and controls whether ``discard`` (also known as ``trim`` or 1330e2fcbf42SPeter Maydell ``unmap``) requests are ignored or passed to the filesystem. 1331e2fcbf42SPeter Maydell Some machine types may not support discard requests. 1332e2fcbf42SPeter Maydell 1333e2fcbf42SPeter Maydell ``detect-zeroes=detect-zeroes`` 1334e2fcbf42SPeter Maydell detect-zeroes is "off", "on" or "unmap" and enables the 1335e2fcbf42SPeter Maydell automatic conversion of plain zero writes by the OS to 1336e2fcbf42SPeter Maydell driver specific optimized zero write commands. You may even 1337e2fcbf42SPeter Maydell choose "unmap" if discard is set to "unmap" to allow a zero 1338e2fcbf42SPeter Maydell write to be converted to an ``unmap`` operation. 1339e2fcbf42SPeter Maydell 1340e2fcbf42SPeter Maydell ``Driver-specific options for file`` 1341e2fcbf42SPeter Maydell This is the protocol-level block driver for accessing regular 1342e2fcbf42SPeter Maydell files. 1343e2fcbf42SPeter Maydell 1344e2fcbf42SPeter Maydell ``filename`` 1345e2fcbf42SPeter Maydell The path to the image file in the local filesystem 1346e2fcbf42SPeter Maydell 1347e2fcbf42SPeter Maydell ``aio`` 1348ad1e691dSStefano Garzarella Specifies the AIO backend (threads/native/io_uring, 1349ad1e691dSStefano Garzarella default: threads) 1350e2fcbf42SPeter Maydell 1351e2fcbf42SPeter Maydell ``locking`` 1352e2fcbf42SPeter Maydell Specifies whether the image file is protected with Linux OFD 1353e2fcbf42SPeter Maydell / POSIX locks. The default is to use the Linux Open File 1354e2fcbf42SPeter Maydell Descriptor API if available, otherwise no lock is applied. 1355e2fcbf42SPeter Maydell (auto/on/off, default: auto) 1356e2fcbf42SPeter Maydell 1357e2fcbf42SPeter Maydell Example: 1358e2fcbf42SPeter Maydell 1359e2fcbf42SPeter Maydell :: 1360e2fcbf42SPeter Maydell 1361e2fcbf42SPeter Maydell -blockdev driver=file,node-name=disk,filename=disk.img 1362e2fcbf42SPeter Maydell 1363e2fcbf42SPeter Maydell ``Driver-specific options for raw`` 1364e2fcbf42SPeter Maydell This is the image format block driver for raw images. It is 1365e2fcbf42SPeter Maydell usually stacked on top of a protocol level block driver such as 1366e2fcbf42SPeter Maydell ``file``. 1367e2fcbf42SPeter Maydell 1368e2fcbf42SPeter Maydell ``file`` 1369e2fcbf42SPeter Maydell Reference to or definition of the data source block driver 1370e2fcbf42SPeter Maydell node (e.g. a ``file`` driver node) 1371e2fcbf42SPeter Maydell 1372e2fcbf42SPeter Maydell Example 1: 1373e2fcbf42SPeter Maydell 1374e2fcbf42SPeter Maydell :: 1375e2fcbf42SPeter Maydell 1376e2fcbf42SPeter Maydell -blockdev driver=file,node-name=disk_file,filename=disk.img 1377e2fcbf42SPeter Maydell -blockdev driver=raw,node-name=disk,file=disk_file 1378e2fcbf42SPeter Maydell 1379e2fcbf42SPeter Maydell Example 2: 1380e2fcbf42SPeter Maydell 1381e2fcbf42SPeter Maydell :: 1382e2fcbf42SPeter Maydell 1383e2fcbf42SPeter Maydell -blockdev driver=raw,node-name=disk,file.driver=file,file.filename=disk.img 1384e2fcbf42SPeter Maydell 1385e2fcbf42SPeter Maydell ``Driver-specific options for qcow2`` 1386e2fcbf42SPeter Maydell This is the image format block driver for qcow2 images. It is 1387e2fcbf42SPeter Maydell usually stacked on top of a protocol level block driver such as 1388e2fcbf42SPeter Maydell ``file``. 1389e2fcbf42SPeter Maydell 1390e2fcbf42SPeter Maydell ``file`` 1391e2fcbf42SPeter Maydell Reference to or definition of the data source block driver 1392e2fcbf42SPeter Maydell node (e.g. a ``file`` driver node) 1393e2fcbf42SPeter Maydell 1394e2fcbf42SPeter Maydell ``backing`` 1395e2fcbf42SPeter Maydell Reference to or definition of the backing file block device 1396e2fcbf42SPeter Maydell (default is taken from the image file). It is allowed to 1397e2fcbf42SPeter Maydell pass ``null`` here in order to disable the default backing 1398e2fcbf42SPeter Maydell file. 1399e2fcbf42SPeter Maydell 1400e2fcbf42SPeter Maydell ``lazy-refcounts`` 1401e2fcbf42SPeter Maydell Whether to enable the lazy refcounts feature (on/off; 1402e2fcbf42SPeter Maydell default is taken from the image file) 1403e2fcbf42SPeter Maydell 1404e2fcbf42SPeter Maydell ``cache-size`` 1405e2fcbf42SPeter Maydell The maximum total size of the L2 table and refcount block 1406e2fcbf42SPeter Maydell caches in bytes (default: the sum of l2-cache-size and 1407e2fcbf42SPeter Maydell refcount-cache-size) 1408e2fcbf42SPeter Maydell 1409e2fcbf42SPeter Maydell ``l2-cache-size`` 1410e2fcbf42SPeter Maydell The maximum size of the L2 table cache in bytes (default: if 1411e2fcbf42SPeter Maydell cache-size is not specified - 32M on Linux platforms, and 8M 1412e2fcbf42SPeter Maydell on non-Linux platforms; otherwise, as large as possible 1413e2fcbf42SPeter Maydell within the cache-size, while permitting the requested or the 1414e2fcbf42SPeter Maydell minimal refcount cache size) 1415e2fcbf42SPeter Maydell 1416e2fcbf42SPeter Maydell ``refcount-cache-size`` 1417e2fcbf42SPeter Maydell The maximum size of the refcount block cache in bytes 1418e2fcbf42SPeter Maydell (default: 4 times the cluster size; or if cache-size is 1419e2fcbf42SPeter Maydell specified, the part of it which is not used for the L2 1420e2fcbf42SPeter Maydell cache) 1421e2fcbf42SPeter Maydell 1422e2fcbf42SPeter Maydell ``cache-clean-interval`` 1423e2fcbf42SPeter Maydell Clean unused entries in the L2 and refcount caches. The 1424e2fcbf42SPeter Maydell interval is in seconds. The default value is 600 on 1425e2fcbf42SPeter Maydell supporting platforms, and 0 on other platforms. Setting it 1426e2fcbf42SPeter Maydell to 0 disables this feature. 1427e2fcbf42SPeter Maydell 1428e2fcbf42SPeter Maydell ``pass-discard-request`` 1429e2fcbf42SPeter Maydell Whether discard requests to the qcow2 device should be 1430e2fcbf42SPeter Maydell forwarded to the data source (on/off; default: on if 1431e2fcbf42SPeter Maydell discard=unmap is specified, off otherwise) 1432e2fcbf42SPeter Maydell 1433e2fcbf42SPeter Maydell ``pass-discard-snapshot`` 1434e2fcbf42SPeter Maydell Whether discard requests for the data source should be 1435e2fcbf42SPeter Maydell issued when a snapshot operation (e.g. deleting a snapshot) 1436e2fcbf42SPeter Maydell frees clusters in the qcow2 file (on/off; default: on) 1437e2fcbf42SPeter Maydell 1438e2fcbf42SPeter Maydell ``pass-discard-other`` 1439e2fcbf42SPeter Maydell Whether discard requests for the data source should be 1440e2fcbf42SPeter Maydell issued on other occasions where a cluster gets freed 1441e2fcbf42SPeter Maydell (on/off; default: off) 1442e2fcbf42SPeter Maydell 144342a2890aSJean-Louis Dupond ``discard-no-unref`` 144442a2890aSJean-Louis Dupond When enabled, discards from the guest will not cause cluster 144542a2890aSJean-Louis Dupond allocations to be relinquished. This prevents qcow2 fragmentation 144642a2890aSJean-Louis Dupond that would be caused by such discards. Besides potential 144742a2890aSJean-Louis Dupond performance degradation, such fragmentation can lead to increased 144842a2890aSJean-Louis Dupond allocation of clusters past the end of the image file, 144942a2890aSJean-Louis Dupond resulting in image files whose file length can grow much larger 145042a2890aSJean-Louis Dupond than their guest disk size would suggest. 145142a2890aSJean-Louis Dupond If image file length is of concern (e.g. when storing qcow2 145242a2890aSJean-Louis Dupond images directly on block devices), you should consider enabling 145342a2890aSJean-Louis Dupond this option. 145442a2890aSJean-Louis Dupond 1455e2fcbf42SPeter Maydell ``overlap-check`` 1456e2fcbf42SPeter Maydell Which overlap checks to perform for writes to the image 1457e2fcbf42SPeter Maydell (none/constant/cached/all; default: cached). For details or 1458e2fcbf42SPeter Maydell finer granularity control refer to the QAPI documentation of 1459e2fcbf42SPeter Maydell ``blockdev-add``. 1460e2fcbf42SPeter Maydell 1461e2fcbf42SPeter Maydell Example 1: 1462e2fcbf42SPeter Maydell 1463e2fcbf42SPeter Maydell :: 1464e2fcbf42SPeter Maydell 1465e2fcbf42SPeter Maydell -blockdev driver=file,node-name=my_file,filename=/tmp/disk.qcow2 1466e2fcbf42SPeter Maydell -blockdev driver=qcow2,node-name=hda,file=my_file,overlap-check=none,cache-size=16777216 1467e2fcbf42SPeter Maydell 1468e2fcbf42SPeter Maydell Example 2: 1469e2fcbf42SPeter Maydell 1470e2fcbf42SPeter Maydell :: 1471e2fcbf42SPeter Maydell 1472e2fcbf42SPeter Maydell -blockdev driver=qcow2,node-name=disk,file.driver=http,file.filename=http://example.com/image.qcow2 1473e2fcbf42SPeter Maydell 1474e2fcbf42SPeter Maydell ``Driver-specific options for other drivers`` 1475e2fcbf42SPeter Maydell Please refer to the QAPI documentation of the ``blockdev-add`` 1476e2fcbf42SPeter Maydell QMP command. 1477e2fcbf42SPeter MaydellERST 147842e5f393SMarkus Armbruster 14795824d651Sblueswir1DEF("drive", HAS_ARG, QEMU_OPTION_drive, 14805824d651Sblueswir1 "-drive [file=file][,if=type][,bus=n][,unit=m][,media=d][,index=i]\n" 148192196b2fSStefan Hajnoczi " [,cache=writethrough|writeback|none|directsync|unsafe][,format=f]\n" 1482572023f7SKevin Wolf " [,snapshot=on|off][,rerror=ignore|stop|report]\n" 1483ad1e691dSStefano Garzarella " [,werror=ignore|stop|report|enospc][,id=name]\n" 1484ad1e691dSStefano Garzarella " [,aio=threads|native|io_uring]\n" 1485fb0490f6SStefan Hajnoczi " [,readonly=on|off][,copy-on-read=on|off]\n" 14862f7133b2SPeter Lieven " [,discard=ignore|unmap][,detect-zeroes=on|off|unmap]\n" 14873e9fab69SBenoît Canet " [[,bps=b]|[[,bps_rd=r][,bps_wr=w]]]\n" 14883e9fab69SBenoît Canet " [[,iops=i]|[[,iops_rd=r][,iops_wr=w]]]\n" 14893e9fab69SBenoît Canet " [[,bps_max=bm]|[[,bps_rd_max=rm][,bps_wr_max=wm]]]\n" 14903e9fab69SBenoît Canet " [[,iops_max=im]|[[,iops_rd_max=irm][,iops_wr_max=iwm]]]\n" 14912024c1dfSBenoît Canet " [[,iops_size=is]]\n" 149276f4afb4SAlberto Garcia " [[,group=g]]\n" 1493ad96090aSBlue Swirl " use 'file' as a drive image\n", QEMU_ARCH_ALL) 1494e2fcbf42SPeter MaydellSRST 1495e2fcbf42SPeter Maydell``-drive option[,option[,option[,...]]]`` 1496e2fcbf42SPeter Maydell Define a new drive. This includes creating a block driver node (the 1497e2fcbf42SPeter Maydell backend) as well as a guest device, and is mostly a shortcut for 1498e2fcbf42SPeter Maydell defining the corresponding ``-blockdev`` and ``-device`` options. 1499e2fcbf42SPeter Maydell 1500e2fcbf42SPeter Maydell ``-drive`` accepts all options that are accepted by ``-blockdev``. 1501e2fcbf42SPeter Maydell In addition, it knows the following options: 1502e2fcbf42SPeter Maydell 1503e2fcbf42SPeter Maydell ``file=file`` 1504923e9311SThomas Huth This option defines which disk image (see the :ref:`disk images` 1505923e9311SThomas Huth chapter in the System Emulation Users Guide) to use with this drive. 1506923e9311SThomas Huth If the filename contains comma, you must double it (for instance, 1507e2fcbf42SPeter Maydell "file=my,,file" to use file "my,file"). 1508e2fcbf42SPeter Maydell 1509e2fcbf42SPeter Maydell Special files such as iSCSI devices can be specified using 1510e2fcbf42SPeter Maydell protocol specific URLs. See the section for "Device URL Syntax" 1511e2fcbf42SPeter Maydell for more information. 1512e2fcbf42SPeter Maydell 1513e2fcbf42SPeter Maydell ``if=interface`` 1514e2fcbf42SPeter Maydell This option defines on which type on interface the drive is 1515e2fcbf42SPeter Maydell connected. Available types are: ide, scsi, sd, mtd, floppy, 1516e2fcbf42SPeter Maydell pflash, virtio, none. 1517e2fcbf42SPeter Maydell 1518e2fcbf42SPeter Maydell ``bus=bus,unit=unit`` 1519e2fcbf42SPeter Maydell These options define where is connected the drive by defining 1520e2fcbf42SPeter Maydell the bus number and the unit id. 1521e2fcbf42SPeter Maydell 1522e2fcbf42SPeter Maydell ``index=index`` 152335aab303SLaurent Vivier This option defines where the drive is connected by using an 1524e2fcbf42SPeter Maydell index in the list of available connectors of a given interface 1525e2fcbf42SPeter Maydell type. 1526e2fcbf42SPeter Maydell 1527e2fcbf42SPeter Maydell ``media=media`` 1528e2fcbf42SPeter Maydell This option defines the type of the media: disk or cdrom. 1529e2fcbf42SPeter Maydell 1530e2fcbf42SPeter Maydell ``snapshot=snapshot`` 1531e2fcbf42SPeter Maydell snapshot is "on" or "off" and controls snapshot mode for the 1532e2fcbf42SPeter Maydell given drive (see ``-snapshot``). 1533e2fcbf42SPeter Maydell 1534e2fcbf42SPeter Maydell ``cache=cache`` 1535e2fcbf42SPeter Maydell cache is "none", "writeback", "unsafe", "directsync" or 1536e2fcbf42SPeter Maydell "writethrough" and controls how the host cache is used to access 1537e2fcbf42SPeter Maydell block data. This is a shortcut that sets the ``cache.direct`` 1538e2fcbf42SPeter Maydell and ``cache.no-flush`` options (as in ``-blockdev``), and 1539e2fcbf42SPeter Maydell additionally ``cache.writeback``, which provides a default for 1540e2fcbf42SPeter Maydell the ``write-cache`` option of block guest devices (as in 1541e2fcbf42SPeter Maydell ``-device``). The modes correspond to the following settings: 1542e2fcbf42SPeter Maydell 154309ce5f2dSPeter Maydell ============= =============== ============ ============== 154409ce5f2dSPeter Maydell \ cache.writeback cache.direct cache.no-flush 154509ce5f2dSPeter Maydell ============= =============== ============ ============== 154609ce5f2dSPeter Maydell writeback on off off 154709ce5f2dSPeter Maydell none on on off 154809ce5f2dSPeter Maydell writethrough off off off 154909ce5f2dSPeter Maydell directsync off on off 155009ce5f2dSPeter Maydell unsafe on off on 155109ce5f2dSPeter Maydell ============= =============== ============ ============== 1552e2fcbf42SPeter Maydell 1553e2fcbf42SPeter Maydell The default mode is ``cache=writeback``. 1554e2fcbf42SPeter Maydell 1555e2fcbf42SPeter Maydell ``aio=aio`` 1556ad1e691dSStefano Garzarella aio is "threads", "native", or "io_uring" and selects between pthread 1557ad1e691dSStefano Garzarella based disk I/O, native Linux AIO, or Linux io_uring API. 1558e2fcbf42SPeter Maydell 1559e2fcbf42SPeter Maydell ``format=format`` 1560e2fcbf42SPeter Maydell Specify which disk format will be used rather than detecting the 1561e2fcbf42SPeter Maydell format. Can be used to specify format=raw to avoid interpreting 1562e2fcbf42SPeter Maydell an untrusted format header. 1563e2fcbf42SPeter Maydell 1564e2fcbf42SPeter Maydell ``werror=action,rerror=action`` 1565e2fcbf42SPeter Maydell Specify which action to take on write and read errors. Valid 1566e2fcbf42SPeter Maydell actions are: "ignore" (ignore the error and try to continue), 1567e2fcbf42SPeter Maydell "stop" (pause QEMU), "report" (report the error to the guest), 1568e2fcbf42SPeter Maydell "enospc" (pause QEMU only if the host disk is full; report the 1569e2fcbf42SPeter Maydell error to the guest otherwise). The default setting is 1570e2fcbf42SPeter Maydell ``werror=enospc`` and ``rerror=report``. 1571e2fcbf42SPeter Maydell 1572e2fcbf42SPeter Maydell ``copy-on-read=copy-on-read`` 1573e2fcbf42SPeter Maydell copy-on-read is "on" or "off" and enables whether to copy read 1574e2fcbf42SPeter Maydell backing file sectors into the image file. 1575e2fcbf42SPeter Maydell 1576e2fcbf42SPeter Maydell ``bps=b,bps_rd=r,bps_wr=w`` 1577e2fcbf42SPeter Maydell Specify bandwidth throttling limits in bytes per second, either 1578e2fcbf42SPeter Maydell for all request types or for reads or writes only. Small values 1579e2fcbf42SPeter Maydell can lead to timeouts or hangs inside the guest. A safe minimum 1580e2fcbf42SPeter Maydell for disks is 2 MB/s. 1581e2fcbf42SPeter Maydell 1582e2fcbf42SPeter Maydell ``bps_max=bm,bps_rd_max=rm,bps_wr_max=wm`` 1583e2fcbf42SPeter Maydell Specify bursts in bytes per second, either for all request types 1584e2fcbf42SPeter Maydell or for reads or writes only. Bursts allow the guest I/O to spike 1585e2fcbf42SPeter Maydell above the limit temporarily. 1586e2fcbf42SPeter Maydell 1587e2fcbf42SPeter Maydell ``iops=i,iops_rd=r,iops_wr=w`` 1588e2fcbf42SPeter Maydell Specify request rate limits in requests per second, either for 1589e2fcbf42SPeter Maydell all request types or for reads or writes only. 1590e2fcbf42SPeter Maydell 1591e2fcbf42SPeter Maydell ``iops_max=bm,iops_rd_max=rm,iops_wr_max=wm`` 1592e2fcbf42SPeter Maydell Specify bursts in requests per second, either for all request 1593e2fcbf42SPeter Maydell types or for reads or writes only. Bursts allow the guest I/O to 1594e2fcbf42SPeter Maydell spike above the limit temporarily. 1595e2fcbf42SPeter Maydell 1596e2fcbf42SPeter Maydell ``iops_size=is`` 1597e2fcbf42SPeter Maydell Let every is bytes of a request count as a new request for iops 1598e2fcbf42SPeter Maydell throttling purposes. Use this option to prevent guests from 1599e2fcbf42SPeter Maydell circumventing iops limits by sending fewer but larger requests. 1600e2fcbf42SPeter Maydell 1601e2fcbf42SPeter Maydell ``group=g`` 1602e2fcbf42SPeter Maydell Join a throttling quota group with given name g. All drives that 1603e2fcbf42SPeter Maydell are members of the same group are accounted for together. Use 1604e2fcbf42SPeter Maydell this option to prevent guests from circumventing throttling 1605e2fcbf42SPeter Maydell limits by using many small disks instead of a single larger 1606e2fcbf42SPeter Maydell disk. 1607e2fcbf42SPeter Maydell 1608e2fcbf42SPeter Maydell By default, the ``cache.writeback=on`` mode is used. It will report 1609e2fcbf42SPeter Maydell data writes as completed as soon as the data is present in the host 1610e2fcbf42SPeter Maydell page cache. This is safe as long as your guest OS makes sure to 1611e2fcbf42SPeter Maydell correctly flush disk caches where needed. If your guest OS does not 1612e2fcbf42SPeter Maydell handle volatile disk write caches correctly and your host crashes or 1613e2fcbf42SPeter Maydell loses power, then the guest may experience data corruption. 1614e2fcbf42SPeter Maydell 1615e2fcbf42SPeter Maydell For such guests, you should consider using ``cache.writeback=off``. 1616e2fcbf42SPeter Maydell This means that the host page cache will be used to read and write 1617e2fcbf42SPeter Maydell data, but write notification will be sent to the guest only after 1618e2fcbf42SPeter Maydell QEMU has made sure to flush each write to the disk. Be aware that 1619e2fcbf42SPeter Maydell this has a major impact on performance. 1620e2fcbf42SPeter Maydell 1621e2fcbf42SPeter Maydell When using the ``-snapshot`` option, unsafe caching is always used. 1622e2fcbf42SPeter Maydell 1623e2fcbf42SPeter Maydell Copy-on-read avoids accessing the same backing file sectors 1624e2fcbf42SPeter Maydell repeatedly and is useful when the backing file is over a slow 1625e2fcbf42SPeter Maydell network. By default copy-on-read is off. 1626e2fcbf42SPeter Maydell 1627e2fcbf42SPeter Maydell Instead of ``-cdrom`` you can use: 1628e2fcbf42SPeter Maydell 1629e2fcbf42SPeter Maydell .. parsed-literal:: 1630e2fcbf42SPeter Maydell 1631e2fcbf42SPeter Maydell |qemu_system| -drive file=file,index=2,media=cdrom 1632e2fcbf42SPeter Maydell 1633e2fcbf42SPeter Maydell Instead of ``-hda``, ``-hdb``, ``-hdc``, ``-hdd``, you can use: 1634e2fcbf42SPeter Maydell 1635e2fcbf42SPeter Maydell .. parsed-literal:: 1636e2fcbf42SPeter Maydell 1637e2fcbf42SPeter Maydell |qemu_system| -drive file=file,index=0,media=disk 1638e2fcbf42SPeter Maydell |qemu_system| -drive file=file,index=1,media=disk 1639e2fcbf42SPeter Maydell |qemu_system| -drive file=file,index=2,media=disk 1640e2fcbf42SPeter Maydell |qemu_system| -drive file=file,index=3,media=disk 1641e2fcbf42SPeter Maydell 1642e2fcbf42SPeter Maydell You can open an image using pre-opened file descriptors from an fd 1643e2fcbf42SPeter Maydell set: 1644e2fcbf42SPeter Maydell 1645e2fcbf42SPeter Maydell .. parsed-literal:: 1646e2fcbf42SPeter Maydell 1647353a06b4SLaszlo Ersek |qemu_system| \\ 1648353a06b4SLaszlo Ersek -add-fd fd=3,set=2,opaque="rdwr:/path/to/file" \\ 1649353a06b4SLaszlo Ersek -add-fd fd=4,set=2,opaque="rdonly:/path/to/file" \\ 1650e2fcbf42SPeter Maydell -drive file=/dev/fdset/2,index=0,media=disk 1651e2fcbf42SPeter Maydell 1652e2fcbf42SPeter Maydell You can connect a CDROM to the slave of ide0: 1653e2fcbf42SPeter Maydell 1654e2fcbf42SPeter Maydell .. parsed-literal:: 1655e2fcbf42SPeter Maydell 1656e2fcbf42SPeter Maydell |qemu_system_x86| -drive file=file,if=ide,index=1,media=cdrom 1657e2fcbf42SPeter Maydell 1658e2fcbf42SPeter Maydell If you don't specify the "file=" argument, you define an empty 1659e2fcbf42SPeter Maydell drive: 1660e2fcbf42SPeter Maydell 1661e2fcbf42SPeter Maydell .. parsed-literal:: 1662e2fcbf42SPeter Maydell 1663e2fcbf42SPeter Maydell |qemu_system_x86| -drive if=ide,index=1,media=cdrom 1664e2fcbf42SPeter Maydell 1665e2fcbf42SPeter Maydell Instead of ``-fda``, ``-fdb``, you can use: 1666e2fcbf42SPeter Maydell 1667e2fcbf42SPeter Maydell .. parsed-literal:: 1668e2fcbf42SPeter Maydell 1669e2fcbf42SPeter Maydell |qemu_system_x86| -drive file=file,index=0,if=floppy 1670e2fcbf42SPeter Maydell |qemu_system_x86| -drive file=file,index=1,if=floppy 1671e2fcbf42SPeter Maydell 1672e2fcbf42SPeter Maydell By default, interface is "ide" and index is automatically 1673e2fcbf42SPeter Maydell incremented: 1674e2fcbf42SPeter Maydell 1675e2fcbf42SPeter Maydell .. parsed-literal:: 1676e2fcbf42SPeter Maydell 1677a234ec31SJohn Snow |qemu_system_x86| -drive file=a -drive file=b 1678e2fcbf42SPeter Maydell 1679e2fcbf42SPeter Maydell is interpreted like: 1680e2fcbf42SPeter Maydell 1681e2fcbf42SPeter Maydell .. parsed-literal:: 1682e2fcbf42SPeter Maydell 1683e2fcbf42SPeter Maydell |qemu_system_x86| -hda a -hdb b 1684e2fcbf42SPeter MaydellERST 16855824d651Sblueswir1 16865824d651Sblueswir1DEF("mtdblock", HAS_ARG, QEMU_OPTION_mtdblock, 1687ad96090aSBlue Swirl "-mtdblock file use 'file' as on-board Flash memory image\n", 1688ad96090aSBlue Swirl QEMU_ARCH_ALL) 1689e2fcbf42SPeter MaydellSRST 1690e2fcbf42SPeter Maydell``-mtdblock file`` 1691e2fcbf42SPeter Maydell Use file as on-board Flash memory image. 1692e2fcbf42SPeter MaydellERST 16935824d651Sblueswir1 16945824d651Sblueswir1DEF("sd", HAS_ARG, QEMU_OPTION_sd, 1695ad96090aSBlue Swirl "-sd file use 'file' as SecureDigital card image\n", QEMU_ARCH_ALL) 1696e2fcbf42SPeter MaydellSRST 1697e2fcbf42SPeter Maydell``-sd file`` 1698e2fcbf42SPeter Maydell Use file as SecureDigital card image. 1699e2fcbf42SPeter MaydellERST 17005824d651Sblueswir1 17015824d651Sblueswir1DEF("snapshot", 0, QEMU_OPTION_snapshot, 1702ad96090aSBlue Swirl "-snapshot write to temporary files instead of disk image files\n", 1703ad96090aSBlue Swirl QEMU_ARCH_ALL) 1704e2fcbf42SPeter MaydellSRST 1705e2fcbf42SPeter Maydell``-snapshot`` 1706e2fcbf42SPeter Maydell Write to temporary files instead of disk image files. In this case, 1707e2fcbf42SPeter Maydell the raw disk image you use is not written back. You can however 1708923e9311SThomas Huth force the write back by pressing C-a s (see the :ref:`disk images` 1709923e9311SThomas Huth chapter in the System Emulation Users Guide). 1710c1654c3eSAlex Bennée 1711c1654c3eSAlex Bennée .. warning:: 1712c1654c3eSAlex Bennée snapshot is incompatible with ``-blockdev`` (instead use qemu-img 1713c1654c3eSAlex Bennée to manually create snapshot images to attach to your blockdev). 1714c1654c3eSAlex Bennée If you have mixed ``-blockdev`` and ``-drive`` declarations you 1715c1654c3eSAlex Bennée can use the 'snapshot' property on your drive declarations 1716c1654c3eSAlex Bennée instead of this global option. 1717c1654c3eSAlex Bennée 1718e2fcbf42SPeter MaydellERST 17195824d651Sblueswir1 172074db920cSGautham R ShenoyDEF("fsdev", HAS_ARG, QEMU_OPTION_fsdev, 1721b44a6b09SGreg Kurz "-fsdev local,id=id,path=path,security_model=mapped-xattr|mapped-file|passthrough|none\n" 1722991c180dSPaolo Bonzini " [,writeout=immediate][,readonly=on][,fmode=fmode][,dmode=dmode]\n" 1723b8bbdb88SPradeep Jagadeesh " [[,throttling.bps-total=b]|[[,throttling.bps-read=r][,throttling.bps-write=w]]]\n" 1724b8bbdb88SPradeep Jagadeesh " [[,throttling.iops-total=i]|[[,throttling.iops-read=r][,throttling.iops-write=w]]]\n" 1725b8bbdb88SPradeep Jagadeesh " [[,throttling.bps-total-max=bm]|[[,throttling.bps-read-max=rm][,throttling.bps-write-max=wm]]]\n" 1726b8bbdb88SPradeep Jagadeesh " [[,throttling.iops-total-max=im]|[[,throttling.iops-read-max=irm][,throttling.iops-write-max=iwm]]]\n" 1727b44a6b09SGreg Kurz " [[,throttling.iops-size=is]]\n" 1728991c180dSPaolo Bonzini "-fsdev proxy,id=id,socket=socket[,writeout=immediate][,readonly=on]\n" 1729991c180dSPaolo Bonzini "-fsdev proxy,id=id,sock_fd=sock_fd[,writeout=immediate][,readonly=on]\n" 1730b44a6b09SGreg Kurz "-fsdev synth,id=id\n", 173174db920cSGautham R Shenoy QEMU_ARCH_ALL) 173274db920cSGautham R Shenoy 1733e2fcbf42SPeter MaydellSRST 1734991c180dSPaolo 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[,...]]]`` 173509ce5f2dSPeter Maydell \ 1736991c180dSPaolo Bonzini``-fsdev proxy,id=id,socket=socket[,writeout=writeout][,readonly=on]`` 173709ce5f2dSPeter Maydell \ 1738991c180dSPaolo Bonzini``-fsdev proxy,id=id,sock_fd=sock_fd[,writeout=writeout][,readonly=on]`` 173909ce5f2dSPeter Maydell \ 1740991c180dSPaolo Bonzini``-fsdev synth,id=id[,readonly=on]`` 1741e2fcbf42SPeter Maydell Define a new file system device. Valid options are: 1742e2fcbf42SPeter Maydell 1743e2fcbf42SPeter Maydell ``local`` 1744e2fcbf42SPeter Maydell Accesses to the filesystem are done by QEMU. 1745e2fcbf42SPeter Maydell 1746e2fcbf42SPeter Maydell ``proxy`` 174771d72eceSChristian Schoenebeck Accesses to the filesystem are done by virtfs-proxy-helper(1). This 174871d72eceSChristian Schoenebeck option is deprecated (since QEMU 8.1) and will be removed in a future 174971d72eceSChristian Schoenebeck version of QEMU. Use ``local`` instead. 1750e2fcbf42SPeter Maydell 1751e2fcbf42SPeter Maydell ``synth`` 1752e2fcbf42SPeter Maydell Synthetic filesystem, only used by QTests. 1753e2fcbf42SPeter Maydell 1754e2fcbf42SPeter Maydell ``id=id`` 1755e2fcbf42SPeter Maydell Specifies identifier for this device. 1756e2fcbf42SPeter Maydell 1757e2fcbf42SPeter Maydell ``path=path`` 1758e2fcbf42SPeter Maydell Specifies the export path for the file system device. Files 1759e2fcbf42SPeter Maydell under this path will be available to the 9p client on the guest. 1760e2fcbf42SPeter Maydell 1761e2fcbf42SPeter Maydell ``security_model=security_model`` 1762e2fcbf42SPeter Maydell Specifies the security model to be used for this export path. 1763e2fcbf42SPeter Maydell Supported security models are "passthrough", "mapped-xattr", 1764e2fcbf42SPeter Maydell "mapped-file" and "none". In "passthrough" security model, files 1765e2fcbf42SPeter Maydell are stored using the same credentials as they are created on the 1766e2fcbf42SPeter Maydell guest. This requires QEMU to run as root. In "mapped-xattr" 1767e2fcbf42SPeter Maydell security model, some of the file attributes like uid, gid, mode 1768e2fcbf42SPeter Maydell bits and link target are stored as file attributes. For 1769e2fcbf42SPeter Maydell "mapped-file" these attributes are stored in the hidden 1770e2fcbf42SPeter Maydell .virtfs\_metadata directory. Directories exported by this 1771e2fcbf42SPeter Maydell security model cannot interact with other unix tools. "none" 1772e2fcbf42SPeter Maydell security model is same as passthrough except the sever won't 1773e2fcbf42SPeter Maydell report failures if it fails to set file attributes like 1774e2fcbf42SPeter Maydell ownership. Security model is mandatory only for local fsdriver. 1775e2fcbf42SPeter Maydell Other fsdrivers (like proxy) don't take security model as a 1776e2fcbf42SPeter Maydell parameter. 1777e2fcbf42SPeter Maydell 1778e2fcbf42SPeter Maydell ``writeout=writeout`` 1779e2fcbf42SPeter Maydell This is an optional argument. The only supported value is 1780e2fcbf42SPeter Maydell "immediate". This means that host page cache will be used to 1781e2fcbf42SPeter Maydell read and write data but write notification will be sent to the 1782e2fcbf42SPeter Maydell guest only when the data has been reported as written by the 1783e2fcbf42SPeter Maydell storage subsystem. 1784e2fcbf42SPeter Maydell 1785991c180dSPaolo Bonzini ``readonly=on`` 1786e2fcbf42SPeter Maydell Enables exporting 9p share as a readonly mount for guests. By 1787e2fcbf42SPeter Maydell default read-write access is given. 1788e2fcbf42SPeter Maydell 1789e2fcbf42SPeter Maydell ``socket=socket`` 1790e2fcbf42SPeter Maydell Enables proxy filesystem driver to use passed socket file for 1791e2fcbf42SPeter Maydell communicating with virtfs-proxy-helper(1). 1792e2fcbf42SPeter Maydell 1793e2fcbf42SPeter Maydell ``sock_fd=sock_fd`` 1794e2fcbf42SPeter Maydell Enables proxy filesystem driver to use passed socket descriptor 1795e2fcbf42SPeter Maydell for communicating with virtfs-proxy-helper(1). Usually a helper 1796e2fcbf42SPeter Maydell like libvirt will create socketpair and pass one of the fds as 1797e2fcbf42SPeter Maydell sock\_fd. 1798e2fcbf42SPeter Maydell 1799e2fcbf42SPeter Maydell ``fmode=fmode`` 1800e2fcbf42SPeter Maydell Specifies the default mode for newly created files on the host. 1801e2fcbf42SPeter Maydell Works only with security models "mapped-xattr" and 1802e2fcbf42SPeter Maydell "mapped-file". 1803e2fcbf42SPeter Maydell 1804e2fcbf42SPeter Maydell ``dmode=dmode`` 1805e2fcbf42SPeter Maydell Specifies the default mode for newly created directories on the 1806e2fcbf42SPeter Maydell host. Works only with security models "mapped-xattr" and 1807e2fcbf42SPeter Maydell "mapped-file". 1808e2fcbf42SPeter Maydell 1809e2fcbf42SPeter Maydell ``throttling.bps-total=b,throttling.bps-read=r,throttling.bps-write=w`` 1810e2fcbf42SPeter Maydell Specify bandwidth throttling limits in bytes per second, either 1811e2fcbf42SPeter Maydell for all request types or for reads or writes only. 1812e2fcbf42SPeter Maydell 1813e2fcbf42SPeter Maydell ``throttling.bps-total-max=bm,bps-read-max=rm,bps-write-max=wm`` 1814e2fcbf42SPeter Maydell Specify bursts in bytes per second, either for all request types 1815e2fcbf42SPeter Maydell or for reads or writes only. Bursts allow the guest I/O to spike 1816e2fcbf42SPeter Maydell above the limit temporarily. 1817e2fcbf42SPeter Maydell 1818e2fcbf42SPeter Maydell ``throttling.iops-total=i,throttling.iops-read=r, throttling.iops-write=w`` 1819e2fcbf42SPeter Maydell Specify request rate limits in requests per second, either for 1820e2fcbf42SPeter Maydell all request types or for reads or writes only. 1821e2fcbf42SPeter Maydell 1822e2fcbf42SPeter Maydell ``throttling.iops-total-max=im,throttling.iops-read-max=irm, throttling.iops-write-max=iwm`` 1823e2fcbf42SPeter Maydell Specify bursts in requests per second, either for all request 1824e2fcbf42SPeter Maydell types or for reads or writes only. Bursts allow the guest I/O to 1825e2fcbf42SPeter Maydell spike above the limit temporarily. 1826e2fcbf42SPeter Maydell 1827e2fcbf42SPeter Maydell ``throttling.iops-size=is`` 1828e2fcbf42SPeter Maydell Let every is bytes of a request count as a new request for iops 1829e2fcbf42SPeter Maydell throttling purposes. 1830e2fcbf42SPeter Maydell 1831e2fcbf42SPeter Maydell -fsdev option is used along with -device driver "virtio-9p-...". 1832e2fcbf42SPeter Maydell 1833e2fcbf42SPeter Maydell``-device virtio-9p-type,fsdev=id,mount_tag=mount_tag`` 1834e2fcbf42SPeter Maydell Options for virtio-9p-... driver are: 1835e2fcbf42SPeter Maydell 1836e2fcbf42SPeter Maydell ``type`` 1837e2fcbf42SPeter Maydell Specifies the variant to be used. Supported values are "pci", 1838e2fcbf42SPeter Maydell "ccw" or "device", depending on the machine type. 1839e2fcbf42SPeter Maydell 1840e2fcbf42SPeter Maydell ``fsdev=id`` 1841e2fcbf42SPeter Maydell Specifies the id value specified along with -fsdev option. 1842e2fcbf42SPeter Maydell 1843e2fcbf42SPeter Maydell ``mount_tag=mount_tag`` 1844e2fcbf42SPeter Maydell Specifies the tag name to be used by the guest to mount this 1845e2fcbf42SPeter Maydell export point. 1846e2fcbf42SPeter MaydellERST 184774db920cSGautham R Shenoy 18483d54abc7SGautham R ShenoyDEF("virtfs", HAS_ARG, QEMU_OPTION_virtfs, 1849b44a6b09SGreg Kurz "-virtfs local,path=path,mount_tag=tag,security_model=mapped-xattr|mapped-file|passthrough|none\n" 1850991c180dSPaolo Bonzini " [,id=id][,writeout=immediate][,readonly=on][,fmode=fmode][,dmode=dmode][,multidevs=remap|forbid|warn]\n" 1851991c180dSPaolo Bonzini "-virtfs proxy,mount_tag=tag,socket=socket[,id=id][,writeout=immediate][,readonly=on]\n" 1852991c180dSPaolo Bonzini "-virtfs proxy,mount_tag=tag,sock_fd=sock_fd[,id=id][,writeout=immediate][,readonly=on]\n" 1853991c180dSPaolo Bonzini "-virtfs synth,mount_tag=tag[,id=id][,readonly=on]\n", 18543d54abc7SGautham R Shenoy QEMU_ARCH_ALL) 18553d54abc7SGautham R Shenoy 1856e2fcbf42SPeter MaydellSRST 1857991c180dSPaolo Bonzini``-virtfs local,path=path,mount_tag=mount_tag ,security_model=security_model[,writeout=writeout][,readonly=on] [,fmode=fmode][,dmode=dmode][,multidevs=multidevs]`` 185809ce5f2dSPeter Maydell \ 1859991c180dSPaolo Bonzini``-virtfs proxy,socket=socket,mount_tag=mount_tag [,writeout=writeout][,readonly=on]`` 186009ce5f2dSPeter Maydell \ 1861991c180dSPaolo Bonzini``-virtfs proxy,sock_fd=sock_fd,mount_tag=mount_tag [,writeout=writeout][,readonly=on]`` 186209ce5f2dSPeter Maydell \ 186309ce5f2dSPeter Maydell``-virtfs synth,mount_tag=mount_tag`` 186465abaa01SChristian Schoenebeck Define a new virtual filesystem device and expose it to the guest using 186565abaa01SChristian Schoenebeck a virtio-9p-device (a.k.a. 9pfs), which essentially means that a certain 186665abaa01SChristian Schoenebeck directory on host is made directly accessible by guest as a pass-through 186765abaa01SChristian Schoenebeck file system by using the 9P network protocol for communication between 186865abaa01SChristian Schoenebeck host and guests, if desired even accessible, shared by several guests 18692cb40d44SStefan Weil simultaneously. 187065abaa01SChristian Schoenebeck 187165abaa01SChristian Schoenebeck Note that ``-virtfs`` is actually just a convenience shortcut for its 187265abaa01SChristian Schoenebeck generalized form ``-fsdev -device virtio-9p-pci``. 187365abaa01SChristian Schoenebeck 187465abaa01SChristian Schoenebeck The general form of pass-through file system options are: 1875e2fcbf42SPeter Maydell 1876e2fcbf42SPeter Maydell ``local`` 1877e2fcbf42SPeter Maydell Accesses to the filesystem are done by QEMU. 1878e2fcbf42SPeter Maydell 1879e2fcbf42SPeter Maydell ``proxy`` 1880e2fcbf42SPeter Maydell Accesses to the filesystem are done by virtfs-proxy-helper(1). 188171d72eceSChristian Schoenebeck This option is deprecated (since QEMU 8.1) and will be removed in a 188271d72eceSChristian Schoenebeck future version of QEMU. Use ``local`` instead. 1883e2fcbf42SPeter Maydell 1884e2fcbf42SPeter Maydell ``synth`` 1885e2fcbf42SPeter Maydell Synthetic filesystem, only used by QTests. 1886e2fcbf42SPeter Maydell 1887e2fcbf42SPeter Maydell ``id=id`` 1888e2fcbf42SPeter Maydell Specifies identifier for the filesystem device 1889e2fcbf42SPeter Maydell 1890e2fcbf42SPeter Maydell ``path=path`` 1891e2fcbf42SPeter Maydell Specifies the export path for the file system device. Files 1892e2fcbf42SPeter Maydell under this path will be available to the 9p client on the guest. 1893e2fcbf42SPeter Maydell 1894e2fcbf42SPeter Maydell ``security_model=security_model`` 1895e2fcbf42SPeter Maydell Specifies the security model to be used for this export path. 1896e2fcbf42SPeter Maydell Supported security models are "passthrough", "mapped-xattr", 1897e2fcbf42SPeter Maydell "mapped-file" and "none". In "passthrough" security model, files 1898e2fcbf42SPeter Maydell are stored using the same credentials as they are created on the 1899e2fcbf42SPeter Maydell guest. This requires QEMU to run as root. In "mapped-xattr" 1900e2fcbf42SPeter Maydell security model, some of the file attributes like uid, gid, mode 1901e2fcbf42SPeter Maydell bits and link target are stored as file attributes. For 1902e2fcbf42SPeter Maydell "mapped-file" these attributes are stored in the hidden 1903e2fcbf42SPeter Maydell .virtfs\_metadata directory. Directories exported by this 1904e2fcbf42SPeter Maydell security model cannot interact with other unix tools. "none" 1905e2fcbf42SPeter Maydell security model is same as passthrough except the sever won't 1906e2fcbf42SPeter Maydell report failures if it fails to set file attributes like 1907e2fcbf42SPeter Maydell ownership. Security model is mandatory only for local fsdriver. 1908e2fcbf42SPeter Maydell Other fsdrivers (like proxy) don't take security model as a 1909e2fcbf42SPeter Maydell parameter. 1910e2fcbf42SPeter Maydell 1911e2fcbf42SPeter Maydell ``writeout=writeout`` 1912e2fcbf42SPeter Maydell This is an optional argument. The only supported value is 1913e2fcbf42SPeter Maydell "immediate". This means that host page cache will be used to 1914e2fcbf42SPeter Maydell read and write data but write notification will be sent to the 1915e2fcbf42SPeter Maydell guest only when the data has been reported as written by the 1916e2fcbf42SPeter Maydell storage subsystem. 1917e2fcbf42SPeter Maydell 1918991c180dSPaolo Bonzini ``readonly=on`` 1919e2fcbf42SPeter Maydell Enables exporting 9p share as a readonly mount for guests. By 1920e2fcbf42SPeter Maydell default read-write access is given. 1921e2fcbf42SPeter Maydell 1922e2fcbf42SPeter Maydell ``socket=socket`` 1923e2fcbf42SPeter Maydell Enables proxy filesystem driver to use passed socket file for 1924e2fcbf42SPeter Maydell communicating with virtfs-proxy-helper(1). Usually a helper like 1925e2fcbf42SPeter Maydell libvirt will create socketpair and pass one of the fds as 1926e2fcbf42SPeter Maydell sock\_fd. 1927e2fcbf42SPeter Maydell 1928e2fcbf42SPeter Maydell ``sock_fd`` 1929e2fcbf42SPeter Maydell Enables proxy filesystem driver to use passed 'sock\_fd' as the 1930e2fcbf42SPeter Maydell socket descriptor for interfacing with virtfs-proxy-helper(1). 1931e2fcbf42SPeter Maydell 1932e2fcbf42SPeter Maydell ``fmode=fmode`` 1933e2fcbf42SPeter Maydell Specifies the default mode for newly created files on the host. 1934e2fcbf42SPeter Maydell Works only with security models "mapped-xattr" and 1935e2fcbf42SPeter Maydell "mapped-file". 1936e2fcbf42SPeter Maydell 1937e2fcbf42SPeter Maydell ``dmode=dmode`` 1938e2fcbf42SPeter Maydell Specifies the default mode for newly created directories on the 1939e2fcbf42SPeter Maydell host. Works only with security models "mapped-xattr" and 1940e2fcbf42SPeter Maydell "mapped-file". 1941e2fcbf42SPeter Maydell 1942e2fcbf42SPeter Maydell ``mount_tag=mount_tag`` 1943e2fcbf42SPeter Maydell Specifies the tag name to be used by the guest to mount this 1944e2fcbf42SPeter Maydell export point. 1945e2fcbf42SPeter Maydell 1946e2fcbf42SPeter Maydell ``multidevs=multidevs`` 1947e2fcbf42SPeter Maydell Specifies how to deal with multiple devices being shared with a 1948e2fcbf42SPeter Maydell 9p export. Supported behaviours are either "remap", "forbid" or 1949e2fcbf42SPeter Maydell "warn". The latter is the default behaviour on which virtfs 9p 1950e2fcbf42SPeter Maydell expects only one device to be shared with the same export, and 1951e2fcbf42SPeter Maydell if more than one device is shared and accessed via the same 9p 1952e2fcbf42SPeter Maydell export then only a warning message is logged (once) by qemu on 1953e2fcbf42SPeter Maydell host side. In order to avoid file ID collisions on guest you 1954e2fcbf42SPeter Maydell should either create a separate virtfs export for each device to 1955e2fcbf42SPeter Maydell be shared with guests (recommended way) or you might use "remap" 1956e2fcbf42SPeter Maydell instead which allows you to share multiple devices with only one 1957e2fcbf42SPeter Maydell export instead, which is achieved by remapping the original 1958e2fcbf42SPeter Maydell inode numbers from host to guest in a way that would prevent 1959e2fcbf42SPeter Maydell such collisions. Remapping inodes in such use cases is required 1960e2fcbf42SPeter Maydell because the original device IDs from host are never passed and 1961e2fcbf42SPeter Maydell exposed on guest. Instead all files of an export shared with 1962e2fcbf42SPeter Maydell virtfs always share the same device id on guest. So two files 1963e2fcbf42SPeter Maydell with identical inode numbers but from actually different devices 1964e2fcbf42SPeter Maydell on host would otherwise cause a file ID collision and hence 1965e2fcbf42SPeter Maydell potential misbehaviours on guest. "forbid" on the other hand 1966e2fcbf42SPeter Maydell assumes like "warn" that only one device is shared by the same 1967e2fcbf42SPeter Maydell export, however it will not only log a warning message but also 1968e2fcbf42SPeter Maydell deny access to additional devices on guest. Note though that 1969e2fcbf42SPeter Maydell "forbid" does currently not block all possible file access 1970e2fcbf42SPeter Maydell operations (e.g. readdir() would still return entries from other 1971e2fcbf42SPeter Maydell devices). 1972e2fcbf42SPeter MaydellERST 19733d54abc7SGautham R Shenoy 197461d70487SMarkus ArmbrusterDEF("iscsi", HAS_ARG, QEMU_OPTION_iscsi, 1975c3b3a6c9SDaniel P. Berrangé "-iscsi [user=user][,password=password][,password-secret=secret-id]\n" 1976c3b3a6c9SDaniel P. Berrangé " [,header-digest=CRC32C|CR32C-NONE|NONE-CRC32C|NONE]\n" 197761d70487SMarkus Armbruster " [,initiator-name=initiator-iqn][,id=target-iqn]\n" 197861d70487SMarkus Armbruster " [,timeout=timeout]\n" 197961d70487SMarkus Armbruster " iSCSI session parameters\n", QEMU_ARCH_ALL) 198061d70487SMarkus Armbruster 1981e2fcbf42SPeter MaydellSRST 1982e2fcbf42SPeter Maydell``-iscsi`` 1983e2fcbf42SPeter Maydell Configure iSCSI session parameters. 1984e2fcbf42SPeter MaydellERST 198544743148SMarkus Armbruster 19865824d651Sblueswir1DEFHEADING() 19875824d651Sblueswir1 1988c2a34ab2SThomas HuthDEFHEADING(USB convenience options:) 198910adb8beSMarkus Armbruster 199010adb8beSMarkus ArmbrusterDEF("usb", 0, QEMU_OPTION_usb, 199173f46fefSStefan Hajnoczi "-usb enable on-board USB host controller (if not enabled by default)\n", 199210adb8beSMarkus Armbruster QEMU_ARCH_ALL) 1993e2fcbf42SPeter MaydellSRST 1994e2fcbf42SPeter Maydell``-usb`` 1995e2fcbf42SPeter Maydell Enable USB emulation on machine types with an on-board USB host 1996e2fcbf42SPeter Maydell controller (if not enabled by default). Note that on-board USB host 1997e2fcbf42SPeter Maydell controllers may not support USB 3.0. In this case 1998e2fcbf42SPeter Maydell ``-device qemu-xhci`` can be used instead on machines with PCI. 1999e2fcbf42SPeter MaydellERST 200010adb8beSMarkus Armbruster 200110adb8beSMarkus ArmbrusterDEF("usbdevice", HAS_ARG, QEMU_OPTION_usbdevice, 200210adb8beSMarkus Armbruster "-usbdevice name add the host or guest USB device 'name'\n", 200310adb8beSMarkus Armbruster QEMU_ARCH_ALL) 2004e2fcbf42SPeter MaydellSRST 2005e2fcbf42SPeter Maydell``-usbdevice devname`` 2006c2a34ab2SThomas Huth Add the USB device devname, and enable an on-board USB controller 2007c2a34ab2SThomas Huth if possible and necessary (just like it can be done via 2008c2a34ab2SThomas Huth ``-machine usb=on``). Note that this option is mainly intended for 2009c2a34ab2SThomas Huth the user's convenience only. More fine-grained control can be 2010c2a34ab2SThomas Huth achieved by selecting a USB host controller (if necessary) and the 2011c2a34ab2SThomas Huth desired USB device via the ``-device`` option instead. For example, 2012c2a34ab2SThomas Huth instead of using ``-usbdevice mouse`` it is possible to use 2013c2a34ab2SThomas Huth ``-device qemu-xhci -device usb-mouse`` to connect the USB mouse 2014c2a34ab2SThomas Huth to a USB 3.0 controller instead (at least on machines that support 2015c2a34ab2SThomas Huth PCI and do not have an USB controller enabled by default yet). 2016c2a34ab2SThomas Huth For more details, see the chapter about 2017923e9311SThomas Huth :ref:`Connecting USB devices` in the System Emulation Users Guide. 2018c2a34ab2SThomas Huth Possible devices for devname are: 2019c2a34ab2SThomas Huth 2020c2a34ab2SThomas Huth ``braille`` 2021c2a34ab2SThomas Huth Braille device. This will use BrlAPI to display the braille 2022c2a34ab2SThomas Huth output on a real or fake device (i.e. it also creates a 2023c2a34ab2SThomas Huth corresponding ``braille`` chardev automatically beside the 2024c2a34ab2SThomas Huth ``usb-braille`` USB device). 2025c2a34ab2SThomas Huth 2026c2a34ab2SThomas Huth ``keyboard`` 2027c2a34ab2SThomas Huth Standard USB keyboard. Will override the PS/2 keyboard (if present). 2028e2fcbf42SPeter Maydell 2029e2fcbf42SPeter Maydell ``mouse`` 2030e2fcbf42SPeter Maydell Virtual Mouse. This will override the PS/2 mouse emulation when 2031e2fcbf42SPeter Maydell activated. 2032e2fcbf42SPeter Maydell 2033e2fcbf42SPeter Maydell ``tablet`` 2034e2fcbf42SPeter Maydell Pointer device that uses absolute coordinates (like a 2035e2fcbf42SPeter Maydell touchscreen). This means QEMU is able to report the mouse 2036e2fcbf42SPeter Maydell position without having to grab the mouse. Also overrides the 2037e2fcbf42SPeter Maydell PS/2 mouse emulation when activated. 2038e2fcbf42SPeter Maydell 2039c2a34ab2SThomas Huth ``wacom-tablet`` 2040c2a34ab2SThomas Huth Wacom PenPartner USB tablet. 2041c2a34ab2SThomas Huth 2042c2a34ab2SThomas Huth 2043e2fcbf42SPeter MaydellERST 204410adb8beSMarkus Armbruster 204510adb8beSMarkus ArmbrusterDEFHEADING() 204610adb8beSMarkus Armbruster 2047de6b4f90SMarkus ArmbrusterDEFHEADING(Display options:) 20485824d651Sblueswir1 20491472a95bSJes SorensenDEF("display", HAS_ARG, QEMU_OPTION_display, 205088b40c68SThomas Huth#if defined(CONFIG_SPICE) 2051d8aec9d9SMarc-André Lureau "-display spice-app[,gl=on|off]\n" 205288b40c68SThomas Huth#endif 205388b40c68SThomas Huth#if defined(CONFIG_SDL) 2054a743d60bSThomas Huth "-display sdl[,gl=on|core|es|off][,grab-mod=<mod>][,show-cursor=on|off]\n" 2055a743d60bSThomas Huth " [,window-close=on|off]\n" 205688b40c68SThomas Huth#endif 205788b40c68SThomas Huth#if defined(CONFIG_GTK) 205895f439bdSThomas Huth "-display gtk[,full-screen=on|off][,gl=on|off][,grab-on-hover=on|off]\n" 2059c34a9338SFelix xq Queißner " [,show-tabs=on|off][,show-cursor=on|off][,window-close=on|off]\n" 2060dbccb1a5SBryce Mills " [,show-menubar=on|off]\n" 206188b40c68SThomas Huth#endif 206288b40c68SThomas Huth#if defined(CONFIG_VNC) 2063f04ec5afSRobert Ho "-display vnc=<display>[,<optargs>]\n" 206488b40c68SThomas Huth#endif 206588b40c68SThomas Huth#if defined(CONFIG_CURSES) 20662f8b7cd5SSamuel Thibault "-display curses[,charset=<encoding>]\n" 206788b40c68SThomas Huth#endif 2068f844cdb9SGustavo Noronha Silva#if defined(CONFIG_COCOA) 20694797adceSGustavo Noronha Silva "-display cocoa[,full-grab=on|off][,swap-opt-cmd=on|off]\n" 2070f844cdb9SGustavo Noronha Silva#endif 207188b40c68SThomas Huth#if defined(CONFIG_OPENGL) 207288b40c68SThomas Huth "-display egl-headless[,rendernode=<file>]\n" 207388b40c68SThomas Huth#endif 2074142ca628SMarc-André Lureau#if defined(CONFIG_DBUS_DISPLAY) 2075142ca628SMarc-André Lureau "-display dbus[,addr=<dbusaddr>]\n" 2076142ca628SMarc-André Lureau " [,gl=on|core|es|off][,rendernode=<file>]\n" 2077142ca628SMarc-André Lureau#endif 207848941a52SCarwyn Ellis#if defined(CONFIG_COCOA) 207948941a52SCarwyn Ellis "-display cocoa[,show-cursor=on|off][,left-command-key=on|off]\n" 208048941a52SCarwyn Ellis#endif 2081144aaa99SErik Skultety "-display none\n" 208288b40c68SThomas Huth " select display backend type\n" 2083f04ec5afSRobert Ho " The default display is equivalent to\n " 2084f04ec5afSRobert Ho#if defined(CONFIG_GTK) 208588b40c68SThomas Huth "\"-display gtk\"\n" 2086f04ec5afSRobert Ho#elif defined(CONFIG_SDL) 208788b40c68SThomas Huth "\"-display sdl\"\n" 2088f04ec5afSRobert Ho#elif defined(CONFIG_COCOA) 208988b40c68SThomas Huth "\"-display cocoa\"\n" 2090f04ec5afSRobert Ho#elif defined(CONFIG_VNC) 209188b40c68SThomas Huth "\"-vnc localhost:0,to=99,id=default\"\n" 2092f04ec5afSRobert Ho#else 209388b40c68SThomas Huth "\"-display none\"\n" 2094f04ec5afSRobert Ho#endif 2095f04ec5afSRobert Ho , QEMU_ARCH_ALL) 2096e2fcbf42SPeter MaydellSRST 2097e2fcbf42SPeter Maydell``-display type`` 2098707d93d4SThomas Huth Select type of display to use. Use ``-display help`` to list the available 2099707d93d4SThomas Huth display types. Valid values for type are 2100e2fcbf42SPeter Maydell 2101ddc71758SAhmed Abouzied ``spice-app[,gl=on|off]`` 2102ddc71758SAhmed Abouzied Start QEMU as a Spice server and launch the default Spice client 2103ddc71758SAhmed Abouzied application. The Spice server will redirect the serial consoles 2104ddc71758SAhmed Abouzied and QEMU monitors. (Since 4.0) 2105ddc71758SAhmed Abouzied 2106142ca628SMarc-André Lureau ``dbus`` 2107142ca628SMarc-André Lureau Export the display over D-Bus interfaces. (Since 7.0) 2108142ca628SMarc-André Lureau 2109142ca628SMarc-André Lureau The connection is registered with the "org.qemu" name (and queued when 2110142ca628SMarc-André Lureau already owned). 2111142ca628SMarc-André Lureau 2112142ca628SMarc-André Lureau ``addr=<dbusaddr>`` : D-Bus bus address to connect to. 2113142ca628SMarc-André Lureau 211499997823SMarc-André Lureau ``p2p=yes|no`` : Use peer-to-peer connection, accepted via QMP ``add_client``. 211599997823SMarc-André Lureau 211699997823SMarc-André Lureau ``gl=on|off|core|es`` : Use OpenGL for rendering (the D-Bus interface 211799997823SMarc-André Lureau will share framebuffers with DMABUF file descriptors). 2118142ca628SMarc-André Lureau 211995f439bdSThomas Huth ``sdl`` 2120e2fcbf42SPeter Maydell Display video output via SDL (usually in a separate graphics 2121e2fcbf42SPeter Maydell window; see the SDL documentation for other possibilities). 212295f439bdSThomas Huth Valid parameters are: 2123e2fcbf42SPeter Maydell 21248e8e844bSThomas Huth ``grab-mod=<mods>`` : Used to select the modifier keys for toggling 2125450e0f28SJohn Snow the mouse grabbing in conjunction with the "g" key. ``<mods>`` can be 2126450e0f28SJohn Snow either ``lshift-lctrl-lalt`` or ``rctrl``. 21278e8e844bSThomas Huth 212895f439bdSThomas Huth ``gl=on|off|core|es`` : Use OpenGL for displaying 212995f439bdSThomas Huth 213095f439bdSThomas Huth ``show-cursor=on|off`` : Force showing the mouse cursor 213195f439bdSThomas Huth 213295f439bdSThomas Huth ``window-close=on|off`` : Allow to quit qemu with window close button 213395f439bdSThomas Huth 213495f439bdSThomas Huth ``gtk`` 2135ddc71758SAhmed Abouzied Display video output in a GTK window. This interface provides 2136ddc71758SAhmed Abouzied drop-down menus and other UI elements to configure and control 213795f439bdSThomas Huth the VM during runtime. Valid parameters are: 213895f439bdSThomas Huth 213995f439bdSThomas Huth ``full-screen=on|off`` : Start in fullscreen mode 214095f439bdSThomas Huth 214195f439bdSThomas Huth ``gl=on|off`` : Use OpenGL for displaying 214295f439bdSThomas Huth 214395f439bdSThomas Huth ``grab-on-hover=on|off`` : Grab keyboard input on mouse hover 214495f439bdSThomas Huth 2145c34a9338SFelix xq Queißner ``show-tabs=on|off`` : Display the tab bar for switching between the 2146c34a9338SFelix xq Queißner various graphical interfaces (e.g. VGA and 2147c34a9338SFelix xq Queißner virtual console character devices) by default. 2148c34a9338SFelix xq Queißner 214995f439bdSThomas Huth ``show-cursor=on|off`` : Force showing the mouse cursor 215095f439bdSThomas Huth 215195f439bdSThomas Huth ``window-close=on|off`` : Allow to quit qemu with window close button 2152ddc71758SAhmed Abouzied 2153dbccb1a5SBryce Mills ``show-menubar=on|off`` : Display the main window menubar, defaults to "on" 2154dbccb1a5SBryce Mills 2155c35d9373SJan Kratochvil ``zoom-to-fit=on|off`` : Expand video output to the window size, 2156c35d9373SJan Kratochvil defaults to "off" 2157c35d9373SJan Kratochvil 2158ddc71758SAhmed Abouzied ``curses[,charset=<encoding>]`` 2159e2fcbf42SPeter Maydell Display video output via curses. For graphics device models 2160e2fcbf42SPeter Maydell which support a text mode, QEMU can display this output using a 2161e2fcbf42SPeter Maydell curses/ncurses interface. Nothing is displayed when the graphics 2162e2fcbf42SPeter Maydell device is in graphical mode or if the graphics device does not 2163e2fcbf42SPeter Maydell support a text mode. Generally only the VGA device models 2164e2fcbf42SPeter Maydell support text mode. The font charset used by the guest can be 2165e2fcbf42SPeter Maydell specified with the ``charset`` option, for example 2166e2fcbf42SPeter Maydell ``charset=CP850`` for IBM CP850 encoding. The default is 2167e2fcbf42SPeter Maydell ``CP437``. 2168e2fcbf42SPeter Maydell 216948941a52SCarwyn Ellis ``cocoa`` 217048941a52SCarwyn Ellis Display video output in a Cocoa window. Mac only. This interface 217148941a52SCarwyn Ellis provides drop-down menus and other UI elements to configure and 217248941a52SCarwyn Ellis control the VM during runtime. Valid parameters are: 217348941a52SCarwyn Ellis 217448941a52SCarwyn Ellis ``show-cursor=on|off`` : Force showing the mouse cursor 217548941a52SCarwyn Ellis 217648941a52SCarwyn Ellis ``left-command-key=on|off`` : Disable forwarding left command key to host 217748941a52SCarwyn Ellis 217895f439bdSThomas Huth ``egl-headless[,rendernode=<file>]`` 2179ddc71758SAhmed Abouzied Offload all OpenGL operations to a local DRI device. For any 2180ddc71758SAhmed Abouzied graphical display, this display needs to be paired with either 2181ddc71758SAhmed Abouzied VNC or SPICE displays. 2182ddc71758SAhmed Abouzied 218395f439bdSThomas Huth ``vnc=<display>`` 218495f439bdSThomas Huth Start a VNC server on display <display> 218595f439bdSThomas Huth 2186e2fcbf42SPeter Maydell ``none`` 2187e2fcbf42SPeter Maydell Do not display video output. The guest will still see an 2188e2fcbf42SPeter Maydell emulated graphics card, but its output will not be displayed to 2189e2fcbf42SPeter Maydell the QEMU user. This option differs from the -nographic option in 2190e2fcbf42SPeter Maydell that it only affects what is done with video output; -nographic 2191e2fcbf42SPeter Maydell also changes the destination of the serial and parallel port 2192e2fcbf42SPeter Maydell data. 2193e2fcbf42SPeter MaydellERST 21941472a95bSJes Sorensen 21955824d651Sblueswir1DEF("nographic", 0, QEMU_OPTION_nographic, 2196ad96090aSBlue Swirl "-nographic disable graphical output and redirect serial I/Os to console\n", 2197ad96090aSBlue Swirl QEMU_ARCH_ALL) 2198e2fcbf42SPeter MaydellSRST 2199e2fcbf42SPeter Maydell``-nographic`` 2200e2fcbf42SPeter Maydell Normally, if QEMU is compiled with graphical window support, it 2201e2fcbf42SPeter Maydell displays output such as guest graphics, guest console, and the QEMU 2202e2fcbf42SPeter Maydell monitor in a window. With this option, you can totally disable 2203e2fcbf42SPeter Maydell graphical output so that QEMU is a simple command line application. 2204e2fcbf42SPeter Maydell The emulated serial port is redirected on the console and muxed with 2205e2fcbf42SPeter Maydell the monitor (unless redirected elsewhere explicitly). Therefore, you 2206e2fcbf42SPeter Maydell can still use QEMU to debug a Linux kernel with a serial console. 2207e2fcbf42SPeter Maydell Use C-a h for help on switching between the console and monitor. 2208e2fcbf42SPeter MaydellERST 22095824d651Sblueswir1 22105324e3e9SMarc-André Lureau#ifdef CONFIG_SPICE 221129b0040bSGerd HoffmannDEF("spice", HAS_ARG, QEMU_OPTION_spice, 221227af7788SYonit Halperin "-spice [port=port][,tls-port=secured-port][,x509-dir=<dir>]\n" 221327af7788SYonit Halperin " [,x509-key-file=<file>][,x509-key-password=<file>]\n" 221427af7788SYonit Halperin " [,x509-cert-file=<file>][,x509-cacert-file=<file>]\n" 2215a9daa36aSDaniel P. Berrangé " [,x509-dh-key-file=<file>][,addr=addr]\n" 2216a9daa36aSDaniel P. Berrangé " [,ipv4=on|off][,ipv6=on|off][,unix=on|off]\n" 221727af7788SYonit Halperin " [,tls-ciphers=<list>]\n" 221827af7788SYonit Halperin " [,tls-channel=[main|display|cursor|inputs|record|playback]]\n" 221927af7788SYonit Halperin " [,plaintext-channel=[main|display|cursor|inputs|record|playback]]\n" 222099522f69SDaniel P. Berrangé " [,sasl=on|off][,disable-ticketing=on|off]\n" 222136debafdSDaniel P. Berrangé " [,password-secret=<secret-id>]\n" 222227af7788SYonit Halperin " [,image-compression=[auto_glz|auto_lz|quic|glz|lz|off]]\n" 222327af7788SYonit Halperin " [,jpeg-wan-compression=[auto|never|always]]\n" 222427af7788SYonit Halperin " [,zlib-glz-wan-compression=[auto|never|always]]\n" 2225a9daa36aSDaniel P. Berrangé " [,streaming-video=[off|all|filter]][,disable-copy-paste=on|off]\n" 2226a9daa36aSDaniel P. Berrangé " [,disable-agent-file-xfer=on|off][,agent-mouse=[on|off]]\n" 22275ad24e5fSHans de Goede " [,playback-compression=[on|off]][,seamless-migration=[on|off]]\n" 22287b525508SMarc-André Lureau " [,gl=[on|off]][,rendernode=<file>]\n" 222927af7788SYonit Halperin " enable spice\n" 223027af7788SYonit Halperin " at least one of {port, tls-port} is mandatory\n", 223127af7788SYonit Halperin QEMU_ARCH_ALL) 22325324e3e9SMarc-André Lureau#endif 2233e2fcbf42SPeter MaydellSRST 2234e2fcbf42SPeter Maydell``-spice option[,option[,...]]`` 2235e2fcbf42SPeter Maydell Enable the spice remote desktop protocol. Valid options are 2236e2fcbf42SPeter Maydell 2237e2fcbf42SPeter Maydell ``port=<nr>`` 2238e2fcbf42SPeter Maydell Set the TCP port spice is listening on for plaintext channels. 2239e2fcbf42SPeter Maydell 2240e2fcbf42SPeter Maydell ``addr=<addr>`` 2241e2fcbf42SPeter Maydell Set the IP address spice is listening on. Default is any 2242e2fcbf42SPeter Maydell address. 2243e2fcbf42SPeter Maydell 2244a9daa36aSDaniel P. Berrangé ``ipv4=on|off``; \ ``ipv6=on|off``; \ ``unix=on|off`` 2245e2fcbf42SPeter Maydell Force using the specified IP version. 2246e2fcbf42SPeter Maydell 224799522f69SDaniel P. Berrangé ``password-secret=<secret-id>`` 224899522f69SDaniel P. Berrangé Set the ID of the ``secret`` object containing the password 224999522f69SDaniel P. Berrangé you need to authenticate. 225099522f69SDaniel P. Berrangé 2251a9daa36aSDaniel P. Berrangé ``sasl=on|off`` 2252e2fcbf42SPeter Maydell Require that the client use SASL to authenticate with the spice. 2253e2fcbf42SPeter Maydell The exact choice of authentication method used is controlled 2254e2fcbf42SPeter Maydell from the system / user's SASL configuration file for the 'qemu' 2255e2fcbf42SPeter Maydell service. This is typically found in /etc/sasl2/qemu.conf. If 2256e2fcbf42SPeter Maydell running QEMU as an unprivileged user, an environment variable 2257e2fcbf42SPeter Maydell SASL\_CONF\_PATH can be used to make it search alternate 2258e2fcbf42SPeter Maydell locations for the service config. While some SASL auth methods 2259e2fcbf42SPeter Maydell can also provide data encryption (eg GSSAPI), it is recommended 2260e2fcbf42SPeter Maydell that SASL always be combined with the 'tls' and 'x509' settings 2261e2fcbf42SPeter Maydell to enable use of SSL and server certificates. This ensures a 2262e2fcbf42SPeter Maydell data encryption preventing compromise of authentication 2263e2fcbf42SPeter Maydell credentials. 2264e2fcbf42SPeter Maydell 2265a9daa36aSDaniel P. Berrangé ``disable-ticketing=on|off`` 2266e2fcbf42SPeter Maydell Allow client connects without authentication. 2267e2fcbf42SPeter Maydell 2268a9daa36aSDaniel P. Berrangé ``disable-copy-paste=on|off`` 2269e2fcbf42SPeter Maydell Disable copy paste between the client and the guest. 2270e2fcbf42SPeter Maydell 2271a9daa36aSDaniel P. Berrangé ``disable-agent-file-xfer=on|off`` 2272e2fcbf42SPeter Maydell Disable spice-vdagent based file-xfer between the client and the 2273e2fcbf42SPeter Maydell guest. 2274e2fcbf42SPeter Maydell 2275e2fcbf42SPeter Maydell ``tls-port=<nr>`` 2276e2fcbf42SPeter Maydell Set the TCP port spice is listening on for encrypted channels. 2277e2fcbf42SPeter Maydell 2278e2fcbf42SPeter Maydell ``x509-dir=<dir>`` 2279e2fcbf42SPeter Maydell Set the x509 file directory. Expects same filenames as -vnc 2280e2fcbf42SPeter Maydell $display,x509=$dir 2281e2fcbf42SPeter Maydell 2282e2fcbf42SPeter Maydell ``x509-key-file=<file>``; \ ``x509-key-password=<file>``; \ ``x509-cert-file=<file>``; \ ``x509-cacert-file=<file>``; \ ``x509-dh-key-file=<file>`` 2283e2fcbf42SPeter Maydell The x509 file names can also be configured individually. 2284e2fcbf42SPeter Maydell 2285e2fcbf42SPeter Maydell ``tls-ciphers=<list>`` 2286e2fcbf42SPeter Maydell Specify which ciphers to use. 2287e2fcbf42SPeter Maydell 2288e2fcbf42SPeter Maydell ``tls-channel=[main|display|cursor|inputs|record|playback]``; \ ``plaintext-channel=[main|display|cursor|inputs|record|playback]`` 2289e2fcbf42SPeter Maydell Force specific channel to be used with or without TLS 2290e2fcbf42SPeter Maydell encryption. The options can be specified multiple times to 2291e2fcbf42SPeter Maydell configure multiple channels. The special name "default" can be 2292e2fcbf42SPeter Maydell used to set the default mode. For channels which are not 2293e2fcbf42SPeter Maydell explicitly forced into one mode the spice client is allowed to 2294e2fcbf42SPeter Maydell pick tls/plaintext as he pleases. 2295e2fcbf42SPeter Maydell 2296e2fcbf42SPeter Maydell ``image-compression=[auto_glz|auto_lz|quic|glz|lz|off]`` 2297e2fcbf42SPeter Maydell Configure image compression (lossless). Default is auto\_glz. 2298e2fcbf42SPeter Maydell 2299e2fcbf42SPeter Maydell ``jpeg-wan-compression=[auto|never|always]``; \ ``zlib-glz-wan-compression=[auto|never|always]`` 2300e2fcbf42SPeter Maydell Configure wan image compression (lossy for slow links). Default 2301e2fcbf42SPeter Maydell is auto. 2302e2fcbf42SPeter Maydell 2303e2fcbf42SPeter Maydell ``streaming-video=[off|all|filter]`` 2304e2fcbf42SPeter Maydell Configure video stream detection. Default is off. 2305e2fcbf42SPeter Maydell 2306e2fcbf42SPeter Maydell ``agent-mouse=[on|off]`` 2307e2fcbf42SPeter Maydell Enable/disable passing mouse events via vdagent. Default is on. 2308e2fcbf42SPeter Maydell 2309e2fcbf42SPeter Maydell ``playback-compression=[on|off]`` 2310e2fcbf42SPeter Maydell Enable/disable audio stream compression (using celt 0.5.1). 2311e2fcbf42SPeter Maydell Default is on. 2312e2fcbf42SPeter Maydell 2313e2fcbf42SPeter Maydell ``seamless-migration=[on|off]`` 2314e2fcbf42SPeter Maydell Enable/disable spice seamless migration. Default is off. 2315e2fcbf42SPeter Maydell 2316e2fcbf42SPeter Maydell ``gl=[on|off]`` 2317e2fcbf42SPeter Maydell Enable/disable OpenGL context. Default is off. 2318e2fcbf42SPeter Maydell 2319e2fcbf42SPeter Maydell ``rendernode=<file>`` 2320e2fcbf42SPeter Maydell DRM render node for OpenGL rendering. If not specified, it will 2321e2fcbf42SPeter Maydell pick the first available. (Since 2.9) 2322e2fcbf42SPeter MaydellERST 232329b0040bSGerd Hoffmann 23245824d651Sblueswir1DEF("portrait", 0, QEMU_OPTION_portrait, 2325ad96090aSBlue Swirl "-portrait rotate graphical output 90 deg left (only PXA LCD)\n", 2326ad96090aSBlue Swirl QEMU_ARCH_ALL) 2327e2fcbf42SPeter MaydellSRST 2328e2fcbf42SPeter Maydell``-portrait`` 2329e2fcbf42SPeter Maydell Rotate graphical output 90 deg left (only PXA LCD). 2330e2fcbf42SPeter MaydellERST 23315824d651Sblueswir1 23329312805dSVasily KhoruzhickDEF("rotate", HAS_ARG, QEMU_OPTION_rotate, 23339312805dSVasily Khoruzhick "-rotate <deg> rotate graphical output some deg left (only PXA LCD)\n", 23349312805dSVasily Khoruzhick QEMU_ARCH_ALL) 2335e2fcbf42SPeter MaydellSRST 2336e2fcbf42SPeter Maydell``-rotate deg`` 2337e2fcbf42SPeter Maydell Rotate graphical output some deg left (only PXA LCD). 2338e2fcbf42SPeter MaydellERST 23399312805dSVasily Khoruzhick 23405824d651Sblueswir1DEF("vga", HAS_ARG, QEMU_OPTION_vga, 2341a94f0c5cSGerd Hoffmann "-vga [std|cirrus|vmware|qxl|xenfb|tcx|cg3|virtio|none]\n" 2342ad96090aSBlue Swirl " select video card type\n", QEMU_ARCH_ALL) 2343e2fcbf42SPeter MaydellSRST 2344e2fcbf42SPeter Maydell``-vga type`` 2345e2fcbf42SPeter Maydell Select type of VGA card to emulate. Valid values for type are 2346e2fcbf42SPeter Maydell 2347e2fcbf42SPeter Maydell ``cirrus`` 2348e2fcbf42SPeter Maydell Cirrus Logic GD5446 Video card. All Windows versions starting 2349e2fcbf42SPeter Maydell from Windows 95 should recognize and use this graphic card. For 2350e2fcbf42SPeter Maydell optimal performances, use 16 bit color depth in the guest and 2351e2fcbf42SPeter Maydell the host OS. (This card was the default before QEMU 2.2) 2352e2fcbf42SPeter Maydell 2353e2fcbf42SPeter Maydell ``std`` 2354e2fcbf42SPeter Maydell Standard VGA card with Bochs VBE extensions. If your guest OS 2355e2fcbf42SPeter Maydell supports the VESA 2.0 VBE extensions (e.g. Windows XP) and if 2356e2fcbf42SPeter Maydell you want to use high resolution modes (>= 1280x1024x16) then you 2357e2fcbf42SPeter Maydell should use this option. (This card is the default since QEMU 2358e2fcbf42SPeter Maydell 2.2) 2359e2fcbf42SPeter Maydell 2360e2fcbf42SPeter Maydell ``vmware`` 2361e2fcbf42SPeter Maydell VMWare SVGA-II compatible adapter. Use it if you have 2362e2fcbf42SPeter Maydell sufficiently recent XFree86/XOrg server or Windows guest with a 2363e2fcbf42SPeter Maydell driver for this card. 2364e2fcbf42SPeter Maydell 2365e2fcbf42SPeter Maydell ``qxl`` 2366e2fcbf42SPeter Maydell QXL paravirtual graphic card. It is VGA compatible (including 2367e2fcbf42SPeter Maydell VESA 2.0 VBE support). Works best with qxl guest drivers 2368e2fcbf42SPeter Maydell installed though. Recommended choice when using the spice 2369e2fcbf42SPeter Maydell protocol. 2370e2fcbf42SPeter Maydell 2371e2fcbf42SPeter Maydell ``tcx`` 2372e2fcbf42SPeter Maydell (sun4m only) Sun TCX framebuffer. This is the default 2373e2fcbf42SPeter Maydell framebuffer for sun4m machines and offers both 8-bit and 24-bit 2374e2fcbf42SPeter Maydell colour depths at a fixed resolution of 1024x768. 2375e2fcbf42SPeter Maydell 2376e2fcbf42SPeter Maydell ``cg3`` 2377e2fcbf42SPeter Maydell (sun4m only) Sun cgthree framebuffer. This is a simple 8-bit 2378e2fcbf42SPeter Maydell framebuffer for sun4m machines available in both 1024x768 2379e2fcbf42SPeter Maydell (OpenBIOS) and 1152x900 (OBP) resolutions aimed at people 2380e2fcbf42SPeter Maydell wishing to run older Solaris versions. 2381e2fcbf42SPeter Maydell 2382e2fcbf42SPeter Maydell ``virtio`` 2383e2fcbf42SPeter Maydell Virtio VGA card. 2384e2fcbf42SPeter Maydell 2385e2fcbf42SPeter Maydell ``none`` 2386e2fcbf42SPeter Maydell Disable VGA card. 2387e2fcbf42SPeter MaydellERST 23885824d651Sblueswir1 23895824d651Sblueswir1DEF("full-screen", 0, QEMU_OPTION_full_screen, 2390ad96090aSBlue Swirl "-full-screen start in full screen\n", QEMU_ARCH_ALL) 2391e2fcbf42SPeter MaydellSRST 2392e2fcbf42SPeter Maydell``-full-screen`` 2393e2fcbf42SPeter Maydell Start in full screen. 2394e2fcbf42SPeter MaydellERST 23955824d651Sblueswir1 239660f9a4efSJohn SnowDEF("g", HAS_ARG, QEMU_OPTION_g , 2397ad96090aSBlue Swirl "-g WxH[xDEPTH] Set the initial graphical resolution and depth\n", 23988ac919a0SLaurent Vivier QEMU_ARCH_PPC | QEMU_ARCH_SPARC | QEMU_ARCH_M68K) 2399e2fcbf42SPeter MaydellSRST 240009ce5f2dSPeter Maydell``-g`` *width*\ ``x``\ *height*\ ``[x``\ *depth*\ ``]`` 2401e2fcbf42SPeter Maydell Set the initial graphical resolution and depth (PPC, SPARC only). 2402e2fcbf42SPeter Maydell 2403e2fcbf42SPeter Maydell For PPC the default is 800x600x32. 2404e2fcbf42SPeter Maydell 2405e2fcbf42SPeter Maydell For SPARC with the TCX graphics device, the default is 1024x768x8 2406e2fcbf42SPeter Maydell with the option of 1024x768x24. For cgthree, the default is 2407e2fcbf42SPeter Maydell 1024x768x8 with the option of 1152x900x8 for people who wish to use 2408e2fcbf42SPeter Maydell OBP. 2409e2fcbf42SPeter MaydellERST 24105824d651Sblueswir1 24115824d651Sblueswir1DEF("vnc", HAS_ARG, QEMU_OPTION_vnc , 2412f04ec5afSRobert Ho "-vnc <display> shorthand for -display vnc=<display>\n", QEMU_ARCH_ALL) 2413e2fcbf42SPeter MaydellSRST 2414e2fcbf42SPeter Maydell``-vnc display[,option[,option[,...]]]`` 2415e2fcbf42SPeter Maydell Normally, if QEMU is compiled with graphical window support, it 2416e2fcbf42SPeter Maydell displays output such as guest graphics, guest console, and the QEMU 2417e2fcbf42SPeter Maydell monitor in a window. With this option, you can have QEMU listen on 2418e2fcbf42SPeter Maydell VNC display display and redirect the VGA display over the VNC 2419e2fcbf42SPeter Maydell session. It is very useful to enable the usb tablet device when 2420e2fcbf42SPeter Maydell using this option (option ``-device usb-tablet``). When using the 2421e2fcbf42SPeter Maydell VNC display, you must use the ``-k`` parameter to set the keyboard 2422e2fcbf42SPeter Maydell layout if you are not using en-us. Valid syntax for the display is 2423e2fcbf42SPeter Maydell 2424e2fcbf42SPeter Maydell ``to=L`` 2425e2fcbf42SPeter Maydell With this option, QEMU will try next available VNC displays, 2426e2fcbf42SPeter Maydell until the number L, if the origianlly defined "-vnc display" is 2427e2fcbf42SPeter Maydell not available, e.g. port 5900+display is already used by another 2428e2fcbf42SPeter Maydell application. By default, to=0. 2429e2fcbf42SPeter Maydell 2430e2fcbf42SPeter Maydell ``host:d`` 2431e2fcbf42SPeter Maydell TCP connections will only be allowed from host on display d. By 2432e2fcbf42SPeter Maydell convention the TCP port is 5900+d. Optionally, host can be 2433e2fcbf42SPeter Maydell omitted in which case the server will accept connections from 2434e2fcbf42SPeter Maydell any host. 2435e2fcbf42SPeter Maydell 2436e2fcbf42SPeter Maydell ``unix:path`` 2437e2fcbf42SPeter Maydell Connections will be allowed over UNIX domain sockets where path 2438e2fcbf42SPeter Maydell is the location of a unix socket to listen for connections on. 2439e2fcbf42SPeter Maydell 2440e2fcbf42SPeter Maydell ``none`` 2441e2fcbf42SPeter Maydell VNC is initialized but not started. The monitor ``change`` 2442e2fcbf42SPeter Maydell command can be used to later start the VNC server. 2443e2fcbf42SPeter Maydell 2444e2fcbf42SPeter Maydell Following the display value there may be one or more option flags 2445e2fcbf42SPeter Maydell separated by commas. Valid options are 2446e2fcbf42SPeter Maydell 244782a17d1dSDaniel P. Berrangé ``reverse=on|off`` 2448e2fcbf42SPeter Maydell Connect to a listening VNC client via a "reverse" connection. 2449e2fcbf42SPeter Maydell The client is specified by the display. For reverse network 2450e2fcbf42SPeter Maydell connections (host:d,``reverse``), the d argument is a TCP port 2451e2fcbf42SPeter Maydell number, not a display number. 2452e2fcbf42SPeter Maydell 245382a17d1dSDaniel P. Berrangé ``websocket=on|off`` 2454e2fcbf42SPeter Maydell Opens an additional TCP listening port dedicated to VNC 2455e2fcbf42SPeter Maydell Websocket connections. If a bare websocket option is given, the 2456e2fcbf42SPeter Maydell Websocket port is 5700+display. An alternative port can be 2457e2fcbf42SPeter Maydell specified with the syntax ``websocket``\ =port. 2458e2fcbf42SPeter Maydell 2459e2fcbf42SPeter Maydell If host is specified connections will only be allowed from this 2460e2fcbf42SPeter Maydell host. It is possible to control the websocket listen address 2461e2fcbf42SPeter Maydell independently, using the syntax ``websocket``\ =host:port. 2462e2fcbf42SPeter Maydell 2463e2fcbf42SPeter Maydell If no TLS credentials are provided, the websocket connection 2464e2fcbf42SPeter Maydell runs in unencrypted mode. If TLS credentials are provided, the 2465e2fcbf42SPeter Maydell websocket connection requires encrypted client connections. 2466e2fcbf42SPeter Maydell 246782a17d1dSDaniel P. Berrangé ``password=on|off`` 2468e2fcbf42SPeter Maydell Require that password based authentication is used for client 2469e2fcbf42SPeter Maydell connections. 2470e2fcbf42SPeter Maydell 2471e2fcbf42SPeter Maydell The password must be set separately using the ``set_password`` 2472923e9311SThomas Huth command in the :ref:`QEMU monitor`. The 2473e2fcbf42SPeter Maydell syntax to change your password is: 2474e2fcbf42SPeter Maydell ``set_password <protocol> <password>`` where <protocol> could be 2475e2fcbf42SPeter Maydell either "vnc" or "spice". 2476e2fcbf42SPeter Maydell 2477e2fcbf42SPeter Maydell If you would like to change <protocol> password expiration, you 2478e2fcbf42SPeter Maydell should use ``expire_password <protocol> <expiration-time>`` 2479e2fcbf42SPeter Maydell where expiration time could be one of the following options: 2480e2fcbf42SPeter Maydell now, never, +seconds or UNIX time of expiration, e.g. +60 to 2481e2fcbf42SPeter Maydell make password expire in 60 seconds, or 1335196800 to make 2482e2fcbf42SPeter Maydell password expire on "Mon Apr 23 12:00:00 EDT 2012" (UNIX time for 2483e2fcbf42SPeter Maydell this date and time). 2484e2fcbf42SPeter Maydell 2485e2fcbf42SPeter Maydell You can also use keywords "now" or "never" for the expiration 2486e2fcbf42SPeter Maydell time to allow <protocol> password to expire immediately or never 2487e2fcbf42SPeter Maydell expire. 2488e2fcbf42SPeter Maydell 24896c6840e9SDaniel P. Berrangé ``password-secret=<secret-id>`` 24906c6840e9SDaniel P. Berrangé Require that password based authentication is used for client 24916c6840e9SDaniel P. Berrangé connections, using the password provided by the ``secret`` 24926c6840e9SDaniel P. Berrangé object identified by ``secret-id``. 24936c6840e9SDaniel P. Berrangé 2494e2fcbf42SPeter Maydell ``tls-creds=ID`` 2495e2fcbf42SPeter Maydell Provides the ID of a set of TLS credentials to use to secure the 2496e2fcbf42SPeter Maydell VNC server. They will apply to both the normal VNC server socket 2497e2fcbf42SPeter Maydell and the websocket socket (if enabled). Setting TLS credentials 2498e2fcbf42SPeter Maydell will cause the VNC server socket to enable the VeNCrypt auth 2499e2fcbf42SPeter Maydell mechanism. The credentials should have been previously created 2500e2fcbf42SPeter Maydell using the ``-object tls-creds`` argument. 2501e2fcbf42SPeter Maydell 2502e2fcbf42SPeter Maydell ``tls-authz=ID`` 2503e2fcbf42SPeter Maydell Provides the ID of the QAuthZ authorization object against which 2504e2fcbf42SPeter Maydell the client's x509 distinguished name will validated. This object 2505e2fcbf42SPeter Maydell is only resolved at time of use, so can be deleted and recreated 2506e2fcbf42SPeter Maydell on the fly while the VNC server is active. If missing, it will 2507e2fcbf42SPeter Maydell default to denying access. 2508e2fcbf42SPeter Maydell 250982a17d1dSDaniel P. Berrangé ``sasl=on|off`` 2510e2fcbf42SPeter Maydell Require that the client use SASL to authenticate with the VNC 2511e2fcbf42SPeter Maydell server. The exact choice of authentication method used is 2512e2fcbf42SPeter Maydell controlled from the system / user's SASL configuration file for 2513e2fcbf42SPeter Maydell the 'qemu' service. This is typically found in 2514e2fcbf42SPeter Maydell /etc/sasl2/qemu.conf. If running QEMU as an unprivileged user, 2515e2fcbf42SPeter Maydell an environment variable SASL\_CONF\_PATH can be used to make it 2516e2fcbf42SPeter Maydell search alternate locations for the service config. While some 2517e2fcbf42SPeter Maydell SASL auth methods can also provide data encryption (eg GSSAPI), 2518e2fcbf42SPeter Maydell it is recommended that SASL always be combined with the 'tls' 2519e2fcbf42SPeter Maydell and 'x509' settings to enable use of SSL and server 2520e2fcbf42SPeter Maydell certificates. This ensures a data encryption preventing 2521e2fcbf42SPeter Maydell compromise of authentication credentials. See the 2522923e9311SThomas Huth :ref:`VNC security` section in the System Emulation Users Guide 2523923e9311SThomas Huth for details on using SASL authentication. 2524e2fcbf42SPeter Maydell 2525e2fcbf42SPeter Maydell ``sasl-authz=ID`` 2526e2fcbf42SPeter Maydell Provides the ID of the QAuthZ authorization object against which 2527e2fcbf42SPeter Maydell the client's SASL username will validated. This object is only 2528e2fcbf42SPeter Maydell resolved at time of use, so can be deleted and recreated on the 2529e2fcbf42SPeter Maydell fly while the VNC server is active. If missing, it will default 2530e2fcbf42SPeter Maydell to denying access. 2531e2fcbf42SPeter Maydell 253282a17d1dSDaniel P. Berrangé ``acl=on|off`` 2533e2fcbf42SPeter Maydell Legacy method for enabling authorization of clients against the 2534e2fcbf42SPeter Maydell x509 distinguished name and SASL username. It results in the 2535e2fcbf42SPeter Maydell creation of two ``authz-list`` objects with IDs of 2536e2fcbf42SPeter Maydell ``vnc.username`` and ``vnc.x509dname``. The rules for these 2537e2fcbf42SPeter Maydell objects must be configured with the HMP ACL commands. 2538e2fcbf42SPeter Maydell 2539e2fcbf42SPeter Maydell This option is deprecated and should no longer be used. The new 2540e2fcbf42SPeter Maydell ``sasl-authz`` and ``tls-authz`` options are a replacement. 2541e2fcbf42SPeter Maydell 254282a17d1dSDaniel P. Berrangé ``lossy=on|off`` 2543e2fcbf42SPeter Maydell Enable lossy compression methods (gradient, JPEG, ...). If this 2544e2fcbf42SPeter Maydell option is set, VNC client may receive lossy framebuffer updates 2545e2fcbf42SPeter Maydell depending on its encoding settings. Enabling this option can 2546e2fcbf42SPeter Maydell save a lot of bandwidth at the expense of quality. 2547e2fcbf42SPeter Maydell 254882a17d1dSDaniel P. Berrangé ``non-adaptive=on|off`` 2549e2fcbf42SPeter Maydell Disable adaptive encodings. Adaptive encodings are enabled by 2550e2fcbf42SPeter Maydell default. An adaptive encoding will try to detect frequently 2551e2fcbf42SPeter Maydell updated screen regions, and send updates in these regions using 2552e2fcbf42SPeter Maydell a lossy encoding (like JPEG). This can be really helpful to save 2553e2fcbf42SPeter Maydell bandwidth when playing videos. Disabling adaptive encodings 2554e2fcbf42SPeter Maydell restores the original static behavior of encodings like Tight. 2555e2fcbf42SPeter Maydell 2556e2fcbf42SPeter Maydell ``share=[allow-exclusive|force-shared|ignore]`` 2557e2fcbf42SPeter Maydell Set display sharing policy. 'allow-exclusive' allows clients to 2558e2fcbf42SPeter Maydell ask for exclusive access. As suggested by the rfb spec this is 2559e2fcbf42SPeter Maydell implemented by dropping other connections. Connecting multiple 2560e2fcbf42SPeter Maydell clients in parallel requires all clients asking for a shared 2561e2fcbf42SPeter Maydell session (vncviewer: -shared switch). This is the default. 2562e2fcbf42SPeter Maydell 'force-shared' disables exclusive client access. Useful for 2563e2fcbf42SPeter Maydell shared desktop sessions, where you don't want someone forgetting 2564e2fcbf42SPeter Maydell specify -shared disconnect everybody else. 'ignore' completely 2565e2fcbf42SPeter Maydell ignores the shared flag and allows everybody connect 2566e2fcbf42SPeter Maydell unconditionally. Doesn't conform to the rfb spec but is 2567e2fcbf42SPeter Maydell traditional QEMU behavior. 2568e2fcbf42SPeter Maydell 2569e2fcbf42SPeter Maydell ``key-delay-ms`` 2570e2fcbf42SPeter Maydell Set keyboard delay, for key down and key up events, in 2571e2fcbf42SPeter Maydell milliseconds. Default is 10. Keyboards are low-bandwidth 2572e2fcbf42SPeter Maydell devices, so this slowdown can help the device and guest to keep 2573e2fcbf42SPeter Maydell up and not lose events in case events are arriving in bulk. 2574e2fcbf42SPeter Maydell Possible causes for the latter are flaky network connections, or 2575e2fcbf42SPeter Maydell scripts for automated testing. 2576e2fcbf42SPeter Maydell 2577e2fcbf42SPeter Maydell ``audiodev=audiodev`` 2578e2fcbf42SPeter Maydell Use the specified audiodev when the VNC client requests audio 2579e2fcbf42SPeter Maydell transmission. When not using an -audiodev argument, this option 2580e2fcbf42SPeter Maydell must be omitted, otherwise is must be present and specify a 2581e2fcbf42SPeter Maydell valid audiodev. 25827b5fa0b5SDaniel P. Berrangé 258382a17d1dSDaniel P. Berrangé ``power-control=on|off`` 25847b5fa0b5SDaniel P. Berrangé Permit the remote client to issue shutdown, reboot or reset power 25857b5fa0b5SDaniel P. Berrangé control requests. 2586e2fcbf42SPeter MaydellERST 25875824d651Sblueswir1 2588a3adb7adSMichael EllermanARCHHEADING(, QEMU_ARCH_I386) 25895824d651Sblueswir1 2590de6b4f90SMarkus ArmbrusterARCHHEADING(i386 target only:, QEMU_ARCH_I386) 25915824d651Sblueswir1 25925824d651Sblueswir1DEF("win2k-hack", 0, QEMU_OPTION_win2k_hack, 2593ad96090aSBlue Swirl "-win2k-hack use it when installing Windows 2000 to avoid a disk full bug\n", 2594ad96090aSBlue Swirl QEMU_ARCH_I386) 2595e2fcbf42SPeter MaydellSRST 2596e2fcbf42SPeter Maydell``-win2k-hack`` 2597e2fcbf42SPeter Maydell Use it when installing Windows 2000 to avoid a disk full bug. After 2598e2fcbf42SPeter Maydell Windows 2000 is installed, you no longer need this option (this 2599e2fcbf42SPeter Maydell option slows down the IDE transfers). 2600e2fcbf42SPeter MaydellERST 26015824d651Sblueswir1 26025824d651Sblueswir1DEF("no-fd-bootchk", 0, QEMU_OPTION_no_fd_bootchk, 2603ad96090aSBlue Swirl "-no-fd-bootchk disable boot signature checking for floppy disks\n", 2604ad96090aSBlue Swirl QEMU_ARCH_I386) 2605e2fcbf42SPeter MaydellSRST 2606e2fcbf42SPeter Maydell``-no-fd-bootchk`` 2607e2fcbf42SPeter Maydell Disable boot signature checking for floppy disks in BIOS. May be 2608e2fcbf42SPeter Maydell needed to boot from old floppy disks. 2609e2fcbf42SPeter MaydellERST 26105824d651Sblueswir1 26115824d651Sblueswir1DEF("no-acpi", 0, QEMU_OPTION_no_acpi, 2612f5d8c8cdSShannon Zhao "-no-acpi disable ACPI\n", QEMU_ARCH_I386 | QEMU_ARCH_ARM) 2613e2fcbf42SPeter MaydellSRST 2614e2fcbf42SPeter Maydell``-no-acpi`` 2615e2fcbf42SPeter Maydell Disable ACPI (Advanced Configuration and Power Interface) support. 2616e2fcbf42SPeter Maydell Use it if your guest OS complains about ACPI problems (PC target 2617e2fcbf42SPeter Maydell machine only). 2618e2fcbf42SPeter MaydellERST 26195824d651Sblueswir1 26205824d651Sblueswir1DEF("no-hpet", 0, QEMU_OPTION_no_hpet, 2621ad96090aSBlue Swirl "-no-hpet disable HPET\n", QEMU_ARCH_I386) 2622e2fcbf42SPeter MaydellSRST 2623e2fcbf42SPeter Maydell``-no-hpet`` 2624df37330cSThomas Huth Disable HPET support. Deprecated, use '-machine hpet=off' instead. 2625e2fcbf42SPeter MaydellERST 26265824d651Sblueswir1 26275824d651Sblueswir1DEF("acpitable", HAS_ARG, QEMU_OPTION_acpitable, 2628104bf02eSMichael 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" 2629ad96090aSBlue Swirl " ACPI table description\n", QEMU_ARCH_I386) 2630e2fcbf42SPeter MaydellSRST 2631e2fcbf42SPeter 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]...]`` 2632e2fcbf42SPeter Maydell Add ACPI table with specified header fields and context from 2633e2fcbf42SPeter Maydell specified files. For file=, take whole ACPI table from the specified 2634e2fcbf42SPeter Maydell files, including all ACPI headers (possible overridden by other 2635e2fcbf42SPeter Maydell options). For data=, only data portion of the table is used, all 2636e2fcbf42SPeter Maydell header information is specified in the command line. If a SLIC table 2637e2fcbf42SPeter Maydell is supplied to QEMU, then the SLIC's oem\_id and oem\_table\_id 2638e2fcbf42SPeter Maydell fields will override the same in the RSDT and the FADT (a.k.a. 2639e2fcbf42SPeter Maydell FACP), in order to ensure the field matches required by the 2640e2fcbf42SPeter Maydell Microsoft SLIC spec and the ACPI spec. 2641e2fcbf42SPeter MaydellERST 26425824d651Sblueswir1 2643b6f6e3d3SaliguoriDEF("smbios", HAS_ARG, QEMU_OPTION_smbios, 2644b6f6e3d3Saliguori "-smbios file=binary\n" 2645ca1a8a06SBruce Rogers " load SMBIOS entry from binary file\n" 2646b155eb1dSGabriel L. Somlo "-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]\n" 2647b155eb1dSGabriel L. Somlo " [,uefi=on|off]\n" 2648ca1a8a06SBruce Rogers " specify SMBIOS type 0 fields\n" 2649b6f6e3d3Saliguori "-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]\n" 2650b6f6e3d3Saliguori " [,uuid=uuid][,sku=str][,family=str]\n" 2651b155eb1dSGabriel L. Somlo " specify SMBIOS type 1 fields\n" 2652b155eb1dSGabriel L. Somlo "-smbios type=2[,manufacturer=str][,product=str][,version=str][,serial=str]\n" 2653b155eb1dSGabriel L. Somlo " [,asset=str][,location=str]\n" 2654b155eb1dSGabriel L. Somlo " specify SMBIOS type 2 fields\n" 2655b155eb1dSGabriel L. Somlo "-smbios type=3[,manufacturer=str][,version=str][,serial=str][,asset=str]\n" 2656b155eb1dSGabriel L. Somlo " [,sku=str]\n" 2657b155eb1dSGabriel L. Somlo " specify SMBIOS type 3 fields\n" 2658b155eb1dSGabriel L. Somlo "-smbios type=4[,sock_pfx=str][,manufacturer=str][,version=str][,serial=str]\n" 2659c906e039SYing Fang " [,asset=str][,part=str][,max-speed=%d][,current-speed=%d]\n" 2660cb5fb04fSPatrick Venture " [,processor-id=%d]\n" 2661b155eb1dSGabriel L. Somlo " specify SMBIOS type 4 fields\n" 2662fd8caa25SHal Martin "-smbios type=8[,external_reference=str][,internal_reference=str][,connector_type=%d][,port_type=%d]\n" 2663fd8caa25SHal Martin " specify SMBIOS type 8 fields\n" 266448a7ff4dSDaniel P. Berrangé "-smbios type=11[,value=str][,path=filename]\n" 266548a7ff4dSDaniel P. Berrangé " specify SMBIOS type 11 fields\n" 2666b155eb1dSGabriel L. Somlo "-smbios type=17[,loc_pfx=str][,bank=str][,manufacturer=str][,serial=str]\n" 26673ebd6cc8SGabriel L. Somlo " [,asset=str][,part=str][,speed=%d]\n" 266805dfb447SVincent Bernat " specify SMBIOS type 17 fields\n" 266905dfb447SVincent Bernat "-smbios type=41[,designation=str][,kind=str][,instance=%d][,pcidev=str]\n" 267005dfb447SVincent Bernat " specify SMBIOS type 41 fields\n", 26714934cc58SSong Gao QEMU_ARCH_I386 | QEMU_ARCH_ARM | QEMU_ARCH_LOONGARCH) 2672e2fcbf42SPeter MaydellSRST 2673e2fcbf42SPeter Maydell``-smbios file=binary`` 2674e2fcbf42SPeter Maydell Load SMBIOS entry from binary file. 2675e2fcbf42SPeter Maydell 2676e2fcbf42SPeter Maydell``-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d][,uefi=on|off]`` 2677e2fcbf42SPeter Maydell Specify SMBIOS type 0 fields 2678e2fcbf42SPeter Maydell 2679e2fcbf42SPeter Maydell``-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str][,uuid=uuid][,sku=str][,family=str]`` 2680e2fcbf42SPeter Maydell Specify SMBIOS type 1 fields 2681e2fcbf42SPeter Maydell 2682e2fcbf42SPeter Maydell``-smbios type=2[,manufacturer=str][,product=str][,version=str][,serial=str][,asset=str][,location=str]`` 2683e2fcbf42SPeter Maydell Specify SMBIOS type 2 fields 2684e2fcbf42SPeter Maydell 2685e2fcbf42SPeter Maydell``-smbios type=3[,manufacturer=str][,version=str][,serial=str][,asset=str][,sku=str]`` 2686e2fcbf42SPeter Maydell Specify SMBIOS type 3 fields 2687e2fcbf42SPeter Maydell 2688cb5fb04fSPatrick Venture``-smbios type=4[,sock_pfx=str][,manufacturer=str][,version=str][,serial=str][,asset=str][,part=str][,processor-id=%d]`` 2689e2fcbf42SPeter Maydell Specify SMBIOS type 4 fields 2690e2fcbf42SPeter Maydell 269148a7ff4dSDaniel P. Berrangé``-smbios type=11[,value=str][,path=filename]`` 269248a7ff4dSDaniel P. Berrangé Specify SMBIOS type 11 fields 269348a7ff4dSDaniel P. Berrangé 269448a7ff4dSDaniel P. Berrangé This argument can be repeated multiple times, and values are added in the order they are parsed. 269548a7ff4dSDaniel P. Berrangé Applications intending to use OEM strings data are encouraged to use their application name as 269648a7ff4dSDaniel P. Berrangé a prefix for the value string. This facilitates passing information for multiple applications 269748a7ff4dSDaniel P. Berrangé concurrently. 269848a7ff4dSDaniel P. Berrangé 269948a7ff4dSDaniel P. Berrangé The ``value=str`` syntax provides the string data inline, while the ``path=filename`` syntax 270048a7ff4dSDaniel P. Berrangé loads data from a file on disk. Note that the file is not permitted to contain any NUL bytes. 270148a7ff4dSDaniel P. Berrangé 270248a7ff4dSDaniel P. Berrangé Both the ``value`` and ``path`` options can be repeated multiple times and will be added to 270348a7ff4dSDaniel P. Berrangé the SMBIOS table in the order in which they appear. 270448a7ff4dSDaniel P. Berrangé 270548a7ff4dSDaniel P. Berrangé Note that on the x86 architecture, the total size of all SMBIOS tables is limited to 65535 270648a7ff4dSDaniel P. Berrangé bytes. Thus the OEM strings data is not suitable for passing large amounts of data into the 270748a7ff4dSDaniel P. Berrangé guest. Instead it should be used as a indicator to inform the guest where to locate the real 270848a7ff4dSDaniel P. Berrangé data set, for example, by specifying the serial ID of a block device. 270948a7ff4dSDaniel P. Berrangé 271048a7ff4dSDaniel P. Berrangé An example passing three strings is 271148a7ff4dSDaniel P. Berrangé 271248a7ff4dSDaniel P. Berrangé .. parsed-literal:: 271348a7ff4dSDaniel P. Berrangé 271448a7ff4dSDaniel P. Berrangé -smbios type=11,value=cloud-init:ds=nocloud-net;s=http://10.10.0.1:8000/,\\ 271548a7ff4dSDaniel P. Berrangé value=anaconda:method=http://dl.fedoraproject.org/pub/fedora/linux/releases/25/x86_64/os,\\ 271648a7ff4dSDaniel P. Berrangé path=/some/file/with/oemstringsdata.txt 271748a7ff4dSDaniel P. Berrangé 271848a7ff4dSDaniel P. Berrangé In the guest OS this is visible with the ``dmidecode`` command 271948a7ff4dSDaniel P. Berrangé 272048a7ff4dSDaniel P. Berrangé .. parsed-literal:: 272148a7ff4dSDaniel P. Berrangé 272248a7ff4dSDaniel P. Berrangé $ dmidecode -t 11 272348a7ff4dSDaniel P. Berrangé Handle 0x0E00, DMI type 11, 5 bytes 272448a7ff4dSDaniel P. Berrangé OEM Strings 272548a7ff4dSDaniel P. Berrangé String 1: cloud-init:ds=nocloud-net;s=http://10.10.0.1:8000/ 272648a7ff4dSDaniel P. Berrangé String 2: anaconda:method=http://dl.fedoraproject.org/pub/fedora/linux/releases/25/x86_64/os 272748a7ff4dSDaniel P. Berrangé String 3: myapp:some extra data 272848a7ff4dSDaniel P. Berrangé 272948a7ff4dSDaniel P. Berrangé 2730e2fcbf42SPeter Maydell``-smbios type=17[,loc_pfx=str][,bank=str][,manufacturer=str][,serial=str][,asset=str][,part=str][,speed=%d]`` 2731e2fcbf42SPeter Maydell Specify SMBIOS type 17 fields 273205dfb447SVincent Bernat 273305dfb447SVincent Bernat``-smbios type=41[,designation=str][,kind=str][,instance=%d][,pcidev=str]`` 273405dfb447SVincent Bernat Specify SMBIOS type 41 fields 273505dfb447SVincent Bernat 273605dfb447SVincent Bernat This argument can be repeated multiple times. Its main use is to allow network interfaces be created 273705dfb447SVincent Bernat as ``enoX`` on Linux, with X being the instance number, instead of the name depending on the interface 273805dfb447SVincent Bernat position on the PCI bus. 273905dfb447SVincent Bernat 274005dfb447SVincent Bernat Here is an example of use: 274105dfb447SVincent Bernat 274205dfb447SVincent Bernat .. parsed-literal:: 274305dfb447SVincent Bernat 274405dfb447SVincent Bernat -netdev user,id=internet \\ 274505dfb447SVincent Bernat -device virtio-net-pci,mac=50:54:00:00:00:42,netdev=internet,id=internet-dev \\ 274605dfb447SVincent Bernat -smbios type=41,designation='Onboard LAN',instance=1,kind=ethernet,pcidev=internet-dev 274705dfb447SVincent Bernat 274805dfb447SVincent Bernat In the guest OS, the device should then appear as ``eno1``: 274905dfb447SVincent Bernat 275005dfb447SVincent Bernat ..parsed-literal:: 275105dfb447SVincent Bernat 275205dfb447SVincent Bernat $ ip -brief l 275305dfb447SVincent Bernat lo UNKNOWN 00:00:00:00:00:00 <LOOPBACK,UP,LOWER_UP> 275405dfb447SVincent Bernat eno1 UP 50:54:00:00:00:42 <BROADCAST,MULTICAST,UP,LOWER_UP> 275505dfb447SVincent Bernat 275605dfb447SVincent Bernat Currently, the PCI device has to be attached to the root bus. 275705dfb447SVincent Bernat 2758e2fcbf42SPeter MaydellERST 2759b6f6e3d3Saliguori 2760c70a01e4SMarkus ArmbrusterDEFHEADING() 27615824d651Sblueswir1 2762de6b4f90SMarkus ArmbrusterDEFHEADING(Network options:) 27635824d651Sblueswir1 27646a8b4a5bSThomas HuthDEF("netdev", HAS_ARG, QEMU_OPTION_netdev, 27655824d651Sblueswir1#ifdef CONFIG_SLIRP 27668b0dc246SDaniel P. Berrangé "-netdev user,id=str[,ipv4=on|off][,net=addr[/mask]][,host=addr]\n" 27678b0dc246SDaniel P. Berrangé " [,ipv6=on|off][,ipv6-net=addr[/int]][,ipv6-host=addr]\n" 27680b11c036SSamuel Thibault " [,restrict=on|off][,hostname=host][,dhcpstart=addr]\n" 2769f18d1375SBenjamin Drung " [,dns=addr][,ipv6-dns=addr][,dnssearch=domain][,domainname=domain]\n" 27700fca92b9SFam Zheng " [,tftp=dir][,tftp-server-name=name][,bootfile=f][,hostfwd=rule][,guestfwd=rule]" 2771ad196a9dSJan Kiszka#ifndef _WIN32 2772c92ef6a2SJan Kiszka "[,smb=dir[,smbserver=addr]]\n" 2773ad196a9dSJan Kiszka#endif 27746a8b4a5bSThomas Huth " configure a user mode network backend with ID 'str',\n" 27756a8b4a5bSThomas Huth " its DHCP server and optional services\n" 27765824d651Sblueswir1#endif 27775824d651Sblueswir1#ifdef _WIN32 27786a8b4a5bSThomas Huth "-netdev tap,id=str,ifname=name\n" 27796a8b4a5bSThomas Huth " configure a host TAP network backend with ID 'str'\n" 27805824d651Sblueswir1#else 27816a8b4a5bSThomas Huth "-netdev tap,id=str[,fd=h][,fds=x:y:...:z][,ifname=name][,script=file][,downscript=dfile]\n" 2782584613eaSAlexey Kardashevskiy " [,br=bridge][,helper=helper][,sndbuf=nbytes][,vnet_hdr=on|off][,vhost=on|off]\n" 27836a8b4a5bSThomas Huth " [,vhostfd=h][,vhostfds=x:y:...:z][,vhostforce=on|off][,queues=n]\n" 278469e87b32SJason Wang " [,poll-us=n]\n" 27856a8b4a5bSThomas Huth " configure a host TAP network backend with ID 'str'\n" 2786584613eaSAlexey Kardashevskiy " connected to a bridge (default=" DEFAULT_BRIDGE_INTERFACE ")\n" 2787a7c36ee4SCorey Bryant " use network scripts 'file' (default=" DEFAULT_NETWORK_SCRIPT ")\n" 2788a7c36ee4SCorey Bryant " to configure it and 'dfile' (default=" DEFAULT_NETWORK_DOWN_SCRIPT ")\n" 2789a7c36ee4SCorey Bryant " to deconfigure it\n" 2790ca1a8a06SBruce Rogers " use '[down]script=no' to disable script execution\n" 2791a7c36ee4SCorey Bryant " use network helper 'helper' (default=" DEFAULT_BRIDGE_HELPER ") to\n" 2792a7c36ee4SCorey Bryant " configure it\n" 27935824d651Sblueswir1 " use 'fd=h' to connect to an already opened TAP interface\n" 27942ca81baaSJason Wang " use 'fds=x:y:...:z' to connect to already opened multiqueue capable TAP interfaces\n" 2795ca1a8a06SBruce Rogers " use 'sndbuf=nbytes' to limit the size of the send buffer (the\n" 2796f157ed20SMichael S. Tsirkin " default is disabled 'sndbuf=0' to enable flow control set 'sndbuf=1048576')\n" 2797ca1a8a06SBruce Rogers " use vnet_hdr=off to avoid enabling the IFF_VNET_HDR tap flag\n" 2798ca1a8a06SBruce Rogers " use vnet_hdr=on to make the lack of IFF_VNET_HDR support an error condition\n" 279982b0d80eSMichael S. Tsirkin " use vhost=on to enable experimental in kernel accelerator\n" 28005430a28fSmst@redhat.com " (only has effect for virtio guests which use MSIX)\n" 28015430a28fSmst@redhat.com " use vhostforce=on to force vhost on for non-MSIX virtio guests\n" 280282b0d80eSMichael S. Tsirkin " use 'vhostfd=h' to connect to an already opened vhost net device\n" 28032ca81baaSJason Wang " use 'vhostfds=x:y:...:z to connect to multiple already opened vhost net devices\n" 2804ec396014SJason Wang " use 'queues=n' to specify the number of queues to be created for multiqueue TAP\n" 2805cba42d61SMichael Tokarev " use 'poll-us=n' to specify the maximum number of microseconds that could be\n" 280669e87b32SJason Wang " spent on busy polling for vhost net\n" 28076a8b4a5bSThomas Huth "-netdev bridge,id=str[,br=bridge][,helper=helper]\n" 28086a8b4a5bSThomas Huth " configure a host TAP network backend with ID 'str' that is\n" 28096a8b4a5bSThomas Huth " connected to a bridge (default=" DEFAULT_BRIDGE_INTERFACE ")\n" 28106a8b4a5bSThomas Huth " using the program 'helper (default=" DEFAULT_BRIDGE_HELPER ")\n" 28110df0ff6dSMark McLoughlin#endif 28123fb69aa1SAnton Ivanov#ifdef __linux__ 28136a8b4a5bSThomas Huth "-netdev l2tpv3,id=str,src=srcaddr,dst=dstaddr[,srcport=srcport][,dstport=dstport]\n" 28148b0dc246SDaniel P. Berrangé " [,rxsession=rxsession],txsession=txsession[,ipv6=on|off][,udp=on|off]\n" 28158b0dc246SDaniel P. Berrangé " [,cookie64=on|off][,counter][,pincounter][,txcookie=txcookie]\n" 28166a8b4a5bSThomas Huth " [,rxcookie=rxcookie][,offset=offset]\n" 28176a8b4a5bSThomas Huth " configure a network backend with ID 'str' connected to\n" 28186a8b4a5bSThomas Huth " an Ethernet over L2TPv3 pseudowire.\n" 28193fb69aa1SAnton Ivanov " Linux kernel 3.3+ as well as most routers can talk\n" 28202f47b403SMichael Tokarev " L2TPv3. This transport allows connecting a VM to a VM,\n" 28213fb69aa1SAnton Ivanov " VM to a router and even VM to Host. It is a nearly-universal\n" 282221843dc4SStefan Hajnoczi " standard (RFC3931). Note - this implementation uses static\n" 28233fb69aa1SAnton Ivanov " pre-configured tunnels (same as the Linux kernel).\n" 28243fb69aa1SAnton Ivanov " use 'src=' to specify source address\n" 28253fb69aa1SAnton Ivanov " use 'dst=' to specify destination address\n" 28263fb69aa1SAnton Ivanov " use 'udp=on' to specify udp encapsulation\n" 28273952651aSGonglei " use 'srcport=' to specify source udp port\n" 28283fb69aa1SAnton Ivanov " use 'dstport=' to specify destination udp port\n" 28293fb69aa1SAnton Ivanov " use 'ipv6=on' to force v6\n" 28303fb69aa1SAnton Ivanov " L2TPv3 uses cookies to prevent misconfiguration as\n" 28313fb69aa1SAnton Ivanov " well as a weak security measure\n" 28323fb69aa1SAnton Ivanov " use 'rxcookie=0x012345678' to specify a rxcookie\n" 28333fb69aa1SAnton Ivanov " use 'txcookie=0x012345678' to specify a txcookie\n" 28343fb69aa1SAnton Ivanov " use 'cookie64=on' to set cookie size to 64 bit, otherwise 32\n" 28353fb69aa1SAnton Ivanov " use 'counter=off' to force a 'cut-down' L2TPv3 with no counter\n" 28363fb69aa1SAnton Ivanov " use 'pincounter=on' to work around broken counter handling in peer\n" 28373fb69aa1SAnton Ivanov " use 'offset=X' to add an extra offset between header and data\n" 28383fb69aa1SAnton Ivanov#endif 28396a8b4a5bSThomas Huth "-netdev socket,id=str[,fd=h][,listen=[host]:port][,connect=host:port]\n" 28406a8b4a5bSThomas Huth " configure a network backend to connect to another network\n" 28416a8b4a5bSThomas Huth " using a socket connection\n" 28426a8b4a5bSThomas Huth "-netdev socket,id=str[,fd=h][,mcast=maddr:port[,localaddr=addr]]\n" 28436a8b4a5bSThomas Huth " configure a network backend to connect to a multicast maddr and port\n" 28443a75e74cSMike Ryan " use 'localaddr=addr' to specify the host address to send packets from\n" 28456a8b4a5bSThomas Huth "-netdev socket,id=str[,fd=h][,udp=host:port][,localaddr=host:port]\n" 28466a8b4a5bSThomas Huth " configure a network backend to connect to another network\n" 28476a8b4a5bSThomas Huth " using an UDP tunnel\n" 2848148fbf0dSLaurent Vivier "-netdev stream,id=str[,server=on|off],addr.type=inet,addr.host=host,addr.port=port[,to=maxport][,numeric=on|off][,keep-alive=on|off][,mptcp=on|off][,addr.ipv4=on|off][,addr.ipv6=on|off][,reconnect=seconds]\n" 2849148fbf0dSLaurent Vivier "-netdev stream,id=str[,server=on|off],addr.type=unix,addr.path=path[,abstract=on|off][,tight=on|off][,reconnect=seconds]\n" 2850148fbf0dSLaurent Vivier "-netdev stream,id=str[,server=on|off],addr.type=fd,addr.str=file-descriptor[,reconnect=seconds]\n" 28515166fe0aSLaurent Vivier " configure a network backend to connect to another network\n" 28525166fe0aSLaurent Vivier " using a socket connection in stream mode.\n" 28535166fe0aSLaurent Vivier "-netdev dgram,id=str,remote.type=inet,remote.host=maddr,remote.port=port[,local.type=inet,local.host=addr]\n" 28545166fe0aSLaurent Vivier "-netdev dgram,id=str,remote.type=inet,remote.host=maddr,remote.port=port[,local.type=fd,local.str=file-descriptor]\n" 28555166fe0aSLaurent Vivier " configure a network backend to connect to a multicast maddr and port\n" 28565166fe0aSLaurent Vivier " use ``local.host=addr`` to specify the host address to send packets from\n" 28575166fe0aSLaurent Vivier "-netdev dgram,id=str,local.type=inet,local.host=addr,local.port=port[,remote.type=inet,remote.host=addr,remote.port=port]\n" 2858784e7a25SLaurent Vivier "-netdev dgram,id=str,local.type=unix,local.path=path[,remote.type=unix,remote.path=path]\n" 28595166fe0aSLaurent Vivier "-netdev dgram,id=str,local.type=fd,local.str=file-descriptor\n" 28605166fe0aSLaurent Vivier " configure a network backend to connect to another network\n" 28615166fe0aSLaurent Vivier " using an UDP tunnel\n" 28625824d651Sblueswir1#ifdef CONFIG_VDE 28636a8b4a5bSThomas Huth "-netdev vde,id=str[,sock=socketpath][,port=n][,group=groupname][,mode=octalmode]\n" 28646a8b4a5bSThomas Huth " configure a network backend to connect to port 'n' of a vde switch\n" 28656a8b4a5bSThomas Huth " running on host and listening for incoming connections on 'socketpath'.\n" 28665824d651Sblueswir1 " Use group 'groupname' and mode 'octalmode' to change default\n" 28675824d651Sblueswir1 " ownership and permissions for communication port.\n" 28685824d651Sblueswir1#endif 286958952137SVincenzo Maffione#ifdef CONFIG_NETMAP 28706a8b4a5bSThomas Huth "-netdev netmap,id=str,ifname=name[,devname=nmname]\n" 287158952137SVincenzo Maffione " attach to the existing netmap-enabled network interface 'name', or to a\n" 287258952137SVincenzo Maffione " VALE port (created on the fly) called 'name' ('nmname' is name of the \n" 287358952137SVincenzo Maffione " netmap device, defaults to '/dev/netmap')\n" 287458952137SVincenzo Maffione#endif 2875cb039ef3SIlya Maximets#ifdef CONFIG_AF_XDP 2876cb039ef3SIlya Maximets "-netdev af-xdp,id=str,ifname=name[,mode=native|skb][,force-copy=on|off]\n" 2877cb039ef3SIlya Maximets " [,queues=n][,start-queue=m][,inhibit=on|off][,sock-fds=x:y:...:z]\n" 2878cb039ef3SIlya Maximets " attach to the existing network interface 'name' with AF_XDP socket\n" 2879cb039ef3SIlya Maximets " use 'mode=MODE' to specify an XDP program attach mode\n" 2880cb039ef3SIlya Maximets " use 'force-copy=on|off' to force XDP copy mode even if device supports zero-copy (default: off)\n" 2881cb039ef3SIlya Maximets " use 'inhibit=on|off' to inhibit loading of a default XDP program (default: off)\n" 2882cb039ef3SIlya Maximets " with inhibit=on,\n" 2883cb039ef3SIlya Maximets " use 'sock-fds' to provide file descriptors for already open AF_XDP sockets\n" 2884cb039ef3SIlya Maximets " added to a socket map in XDP program. One socket per queue.\n" 2885cb039ef3SIlya Maximets " use 'queues=n' to specify how many queues of a multiqueue interface should be used\n" 2886cb039ef3SIlya Maximets " use 'start-queue=m' to specify the first queue that should be used\n" 2887cb039ef3SIlya Maximets#endif 2888253dc14cSThomas Huth#ifdef CONFIG_POSIX 28896a8b4a5bSThomas Huth "-netdev vhost-user,id=str,chardev=dev[,vhostforce=on|off]\n" 28906a8b4a5bSThomas Huth " configure a vhost-user network, backed by a chardev 'dev'\n" 2891253dc14cSThomas Huth#endif 2892108a6481SCindy Lu#ifdef __linux__ 28938801ccd0SSi-Wei Liu "-netdev vhost-vdpa,id=str[,vhostdev=/path/to/dev][,vhostfd=h]\n" 2894108a6481SCindy Lu " configure a vhost-vdpa network,Establish a vhost-vdpa netdev\n" 28958801ccd0SSi-Wei Liu " use 'vhostdev=/path/to/dev' to open a vhost vdpa device\n" 28968801ccd0SSi-Wei Liu " use 'vhostfd=h' to connect to an already opened vhost vdpa device\n" 2897108a6481SCindy Lu#endif 2898b0290db1SVladislav Yaroshchuk#ifdef CONFIG_VMNET 2899b0290db1SVladislav Yaroshchuk "-netdev vmnet-host,id=str[,isolated=on|off][,net-uuid=uuid]\n" 2900b0290db1SVladislav Yaroshchuk " [,start-address=addr,end-address=addr,subnet-mask=mask]\n" 2901b0290db1SVladislav Yaroshchuk " configure a vmnet network backend in host mode with ID 'str',\n" 2902b0290db1SVladislav Yaroshchuk " isolate this interface from others with 'isolated',\n" 2903b0290db1SVladislav Yaroshchuk " configure the address range and choose a subnet mask,\n" 2904b0290db1SVladislav Yaroshchuk " specify network UUID 'uuid' to disable DHCP and interact with\n" 2905b0290db1SVladislav Yaroshchuk " vmnet-host interfaces within this isolated network\n" 2906b0290db1SVladislav Yaroshchuk "-netdev vmnet-shared,id=str[,isolated=on|off][,nat66-prefix=addr]\n" 2907b0290db1SVladislav Yaroshchuk " [,start-address=addr,end-address=addr,subnet-mask=mask]\n" 2908b0290db1SVladislav Yaroshchuk " configure a vmnet network backend in shared mode with ID 'str',\n" 2909b0290db1SVladislav Yaroshchuk " configure the address range and choose a subnet mask,\n" 2910b0290db1SVladislav Yaroshchuk " set IPv6 ULA prefix (of length 64) to use for internal network,\n" 2911b0290db1SVladislav Yaroshchuk " isolate this interface from others with 'isolated'\n" 2912b0290db1SVladislav Yaroshchuk "-netdev vmnet-bridged,id=str,ifname=name[,isolated=on|off]\n" 2913b0290db1SVladislav Yaroshchuk " configure a vmnet network backend in bridged mode with ID 'str',\n" 2914b0290db1SVladislav Yaroshchuk " use 'ifname=name' to select a physical network interface to be bridged,\n" 2915b0290db1SVladislav Yaroshchuk " isolate this interface from others with 'isolated'\n" 2916b0290db1SVladislav Yaroshchuk#endif 291718d65d22SThomas Huth "-netdev hubport,id=str,hubid=n[,netdev=nd]\n" 2918af1a5c3eSThomas Huth " configure a hub port on the hub with ID 'n'\n", QEMU_ARCH_ALL) 291978cd6f7bSThomas HuthDEF("nic", HAS_ARG, QEMU_OPTION_nic, 2920dfaa7d50SBALATON Zoltan "-nic [tap|bridge|" 292178cd6f7bSThomas Huth#ifdef CONFIG_SLIRP 292278cd6f7bSThomas Huth "user|" 292378cd6f7bSThomas Huth#endif 292478cd6f7bSThomas Huth#ifdef __linux__ 292578cd6f7bSThomas Huth "l2tpv3|" 292678cd6f7bSThomas Huth#endif 292778cd6f7bSThomas Huth#ifdef CONFIG_VDE 292878cd6f7bSThomas Huth "vde|" 292978cd6f7bSThomas Huth#endif 293078cd6f7bSThomas Huth#ifdef CONFIG_NETMAP 293178cd6f7bSThomas Huth "netmap|" 293278cd6f7bSThomas Huth#endif 2933cb039ef3SIlya Maximets#ifdef CONFIG_AF_XDP 2934cb039ef3SIlya Maximets "af-xdp|" 2935cb039ef3SIlya Maximets#endif 293678cd6f7bSThomas Huth#ifdef CONFIG_POSIX 293778cd6f7bSThomas Huth "vhost-user|" 293878cd6f7bSThomas Huth#endif 2939b0290db1SVladislav Yaroshchuk#ifdef CONFIG_VMNET 2940b0290db1SVladislav Yaroshchuk "vmnet-host|vmnet-shared|vmnet-bridged|" 2941b0290db1SVladislav Yaroshchuk#endif 294278cd6f7bSThomas Huth "socket][,option][,...][mac=macaddr]\n" 294378cd6f7bSThomas Huth " initialize an on-board / default host NIC (using MAC address\n" 294478cd6f7bSThomas Huth " macaddr) and connect it to the given host network backend\n" 2945dfaa7d50SBALATON Zoltan "-nic none use it alone to have zero network devices (the default is to\n" 294678cd6f7bSThomas Huth " provided a 'user' network connection)\n", 294778cd6f7bSThomas Huth QEMU_ARCH_ALL) 29486a8b4a5bSThomas HuthDEF("net", HAS_ARG, QEMU_OPTION_net, 2949af1a5c3eSThomas Huth "-net nic[,macaddr=mac][,model=type][,name=str][,addr=str][,vectors=v]\n" 29500e60a82dSThomas Huth " configure or create an on-board (or machine default) NIC and\n" 2951af1a5c3eSThomas Huth " connect it to hub 0 (please use -nic unless you need a hub)\n" 29526a8b4a5bSThomas Huth "-net [" 2953a1ea458fSMark McLoughlin#ifdef CONFIG_SLIRP 2954a1ea458fSMark McLoughlin "user|" 2955a1ea458fSMark McLoughlin#endif 2956a1ea458fSMark McLoughlin "tap|" 2957a7c36ee4SCorey Bryant "bridge|" 2958a1ea458fSMark McLoughlin#ifdef CONFIG_VDE 2959a1ea458fSMark McLoughlin "vde|" 2960a1ea458fSMark McLoughlin#endif 296158952137SVincenzo Maffione#ifdef CONFIG_NETMAP 296258952137SVincenzo Maffione "netmap|" 296358952137SVincenzo Maffione#endif 2964cb039ef3SIlya Maximets#ifdef CONFIG_AF_XDP 2965cb039ef3SIlya Maximets "af-xdp|" 2966cb039ef3SIlya Maximets#endif 2967b0290db1SVladislav Yaroshchuk#ifdef CONFIG_VMNET 2968b0290db1SVladislav Yaroshchuk "vmnet-host|vmnet-shared|vmnet-bridged|" 2969b0290db1SVladislav Yaroshchuk#endif 2970af1a5c3eSThomas Huth "socket][,option][,option][,...]\n" 29716a8b4a5bSThomas Huth " old way to initialize a host network interface\n" 29726a8b4a5bSThomas Huth " (use the -netdev option if possible instead)\n", QEMU_ARCH_ALL) 2973e2fcbf42SPeter MaydellSRST 2974cb039ef3SIlya Maximets``-nic [tap|bridge|user|l2tpv3|vde|netmap|af-xdp|vhost-user|socket][,...][,mac=macaddr][,model=mn]`` 2975e2fcbf42SPeter Maydell This option is a shortcut for configuring both the on-board 2976e2fcbf42SPeter Maydell (default) guest NIC hardware and the host network backend in one go. 2977e2fcbf42SPeter Maydell The host backend options are the same as with the corresponding 2978e2fcbf42SPeter Maydell ``-netdev`` options below. The guest NIC model can be set with 2979e2fcbf42SPeter Maydell ``model=modelname``. Use ``model=help`` to list the available device 2980e2fcbf42SPeter Maydell types. The hardware MAC address can be set with ``mac=macaddr``. 2981e2fcbf42SPeter Maydell 2982e2fcbf42SPeter Maydell The following two example do exactly the same, to show how ``-nic`` 2983e2fcbf42SPeter Maydell can be used to shorten the command line length: 2984e2fcbf42SPeter Maydell 2985e2fcbf42SPeter Maydell .. parsed-literal:: 2986e2fcbf42SPeter Maydell 2987e2fcbf42SPeter Maydell |qemu_system| -netdev user,id=n1,ipv6=off -device e1000,netdev=n1,mac=52:54:98:76:54:32 2988e2fcbf42SPeter Maydell |qemu_system| -nic user,ipv6=off,model=e1000,mac=52:54:98:76:54:32 2989e2fcbf42SPeter Maydell 2990e2fcbf42SPeter Maydell``-nic none`` 2991e2fcbf42SPeter Maydell Indicate that no network devices should be configured. It is used to 2992e2fcbf42SPeter Maydell override the default configuration (default NIC with "user" host 2993e2fcbf42SPeter Maydell network backend) which is activated if no other networking options 2994e2fcbf42SPeter Maydell are provided. 2995e2fcbf42SPeter Maydell 2996e2fcbf42SPeter Maydell``-netdev user,id=id[,option][,option][,...]`` 2997e2fcbf42SPeter Maydell Configure user mode host network backend which requires no 2998e2fcbf42SPeter Maydell administrator privilege to run. Valid options are: 2999e2fcbf42SPeter Maydell 3000e2fcbf42SPeter Maydell ``id=id`` 3001e2fcbf42SPeter Maydell Assign symbolic name for use in monitor commands. 3002e2fcbf42SPeter Maydell 3003e2fcbf42SPeter Maydell ``ipv4=on|off and ipv6=on|off`` 3004e2fcbf42SPeter Maydell Specify that either IPv4 or IPv6 must be enabled. If neither is 3005e2fcbf42SPeter Maydell specified both protocols are enabled. 3006e2fcbf42SPeter Maydell 3007e2fcbf42SPeter Maydell ``net=addr[/mask]`` 3008e2fcbf42SPeter Maydell Set IP network address the guest will see. Optionally specify 3009e2fcbf42SPeter Maydell the netmask, either in the form a.b.c.d or as number of valid 3010e2fcbf42SPeter Maydell top-most bits. Default is 10.0.2.0/24. 3011e2fcbf42SPeter Maydell 3012e2fcbf42SPeter Maydell ``host=addr`` 3013e2fcbf42SPeter Maydell Specify the guest-visible address of the host. Default is the 3014e2fcbf42SPeter Maydell 2nd IP in the guest network, i.e. x.x.x.2. 3015e2fcbf42SPeter Maydell 3016e2fcbf42SPeter Maydell ``ipv6-net=addr[/int]`` 3017e2fcbf42SPeter Maydell Set IPv6 network address the guest will see (default is 3018e2fcbf42SPeter Maydell fec0::/64). The network prefix is given in the usual hexadecimal 3019e2fcbf42SPeter Maydell IPv6 address notation. The prefix size is optional, and is given 3020e2fcbf42SPeter Maydell as the number of valid top-most bits (default is 64). 3021e2fcbf42SPeter Maydell 3022e2fcbf42SPeter Maydell ``ipv6-host=addr`` 3023e2fcbf42SPeter Maydell Specify the guest-visible IPv6 address of the host. Default is 3024e2fcbf42SPeter Maydell the 2nd IPv6 in the guest network, i.e. xxxx::2. 3025e2fcbf42SPeter Maydell 3026e2fcbf42SPeter Maydell ``restrict=on|off`` 3027e2fcbf42SPeter Maydell If this option is enabled, the guest will be isolated, i.e. it 3028e2fcbf42SPeter Maydell will not be able to contact the host and no guest IP packets 3029e2fcbf42SPeter Maydell will be routed over the host to the outside. This option does 3030e2fcbf42SPeter Maydell not affect any explicitly set forwarding rules. 3031e2fcbf42SPeter Maydell 3032e2fcbf42SPeter Maydell ``hostname=name`` 3033e2fcbf42SPeter Maydell Specifies the client hostname reported by the built-in DHCP 3034e2fcbf42SPeter Maydell server. 3035e2fcbf42SPeter Maydell 3036e2fcbf42SPeter Maydell ``dhcpstart=addr`` 3037e2fcbf42SPeter Maydell Specify the first of the 16 IPs the built-in DHCP server can 3038e2fcbf42SPeter Maydell assign. Default is the 15th to 31st IP in the guest network, 3039e2fcbf42SPeter Maydell i.e. x.x.x.15 to x.x.x.31. 3040e2fcbf42SPeter Maydell 3041e2fcbf42SPeter Maydell ``dns=addr`` 3042e2fcbf42SPeter Maydell Specify the guest-visible address of the virtual nameserver. The 3043e2fcbf42SPeter Maydell address must be different from the host address. Default is the 3044e2fcbf42SPeter Maydell 3rd IP in the guest network, i.e. x.x.x.3. 3045e2fcbf42SPeter Maydell 3046e2fcbf42SPeter Maydell ``ipv6-dns=addr`` 3047e2fcbf42SPeter Maydell Specify the guest-visible address of the IPv6 virtual 3048e2fcbf42SPeter Maydell nameserver. The address must be different from the host address. 3049e2fcbf42SPeter Maydell Default is the 3rd IP in the guest network, i.e. xxxx::3. 3050e2fcbf42SPeter Maydell 3051e2fcbf42SPeter Maydell ``dnssearch=domain`` 3052e2fcbf42SPeter Maydell Provides an entry for the domain-search list sent by the 3053e2fcbf42SPeter Maydell built-in DHCP server. More than one domain suffix can be 3054e2fcbf42SPeter Maydell transmitted by specifying this option multiple times. If 3055e2fcbf42SPeter Maydell supported, this will cause the guest to automatically try to 3056e2fcbf42SPeter Maydell append the given domain suffix(es) in case a domain name can not 3057e2fcbf42SPeter Maydell be resolved. 3058e2fcbf42SPeter Maydell 3059e2fcbf42SPeter Maydell Example: 3060e2fcbf42SPeter Maydell 3061e2fcbf42SPeter Maydell .. parsed-literal:: 3062e2fcbf42SPeter Maydell 3063e2fcbf42SPeter Maydell |qemu_system| -nic user,dnssearch=mgmt.example.org,dnssearch=example.org 3064e2fcbf42SPeter Maydell 3065e2fcbf42SPeter Maydell ``domainname=domain`` 3066e2fcbf42SPeter Maydell Specifies the client domain name reported by the built-in DHCP 3067e2fcbf42SPeter Maydell server. 3068e2fcbf42SPeter Maydell 3069e2fcbf42SPeter Maydell ``tftp=dir`` 3070e2fcbf42SPeter Maydell When using the user mode network stack, activate a built-in TFTP 3071e2fcbf42SPeter Maydell server. The files in dir will be exposed as the root of a TFTP 3072e2fcbf42SPeter Maydell server. The TFTP client on the guest must be configured in 3073e2fcbf42SPeter Maydell binary mode (use the command ``bin`` of the Unix TFTP client). 3074e2fcbf42SPeter Maydell 3075e2fcbf42SPeter Maydell ``tftp-server-name=name`` 3076e2fcbf42SPeter Maydell In BOOTP reply, broadcast name as the "TFTP server name" 3077e2fcbf42SPeter Maydell (RFC2132 option 66). This can be used to advise the guest to 3078e2fcbf42SPeter Maydell load boot files or configurations from a different server than 3079e2fcbf42SPeter Maydell the host address. 3080e2fcbf42SPeter Maydell 3081e2fcbf42SPeter Maydell ``bootfile=file`` 3082e2fcbf42SPeter Maydell When using the user mode network stack, broadcast file as the 3083e2fcbf42SPeter Maydell BOOTP filename. In conjunction with ``tftp``, this can be used 3084e2fcbf42SPeter Maydell to network boot a guest from a local directory. 3085e2fcbf42SPeter Maydell 3086e2fcbf42SPeter Maydell Example (using pxelinux): 3087e2fcbf42SPeter Maydell 3088e2fcbf42SPeter Maydell .. parsed-literal:: 3089e2fcbf42SPeter Maydell 3090353a06b4SLaszlo Ersek |qemu_system| -hda linux.img -boot n -device e1000,netdev=n1 \\ 3091e2fcbf42SPeter Maydell -netdev user,id=n1,tftp=/path/to/tftp/files,bootfile=/pxelinux.0 3092e2fcbf42SPeter Maydell 3093e2fcbf42SPeter Maydell ``smb=dir[,smbserver=addr]`` 3094e2fcbf42SPeter Maydell When using the user mode network stack, activate a built-in SMB 3095e2fcbf42SPeter Maydell server so that Windows OSes can access to the host files in 3096e2fcbf42SPeter Maydell ``dir`` transparently. The IP address of the SMB server can be 3097e2fcbf42SPeter Maydell set to addr. By default the 4th IP in the guest network is used, 3098e2fcbf42SPeter Maydell i.e. x.x.x.4. 3099e2fcbf42SPeter Maydell 3100e2fcbf42SPeter Maydell In the guest Windows OS, the line: 3101e2fcbf42SPeter Maydell 3102e2fcbf42SPeter Maydell :: 3103e2fcbf42SPeter Maydell 3104e2fcbf42SPeter Maydell 10.0.2.4 smbserver 3105e2fcbf42SPeter Maydell 3106e2fcbf42SPeter Maydell must be added in the file ``C:\WINDOWS\LMHOSTS`` (for windows 3107e2fcbf42SPeter Maydell 9x/Me) or ``C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS`` (Windows 3108e2fcbf42SPeter Maydell NT/2000). 3109e2fcbf42SPeter Maydell 3110e2fcbf42SPeter Maydell Then ``dir`` can be accessed in ``\\smbserver\qemu``. 3111e2fcbf42SPeter Maydell 3112e2fcbf42SPeter Maydell Note that a SAMBA server must be installed on the host OS. 3113e2fcbf42SPeter Maydell 3114e2fcbf42SPeter Maydell ``hostfwd=[tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport`` 3115e2fcbf42SPeter Maydell Redirect incoming TCP or UDP connections to the host port 3116e2fcbf42SPeter Maydell hostport to the guest IP address guestaddr on guest port 3117e2fcbf42SPeter Maydell guestport. If guestaddr is not specified, its value is x.x.x.15 3118e2fcbf42SPeter Maydell (default first address given by the built-in DHCP server). By 3119e2fcbf42SPeter Maydell specifying hostaddr, the rule can be bound to a specific host 3120e2fcbf42SPeter Maydell interface. If no connection type is set, TCP is used. This 3121e2fcbf42SPeter Maydell option can be given multiple times. 3122e2fcbf42SPeter Maydell 3123e2fcbf42SPeter Maydell For example, to redirect host X11 connection from screen 1 to 3124e2fcbf42SPeter Maydell guest screen 0, use the following: 3125e2fcbf42SPeter Maydell 312609ce5f2dSPeter Maydell .. parsed-literal:: 3127e2fcbf42SPeter Maydell 3128e2fcbf42SPeter Maydell # on the host 3129e2fcbf42SPeter Maydell |qemu_system| -nic user,hostfwd=tcp:127.0.0.1:6001-:6000 3130e2fcbf42SPeter Maydell # this host xterm should open in the guest X11 server 3131e2fcbf42SPeter Maydell xterm -display :1 3132e2fcbf42SPeter Maydell 3133e2fcbf42SPeter Maydell To redirect telnet connections from host port 5555 to telnet 3134e2fcbf42SPeter Maydell port on the guest, use the following: 3135e2fcbf42SPeter Maydell 313609ce5f2dSPeter Maydell .. parsed-literal:: 3137e2fcbf42SPeter Maydell 3138e2fcbf42SPeter Maydell # on the host 3139e2fcbf42SPeter Maydell |qemu_system| -nic user,hostfwd=tcp::5555-:23 3140e2fcbf42SPeter Maydell telnet localhost 5555 3141e2fcbf42SPeter Maydell 3142e2fcbf42SPeter Maydell Then when you use on the host ``telnet localhost 5555``, you 3143e2fcbf42SPeter Maydell connect to the guest telnet server. 3144e2fcbf42SPeter Maydell 3145e2fcbf42SPeter Maydell ``guestfwd=[tcp]:server:port-dev``; \ ``guestfwd=[tcp]:server:port-cmd:command`` 3146e2fcbf42SPeter Maydell Forward guest TCP connections to the IP address server on port 3147e2fcbf42SPeter Maydell port to the character device dev or to a program executed by 3148e2fcbf42SPeter Maydell cmd:command which gets spawned for each connection. This option 3149e2fcbf42SPeter Maydell can be given multiple times. 3150e2fcbf42SPeter Maydell 3151e2fcbf42SPeter Maydell You can either use a chardev directly and have that one used 3152e2fcbf42SPeter Maydell throughout QEMU's lifetime, like in the following example: 3153e2fcbf42SPeter Maydell 315409ce5f2dSPeter Maydell .. parsed-literal:: 3155e2fcbf42SPeter Maydell 3156e2fcbf42SPeter Maydell # open 10.10.1.1:4321 on bootup, connect 10.0.2.100:1234 to it whenever 3157e2fcbf42SPeter Maydell # the guest accesses it 3158e2fcbf42SPeter Maydell |qemu_system| -nic user,guestfwd=tcp:10.0.2.100:1234-tcp:10.10.1.1:4321 3159e2fcbf42SPeter Maydell 3160e2fcbf42SPeter Maydell Or you can execute a command on every TCP connection established 3161e2fcbf42SPeter Maydell by the guest, so that QEMU behaves similar to an inetd process 3162e2fcbf42SPeter Maydell for that virtual server: 3163e2fcbf42SPeter Maydell 316409ce5f2dSPeter Maydell .. parsed-literal:: 3165e2fcbf42SPeter Maydell 3166e2fcbf42SPeter Maydell # call "netcat 10.10.1.1 4321" on every TCP connection to 10.0.2.100:1234 3167e2fcbf42SPeter Maydell # and connect the TCP stream to its stdin/stdout 3168e2fcbf42SPeter Maydell |qemu_system| -nic 'user,id=n1,guestfwd=tcp:10.0.2.100:1234-cmd:netcat 10.10.1.1 4321' 3169e2fcbf42SPeter Maydell 3170e2fcbf42SPeter Maydell``-netdev tap,id=id[,fd=h][,ifname=name][,script=file][,downscript=dfile][,br=bridge][,helper=helper]`` 3171e2fcbf42SPeter Maydell Configure a host TAP network backend with ID id. 3172e2fcbf42SPeter Maydell 3173e2fcbf42SPeter Maydell Use the network script file to configure it and the network script 3174e2fcbf42SPeter Maydell dfile to deconfigure it. If name is not provided, the OS 3175e2fcbf42SPeter Maydell automatically provides one. The default network configure script is 3176e2fcbf42SPeter Maydell ``/etc/qemu-ifup`` and the default network deconfigure script is 3177e2fcbf42SPeter Maydell ``/etc/qemu-ifdown``. Use ``script=no`` or ``downscript=no`` to 3178e2fcbf42SPeter Maydell disable script execution. 3179e2fcbf42SPeter Maydell 3180e2fcbf42SPeter Maydell If running QEMU as an unprivileged user, use the network helper 31818d73ec89STianjia Zhang to configure the TAP interface and attach it to the bridge. 3182e2fcbf42SPeter Maydell The default network helper executable is 3183e2fcbf42SPeter Maydell ``/path/to/qemu-bridge-helper`` and the default bridge device is 3184e2fcbf42SPeter Maydell ``br0``. 3185e2fcbf42SPeter Maydell 3186e2fcbf42SPeter Maydell ``fd``\ =h can be used to specify the handle of an already opened 3187e2fcbf42SPeter Maydell host TAP interface. 3188e2fcbf42SPeter Maydell 3189e2fcbf42SPeter Maydell Examples: 3190e2fcbf42SPeter Maydell 319109ce5f2dSPeter Maydell .. parsed-literal:: 3192e2fcbf42SPeter Maydell 3193e2fcbf42SPeter Maydell #launch a QEMU instance with the default network script 3194e2fcbf42SPeter Maydell |qemu_system| linux.img -nic tap 3195e2fcbf42SPeter Maydell 319609ce5f2dSPeter Maydell .. parsed-literal:: 3197e2fcbf42SPeter Maydell 3198e2fcbf42SPeter Maydell #launch a QEMU instance with two NICs, each one connected 3199e2fcbf42SPeter Maydell #to a TAP device 3200353a06b4SLaszlo Ersek |qemu_system| linux.img \\ 3201353a06b4SLaszlo Ersek -netdev tap,id=nd0,ifname=tap0 -device e1000,netdev=nd0 \\ 3202e2fcbf42SPeter Maydell -netdev tap,id=nd1,ifname=tap1 -device rtl8139,netdev=nd1 3203e2fcbf42SPeter Maydell 320409ce5f2dSPeter Maydell .. parsed-literal:: 3205e2fcbf42SPeter Maydell 3206e2fcbf42SPeter Maydell #launch a QEMU instance with the default network helper to 3207e2fcbf42SPeter Maydell #connect a TAP device to bridge br0 3208353a06b4SLaszlo Ersek |qemu_system| linux.img -device virtio-net-pci,netdev=n1 \\ 3209e2fcbf42SPeter Maydell -netdev tap,id=n1,"helper=/path/to/qemu-bridge-helper" 3210e2fcbf42SPeter Maydell 3211e2fcbf42SPeter Maydell``-netdev bridge,id=id[,br=bridge][,helper=helper]`` 3212e2fcbf42SPeter Maydell Connect a host TAP network interface to a host bridge device. 3213e2fcbf42SPeter Maydell 3214e2fcbf42SPeter Maydell Use the network helper helper to configure the TAP interface and 3215e2fcbf42SPeter Maydell attach it to the bridge. The default network helper executable is 3216e2fcbf42SPeter Maydell ``/path/to/qemu-bridge-helper`` and the default bridge device is 3217e2fcbf42SPeter Maydell ``br0``. 3218e2fcbf42SPeter Maydell 3219e2fcbf42SPeter Maydell Examples: 3220e2fcbf42SPeter Maydell 322109ce5f2dSPeter Maydell .. parsed-literal:: 3222e2fcbf42SPeter Maydell 3223e2fcbf42SPeter Maydell #launch a QEMU instance with the default network helper to 3224e2fcbf42SPeter Maydell #connect a TAP device to bridge br0 3225e2fcbf42SPeter Maydell |qemu_system| linux.img -netdev bridge,id=n1 -device virtio-net,netdev=n1 3226e2fcbf42SPeter Maydell 322709ce5f2dSPeter Maydell .. parsed-literal:: 3228e2fcbf42SPeter Maydell 3229e2fcbf42SPeter Maydell #launch a QEMU instance with the default network helper to 3230e2fcbf42SPeter Maydell #connect a TAP device to bridge qemubr0 3231e2fcbf42SPeter Maydell |qemu_system| linux.img -netdev bridge,br=qemubr0,id=n1 -device virtio-net,netdev=n1 3232e2fcbf42SPeter Maydell 3233e2fcbf42SPeter Maydell``-netdev socket,id=id[,fd=h][,listen=[host]:port][,connect=host:port]`` 3234e2fcbf42SPeter Maydell This host network backend can be used to connect the guest's network 3235e2fcbf42SPeter Maydell to another QEMU virtual machine using a TCP socket connection. If 3236e2fcbf42SPeter Maydell ``listen`` is specified, QEMU waits for incoming connections on port 3237e2fcbf42SPeter Maydell (host is optional). ``connect`` is used to connect to another QEMU 3238e2fcbf42SPeter Maydell instance using the ``listen`` option. ``fd``\ =h specifies an 3239e2fcbf42SPeter Maydell already opened TCP socket. 3240e2fcbf42SPeter Maydell 3241e2fcbf42SPeter Maydell Example: 3242e2fcbf42SPeter Maydell 324309ce5f2dSPeter Maydell .. parsed-literal:: 3244e2fcbf42SPeter Maydell 3245e2fcbf42SPeter Maydell # launch a first QEMU instance 3246353a06b4SLaszlo Ersek |qemu_system| linux.img \\ 3247353a06b4SLaszlo Ersek -device e1000,netdev=n1,mac=52:54:00:12:34:56 \\ 3248e2fcbf42SPeter Maydell -netdev socket,id=n1,listen=:1234 3249e2fcbf42SPeter Maydell # connect the network of this instance to the network of the first instance 3250353a06b4SLaszlo Ersek |qemu_system| linux.img \\ 3251353a06b4SLaszlo Ersek -device e1000,netdev=n2,mac=52:54:00:12:34:57 \\ 3252e2fcbf42SPeter Maydell -netdev socket,id=n2,connect=127.0.0.1:1234 3253e2fcbf42SPeter Maydell 3254e2fcbf42SPeter Maydell``-netdev socket,id=id[,fd=h][,mcast=maddr:port[,localaddr=addr]]`` 3255e2fcbf42SPeter Maydell Configure a socket host network backend to share the guest's network 3256e2fcbf42SPeter Maydell traffic with another QEMU virtual machines using a UDP multicast 3257e2fcbf42SPeter Maydell socket, effectively making a bus for every QEMU with same multicast 3258e2fcbf42SPeter Maydell address maddr and port. NOTES: 3259e2fcbf42SPeter Maydell 3260e2fcbf42SPeter Maydell 1. Several QEMU can be running on different hosts and share same bus 3261e2fcbf42SPeter Maydell (assuming correct multicast setup for these hosts). 3262e2fcbf42SPeter Maydell 3263e2fcbf42SPeter Maydell 2. mcast support is compatible with User Mode Linux (argument 3264e2fcbf42SPeter Maydell ``ethN=mcast``), see http://user-mode-linux.sf.net. 3265e2fcbf42SPeter Maydell 3266e2fcbf42SPeter Maydell 3. Use ``fd=h`` to specify an already opened UDP multicast socket. 3267e2fcbf42SPeter Maydell 3268e2fcbf42SPeter Maydell Example: 3269e2fcbf42SPeter Maydell 327009ce5f2dSPeter Maydell .. parsed-literal:: 3271e2fcbf42SPeter Maydell 3272e2fcbf42SPeter Maydell # launch one QEMU instance 3273353a06b4SLaszlo Ersek |qemu_system| linux.img \\ 3274353a06b4SLaszlo Ersek -device e1000,netdev=n1,mac=52:54:00:12:34:56 \\ 3275e2fcbf42SPeter Maydell -netdev socket,id=n1,mcast=230.0.0.1:1234 3276e2fcbf42SPeter Maydell # launch another QEMU instance on same "bus" 3277353a06b4SLaszlo Ersek |qemu_system| linux.img \\ 3278353a06b4SLaszlo Ersek -device e1000,netdev=n2,mac=52:54:00:12:34:57 \\ 3279e2fcbf42SPeter Maydell -netdev socket,id=n2,mcast=230.0.0.1:1234 3280e2fcbf42SPeter Maydell # launch yet another QEMU instance on same "bus" 3281353a06b4SLaszlo Ersek |qemu_system| linux.img \\ 3282353a06b4SLaszlo Ersek -device e1000,netdev=n3,mac=52:54:00:12:34:58 \\ 3283e2fcbf42SPeter Maydell -netdev socket,id=n3,mcast=230.0.0.1:1234 3284e2fcbf42SPeter Maydell 3285e2fcbf42SPeter Maydell Example (User Mode Linux compat.): 3286e2fcbf42SPeter Maydell 328709ce5f2dSPeter Maydell .. parsed-literal:: 3288e2fcbf42SPeter Maydell 3289e2fcbf42SPeter Maydell # launch QEMU instance (note mcast address selected is UML's default) 3290353a06b4SLaszlo Ersek |qemu_system| linux.img \\ 3291353a06b4SLaszlo Ersek -device e1000,netdev=n1,mac=52:54:00:12:34:56 \\ 3292e2fcbf42SPeter Maydell -netdev socket,id=n1,mcast=239.192.168.1:1102 3293e2fcbf42SPeter Maydell # launch UML 3294e2fcbf42SPeter Maydell /path/to/linux ubd0=/path/to/root_fs eth0=mcast 3295e2fcbf42SPeter Maydell 3296e2fcbf42SPeter Maydell Example (send packets from host's 1.2.3.4): 3297e2fcbf42SPeter Maydell 3298e2fcbf42SPeter Maydell .. parsed-literal:: 3299e2fcbf42SPeter Maydell 3300353a06b4SLaszlo Ersek |qemu_system| linux.img \\ 3301353a06b4SLaszlo Ersek -device e1000,netdev=n1,mac=52:54:00:12:34:56 \\ 3302e2fcbf42SPeter Maydell -netdev socket,id=n1,mcast=239.192.168.1:1102,localaddr=1.2.3.4 3303e2fcbf42SPeter Maydell 33048b0dc246SDaniel 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]`` 3305e2fcbf42SPeter Maydell Configure a L2TPv3 pseudowire host network backend. L2TPv3 (RFC3931) 3306e2fcbf42SPeter Maydell is a popular protocol to transport Ethernet (and other Layer 2) data 3307e2fcbf42SPeter Maydell frames between two systems. It is present in routers, firewalls and 3308e2fcbf42SPeter Maydell the Linux kernel (from version 3.3 onwards). 3309e2fcbf42SPeter Maydell 3310e2fcbf42SPeter Maydell This transport allows a VM to communicate to another VM, router or 3311e2fcbf42SPeter Maydell firewall directly. 3312e2fcbf42SPeter Maydell 3313e2fcbf42SPeter Maydell ``src=srcaddr`` 3314e2fcbf42SPeter Maydell source address (mandatory) 3315e2fcbf42SPeter Maydell 3316e2fcbf42SPeter Maydell ``dst=dstaddr`` 3317e2fcbf42SPeter Maydell destination address (mandatory) 3318e2fcbf42SPeter Maydell 3319e2fcbf42SPeter Maydell ``udp`` 3320e2fcbf42SPeter Maydell select udp encapsulation (default is ip). 3321e2fcbf42SPeter Maydell 3322e2fcbf42SPeter Maydell ``srcport=srcport`` 3323e2fcbf42SPeter Maydell source udp port. 3324e2fcbf42SPeter Maydell 3325e2fcbf42SPeter Maydell ``dstport=dstport`` 3326e2fcbf42SPeter Maydell destination udp port. 3327e2fcbf42SPeter Maydell 3328e2fcbf42SPeter Maydell ``ipv6`` 3329e2fcbf42SPeter Maydell force v6, otherwise defaults to v4. 3330e2fcbf42SPeter Maydell 3331e2fcbf42SPeter Maydell ``rxcookie=rxcookie``; \ ``txcookie=txcookie`` 3332e2fcbf42SPeter Maydell Cookies are a weak form of security in the l2tpv3 specification. 3333e2fcbf42SPeter Maydell Their function is mostly to prevent misconfiguration. By default 3334e2fcbf42SPeter Maydell they are 32 bit. 3335e2fcbf42SPeter Maydell 3336e2fcbf42SPeter Maydell ``cookie64`` 3337e2fcbf42SPeter Maydell Set cookie size to 64 bit instead of the default 32 3338e2fcbf42SPeter Maydell 3339e2fcbf42SPeter Maydell ``counter=off`` 3340e2fcbf42SPeter Maydell Force a 'cut-down' L2TPv3 with no counter as in 3341e2fcbf42SPeter Maydell draft-mkonstan-l2tpext-keyed-ipv6-tunnel-00 3342e2fcbf42SPeter Maydell 3343e2fcbf42SPeter Maydell ``pincounter=on`` 3344e2fcbf42SPeter Maydell Work around broken counter handling in peer. This may also help 3345e2fcbf42SPeter Maydell on networks which have packet reorder. 3346e2fcbf42SPeter Maydell 3347e2fcbf42SPeter Maydell ``offset=offset`` 3348e2fcbf42SPeter Maydell Add an extra offset between header and data 3349e2fcbf42SPeter Maydell 3350e2fcbf42SPeter Maydell For example, to attach a VM running on host 4.3.2.1 via L2TPv3 to 3351e2fcbf42SPeter Maydell the bridge br-lan on the remote Linux host 1.2.3.4: 3352e2fcbf42SPeter Maydell 335309ce5f2dSPeter Maydell .. parsed-literal:: 3354e2fcbf42SPeter Maydell 3355e2fcbf42SPeter Maydell # Setup tunnel on linux host using raw ip as encapsulation 3356e2fcbf42SPeter Maydell # on 1.2.3.4 3357353a06b4SLaszlo Ersek ip l2tp add tunnel remote 4.3.2.1 local 1.2.3.4 tunnel_id 1 peer_tunnel_id 1 \\ 3358e2fcbf42SPeter Maydell encap udp udp_sport 16384 udp_dport 16384 3359353a06b4SLaszlo Ersek ip l2tp add session tunnel_id 1 name vmtunnel0 session_id \\ 3360e2fcbf42SPeter Maydell 0xFFFFFFFF peer_session_id 0xFFFFFFFF 3361e2fcbf42SPeter Maydell ifconfig vmtunnel0 mtu 1500 3362e2fcbf42SPeter Maydell ifconfig vmtunnel0 up 3363e2fcbf42SPeter Maydell brctl addif br-lan vmtunnel0 3364e2fcbf42SPeter Maydell 3365e2fcbf42SPeter Maydell 3366e2fcbf42SPeter Maydell # on 4.3.2.1 3367e2fcbf42SPeter Maydell # launch QEMU instance - if your network has reorder or is very lossy add ,pincounter 3368e2fcbf42SPeter Maydell 3369353a06b4SLaszlo Ersek |qemu_system| linux.img -device e1000,netdev=n1 \\ 3370e2fcbf42SPeter 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 3371e2fcbf42SPeter Maydell 3372e2fcbf42SPeter Maydell``-netdev vde,id=id[,sock=socketpath][,port=n][,group=groupname][,mode=octalmode]`` 3373e2fcbf42SPeter Maydell Configure VDE backend to connect to PORT n of a vde switch running 3374e2fcbf42SPeter Maydell on host and listening for incoming connections on socketpath. Use 3375e2fcbf42SPeter Maydell GROUP groupname and MODE octalmode to change default ownership and 3376e2fcbf42SPeter Maydell permissions for communication port. This option is only available if 3377e2fcbf42SPeter Maydell QEMU has been compiled with vde support enabled. 3378e2fcbf42SPeter Maydell 3379e2fcbf42SPeter Maydell Example: 3380e2fcbf42SPeter Maydell 338109ce5f2dSPeter Maydell .. parsed-literal:: 3382e2fcbf42SPeter Maydell 3383e2fcbf42SPeter Maydell # launch vde switch 3384e2fcbf42SPeter Maydell vde_switch -F -sock /tmp/myswitch 3385e2fcbf42SPeter Maydell # launch QEMU instance 3386e2fcbf42SPeter Maydell |qemu_system| linux.img -nic vde,sock=/tmp/myswitch 3387e2fcbf42SPeter Maydell 3388cb039ef3SIlya Maximets``-netdev af-xdp,id=str,ifname=name[,mode=native|skb][,force-copy=on|off][,queues=n][,start-queue=m][,inhibit=on|off][,sock-fds=x:y:...:z]`` 3389cb039ef3SIlya Maximets Configure AF_XDP backend to connect to a network interface 'name' 3390cb039ef3SIlya Maximets using AF_XDP socket. A specific program attach mode for a default 3391cb039ef3SIlya Maximets XDP program can be forced with 'mode', defaults to best-effort, 3392cb039ef3SIlya Maximets where the likely most performant mode will be in use. Number of queues 3393cb039ef3SIlya Maximets 'n' should generally match the number or queues in the interface, 3394cb039ef3SIlya Maximets defaults to 1. Traffic arriving on non-configured device queues will 3395cb039ef3SIlya Maximets not be delivered to the network backend. 3396cb039ef3SIlya Maximets 3397cb039ef3SIlya Maximets .. parsed-literal:: 3398cb039ef3SIlya Maximets 3399cb039ef3SIlya Maximets # set number of queues to 4 3400cb039ef3SIlya Maximets ethtool -L eth0 combined 4 3401cb039ef3SIlya Maximets # launch QEMU instance 3402cb039ef3SIlya Maximets |qemu_system| linux.img -device virtio-net-pci,netdev=n1 \\ 3403cb039ef3SIlya Maximets -netdev af-xdp,id=n1,ifname=eth0,queues=4 3404cb039ef3SIlya Maximets 3405cb039ef3SIlya Maximets 'start-queue' option can be specified if a particular range of queues 3406cb039ef3SIlya Maximets [m, m + n] should be in use. For example, this is may be necessary in 3407cb039ef3SIlya Maximets order to use certain NICs in native mode. Kernel allows the driver to 3408cb039ef3SIlya Maximets create a separate set of XDP queues on top of regular ones, and only 3409cb039ef3SIlya Maximets these queues can be used for AF_XDP sockets. NICs that work this way 3410cb039ef3SIlya Maximets may also require an additional traffic redirection with ethtool to these 3411cb039ef3SIlya Maximets special queues. 3412cb039ef3SIlya Maximets 3413cb039ef3SIlya Maximets .. parsed-literal:: 3414cb039ef3SIlya Maximets 3415cb039ef3SIlya Maximets # set number of queues to 1 3416cb039ef3SIlya Maximets ethtool -L eth0 combined 1 3417cb039ef3SIlya Maximets # redirect all the traffic to the second queue (id: 1) 3418cb039ef3SIlya Maximets # note: drivers may require non-empty key/mask pair. 3419cb039ef3SIlya Maximets ethtool -N eth0 flow-type ether \\ 3420cb039ef3SIlya Maximets dst 00:00:00:00:00:00 m FF:FF:FF:FF:FF:FE action 1 3421cb039ef3SIlya Maximets ethtool -N eth0 flow-type ether \\ 3422cb039ef3SIlya Maximets dst 00:00:00:00:00:01 m FF:FF:FF:FF:FF:FE action 1 3423cb039ef3SIlya Maximets # launch QEMU instance 3424cb039ef3SIlya Maximets |qemu_system| linux.img -device virtio-net-pci,netdev=n1 \\ 3425cb039ef3SIlya Maximets -netdev af-xdp,id=n1,ifname=eth0,queues=1,start-queue=1 3426cb039ef3SIlya Maximets 3427cb039ef3SIlya Maximets XDP program can also be loaded externally. In this case 'inhibit' option 3428cb039ef3SIlya Maximets should be set to 'on' and 'sock-fds' provided with file descriptors for 3429cb039ef3SIlya Maximets already open but not bound XDP sockets already added to a socket map for 3430cb039ef3SIlya Maximets corresponding queues. One socket per queue. 3431cb039ef3SIlya Maximets 3432cb039ef3SIlya Maximets .. parsed-literal:: 3433cb039ef3SIlya Maximets 3434cb039ef3SIlya Maximets |qemu_system| linux.img -device virtio-net-pci,netdev=n1 \\ 3435cb039ef3SIlya Maximets -netdev af-xdp,id=n1,ifname=eth0,queues=3,inhibit=on,sock-fds=15:16:17 3436cb039ef3SIlya Maximets 3437e2fcbf42SPeter Maydell``-netdev vhost-user,chardev=id[,vhostforce=on|off][,queues=n]`` 3438e2fcbf42SPeter Maydell Establish a vhost-user netdev, backed by a chardev id. The chardev 3439e2fcbf42SPeter Maydell should be a unix domain socket backed one. The vhost-user uses a 3440e2fcbf42SPeter Maydell specifically defined protocol to pass vhost ioctl replacement 3441e2fcbf42SPeter Maydell messages to an application on the other end of the socket. On 3442e2fcbf42SPeter Maydell non-MSIX guests, the feature can be forced with vhostforce. Use 3443e2fcbf42SPeter Maydell 'queues=n' to specify the number of queues to be created for 3444e2fcbf42SPeter Maydell multiqueue vhost-user. 3445e2fcbf42SPeter Maydell 3446e2fcbf42SPeter Maydell Example: 3447e2fcbf42SPeter Maydell 3448e2fcbf42SPeter Maydell :: 3449e2fcbf42SPeter Maydell 3450e2fcbf42SPeter Maydell qemu -m 512 -object memory-backend-file,id=mem,size=512M,mem-path=/hugetlbfs,share=on \ 3451e2fcbf42SPeter Maydell -numa node,memdev=mem \ 3452e2fcbf42SPeter Maydell -chardev socket,id=chr0,path=/path/to/socket \ 3453e2fcbf42SPeter Maydell -netdev type=vhost-user,id=net0,chardev=chr0 \ 3454e2fcbf42SPeter Maydell -device virtio-net-pci,netdev=net0 3455e2fcbf42SPeter Maydell 34568801ccd0SSi-Wei Liu``-netdev vhost-vdpa[,vhostdev=/path/to/dev][,vhostfd=h]`` 3457108a6481SCindy Lu Establish a vhost-vdpa netdev. 3458108a6481SCindy Lu 3459108a6481SCindy Lu vDPA device is a device that uses a datapath which complies with 3460108a6481SCindy Lu the virtio specifications with a vendor specific control path. 3461108a6481SCindy Lu vDPA devices can be both physically located on the hardware or 3462108a6481SCindy Lu emulated by software. 3463108a6481SCindy Lu 3464e2fcbf42SPeter Maydell``-netdev hubport,id=id,hubid=hubid[,netdev=nd]`` 3465e2fcbf42SPeter Maydell Create a hub port on the emulated hub with ID hubid. 3466e2fcbf42SPeter Maydell 3467e2fcbf42SPeter Maydell The hubport netdev lets you connect a NIC to a QEMU emulated hub 3468e2fcbf42SPeter Maydell instead of a single netdev. Alternatively, you can also connect the 3469e2fcbf42SPeter Maydell hubport to another netdev with ID nd by using the ``netdev=nd`` 3470e2fcbf42SPeter Maydell option. 3471e2fcbf42SPeter Maydell 3472e2fcbf42SPeter Maydell``-net nic[,netdev=nd][,macaddr=mac][,model=type] [,name=name][,addr=addr][,vectors=v]`` 3473e2fcbf42SPeter Maydell Legacy option to configure or create an on-board (or machine 3474e2fcbf42SPeter Maydell default) Network Interface Card(NIC) and connect it either to the 3475e2fcbf42SPeter Maydell emulated hub with ID 0 (i.e. the default hub), or to the netdev nd. 3476e2fcbf42SPeter Maydell If model is omitted, then the default NIC model associated with the 3477e2fcbf42SPeter Maydell machine type is used. Note that the default NIC model may change in 3478e2fcbf42SPeter Maydell future QEMU releases, so it is highly recommended to always specify 3479e2fcbf42SPeter Maydell a model. Optionally, the MAC address can be changed to mac, the 3480e2fcbf42SPeter Maydell device address set to addr (PCI cards only), and a name can be 3481e2fcbf42SPeter Maydell assigned for use in monitor commands. Optionally, for PCI cards, you 3482e2fcbf42SPeter Maydell can specify the number v of MSI-X vectors that the card should have; 3483e2fcbf42SPeter Maydell this option currently only affects virtio cards; set v = 0 to 3484e2fcbf42SPeter Maydell disable MSI-X. If no ``-net`` option is specified, a single NIC is 3485e2fcbf42SPeter Maydell created. QEMU can emulate several different models of network card. 3486e2fcbf42SPeter Maydell Use ``-net nic,model=help`` for a list of available devices for your 3487e2fcbf42SPeter Maydell target. 3488e2fcbf42SPeter Maydell 3489e2fcbf42SPeter Maydell``-net user|tap|bridge|socket|l2tpv3|vde[,...][,name=name]`` 3490e2fcbf42SPeter Maydell Configure a host network backend (with the options corresponding to 3491e2fcbf42SPeter Maydell the same ``-netdev`` option) and connect it to the emulated hub 0 3492e2fcbf42SPeter Maydell (the default hub). Use name to specify the name of the hub port. 3493e2fcbf42SPeter MaydellERST 34945824d651Sblueswir1 34957273a2dbSMatthew BoothDEFHEADING() 34967273a2dbSMatthew Booth 3497de6b4f90SMarkus ArmbrusterDEFHEADING(Character device options:) 34987273a2dbSMatthew Booth 34997273a2dbSMatthew BoothDEF("chardev", HAS_ARG, QEMU_OPTION_chardev, 3500517b3d40SLin Ma "-chardev help\n" 3501d0d7708bSDaniel P. Berrange "-chardev null,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" 3502ba858d1fSMarkus Armbruster "-chardev socket,id=id[,host=host],port=port[,to=to][,ipv4=on|off][,ipv6=on|off][,nodelay=on|off]\n" 3503bfdc1267SDaniel P. Berrangé " [,server=on|off][,wait=on|off][,telnet=on|off][,websocket=on|off][,reconnect=seconds][,mux=on|off]\n" 3504fd4a5fd4SDaniel P. Berrange " [,logfile=PATH][,logappend=on|off][,tls-creds=ID][,tls-authz=ID] (tcp)\n" 3505bfdc1267SDaniel P. Berrangé "-chardev socket,id=id,path=path[,server=on|off][,wait=on|off][,telnet=on|off][,websocket=on|off][,reconnect=seconds]\n" 3506e339273bSxiaoqiang zhao " [,mux=on|off][,logfile=PATH][,logappend=on|off][,abstract=on|off][,tight=on|off] (unix)\n" 35077273a2dbSMatthew Booth "-chardev udp,id=id[,host=host],port=port[,localaddr=localaddr]\n" 3508bfdc1267SDaniel P. Berrangé " [,localport=localport][,ipv4=on|off][,ipv6=on|off][,mux=on|off]\n" 3509d0d7708bSDaniel P. Berrange " [,logfile=PATH][,logappend=on|off]\n" 3510d0d7708bSDaniel P. Berrange "-chardev msmouse,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" 35117273a2dbSMatthew Booth "-chardev vc,id=id[[,width=width][,height=height]][[,cols=cols][,rows=rows]]\n" 3512d0d7708bSDaniel P. Berrange " [,mux=on|off][,logfile=PATH][,logappend=on|off]\n" 3513d0d7708bSDaniel P. Berrange "-chardev ringbuf,id=id[,size=size][,logfile=PATH][,logappend=on|off]\n" 35145b18a6bfSPeter Maydell "-chardev file,id=id,path=path[,input-path=input-file][,mux=on|off][,logfile=PATH][,logappend=on|off]\n" 3515d0d7708bSDaniel P. Berrange "-chardev pipe,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" 35167273a2dbSMatthew Booth#ifdef _WIN32 3517d0d7708bSDaniel P. Berrange "-chardev console,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" 3518d0d7708bSDaniel P. Berrange "-chardev serial,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" 35197273a2dbSMatthew Booth#else 3520d0d7708bSDaniel P. Berrange "-chardev pty,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" 3521d0d7708bSDaniel P. Berrange "-chardev stdio,id=id[,mux=on|off][,signal=on|off][,logfile=PATH][,logappend=on|off]\n" 35227273a2dbSMatthew Booth#endif 35237273a2dbSMatthew Booth#ifdef CONFIG_BRLAPI 3524d0d7708bSDaniel P. Berrange "-chardev braille,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" 35257273a2dbSMatthew Booth#endif 35267273a2dbSMatthew Booth#if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \ 35277273a2dbSMatthew Booth || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) 3528d0d7708bSDaniel P. Berrange "-chardev serial,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" 35297273a2dbSMatthew Booth#endif 35307273a2dbSMatthew Booth#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__) 3531d0d7708bSDaniel P. Berrange "-chardev parallel,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" 35327273a2dbSMatthew Booth#endif 3533cbcc6336SAlon Levy#if defined(CONFIG_SPICE) 3534d0d7708bSDaniel P. Berrange "-chardev spicevmc,id=id,name=name[,debug=debug][,logfile=PATH][,logappend=on|off]\n" 3535d0d7708bSDaniel P. Berrange "-chardev spiceport,id=id,name=name[,debug=debug][,logfile=PATH][,logappend=on|off]\n" 3536cbcc6336SAlon Levy#endif 3537ad96090aSBlue Swirl , QEMU_ARCH_ALL 35387273a2dbSMatthew Booth) 35397273a2dbSMatthew Booth 3540e2fcbf42SPeter MaydellSRST 3541e2fcbf42SPeter MaydellThe general form of a character device option is: 3542e2fcbf42SPeter Maydell 3543e2fcbf42SPeter Maydell``-chardev backend,id=id[,mux=on|off][,options]`` 3544e2fcbf42SPeter Maydell Backend is one of: ``null``, ``socket``, ``udp``, ``msmouse``, 3545e2fcbf42SPeter Maydell ``vc``, ``ringbuf``, ``file``, ``pipe``, ``console``, ``serial``, 35466f9f6308SPaolo Bonzini ``pty``, ``stdio``, ``braille``, ``parallel``, 3547e2fcbf42SPeter Maydell ``spicevmc``, ``spiceport``. The specific backend will determine the 3548e2fcbf42SPeter Maydell applicable options. 3549e2fcbf42SPeter Maydell 3550e2fcbf42SPeter Maydell Use ``-chardev help`` to print all available chardev backend types. 3551e2fcbf42SPeter Maydell 3552e2fcbf42SPeter Maydell All devices must have an id, which can be any string up to 127 3553e2fcbf42SPeter Maydell characters long. It is used to uniquely identify this device in 3554e2fcbf42SPeter Maydell other command line directives. 3555e2fcbf42SPeter Maydell 3556e2fcbf42SPeter Maydell A character device may be used in multiplexing mode by multiple 3557e2fcbf42SPeter Maydell front-ends. Specify ``mux=on`` to enable this mode. A multiplexer is 3558e2fcbf42SPeter Maydell a "1:N" device, and here the "1" end is your specified chardev 3559e2fcbf42SPeter Maydell backend, and the "N" end is the various parts of QEMU that can talk 3560e2fcbf42SPeter Maydell to a chardev. If you create a chardev with ``id=myid`` and 3561e2fcbf42SPeter Maydell ``mux=on``, QEMU will create a multiplexer with your specified ID, 3562e2fcbf42SPeter Maydell and you can then configure multiple front ends to use that chardev 3563e2fcbf42SPeter Maydell ID for their input/output. Up to four different front ends can be 3564e2fcbf42SPeter Maydell connected to a single multiplexed chardev. (Without multiplexing 3565e2fcbf42SPeter Maydell enabled, a chardev can only be used by a single front end.) For 3566e2fcbf42SPeter Maydell instance you could use this to allow a single stdio chardev to be 3567e2fcbf42SPeter Maydell used by two serial ports and the QEMU monitor: 3568e2fcbf42SPeter Maydell 3569e2fcbf42SPeter Maydell :: 3570e2fcbf42SPeter Maydell 3571e2fcbf42SPeter Maydell -chardev stdio,mux=on,id=char0 \ 3572e2fcbf42SPeter Maydell -mon chardev=char0,mode=readline \ 3573e2fcbf42SPeter Maydell -serial chardev:char0 \ 3574e2fcbf42SPeter Maydell -serial chardev:char0 3575e2fcbf42SPeter Maydell 3576e2fcbf42SPeter Maydell You can have more than one multiplexer in a system configuration; 3577e2fcbf42SPeter Maydell for instance you could have a TCP port multiplexed between UART 0 3578e2fcbf42SPeter Maydell and UART 1, and stdio multiplexed between the QEMU monitor and a 3579e2fcbf42SPeter Maydell parallel port: 3580e2fcbf42SPeter Maydell 3581e2fcbf42SPeter Maydell :: 3582e2fcbf42SPeter Maydell 3583e2fcbf42SPeter Maydell -chardev stdio,mux=on,id=char0 \ 3584e2fcbf42SPeter Maydell -mon chardev=char0,mode=readline \ 3585e2fcbf42SPeter Maydell -parallel chardev:char0 \ 3586e2fcbf42SPeter Maydell -chardev tcp,...,mux=on,id=char1 \ 3587e2fcbf42SPeter Maydell -serial chardev:char1 \ 3588e2fcbf42SPeter Maydell -serial chardev:char1 3589e2fcbf42SPeter Maydell 3590e2fcbf42SPeter Maydell When you're using a multiplexed character device, some escape 3591923e9311SThomas Huth sequences are interpreted in the input. See the chapter about 3592923e9311SThomas Huth :ref:`keys in the character backend multiplexer` in the 3593923e9311SThomas Huth System Emulation Users Guide for more details. 3594e2fcbf42SPeter Maydell 3595e2fcbf42SPeter Maydell Note that some other command line options may implicitly create 3596e2fcbf42SPeter Maydell multiplexed character backends; for instance ``-serial mon:stdio`` 3597e2fcbf42SPeter Maydell creates a multiplexed stdio backend connected to the serial port and 3598e2fcbf42SPeter Maydell the QEMU monitor, and ``-nographic`` also multiplexes the console 3599e2fcbf42SPeter Maydell and the monitor to stdio. 3600e2fcbf42SPeter Maydell 3601e2fcbf42SPeter Maydell There is currently no support for multiplexing in the other 3602e2fcbf42SPeter Maydell direction (where a single QEMU front end takes input and output from 3603e2fcbf42SPeter Maydell multiple chardevs). 3604e2fcbf42SPeter Maydell 3605e2fcbf42SPeter Maydell Every backend supports the ``logfile`` option, which supplies the 3606e2fcbf42SPeter Maydell path to a file to record all data transmitted via the backend. The 3607e2fcbf42SPeter Maydell ``logappend`` option controls whether the log file will be truncated 3608e2fcbf42SPeter Maydell or appended to when opened. 3609e2fcbf42SPeter Maydell 3610e2fcbf42SPeter MaydellThe available backends are: 3611e2fcbf42SPeter Maydell 3612e2fcbf42SPeter Maydell``-chardev null,id=id`` 3613e2fcbf42SPeter Maydell A void device. This device will not emit any data, and will drop any 3614e2fcbf42SPeter Maydell data it receives. The null backend does not take any options. 3615e2fcbf42SPeter Maydell 3616bfdc1267SDaniel 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]`` 3617e2fcbf42SPeter Maydell Create a two-way stream socket, which can be either a TCP or a unix 3618e2fcbf42SPeter Maydell socket. A unix socket will be created if ``path`` is specified. 3619e2fcbf42SPeter Maydell Behaviour is undefined if TCP options are specified for a unix 3620e2fcbf42SPeter Maydell socket. 3621e2fcbf42SPeter Maydell 3622bfdc1267SDaniel P. Berrangé ``server=on|off`` specifies that the socket shall be a listening socket. 3623e2fcbf42SPeter Maydell 3624bfdc1267SDaniel P. Berrangé ``wait=on|off`` specifies that QEMU should not block waiting for a client 3625e2fcbf42SPeter Maydell to connect to a listening socket. 3626e2fcbf42SPeter Maydell 3627bfdc1267SDaniel P. Berrangé ``telnet=on|off`` specifies that traffic on the socket should interpret 3628e2fcbf42SPeter Maydell telnet escape sequences. 3629e2fcbf42SPeter Maydell 3630bfdc1267SDaniel P. Berrangé ``websocket=on|off`` specifies that the socket uses WebSocket protocol for 3631e2fcbf42SPeter Maydell communication. 3632e2fcbf42SPeter Maydell 3633e2fcbf42SPeter Maydell ``reconnect`` sets the timeout for reconnecting on non-server 3634e2fcbf42SPeter Maydell sockets when the remote end goes away. qemu will delay this many 3635e2fcbf42SPeter Maydell seconds and then attempt to reconnect. Zero disables reconnecting, 3636e2fcbf42SPeter Maydell and is the default. 3637e2fcbf42SPeter Maydell 3638e2fcbf42SPeter Maydell ``tls-creds`` requests enablement of the TLS protocol for 3639e2fcbf42SPeter Maydell encryption, and specifies the id of the TLS credentials to use for 3640e2fcbf42SPeter Maydell the handshake. The credentials must be previously created with the 3641e2fcbf42SPeter Maydell ``-object tls-creds`` argument. 3642e2fcbf42SPeter Maydell 3643e2fcbf42SPeter Maydell ``tls-auth`` provides the ID of the QAuthZ authorization object 3644e2fcbf42SPeter Maydell against which the client's x509 distinguished name will be 3645e2fcbf42SPeter Maydell validated. This object is only resolved at time of use, so can be 3646e2fcbf42SPeter Maydell deleted and recreated on the fly while the chardev server is active. 3647e2fcbf42SPeter Maydell If missing, it will default to denying access. 3648e2fcbf42SPeter Maydell 3649e2fcbf42SPeter Maydell TCP and unix socket options are given below: 3650e2fcbf42SPeter Maydell 3651a9b1315fSPaolo Bonzini ``TCP options: port=port[,host=host][,to=to][,ipv4=on|off][,ipv6=on|off][,nodelay=on|off]`` 3652e2fcbf42SPeter Maydell ``host`` for a listening socket specifies the local address to 3653e2fcbf42SPeter Maydell be bound. For a connecting socket species the remote host to 3654e2fcbf42SPeter Maydell connect to. ``host`` is optional for listening sockets. If not 3655e2fcbf42SPeter Maydell specified it defaults to ``0.0.0.0``. 3656e2fcbf42SPeter Maydell 3657e2fcbf42SPeter Maydell ``port`` for a listening socket specifies the local port to be 3658e2fcbf42SPeter Maydell bound. For a connecting socket specifies the port on the remote 3659e2fcbf42SPeter Maydell host to connect to. ``port`` can be given as either a port 3660e2fcbf42SPeter Maydell number or a service name. ``port`` is required. 3661e2fcbf42SPeter Maydell 3662e2fcbf42SPeter Maydell ``to`` is only relevant to listening sockets. If it is 3663e2fcbf42SPeter Maydell specified, and ``port`` cannot be bound, QEMU will attempt to 3664e2fcbf42SPeter Maydell bind to subsequent ports up to and including ``to`` until it 3665e2fcbf42SPeter Maydell succeeds. ``to`` must be specified as a port number. 3666e2fcbf42SPeter Maydell 3667bfdc1267SDaniel P. Berrangé ``ipv4=on|off`` and ``ipv6=on|off`` specify that either IPv4 3668bfdc1267SDaniel P. Berrangé or IPv6 must be used. If neither is specified the socket may 3669bfdc1267SDaniel P. Berrangé use either protocol. 3670e2fcbf42SPeter Maydell 3671a9b1315fSPaolo Bonzini ``nodelay=on|off`` disables the Nagle algorithm. 3672e2fcbf42SPeter Maydell 3673e339273bSxiaoqiang zhao ``unix options: path=path[,abstract=on|off][,tight=on|off]`` 3674e2fcbf42SPeter Maydell ``path`` specifies the local path of the unix socket. ``path`` 3675e2fcbf42SPeter Maydell is required. 3676bfdc1267SDaniel P. Berrangé ``abstract=on|off`` specifies the use of the abstract socket namespace, 3677e339273bSxiaoqiang zhao rather than the filesystem. Optional, defaults to false. 3678bfdc1267SDaniel P. Berrangé ``tight=on|off`` sets the socket length of abstract sockets to their minimum, 3679e339273bSxiaoqiang zhao rather than the full sun_path length. Optional, defaults to true. 3680e2fcbf42SPeter Maydell 3681bfdc1267SDaniel P. Berrangé``-chardev udp,id=id[,host=host],port=port[,localaddr=localaddr][,localport=localport][,ipv4=on|off][,ipv6=on|off]`` 3682e2fcbf42SPeter Maydell Sends all traffic from the guest to a remote host over UDP. 3683e2fcbf42SPeter Maydell 3684e2fcbf42SPeter Maydell ``host`` specifies the remote host to connect to. If not specified 3685e2fcbf42SPeter Maydell it defaults to ``localhost``. 3686e2fcbf42SPeter Maydell 3687e2fcbf42SPeter Maydell ``port`` specifies the port on the remote host to connect to. 3688e2fcbf42SPeter Maydell ``port`` is required. 3689e2fcbf42SPeter Maydell 3690e2fcbf42SPeter Maydell ``localaddr`` specifies the local address to bind to. If not 3691e2fcbf42SPeter Maydell specified it defaults to ``0.0.0.0``. 3692e2fcbf42SPeter Maydell 3693e2fcbf42SPeter Maydell ``localport`` specifies the local port to bind to. If not specified 3694e2fcbf42SPeter Maydell any available local port will be used. 3695e2fcbf42SPeter Maydell 3696bfdc1267SDaniel P. Berrangé ``ipv4=on|off`` and ``ipv6=on|off`` specify that either IPv4 or IPv6 must be used. 3697e2fcbf42SPeter Maydell If neither is specified the device may use either protocol. 3698e2fcbf42SPeter Maydell 3699e2fcbf42SPeter Maydell``-chardev msmouse,id=id`` 3700e2fcbf42SPeter Maydell Forward QEMU's emulated msmouse events to the guest. ``msmouse`` 3701e2fcbf42SPeter Maydell does not take any options. 3702e2fcbf42SPeter Maydell 3703e2fcbf42SPeter Maydell``-chardev vc,id=id[[,width=width][,height=height]][[,cols=cols][,rows=rows]]`` 3704e2fcbf42SPeter Maydell Connect to a QEMU text console. ``vc`` may optionally be given a 3705e2fcbf42SPeter Maydell specific size. 3706e2fcbf42SPeter Maydell 3707e2fcbf42SPeter Maydell ``width`` and ``height`` specify the width and height respectively 3708e2fcbf42SPeter Maydell of the console, in pixels. 3709e2fcbf42SPeter Maydell 3710e2fcbf42SPeter Maydell ``cols`` and ``rows`` specify that the console be sized to fit a 3711e2fcbf42SPeter Maydell text console with the given dimensions. 3712e2fcbf42SPeter Maydell 3713e2fcbf42SPeter Maydell``-chardev ringbuf,id=id[,size=size]`` 3714e2fcbf42SPeter Maydell Create a ring buffer with fixed size ``size``. size must be a power 3715e2fcbf42SPeter Maydell of two and defaults to ``64K``. 3716e2fcbf42SPeter Maydell 37175b18a6bfSPeter Maydell``-chardev file,id=id,path=path[,input-path=input-path]`` 3718e2fcbf42SPeter Maydell Log all traffic received from the guest to a file. 3719e2fcbf42SPeter Maydell 3720e2fcbf42SPeter Maydell ``path`` specifies the path of the file to be opened. This file will 3721e2fcbf42SPeter Maydell be created if it does not already exist, and overwritten if it does. 3722e2fcbf42SPeter Maydell ``path`` is required. 3723e2fcbf42SPeter Maydell 37245b18a6bfSPeter Maydell If ``input-path`` is specified, this is the path of a second file 37255b18a6bfSPeter Maydell which will be used for input. If ``input-path`` is not specified, 37265b18a6bfSPeter Maydell no input will be available from the chardev. 37275b18a6bfSPeter Maydell 37285b18a6bfSPeter Maydell Note that ``input-path`` is not supported on Windows hosts. 37295b18a6bfSPeter Maydell 3730e2fcbf42SPeter Maydell``-chardev pipe,id=id,path=path`` 3731e2fcbf42SPeter Maydell Create a two-way connection to the guest. The behaviour differs 3732e2fcbf42SPeter Maydell slightly between Windows hosts and other hosts: 3733e2fcbf42SPeter Maydell 3734e2fcbf42SPeter Maydell On Windows, a single duplex pipe will be created at 3735e2fcbf42SPeter Maydell ``\\.pipe\path``. 3736e2fcbf42SPeter Maydell 3737e2fcbf42SPeter Maydell On other hosts, 2 pipes will be created called ``path.in`` and 3738e2fcbf42SPeter Maydell ``path.out``. Data written to ``path.in`` will be received by the 3739e2fcbf42SPeter Maydell guest. Data written by the guest can be read from ``path.out``. QEMU 3740e2fcbf42SPeter Maydell will not create these fifos, and requires them to be present. 3741e2fcbf42SPeter Maydell 3742e2fcbf42SPeter Maydell ``path`` forms part of the pipe path as described above. ``path`` is 3743e2fcbf42SPeter Maydell required. 3744e2fcbf42SPeter Maydell 3745e2fcbf42SPeter Maydell``-chardev console,id=id`` 3746e2fcbf42SPeter Maydell Send traffic from the guest to QEMU's standard output. ``console`` 3747e2fcbf42SPeter Maydell does not take any options. 3748e2fcbf42SPeter Maydell 3749e2fcbf42SPeter Maydell ``console`` is only available on Windows hosts. 3750e2fcbf42SPeter Maydell 3751e2fcbf42SPeter Maydell``-chardev serial,id=id,path=path`` 3752e2fcbf42SPeter Maydell Send traffic from the guest to a serial device on the host. 3753e2fcbf42SPeter Maydell 3754e2fcbf42SPeter Maydell On Unix hosts serial will actually accept any tty device, not only 3755e2fcbf42SPeter Maydell serial lines. 3756e2fcbf42SPeter Maydell 3757e2fcbf42SPeter Maydell ``path`` specifies the name of the serial device to open. 3758e2fcbf42SPeter Maydell 3759e2fcbf42SPeter Maydell``-chardev pty,id=id`` 3760e2fcbf42SPeter Maydell Create a new pseudo-terminal on the host and connect to it. ``pty`` 3761e2fcbf42SPeter Maydell does not take any options. 3762e2fcbf42SPeter Maydell 3763e2fcbf42SPeter Maydell ``pty`` is not available on Windows hosts. 3764e2fcbf42SPeter Maydell 3765e2fcbf42SPeter Maydell``-chardev stdio,id=id[,signal=on|off]`` 3766e2fcbf42SPeter Maydell Connect to standard input and standard output of the QEMU process. 3767e2fcbf42SPeter Maydell 3768e2fcbf42SPeter Maydell ``signal`` controls if signals are enabled on the terminal, that 3769e2fcbf42SPeter Maydell includes exiting QEMU with the key sequence Control-c. This option 3770e2fcbf42SPeter Maydell is enabled by default, use ``signal=off`` to disable it. 3771e2fcbf42SPeter Maydell 3772e2fcbf42SPeter Maydell``-chardev braille,id=id`` 3773e2fcbf42SPeter Maydell Connect to a local BrlAPI server. ``braille`` does not take any 3774e2fcbf42SPeter Maydell options. 3775e2fcbf42SPeter Maydell 377609ce5f2dSPeter Maydell``-chardev parallel,id=id,path=path`` 377709ce5f2dSPeter Maydell \ 3778e2fcbf42SPeter Maydell ``parallel`` is only available on Linux, FreeBSD and DragonFlyBSD 3779e2fcbf42SPeter Maydell hosts. 3780e2fcbf42SPeter Maydell 3781e2fcbf42SPeter Maydell Connect to a local parallel port. 3782e2fcbf42SPeter Maydell 3783e2fcbf42SPeter Maydell ``path`` specifies the path to the parallel port device. ``path`` is 3784e2fcbf42SPeter Maydell required. 3785e2fcbf42SPeter Maydell 3786e2fcbf42SPeter Maydell``-chardev spicevmc,id=id,debug=debug,name=name`` 3787e2fcbf42SPeter Maydell ``spicevmc`` is only available when spice support is built in. 3788e2fcbf42SPeter Maydell 3789e2fcbf42SPeter Maydell ``debug`` debug level for spicevmc 3790e2fcbf42SPeter Maydell 3791e2fcbf42SPeter Maydell ``name`` name of spice channel to connect to 3792e2fcbf42SPeter Maydell 3793e2fcbf42SPeter Maydell Connect to a spice virtual machine channel, such as vdiport. 3794e2fcbf42SPeter Maydell 3795e2fcbf42SPeter Maydell``-chardev spiceport,id=id,debug=debug,name=name`` 3796e2fcbf42SPeter Maydell ``spiceport`` is only available when spice support is built in. 3797e2fcbf42SPeter Maydell 3798e2fcbf42SPeter Maydell ``debug`` debug level for spicevmc 3799e2fcbf42SPeter Maydell 3800e2fcbf42SPeter Maydell ``name`` name of spice port to connect to 3801e2fcbf42SPeter Maydell 3802e2fcbf42SPeter Maydell Connect to a spice port, allowing a Spice client to handle the 3803e2fcbf42SPeter Maydell traffic identified by a name (preferably a fqdn). 3804e2fcbf42SPeter MaydellERST 38057273a2dbSMatthew Booth 38067273a2dbSMatthew BoothDEFHEADING() 38077273a2dbSMatthew Booth 3808d1a0cf73SStefan Berger#ifdef CONFIG_TPM 3809de6b4f90SMarkus ArmbrusterDEFHEADING(TPM device options:) 3810d1a0cf73SStefan Berger 3811d1a0cf73SStefan BergerDEF("tpmdev", HAS_ARG, QEMU_OPTION_tpmdev, \ 381292dcc234SStefan Berger "-tpmdev passthrough,id=id[,path=path][,cancel-path=path]\n" 381392dcc234SStefan Berger " use path to provide path to a character device; default is /dev/tpm0\n" 381492dcc234SStefan Berger " use cancel-path to provide path to TPM's cancel sysfs entry; if\n" 3815f4ede81eSAmarnath Valluri " not provided it will be searched for in /sys/class/misc/tpm?/device\n" 3816f4ede81eSAmarnath Valluri "-tpmdev emulator,id=id,chardev=dev\n" 3817f4ede81eSAmarnath Valluri " configure the TPM device using chardev backend\n", 3818d1a0cf73SStefan Berger QEMU_ARCH_ALL) 3819e2fcbf42SPeter MaydellSRST 3820e2fcbf42SPeter MaydellThe general form of a TPM device option is: 3821e2fcbf42SPeter Maydell 3822e2fcbf42SPeter Maydell``-tpmdev backend,id=id[,options]`` 3823e2fcbf42SPeter Maydell The specific backend type will determine the applicable options. The 3824e2fcbf42SPeter Maydell ``-tpmdev`` option creates the TPM backend and requires a 3825e2fcbf42SPeter Maydell ``-device`` option that specifies the TPM frontend interface model. 3826e2fcbf42SPeter Maydell 3827e2fcbf42SPeter Maydell Use ``-tpmdev help`` to print all available TPM backend types. 3828e2fcbf42SPeter Maydell 3829e2fcbf42SPeter MaydellThe available backends are: 3830e2fcbf42SPeter Maydell 3831e2fcbf42SPeter Maydell``-tpmdev passthrough,id=id,path=path,cancel-path=cancel-path`` 3832e2fcbf42SPeter Maydell (Linux-host only) Enable access to the host's TPM using the 3833e2fcbf42SPeter Maydell passthrough driver. 3834e2fcbf42SPeter Maydell 3835e2fcbf42SPeter Maydell ``path`` specifies the path to the host's TPM device, i.e., on a 3836e2fcbf42SPeter Maydell Linux host this would be ``/dev/tpm0``. ``path`` is optional and by 3837e2fcbf42SPeter Maydell default ``/dev/tpm0`` is used. 3838e2fcbf42SPeter Maydell 3839e2fcbf42SPeter Maydell ``cancel-path`` specifies the path to the host TPM device's sysfs 3840e2fcbf42SPeter Maydell entry allowing for cancellation of an ongoing TPM command. 3841e2fcbf42SPeter Maydell ``cancel-path`` is optional and by default QEMU will search for the 3842e2fcbf42SPeter Maydell sysfs entry to use. 3843e2fcbf42SPeter Maydell 3844e2fcbf42SPeter Maydell Some notes about using the host's TPM with the passthrough driver: 3845e2fcbf42SPeter Maydell 3846e2fcbf42SPeter Maydell The TPM device accessed by the passthrough driver must not be used 3847e2fcbf42SPeter Maydell by any other application on the host. 3848e2fcbf42SPeter Maydell 3849e2fcbf42SPeter Maydell Since the host's firmware (BIOS/UEFI) has already initialized the 3850e2fcbf42SPeter Maydell TPM, the VM's firmware (BIOS/UEFI) will not be able to initialize 3851e2fcbf42SPeter Maydell the TPM again and may therefore not show a TPM-specific menu that 3852e2fcbf42SPeter Maydell would otherwise allow the user to configure the TPM, e.g., allow the 3853e2fcbf42SPeter Maydell user to enable/disable or activate/deactivate the TPM. Further, if 3854e2fcbf42SPeter Maydell TPM ownership is released from within a VM then the host's TPM will 3855e2fcbf42SPeter Maydell get disabled and deactivated. To enable and activate the TPM again 3856e2fcbf42SPeter Maydell afterwards, the host has to be rebooted and the user is required to 3857e2fcbf42SPeter Maydell enter the firmware's menu to enable and activate the TPM. If the TPM 3858e2fcbf42SPeter Maydell is left disabled and/or deactivated most TPM commands will fail. 3859e2fcbf42SPeter Maydell 3860e2fcbf42SPeter Maydell To create a passthrough TPM use the following two options: 3861e2fcbf42SPeter Maydell 3862e2fcbf42SPeter Maydell :: 3863e2fcbf42SPeter Maydell 3864e2fcbf42SPeter Maydell -tpmdev passthrough,id=tpm0 -device tpm-tis,tpmdev=tpm0 3865e2fcbf42SPeter Maydell 3866e2fcbf42SPeter Maydell Note that the ``-tpmdev`` id is ``tpm0`` and is referenced by 3867e2fcbf42SPeter Maydell ``tpmdev=tpm0`` in the device option. 3868e2fcbf42SPeter Maydell 3869e2fcbf42SPeter Maydell``-tpmdev emulator,id=id,chardev=dev`` 3870e2fcbf42SPeter Maydell (Linux-host only) Enable access to a TPM emulator using Unix domain 3871e2fcbf42SPeter Maydell socket based chardev backend. 3872e2fcbf42SPeter Maydell 3873e2fcbf42SPeter Maydell ``chardev`` specifies the unique ID of a character device backend 3874e2fcbf42SPeter Maydell that provides connection to the software TPM server. 3875e2fcbf42SPeter Maydell 3876e2fcbf42SPeter Maydell To create a TPM emulator backend device with chardev socket backend: 3877e2fcbf42SPeter Maydell 3878e2fcbf42SPeter Maydell :: 3879e2fcbf42SPeter Maydell 3880e2fcbf42SPeter Maydell -chardev socket,id=chrtpm,path=/tmp/swtpm-sock -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis,tpmdev=tpm0 3881e2fcbf42SPeter MaydellERST 3882d1a0cf73SStefan Berger 3883d1a0cf73SStefan BergerDEFHEADING() 3884d1a0cf73SStefan Berger 3885d1a0cf73SStefan Berger#endif 3886d1a0cf73SStefan Berger 38871235cf7dSAlex BennéeDEFHEADING(Boot Image or Kernel specific:) 3888e2fcbf42SPeter MaydellSRST 38891235cf7dSAlex BennéeThere are broadly 4 ways you can boot a system with QEMU. 3890e2fcbf42SPeter Maydell 38911235cf7dSAlex Bennée - specify a firmware and let it control finding a kernel 38921235cf7dSAlex Bennée - specify a firmware and pass a hint to the kernel to boot 38931235cf7dSAlex Bennée - direct kernel image boot 38941235cf7dSAlex Bennée - manually load files into the guest's address space 38951235cf7dSAlex Bennée 38961235cf7dSAlex BennéeThe third method is useful for quickly testing kernels but as there is 38971235cf7dSAlex Bennéeno firmware to pass configuration information to the kernel the 38981235cf7dSAlex Bennéehardware must either be probeable, the kernel built for the exact 38991235cf7dSAlex Bennéeconfiguration or passed some configuration data (e.g. a DTB blob) 39001235cf7dSAlex Bennéewhich tells the kernel what drivers it needs. This exact details are 39011235cf7dSAlex Bennéeoften hardware specific. 39021235cf7dSAlex Bennée 39031235cf7dSAlex BennéeThe final method is the most generic way of loading images into the 39041235cf7dSAlex Bennéeguest address space and used mostly for ``bare metal`` type 39051235cf7dSAlex Bennéedevelopment where the reset vectors of the processor are taken into 39061235cf7dSAlex Bennéeaccount. 39071235cf7dSAlex Bennée 39081235cf7dSAlex BennéeERST 39091235cf7dSAlex Bennée 39101235cf7dSAlex BennéeSRST 39111235cf7dSAlex Bennée 39121235cf7dSAlex BennéeFor x86 machines and some other architectures ``-bios`` will generally 39131235cf7dSAlex Bennéedo the right thing with whatever it is given. For other machines the 39141235cf7dSAlex Bennéemore strict ``-pflash`` option needs an image that is sized for the 39151235cf7dSAlex Bennéeflash device for the given machine type. 39161235cf7dSAlex Bennée 39171235cf7dSAlex BennéePlease see the :ref:`system-targets-ref` section of the manual for 39181235cf7dSAlex Bennéemore detailed documentation. 39191235cf7dSAlex Bennée 39201235cf7dSAlex BennéeERST 39211235cf7dSAlex Bennée 39221235cf7dSAlex BennéeDEF("bios", HAS_ARG, QEMU_OPTION_bios, \ 39231235cf7dSAlex Bennée "-bios file set the filename for the BIOS\n", QEMU_ARCH_ALL) 39241235cf7dSAlex BennéeSRST 39251235cf7dSAlex Bennée``-bios file`` 39261235cf7dSAlex Bennée Set the filename for the BIOS. 39271235cf7dSAlex BennéeERST 39281235cf7dSAlex Bennée 39291235cf7dSAlex BennéeDEF("pflash", HAS_ARG, QEMU_OPTION_pflash, 39301235cf7dSAlex Bennée "-pflash file use 'file' as a parallel flash image\n", QEMU_ARCH_ALL) 39311235cf7dSAlex BennéeSRST 39321235cf7dSAlex Bennée``-pflash file`` 39331235cf7dSAlex Bennée Use file as a parallel flash image. 39341235cf7dSAlex BennéeERST 39351235cf7dSAlex Bennée 39361235cf7dSAlex BennéeSRST 39371235cf7dSAlex Bennée 39381235cf7dSAlex BennéeThe kernel options were designed to work with Linux kernels although 39391235cf7dSAlex Bennéeother things (like hypervisors) can be packaged up as a kernel 39401235cf7dSAlex Bennéeexecutable image. The exact format of a executable image is usually 39411235cf7dSAlex Bennéearchitecture specific. 39421235cf7dSAlex Bennée 39431235cf7dSAlex BennéeThe way in which the kernel is started (what address it is loaded at, 39441235cf7dSAlex Bennéewhat if any information is passed to it via CPU registers, the state 39451235cf7dSAlex Bennéeof the hardware when it is started, and so on) is also architecture 39461235cf7dSAlex Bennéespecific. Typically it follows the specification laid down by the 39471235cf7dSAlex BennéeLinux kernel for how kernels for that architecture must be started. 3948e2fcbf42SPeter Maydell 3949e2fcbf42SPeter MaydellERST 39505824d651Sblueswir1 39515824d651Sblueswir1DEF("kernel", HAS_ARG, QEMU_OPTION_kernel, \ 3952ad96090aSBlue Swirl "-kernel bzImage use 'bzImage' as kernel image\n", QEMU_ARCH_ALL) 3953e2fcbf42SPeter MaydellSRST 3954e2fcbf42SPeter Maydell``-kernel bzImage`` 3955e2fcbf42SPeter Maydell Use bzImage as kernel image. The kernel can be either a Linux kernel 3956e2fcbf42SPeter Maydell or in multiboot format. 3957e2fcbf42SPeter MaydellERST 39585824d651Sblueswir1 39595824d651Sblueswir1DEF("append", HAS_ARG, QEMU_OPTION_append, \ 3960ad96090aSBlue Swirl "-append cmdline use 'cmdline' as kernel command line\n", QEMU_ARCH_ALL) 3961e2fcbf42SPeter MaydellSRST 3962e2fcbf42SPeter Maydell``-append cmdline`` 3963e2fcbf42SPeter Maydell Use cmdline as kernel command line 3964e2fcbf42SPeter MaydellERST 39655824d651Sblueswir1 39665824d651Sblueswir1DEF("initrd", HAS_ARG, QEMU_OPTION_initrd, \ 3967ad96090aSBlue Swirl "-initrd file use 'file' as initial ram disk\n", QEMU_ARCH_ALL) 3968e2fcbf42SPeter MaydellSRST 3969e2fcbf42SPeter Maydell``-initrd file`` 3970e2fcbf42SPeter Maydell Use file as initial ram disk. 3971e2fcbf42SPeter Maydell 3972e2fcbf42SPeter Maydell``-initrd "file1 arg=foo,file2"`` 3973e2fcbf42SPeter Maydell This syntax is only available with multiboot. 3974e2fcbf42SPeter Maydell 3975e2fcbf42SPeter Maydell Use file1 and file2 as modules and pass arg=foo as parameter to the 3976e2fcbf42SPeter Maydell first module. 3977e2fcbf42SPeter MaydellERST 39785824d651Sblueswir1 3979412beee6SGrant LikelyDEF("dtb", HAS_ARG, QEMU_OPTION_dtb, \ 3980379b5c7cSPeter A. G. Crosthwaite "-dtb file use 'file' as device tree image\n", QEMU_ARCH_ALL) 3981e2fcbf42SPeter MaydellSRST 3982e2fcbf42SPeter Maydell``-dtb file`` 3983e2fcbf42SPeter Maydell Use file as a device tree binary (dtb) image and pass it to the 3984e2fcbf42SPeter Maydell kernel on boot. 3985e2fcbf42SPeter MaydellERST 3986412beee6SGrant Likely 39871235cf7dSAlex BennéeSRST 39881235cf7dSAlex Bennée 39891235cf7dSAlex BennéeFinally you can also manually load images directly into the address 39901235cf7dSAlex Bennéespace of the guest. This is most useful for developers who already 39911235cf7dSAlex Bennéeknow the layout of their guest and take care to ensure something sane 39921235cf7dSAlex Bennéewill happen when the reset vector executes. 39931235cf7dSAlex Bennée 39941235cf7dSAlex BennéeThe generic loader can be invoked by using the loader device: 39951235cf7dSAlex Bennée 39961235cf7dSAlex Bennée``-device loader,addr=<addr>,data=<data>,data-len=<data-len>[,data-be=<data-be>][,cpu-num=<cpu-num>]`` 39971235cf7dSAlex Bennée 39981235cf7dSAlex Bennéethere is also the guest loader which operates in a similar way but 39991235cf7dSAlex Bennéetweaks the DTB so a hypervisor loaded via ``-kernel`` can find where 40001235cf7dSAlex Bennéethe guest image is: 40011235cf7dSAlex Bennée 40021235cf7dSAlex Bennée``-device guest-loader,addr=<addr>[,kernel=<path>,[bootargs=<arguments>]][,initrd=<path>]`` 40031235cf7dSAlex Bennée 40041235cf7dSAlex BennéeERST 40051235cf7dSAlex Bennée 40065824d651Sblueswir1DEFHEADING() 40075824d651Sblueswir1 4008de6b4f90SMarkus ArmbrusterDEFHEADING(Debug/Expert options:) 40095824d651Sblueswir1 40106dd75472SMarkus ArmbrusterDEF("compat", HAS_ARG, QEMU_OPTION_compat, 4011dbb675c1SMarkus Armbruster "-compat [deprecated-input=accept|reject|crash][,deprecated-output=accept|hide]\n" 401257df0dffSMarkus Armbruster " Policy for handling deprecated management interfaces\n" 401357df0dffSMarkus Armbruster "-compat [unstable-input=accept|reject|crash][,unstable-output=accept|hide]\n" 401457df0dffSMarkus Armbruster " Policy for handling unstable management interfaces\n", 40156dd75472SMarkus Armbruster QEMU_ARCH_ALL) 40166dd75472SMarkus ArmbrusterSRST 40176dd75472SMarkus Armbruster``-compat [deprecated-input=@var{input-policy}][,deprecated-output=@var{output-policy}]`` 40186dd75472SMarkus Armbruster Set policy for handling deprecated management interfaces (experimental): 40196dd75472SMarkus Armbruster 40206dd75472SMarkus Armbruster ``deprecated-input=accept`` (default) 40216dd75472SMarkus Armbruster Accept deprecated commands and arguments 40226dd75472SMarkus Armbruster ``deprecated-input=reject`` 40236dd75472SMarkus Armbruster Reject deprecated commands and arguments 4024dbb675c1SMarkus Armbruster ``deprecated-input=crash`` 4025dbb675c1SMarkus Armbruster Crash on deprecated commands and arguments 40266dd75472SMarkus Armbruster ``deprecated-output=accept`` (default) 40276dd75472SMarkus Armbruster Emit deprecated command results and events 40286dd75472SMarkus Armbruster ``deprecated-output=hide`` 40296dd75472SMarkus Armbruster Suppress deprecated command results and events 40306dd75472SMarkus Armbruster 40316dd75472SMarkus Armbruster Limitation: covers only syntactic aspects of QMP. 403257df0dffSMarkus Armbruster 403357df0dffSMarkus Armbruster``-compat [unstable-input=@var{input-policy}][,unstable-output=@var{output-policy}]`` 403457df0dffSMarkus Armbruster Set policy for handling unstable management interfaces (experimental): 403557df0dffSMarkus Armbruster 403657df0dffSMarkus Armbruster ``unstable-input=accept`` (default) 403757df0dffSMarkus Armbruster Accept unstable commands and arguments 403857df0dffSMarkus Armbruster ``unstable-input=reject`` 403957df0dffSMarkus Armbruster Reject unstable commands and arguments 404057df0dffSMarkus Armbruster ``unstable-input=crash`` 404157df0dffSMarkus Armbruster Crash on unstable commands and arguments 404257df0dffSMarkus Armbruster ``unstable-output=accept`` (default) 404357df0dffSMarkus Armbruster Emit unstable command results and events 404457df0dffSMarkus Armbruster ``unstable-output=hide`` 404557df0dffSMarkus Armbruster Suppress unstable command results and events 404657df0dffSMarkus Armbruster 404757df0dffSMarkus Armbruster Limitation: covers only syntactic aspects of QMP. 40486dd75472SMarkus ArmbrusterERST 40496dd75472SMarkus Armbruster 405081b2b810SGabriel L. SomloDEF("fw_cfg", HAS_ARG, QEMU_OPTION_fwcfg, 405181b2b810SGabriel L. Somlo "-fw_cfg [name=]<name>,file=<file>\n" 405263d3145aSMarkus Armbruster " add named fw_cfg entry with contents from file\n" 40536407d76eSGabriel L. Somlo "-fw_cfg [name=]<name>,string=<str>\n" 405463d3145aSMarkus Armbruster " add named fw_cfg entry with contents from string\n", 405581b2b810SGabriel L. Somlo QEMU_ARCH_ALL) 4056e2fcbf42SPeter MaydellSRST 4057e2fcbf42SPeter Maydell``-fw_cfg [name=]name,file=file`` 4058e2fcbf42SPeter Maydell Add named fw\_cfg entry with contents from file file. 4059e2fcbf42SPeter Maydell 4060e2fcbf42SPeter Maydell``-fw_cfg [name=]name,string=str`` 4061e2fcbf42SPeter Maydell Add named fw\_cfg entry with contents from string str. 4062e2fcbf42SPeter Maydell 4063e2fcbf42SPeter Maydell The terminating NUL character of the contents of str will not be 4064e2fcbf42SPeter Maydell included as part of the fw\_cfg item data. To insert contents with 4065e2fcbf42SPeter Maydell embedded NUL characters, you have to use the file parameter. 4066e2fcbf42SPeter Maydell 4067e2fcbf42SPeter Maydell The fw\_cfg entries are passed by QEMU through to the guest. 4068e2fcbf42SPeter Maydell 4069e2fcbf42SPeter Maydell Example: 4070e2fcbf42SPeter Maydell 4071e2fcbf42SPeter Maydell :: 4072e2fcbf42SPeter Maydell 4073e2fcbf42SPeter Maydell -fw_cfg name=opt/com.mycompany/blob,file=./my_blob.bin 4074e2fcbf42SPeter Maydell 4075e2fcbf42SPeter Maydell creates an fw\_cfg entry named opt/com.mycompany/blob with contents 4076e2fcbf42SPeter Maydell from ./my\_blob.bin. 4077e2fcbf42SPeter MaydellERST 407881b2b810SGabriel L. Somlo 40795824d651Sblueswir1DEF("serial", HAS_ARG, QEMU_OPTION_serial, \ 4080ad96090aSBlue Swirl "-serial dev redirect the serial port to char device 'dev'\n", 4081ad96090aSBlue Swirl QEMU_ARCH_ALL) 4082e2fcbf42SPeter MaydellSRST 4083e2fcbf42SPeter Maydell``-serial dev`` 4084e2fcbf42SPeter Maydell Redirect the virtual serial port to host character device dev. The 4085e2fcbf42SPeter Maydell default device is ``vc`` in graphical mode and ``stdio`` in non 4086e2fcbf42SPeter Maydell graphical mode. 4087e2fcbf42SPeter Maydell 4088e2fcbf42SPeter Maydell This option can be used several times to simulate up to 4 serial 4089e2fcbf42SPeter Maydell ports. 4090e2fcbf42SPeter Maydell 4091e2fcbf42SPeter Maydell Use ``-serial none`` to disable all serial ports. 4092e2fcbf42SPeter Maydell 4093e2fcbf42SPeter Maydell Available character devices are: 4094e2fcbf42SPeter Maydell 4095e2fcbf42SPeter Maydell ``vc[:WxH]`` 4096e2fcbf42SPeter Maydell Virtual console. Optionally, a width and height can be given in 4097e2fcbf42SPeter Maydell pixel with 4098e2fcbf42SPeter Maydell 4099e2fcbf42SPeter Maydell :: 4100e2fcbf42SPeter Maydell 4101e2fcbf42SPeter Maydell vc:800x600 4102e2fcbf42SPeter Maydell 4103e2fcbf42SPeter Maydell It is also possible to specify width or height in characters: 4104e2fcbf42SPeter Maydell 4105e2fcbf42SPeter Maydell :: 4106e2fcbf42SPeter Maydell 4107e2fcbf42SPeter Maydell vc:80Cx24C 4108e2fcbf42SPeter Maydell 4109e2fcbf42SPeter Maydell ``pty`` 4110e2fcbf42SPeter Maydell [Linux only] Pseudo TTY (a new PTY is automatically allocated) 4111e2fcbf42SPeter Maydell 4112e2fcbf42SPeter Maydell ``none`` 4113e2fcbf42SPeter Maydell No device is allocated. 4114e2fcbf42SPeter Maydell 4115e2fcbf42SPeter Maydell ``null`` 4116e2fcbf42SPeter Maydell void device 4117e2fcbf42SPeter Maydell 4118e2fcbf42SPeter Maydell ``chardev:id`` 4119e2fcbf42SPeter Maydell Use a named character device defined with the ``-chardev`` 4120e2fcbf42SPeter Maydell option. 4121e2fcbf42SPeter Maydell 4122e2fcbf42SPeter Maydell ``/dev/XXX`` 4123e2fcbf42SPeter Maydell [Linux only] Use host tty, e.g. ``/dev/ttyS0``. The host serial 4124e2fcbf42SPeter Maydell port parameters are set according to the emulated ones. 4125e2fcbf42SPeter Maydell 4126e2fcbf42SPeter Maydell ``/dev/parportN`` 4127e2fcbf42SPeter Maydell [Linux only, parallel port only] Use host parallel port N. 4128e2fcbf42SPeter Maydell Currently SPP and EPP parallel port features can be used. 4129e2fcbf42SPeter Maydell 4130e2fcbf42SPeter Maydell ``file:filename`` 4131e2fcbf42SPeter Maydell Write output to filename. No character can be read. 4132e2fcbf42SPeter Maydell 4133e2fcbf42SPeter Maydell ``stdio`` 4134e2fcbf42SPeter Maydell [Unix only] standard input/output 4135e2fcbf42SPeter Maydell 4136e2fcbf42SPeter Maydell ``pipe:filename`` 4137e2fcbf42SPeter Maydell name pipe filename 4138e2fcbf42SPeter Maydell 4139e2fcbf42SPeter Maydell ``COMn`` 4140e2fcbf42SPeter Maydell [Windows only] Use host serial port n 4141e2fcbf42SPeter Maydell 4142e2fcbf42SPeter Maydell ``udp:[remote_host]:remote_port[@[src_ip]:src_port]`` 4143e2fcbf42SPeter Maydell This implements UDP Net Console. When remote\_host or src\_ip 4144e2fcbf42SPeter Maydell are not specified they default to ``0.0.0.0``. When not using a 4145e2fcbf42SPeter Maydell specified src\_port a random port is automatically chosen. 4146e2fcbf42SPeter Maydell 4147e2fcbf42SPeter Maydell If you just want a simple readonly console you can use 4148e2fcbf42SPeter Maydell ``netcat`` or ``nc``, by starting QEMU with: 4149e2fcbf42SPeter Maydell ``-serial udp::4555`` and nc as: ``nc -u -l -p 4555``. Any time 4150e2fcbf42SPeter Maydell QEMU writes something to that port it will appear in the 4151e2fcbf42SPeter Maydell netconsole session. 4152e2fcbf42SPeter Maydell 4153e2fcbf42SPeter Maydell If you plan to send characters back via netconsole or you want 4154e2fcbf42SPeter Maydell to stop and start QEMU a lot of times, you should have QEMU use 4155e2fcbf42SPeter Maydell the same source port each time by using something like ``-serial 4156e2fcbf42SPeter Maydell udp::4555@:4556`` to QEMU. Another approach is to use a patched 4157e2fcbf42SPeter Maydell version of netcat which can listen to a TCP port and send and 4158e2fcbf42SPeter Maydell receive characters via udp. If you have a patched version of 4159e2fcbf42SPeter Maydell netcat which activates telnet remote echo and single char 4160e2fcbf42SPeter Maydell transfer, then you can use the following options to set up a 4161e2fcbf42SPeter Maydell netcat redirector to allow telnet on port 5555 to access the 4162e2fcbf42SPeter Maydell QEMU port. 4163e2fcbf42SPeter Maydell 4164e2fcbf42SPeter Maydell ``QEMU Options:`` 4165e2fcbf42SPeter Maydell -serial udp::4555@:4556 4166e2fcbf42SPeter Maydell 4167e2fcbf42SPeter Maydell ``netcat options:`` 4168e2fcbf42SPeter Maydell -u -P 4555 -L 0.0.0.0:4556 -t -p 5555 -I -T 4169e2fcbf42SPeter Maydell 4170e2fcbf42SPeter Maydell ``telnet options:`` 4171e2fcbf42SPeter Maydell localhost 5555 4172e2fcbf42SPeter Maydell 4173a9b1315fSPaolo Bonzini ``tcp:[host]:port[,server=on|off][,wait=on|off][,nodelay=on|off][,reconnect=seconds]`` 4174e2fcbf42SPeter Maydell The TCP Net Console has two modes of operation. It can send the 4175e2fcbf42SPeter Maydell serial I/O to a location or wait for a connection from a 4176e2fcbf42SPeter Maydell location. By default the TCP Net Console is sent to host at the 4177bfdc1267SDaniel P. Berrangé port. If you use the ``server=on`` option QEMU will wait for a client 4178e2fcbf42SPeter Maydell socket application to connect to the port before continuing, 4179a9b1315fSPaolo Bonzini unless the ``wait=on|off`` option was specified. The ``nodelay=on|off`` 4180bfdc1267SDaniel P. Berrangé option disables the Nagle buffering algorithm. The ``reconnect=on`` 4181bfdc1267SDaniel P. Berrangé option only applies if ``server=no`` is set, if the connection goes 4182e2fcbf42SPeter Maydell down it will attempt to reconnect at the given interval. If host 4183e2fcbf42SPeter Maydell is omitted, 0.0.0.0 is assumed. Only one TCP connection at a 4184bfdc1267SDaniel P. Berrangé time is accepted. You can use ``telnet=on`` to connect to the 4185e2fcbf42SPeter Maydell corresponding character device. 4186e2fcbf42SPeter Maydell 4187e2fcbf42SPeter Maydell ``Example to send tcp console to 192.168.0.2 port 4444`` 4188e2fcbf42SPeter Maydell -serial tcp:192.168.0.2:4444 4189e2fcbf42SPeter Maydell 4190e2fcbf42SPeter Maydell ``Example to listen and wait on port 4444 for connection`` 4191bfdc1267SDaniel P. Berrangé -serial tcp::4444,server=on 4192e2fcbf42SPeter Maydell 4193e2fcbf42SPeter Maydell ``Example to not wait and listen on ip 192.168.0.100 port 4444`` 4194bfdc1267SDaniel P. Berrangé -serial tcp:192.168.0.100:4444,server=on,wait=off 4195e2fcbf42SPeter Maydell 4196a9b1315fSPaolo Bonzini ``telnet:host:port[,server=on|off][,wait=on|off][,nodelay=on|off]`` 4197e2fcbf42SPeter Maydell The telnet protocol is used instead of raw tcp sockets. The 4198e2fcbf42SPeter Maydell options work the same as if you had specified ``-serial tcp``. 4199e2fcbf42SPeter Maydell The difference is that the port acts like a telnet server or 4200e2fcbf42SPeter Maydell client using telnet option negotiation. This will also allow you 4201e2fcbf42SPeter Maydell to send the MAGIC\_SYSRQ sequence if you use a telnet that 4202e2fcbf42SPeter Maydell supports sending the break sequence. Typically in unix telnet 4203e2fcbf42SPeter Maydell you do it with Control-] and then type "send break" followed by 4204e2fcbf42SPeter Maydell pressing the enter key. 4205e2fcbf42SPeter Maydell 4206a9b1315fSPaolo Bonzini ``websocket:host:port,server=on[,wait=on|off][,nodelay=on|off]`` 4207e2fcbf42SPeter Maydell The WebSocket protocol is used instead of raw tcp socket. The 4208e2fcbf42SPeter Maydell port acts as a WebSocket server. Client mode is not supported. 4209e2fcbf42SPeter Maydell 4210bfdc1267SDaniel P. Berrangé ``unix:path[,server=on|off][,wait=on|off][,reconnect=seconds]`` 4211e2fcbf42SPeter Maydell A unix domain socket is used instead of a tcp socket. The option 4212e2fcbf42SPeter Maydell works the same as if you had specified ``-serial tcp`` except 4213e2fcbf42SPeter Maydell the unix domain socket path is used for connections. 4214e2fcbf42SPeter Maydell 4215e2fcbf42SPeter Maydell ``mon:dev_string`` 4216e2fcbf42SPeter Maydell This is a special option to allow the monitor to be multiplexed 4217e2fcbf42SPeter Maydell onto another serial port. The monitor is accessed with key 4218e2fcbf42SPeter Maydell sequence of Control-a and then pressing c. dev\_string should be 4219e2fcbf42SPeter Maydell any one of the serial devices specified above. An example to 4220e2fcbf42SPeter Maydell multiplex the monitor onto a telnet server listening on port 4221e2fcbf42SPeter Maydell 4444 would be: 4222e2fcbf42SPeter Maydell 4223bfdc1267SDaniel P. Berrangé ``-serial mon:telnet::4444,server=on,wait=off`` 4224e2fcbf42SPeter Maydell 4225e2fcbf42SPeter Maydell When the monitor is multiplexed to stdio in this way, Ctrl+C 4226e2fcbf42SPeter Maydell will not terminate QEMU any more but will be passed to the guest 4227e2fcbf42SPeter Maydell instead. 4228e2fcbf42SPeter Maydell 4229e2fcbf42SPeter Maydell ``braille`` 4230e2fcbf42SPeter Maydell Braille device. This will use BrlAPI to display the braille 4231e2fcbf42SPeter Maydell output on a real or fake device. 4232e2fcbf42SPeter Maydell 4233e2fcbf42SPeter Maydell ``msmouse`` 4234e2fcbf42SPeter Maydell Three button serial mouse. Configure the guest to use Microsoft 4235e2fcbf42SPeter Maydell protocol. 4236e2fcbf42SPeter MaydellERST 42375824d651Sblueswir1 42385824d651Sblueswir1DEF("parallel", HAS_ARG, QEMU_OPTION_parallel, \ 4239ad96090aSBlue Swirl "-parallel dev redirect the parallel port to char device 'dev'\n", 4240ad96090aSBlue Swirl QEMU_ARCH_ALL) 4241e2fcbf42SPeter MaydellSRST 4242e2fcbf42SPeter Maydell``-parallel dev`` 4243e2fcbf42SPeter Maydell Redirect the virtual parallel port to host device dev (same devices 4244e2fcbf42SPeter Maydell as the serial port). On Linux hosts, ``/dev/parportN`` can be used 4245e2fcbf42SPeter Maydell to use hardware devices connected on the corresponding host parallel 4246e2fcbf42SPeter Maydell port. 4247e2fcbf42SPeter Maydell 4248e2fcbf42SPeter Maydell This option can be used several times to simulate up to 3 parallel 4249e2fcbf42SPeter Maydell ports. 4250e2fcbf42SPeter Maydell 4251e2fcbf42SPeter Maydell Use ``-parallel none`` to disable all parallel ports. 4252e2fcbf42SPeter MaydellERST 42535824d651Sblueswir1 42545824d651Sblueswir1DEF("monitor", HAS_ARG, QEMU_OPTION_monitor, \ 4255ad96090aSBlue Swirl "-monitor dev redirect the monitor to char device 'dev'\n", 4256ad96090aSBlue Swirl QEMU_ARCH_ALL) 4257e2fcbf42SPeter MaydellSRST 4258e2fcbf42SPeter Maydell``-monitor dev`` 4259e2fcbf42SPeter Maydell Redirect the monitor to host device dev (same devices as the serial 4260e2fcbf42SPeter Maydell port). The default device is ``vc`` in graphical mode and ``stdio`` 4261e2fcbf42SPeter Maydell in non graphical mode. Use ``-monitor none`` to disable the default 4262e2fcbf42SPeter Maydell monitor. 4263e2fcbf42SPeter MaydellERST 42646ca5582dSGerd HoffmannDEF("qmp", HAS_ARG, QEMU_OPTION_qmp, \ 4265ad96090aSBlue Swirl "-qmp dev like -monitor but opens in 'control' mode\n", 4266ad96090aSBlue Swirl QEMU_ARCH_ALL) 4267e2fcbf42SPeter MaydellSRST 4268e2fcbf42SPeter Maydell``-qmp dev`` 42690ec4468fSPeter Maydell Like ``-monitor`` but opens in 'control' mode. For example, to make 42700ec4468fSPeter Maydell QMP available on localhost port 4444:: 42710ec4468fSPeter Maydell 42720ec4468fSPeter Maydell -qmp tcp:localhost:4444,server=on,wait=off 42730ec4468fSPeter Maydell 42740ec4468fSPeter Maydell Not all options are configurable via this syntax; for maximum 42750ec4468fSPeter Maydell flexibility use the ``-mon`` option and an accompanying ``-chardev``. 42760ec4468fSPeter Maydell 4277e2fcbf42SPeter MaydellERST 42784821cd4cSMax ReitzDEF("qmp-pretty", HAS_ARG, QEMU_OPTION_qmp_pretty, \ 42794821cd4cSMax Reitz "-qmp-pretty dev like -qmp but uses pretty JSON formatting\n", 42804821cd4cSMax Reitz QEMU_ARCH_ALL) 4281e2fcbf42SPeter MaydellSRST 4282e2fcbf42SPeter Maydell``-qmp-pretty dev`` 42830ec4468fSPeter Maydell Like ``-qmp`` but uses pretty JSON formatting. 4284e2fcbf42SPeter MaydellERST 42855824d651Sblueswir1 428622a0e04bSGerd HoffmannDEF("mon", HAS_ARG, QEMU_OPTION_mon, \ 4287ef670726SVicente Jimenez Aguilar "-mon [chardev=]name[,mode=readline|control][,pretty[=on|off]]\n", QEMU_ARCH_ALL) 4288e2fcbf42SPeter MaydellSRST 4289e2fcbf42SPeter Maydell``-mon [chardev=]name[,mode=readline|control][,pretty[=on|off]]`` 42900ec4468fSPeter Maydell Set up a monitor connected to the chardev ``name``. 42910ec4468fSPeter Maydell QEMU supports two monitors: the Human Monitor Protocol 42920ec4468fSPeter Maydell (HMP; for human interaction), and the QEMU Monitor Protocol 42930ec4468fSPeter Maydell (QMP; a JSON RPC-style protocol). 42940ec4468fSPeter Maydell The default is HMP; ``mode=control`` selects QMP instead. 429516b3f3bbSAli Shirvani ``pretty`` is only valid when ``mode=control``, 429616b3f3bbSAli Shirvani turning on JSON pretty printing to ease 4297283d845cSDaniel P. Berrangé human reading and debugging. 42980ec4468fSPeter Maydell 42990ec4468fSPeter Maydell For example:: 43000ec4468fSPeter Maydell 43010ec4468fSPeter Maydell -chardev socket,id=mon1,host=localhost,port=4444,server=on,wait=off \ 43020ec4468fSPeter Maydell -mon chardev=mon1,mode=control,pretty=on 43030ec4468fSPeter Maydell 43040ec4468fSPeter Maydell enables the QMP monitor on localhost port 4444 with pretty-printing. 4305e2fcbf42SPeter MaydellERST 430622a0e04bSGerd Hoffmann 4307c9f398e5SH. Peter AnvinDEF("debugcon", HAS_ARG, QEMU_OPTION_debugcon, \ 4308ad96090aSBlue Swirl "-debugcon dev redirect the debug console to char device 'dev'\n", 4309ad96090aSBlue Swirl QEMU_ARCH_ALL) 4310e2fcbf42SPeter MaydellSRST 4311e2fcbf42SPeter Maydell``-debugcon dev`` 4312e2fcbf42SPeter Maydell Redirect the debug console to host device dev (same devices as the 4313e2fcbf42SPeter Maydell serial port). The debug console is an I/O port which is typically 4314e2fcbf42SPeter Maydell port 0xe9; writing to that I/O port sends output to this device. The 4315e2fcbf42SPeter Maydell default device is ``vc`` in graphical mode and ``stdio`` in non 4316e2fcbf42SPeter Maydell graphical mode. 4317e2fcbf42SPeter MaydellERST 4318c9f398e5SH. Peter Anvin 43195824d651Sblueswir1DEF("pidfile", HAS_ARG, QEMU_OPTION_pidfile, \ 4320ad96090aSBlue Swirl "-pidfile file write PID to 'file'\n", QEMU_ARCH_ALL) 4321e2fcbf42SPeter MaydellSRST 4322e2fcbf42SPeter Maydell``-pidfile file`` 4323e2fcbf42SPeter Maydell Store the QEMU process PID in file. It is useful if you launch QEMU 4324e2fcbf42SPeter Maydell from a script. 4325e2fcbf42SPeter MaydellERST 43265824d651Sblueswir1 43271b530a6dSaurel32DEF("singlestep", 0, QEMU_OPTION_singlestep, \ 432812fd0f41SPeter Maydell "-singlestep deprecated synonym for -accel tcg,one-insn-per-tb=on\n", QEMU_ARCH_ALL) 4329e2fcbf42SPeter MaydellSRST 4330e2fcbf42SPeter Maydell``-singlestep`` 433112fd0f41SPeter Maydell This is a deprecated synonym for the TCG accelerator property 433212fd0f41SPeter Maydell ``one-insn-per-tb``. 4333e2fcbf42SPeter MaydellERST 43341b530a6dSaurel32 4335047f7038SIgor MammedovDEF("preconfig", 0, QEMU_OPTION_preconfig, \ 4336361ac948SMarkus Armbruster "--preconfig pause QEMU before machine is initialized (experimental)\n", 4337047f7038SIgor Mammedov QEMU_ARCH_ALL) 4338e2fcbf42SPeter MaydellSRST 4339e2fcbf42SPeter Maydell``--preconfig`` 4340e2fcbf42SPeter Maydell Pause QEMU for interactive configuration before the machine is 4341e2fcbf42SPeter Maydell created, which allows querying and configuring properties that will 4342e2fcbf42SPeter Maydell affect machine initialization. Use QMP command 'x-exit-preconfig' to 4343e2fcbf42SPeter Maydell exit the preconfig state and move to the next state (i.e. run guest 4344e2fcbf42SPeter Maydell if -S isn't used or pause the second time if -S is used). This 4345e2fcbf42SPeter Maydell option is experimental. 4346e2fcbf42SPeter MaydellERST 4347047f7038SIgor Mammedov 43485824d651Sblueswir1DEF("S", 0, QEMU_OPTION_S, \ 4349ad96090aSBlue Swirl "-S freeze CPU at startup (use 'c' to start execution)\n", 4350ad96090aSBlue Swirl QEMU_ARCH_ALL) 4351e2fcbf42SPeter MaydellSRST 4352e2fcbf42SPeter Maydell``-S`` 4353e2fcbf42SPeter Maydell Do not start CPU at startup (you must type 'c' in the monitor). 4354e2fcbf42SPeter MaydellERST 43555824d651Sblueswir1 43566f131f13SMichael S. TsirkinDEF("overcommit", HAS_ARG, QEMU_OPTION_overcommit, 4357dfaa7d50SBALATON Zoltan "-overcommit [mem-lock=on|off][cpu-pm=on|off]\n" 43586f131f13SMichael S. Tsirkin " run qemu with overcommit hints\n" 43596f131f13SMichael S. Tsirkin " mem-lock=on|off controls memory lock support (default: off)\n" 43606f131f13SMichael S. Tsirkin " cpu-pm=on|off controls cpu power management (default: off)\n", 43616f131f13SMichael S. Tsirkin QEMU_ARCH_ALL) 4362e2fcbf42SPeter MaydellSRST 4363e2fcbf42SPeter Maydell``-overcommit mem-lock=on|off`` 436409ce5f2dSPeter Maydell \ 4365e2fcbf42SPeter Maydell``-overcommit cpu-pm=on|off`` 4366e2fcbf42SPeter Maydell Run qemu with hints about host resource overcommit. The default is 4367e2fcbf42SPeter Maydell to assume that host overcommits all resources. 4368e2fcbf42SPeter Maydell 4369e2fcbf42SPeter Maydell Locking qemu and guest memory can be enabled via ``mem-lock=on`` 4370e2fcbf42SPeter Maydell (disabled by default). This works when host memory is not 4371c8c9dc42SThomas Huth overcommitted and reduces the worst-case latency for guest. 4372e2fcbf42SPeter Maydell 4373e2fcbf42SPeter Maydell Guest ability to manage power state of host cpus (increasing latency 4374e2fcbf42SPeter Maydell for other processes on the same host cpu, but decreasing latency for 4375e2fcbf42SPeter Maydell guest) can be enabled via ``cpu-pm=on`` (disabled by default). This 4376e2fcbf42SPeter Maydell works best when host CPU is not overcommitted. When used, host 4377e2fcbf42SPeter Maydell estimates of CPU cycle and power utilization will be incorrect, not 4378e2fcbf42SPeter Maydell taking into account guest idle time. 4379e2fcbf42SPeter MaydellERST 43806f131f13SMichael S. Tsirkin 438159030a8cSaliguoriDEF("gdb", HAS_ARG, QEMU_OPTION_gdb, \ 4382e5910d42SPeter Maydell "-gdb dev accept gdb connection on 'dev'. (QEMU defaults to starting\n" 4383e5910d42SPeter Maydell " the guest without waiting for gdb to connect; use -S too\n" 4384e5910d42SPeter Maydell " if you want it to not start execution.)\n", 4385e5910d42SPeter Maydell QEMU_ARCH_ALL) 4386e2fcbf42SPeter MaydellSRST 4387e2fcbf42SPeter Maydell``-gdb dev`` 4388923e9311SThomas Huth Accept a gdb connection on device dev (see the :ref:`GDB usage` chapter 4389923e9311SThomas Huth in the System Emulation Users Guide). Note that this option does not pause QEMU 4390e5910d42SPeter Maydell execution -- if you want QEMU to not start the guest until you 4391e5910d42SPeter Maydell connect with gdb and issue a ``continue`` command, you will need to 4392e5910d42SPeter Maydell also pass the ``-S`` option to QEMU. 4393e5910d42SPeter Maydell 4394e5910d42SPeter Maydell The most usual configuration is to listen on a local TCP socket:: 4395e5910d42SPeter Maydell 4396e5910d42SPeter Maydell -gdb tcp::3117 4397e5910d42SPeter Maydell 4398e5910d42SPeter Maydell but you can specify other backends; UDP, pseudo TTY, or even stdio 4399e5910d42SPeter Maydell are all reasonable use cases. For example, a stdio connection 4400e5910d42SPeter Maydell allows you to start QEMU from within gdb and establish the 4401e5910d42SPeter Maydell connection via a pipe: 4402e2fcbf42SPeter Maydell 440309ce5f2dSPeter Maydell .. parsed-literal:: 4404e2fcbf42SPeter Maydell 4405e2fcbf42SPeter Maydell (gdb) target remote | exec |qemu_system| -gdb stdio ... 4406e2fcbf42SPeter MaydellERST 44075824d651Sblueswir1 440859030a8cSaliguoriDEF("s", 0, QEMU_OPTION_s, \ 4409ad96090aSBlue Swirl "-s shorthand for -gdb tcp::" DEFAULT_GDBSTUB_PORT "\n", 4410ad96090aSBlue Swirl QEMU_ARCH_ALL) 4411e2fcbf42SPeter MaydellSRST 4412e2fcbf42SPeter Maydell``-s`` 4413e2fcbf42SPeter Maydell Shorthand for -gdb tcp::1234, i.e. open a gdbserver on TCP port 1234 4414923e9311SThomas Huth (see the :ref:`GDB usage` chapter in the System Emulation Users Guide). 4415e2fcbf42SPeter MaydellERST 44165824d651Sblueswir1 44175824d651Sblueswir1DEF("d", HAS_ARG, QEMU_OPTION_d, \ 4418989b697dSPeter Maydell "-d item1,... enable logging of specified items (use '-d help' for a list of log items)\n", 4419ad96090aSBlue Swirl QEMU_ARCH_ALL) 4420e2fcbf42SPeter MaydellSRST 4421e2fcbf42SPeter Maydell``-d item1[,...]`` 4422e2fcbf42SPeter Maydell Enable logging of specified items. Use '-d help' for a list of log 4423e2fcbf42SPeter Maydell items. 4424e2fcbf42SPeter MaydellERST 44255824d651Sblueswir1 4426c235d738SMatthew FernandezDEF("D", HAS_ARG, QEMU_OPTION_D, \ 4427989b697dSPeter Maydell "-D logfile output log to logfile (default stderr)\n", 4428c235d738SMatthew Fernandez QEMU_ARCH_ALL) 4429e2fcbf42SPeter MaydellSRST 4430e2fcbf42SPeter Maydell``-D logfile`` 4431e2fcbf42SPeter Maydell Output log in logfile instead of to stderr 4432e2fcbf42SPeter MaydellERST 4433c235d738SMatthew Fernandez 44343514552eSAlex BennéeDEF("dfilter", HAS_ARG, QEMU_OPTION_DFILTER, \ 44353514552eSAlex Bennée "-dfilter range,.. filter debug output to range of addresses (useful for -d cpu,exec,etc..)\n", 44363514552eSAlex Bennée QEMU_ARCH_ALL) 4437e2fcbf42SPeter MaydellSRST 4438e2fcbf42SPeter Maydell``-dfilter range1[,...]`` 4439e2fcbf42SPeter Maydell Filter debug output to that relevant to a range of target addresses. 4440e2fcbf42SPeter Maydell The filter spec can be either start+size, start-size or start..end 4441e2fcbf42SPeter Maydell where start end and size are the addresses and sizes required. For 4442e2fcbf42SPeter Maydell example: 4443e2fcbf42SPeter Maydell 4444e2fcbf42SPeter Maydell :: 4445e2fcbf42SPeter Maydell 4446e2fcbf42SPeter Maydell -dfilter 0x8000..0x8fff,0xffffffc000080000+0x200,0xffffffc000060000-0x1000 4447e2fcbf42SPeter Maydell 4448e2fcbf42SPeter Maydell Will dump output for any code in the 0x1000 sized block starting at 4449e2fcbf42SPeter Maydell 0x8000 and the 0x200 sized block starting at 0xffffffc000080000 and 4450e2fcbf42SPeter Maydell another 0x1000 sized block starting at 0xffffffc00005f000. 4451e2fcbf42SPeter MaydellERST 44523514552eSAlex Bennée 44539c09a251SRichard HendersonDEF("seed", HAS_ARG, QEMU_OPTION_seed, \ 44549c09a251SRichard Henderson "-seed number seed the pseudo-random number generator\n", 44559c09a251SRichard Henderson QEMU_ARCH_ALL) 4456e2fcbf42SPeter MaydellSRST 4457e2fcbf42SPeter Maydell``-seed number`` 4458e2fcbf42SPeter Maydell Force the guest to use a deterministic pseudo-random number 4459e2fcbf42SPeter Maydell generator, seeded with number. This does not affect crypto routines 4460e2fcbf42SPeter Maydell within the host. 4461e2fcbf42SPeter MaydellERST 44629c09a251SRichard Henderson 44635824d651Sblueswir1DEF("L", HAS_ARG, QEMU_OPTION_L, \ 4464ad96090aSBlue Swirl "-L path set the directory for the BIOS, VGA BIOS and keymaps\n", 4465ad96090aSBlue Swirl QEMU_ARCH_ALL) 4466e2fcbf42SPeter MaydellSRST 4467e2fcbf42SPeter Maydell``-L path`` 4468e2fcbf42SPeter Maydell Set the directory for the BIOS, VGA BIOS and keymaps. 4469e2fcbf42SPeter Maydell 4470e2fcbf42SPeter Maydell To list all the data directories, use ``-L help``. 4471e2fcbf42SPeter MaydellERST 44725824d651Sblueswir1 44735824d651Sblueswir1DEF("enable-kvm", 0, QEMU_OPTION_enable_kvm, \ 447421abf010SThomas Huth "-enable-kvm enable KVM full virtualization support\n", 447521abf010SThomas Huth QEMU_ARCH_ARM | QEMU_ARCH_I386 | QEMU_ARCH_MIPS | QEMU_ARCH_PPC | 447621abf010SThomas Huth QEMU_ARCH_RISCV | QEMU_ARCH_S390X) 4477e2fcbf42SPeter MaydellSRST 4478e2fcbf42SPeter Maydell``-enable-kvm`` 4479e2fcbf42SPeter Maydell Enable KVM full virtualization support. This option is only 4480e2fcbf42SPeter Maydell available if KVM support is enabled when compiling. 4481e2fcbf42SPeter MaydellERST 44825824d651Sblueswir1 4483e37630caSaliguoriDEF("xen-domid", HAS_ARG, QEMU_OPTION_xen_domid, 4484eeb3647cSThomas Huth "-xen-domid id specify xen guest domain id\n", 4485eeb3647cSThomas Huth QEMU_ARCH_ARM | QEMU_ARCH_I386) 4486e37630caSaliguoriDEF("xen-attach", 0, QEMU_OPTION_xen_attach, 4487e37630caSaliguori "-xen-attach attach to existing xen domain\n" 44881077bcacSAnthony PERARD " libxl will use this when starting QEMU\n", 4489eeb3647cSThomas Huth QEMU_ARCH_ARM | QEMU_ARCH_I386) 44901c599472SPaul DurrantDEF("xen-domid-restrict", 0, QEMU_OPTION_xen_domid_restrict, 44911c599472SPaul Durrant "-xen-domid-restrict restrict set of available xen operations\n" 44921c599472SPaul Durrant " to specified domain id. (Does not affect\n" 44931c599472SPaul Durrant " xenpv machine type).\n", 4494eeb3647cSThomas Huth QEMU_ARCH_ARM | QEMU_ARCH_I386) 4495e2fcbf42SPeter MaydellSRST 4496e2fcbf42SPeter Maydell``-xen-domid id`` 4497e2fcbf42SPeter Maydell Specify xen guest domain id (XEN only). 4498e2fcbf42SPeter Maydell 4499e2fcbf42SPeter Maydell``-xen-attach`` 4500e2fcbf42SPeter Maydell Attach to existing xen domain. libxl will use this when starting 4501e2fcbf42SPeter Maydell QEMU (XEN only). Restrict set of available xen operations to 4502e2fcbf42SPeter Maydell specified domain id (XEN only). 4503e2fcbf42SPeter MaydellERST 4504e37630caSaliguori 45055824d651Sblueswir1DEF("no-reboot", 0, QEMU_OPTION_no_reboot, \ 4506ad96090aSBlue Swirl "-no-reboot exit instead of rebooting\n", QEMU_ARCH_ALL) 4507e2fcbf42SPeter MaydellSRST 4508e2fcbf42SPeter Maydell``-no-reboot`` 4509e2fcbf42SPeter Maydell Exit instead of rebooting. 4510e2fcbf42SPeter MaydellERST 45115824d651Sblueswir1 45125824d651Sblueswir1DEF("no-shutdown", 0, QEMU_OPTION_no_shutdown, \ 4513ad96090aSBlue Swirl "-no-shutdown stop before shutdown\n", QEMU_ARCH_ALL) 4514e2fcbf42SPeter MaydellSRST 4515e2fcbf42SPeter Maydell``-no-shutdown`` 4516e2fcbf42SPeter Maydell Don't exit QEMU on guest shutdown, but instead only stop the 4517e2fcbf42SPeter Maydell emulation. This allows for instance switching to monitor to commit 4518e2fcbf42SPeter Maydell changes to the disk image. 4519e2fcbf42SPeter MaydellERST 45205824d651Sblueswir1 45212a5ad60bSAlejandro JimenezDEF("action", HAS_ARG, QEMU_OPTION_action, 4522c27025e0SPaolo Bonzini "-action reboot=reset|shutdown\n" 4523c27025e0SPaolo Bonzini " action when guest reboots [default=reset]\n" 45242a5ad60bSAlejandro Jimenez "-action shutdown=poweroff|pause\n" 45252a5ad60bSAlejandro Jimenez " action when guest shuts down [default=poweroff]\n" 45260882caf4SIlya Leoshkevich "-action panic=pause|shutdown|exit-failure|none\n" 4527c27025e0SPaolo Bonzini " action when guest panics [default=shutdown]\n" 45282a5ad60bSAlejandro Jimenez "-action watchdog=reset|shutdown|poweroff|inject-nmi|pause|debug|none\n" 45292a5ad60bSAlejandro Jimenez " action when watchdog fires [default=reset]\n", 45302a5ad60bSAlejandro Jimenez QEMU_ARCH_ALL) 45312a5ad60bSAlejandro JimenezSRST 45322a5ad60bSAlejandro Jimenez``-action event=action`` 45332a5ad60bSAlejandro Jimenez The action parameter serves to modify QEMU's default behavior when 45342a5ad60bSAlejandro Jimenez certain guest events occur. It provides a generic method for specifying the 45352a5ad60bSAlejandro Jimenez same behaviors that are modified by the ``-no-reboot`` and ``-no-shutdown`` 45362a5ad60bSAlejandro Jimenez parameters. 45372a5ad60bSAlejandro Jimenez 45382a5ad60bSAlejandro Jimenez Examples: 45392a5ad60bSAlejandro Jimenez 4540c753e8e7SAlejandro Jimenez ``-action panic=none`` 45412a5ad60bSAlejandro Jimenez ``-action reboot=shutdown,shutdown=pause`` 45425433af76SPaolo Bonzini ``-device i6300esb -action watchdog=pause`` 45432a5ad60bSAlejandro Jimenez 45442a5ad60bSAlejandro JimenezERST 45452a5ad60bSAlejandro Jimenez 45465824d651Sblueswir1DEF("loadvm", HAS_ARG, QEMU_OPTION_loadvm, \ 45475824d651Sblueswir1 "-loadvm [tag|id]\n" \ 4548ad96090aSBlue Swirl " start right away with a saved state (loadvm in monitor)\n", 4549ad96090aSBlue Swirl QEMU_ARCH_ALL) 4550e2fcbf42SPeter MaydellSRST 4551e2fcbf42SPeter Maydell``-loadvm file`` 4552e2fcbf42SPeter Maydell Start right away with a saved state (``loadvm`` in monitor) 4553e2fcbf42SPeter MaydellERST 45545824d651Sblueswir1 45555824d651Sblueswir1#ifndef _WIN32 45565824d651Sblueswir1DEF("daemonize", 0, QEMU_OPTION_daemonize, \ 4557ad96090aSBlue Swirl "-daemonize daemonize QEMU after initializing\n", QEMU_ARCH_ALL) 45585824d651Sblueswir1#endif 4559e2fcbf42SPeter MaydellSRST 4560e2fcbf42SPeter Maydell``-daemonize`` 4561e2fcbf42SPeter Maydell Daemonize the QEMU process after initialization. QEMU will not 4562e2fcbf42SPeter Maydell detach from standard IO until it is ready to receive connections on 4563e2fcbf42SPeter Maydell any of its devices. This option is a useful way for external 4564e2fcbf42SPeter Maydell programs to launch QEMU without having to cope with initialization 4565e2fcbf42SPeter Maydell race conditions. 4566e2fcbf42SPeter MaydellERST 45675824d651Sblueswir1 45685824d651Sblueswir1DEF("option-rom", HAS_ARG, QEMU_OPTION_option_rom, \ 4569ad96090aSBlue Swirl "-option-rom rom load a file, rom, into the option ROM space\n", 4570ad96090aSBlue Swirl QEMU_ARCH_ALL) 4571e2fcbf42SPeter MaydellSRST 4572e2fcbf42SPeter Maydell``-option-rom file`` 4573e2fcbf42SPeter Maydell Load the contents of file as an option ROM. This option is useful to 4574e2fcbf42SPeter Maydell load things like EtherBoot. 4575e2fcbf42SPeter MaydellERST 45765824d651Sblueswir1 45771ed2fc1fSJan KiszkaDEF("rtc", HAS_ARG, QEMU_OPTION_rtc, \ 4578238d1240SArtem Pisarenko "-rtc [base=utc|localtime|<datetime>][,clock=host|rt|vm][,driftfix=none|slew]\n" \ 4579ad96090aSBlue Swirl " set the RTC base and clock, enable drift fix for clock ticks (x86 only)\n", 4580ad96090aSBlue Swirl QEMU_ARCH_ALL) 45811ed2fc1fSJan Kiszka 4582e2fcbf42SPeter MaydellSRST 4583e2fcbf42SPeter Maydell``-rtc [base=utc|localtime|datetime][,clock=host|rt|vm][,driftfix=none|slew]`` 4584e2fcbf42SPeter Maydell Specify ``base`` as ``utc`` or ``localtime`` to let the RTC start at 4585e2fcbf42SPeter Maydell the current UTC or local time, respectively. ``localtime`` is 4586e2fcbf42SPeter Maydell required for correct date in MS-DOS or Windows. To start at a 4587e2fcbf42SPeter Maydell specific point in time, provide datetime in the format 4588e2fcbf42SPeter Maydell ``2006-06-17T16:01:21`` or ``2006-06-17``. The default base is UTC. 4589e2fcbf42SPeter Maydell 4590e2fcbf42SPeter Maydell By default the RTC is driven by the host system time. This allows 4591e2fcbf42SPeter Maydell using of the RTC as accurate reference clock inside the guest, 4592e2fcbf42SPeter Maydell specifically if the host time is smoothly following an accurate 4593e2fcbf42SPeter Maydell external reference clock, e.g. via NTP. If you want to isolate the 4594e2fcbf42SPeter Maydell guest time from the host, you can set ``clock`` to ``rt`` instead, 4595e2fcbf42SPeter Maydell which provides a host monotonic clock if host support it. To even 4596e2fcbf42SPeter Maydell prevent the RTC from progressing during suspension, you can set 4597e2fcbf42SPeter Maydell ``clock`` to ``vm`` (virtual clock). '\ ``clock=vm``\ ' is 4598e2fcbf42SPeter Maydell recommended especially in icount mode in order to preserve 4599e2fcbf42SPeter Maydell determinism; however, note that in icount mode the speed of the 4600e2fcbf42SPeter Maydell virtual clock is variable and can in general differ from the host 4601e2fcbf42SPeter Maydell clock. 4602e2fcbf42SPeter Maydell 4603e2fcbf42SPeter Maydell Enable ``driftfix`` (i386 targets only) if you experience time drift 4604e2fcbf42SPeter Maydell problems, specifically with Windows' ACPI HAL. This option will try 4605e2fcbf42SPeter Maydell to figure out how many timer interrupts were not processed by the 4606e2fcbf42SPeter Maydell Windows guest and will re-inject them. 4607e2fcbf42SPeter MaydellERST 46085824d651Sblueswir1 46095824d651Sblueswir1DEF("icount", HAS_ARG, QEMU_OPTION_icount, \ 4610fa647905SPeter Maydell "-icount [shift=N|auto][,align=on|off][,sleep=on|off][,rr=record|replay,rrfile=<filename>[,rrsnapshot=<snapshot>]]\n" \ 4611bc14ca24Saliguori " enable virtual instruction counter with 2^N clock ticks per\n" \ 4612f1f4b57eSVictor CLEMENT " instruction, enable aligning the host and virtual clocks\n" \ 4613fa647905SPeter Maydell " or disable real time cpu sleeping, and optionally enable\n" \ 4614fa647905SPeter Maydell " record-and-replay mode\n", QEMU_ARCH_ALL) 4615e2fcbf42SPeter MaydellSRST 4616fa647905SPeter Maydell``-icount [shift=N|auto][,align=on|off][,sleep=on|off][,rr=record|replay,rrfile=filename[,rrsnapshot=snapshot]]`` 4617e2fcbf42SPeter Maydell Enable virtual instruction counter. The virtual cpu will execute one 4618e2fcbf42SPeter Maydell instruction every 2^N ns of virtual time. If ``auto`` is specified 4619e2fcbf42SPeter Maydell then the virtual cpu speed will be automatically adjusted to keep 4620e2fcbf42SPeter Maydell virtual time within a few seconds of real time. 4621e2fcbf42SPeter Maydell 4622e2fcbf42SPeter Maydell Note that while this option can give deterministic behavior, it does 4623e2fcbf42SPeter Maydell not provide cycle accurate emulation. Modern CPUs contain 4624e2fcbf42SPeter Maydell superscalar out of order cores with complex cache hierarchies. The 4625e2fcbf42SPeter Maydell number of instructions executed often has little or no correlation 4626e2fcbf42SPeter Maydell with actual performance. 4627e2fcbf42SPeter Maydell 4628fa647905SPeter Maydell When the virtual cpu is sleeping, the virtual time will advance at 4629fa647905SPeter Maydell default speed unless ``sleep=on`` is specified. With 4630fa647905SPeter Maydell ``sleep=on``, the virtual time will jump to the next timer 4631fa647905SPeter Maydell deadline instantly whenever the virtual cpu goes to sleep mode and 4632fa647905SPeter Maydell will not advance if no timer is enabled. This behavior gives 4633fa647905SPeter Maydell deterministic execution times from the guest point of view. 4634fa647905SPeter Maydell The default if icount is enabled is ``sleep=off``. 4635fa647905SPeter Maydell ``sleep=on`` cannot be used together with either ``shift=auto`` 4636fa647905SPeter Maydell or ``align=on``. 4637fa647905SPeter Maydell 4638e2fcbf42SPeter Maydell ``align=on`` will activate the delay algorithm which will try to 4639e2fcbf42SPeter Maydell synchronise the host clock and the virtual clock. The goal is to 4640e2fcbf42SPeter Maydell have a guest running at the real frequency imposed by the shift 4641e2fcbf42SPeter Maydell option. Whenever the guest clock is behind the host clock and if 4642e2fcbf42SPeter Maydell ``align=on`` is specified then we print a message to the user to 4643e2fcbf42SPeter Maydell inform about the delay. Currently this option does not work when 4644e2fcbf42SPeter Maydell ``shift`` is ``auto``. Note: The sync algorithm will work for those 4645e2fcbf42SPeter Maydell shift values for which the guest clock runs ahead of the host clock. 4646e2fcbf42SPeter Maydell Typically this happens when the shift value is high (how high 4647fa647905SPeter Maydell depends on the host machine). The default if icount is enabled 4648fa647905SPeter Maydell is ``align=off``. 4649e2fcbf42SPeter Maydell 4650fa647905SPeter Maydell When the ``rr`` option is specified deterministic record/replay is 4651fa647905SPeter Maydell enabled. The ``rrfile=`` option must also be provided to 4652fa647905SPeter Maydell specify the path to the replay log. In record mode data is written 4653fa647905SPeter Maydell to this file, and in replay mode it is read back. 4654fa647905SPeter Maydell If the ``rrsnapshot`` option is given then it specifies a VM snapshot 4655fa647905SPeter Maydell name. In record mode, a new VM snapshot with the given name is created 4656fa647905SPeter Maydell at the start of execution recording. In replay mode this option 4657fa647905SPeter Maydell specifies the snapshot name used to load the initial VM state. 4658e2fcbf42SPeter MaydellERST 46595824d651Sblueswir1 46609dd986ccSRichard W.M. JonesDEF("watchdog-action", HAS_ARG, QEMU_OPTION_watchdog_action, \ 46617ad9270eSMarkus Armbruster "-watchdog-action reset|shutdown|poweroff|inject-nmi|pause|debug|none\n" \ 4662ad96090aSBlue Swirl " action when watchdog fires [default=reset]\n", 4663ad96090aSBlue Swirl QEMU_ARCH_ALL) 4664e2fcbf42SPeter MaydellSRST 4665e2fcbf42SPeter Maydell``-watchdog-action action`` 4666e2fcbf42SPeter Maydell The action controls what QEMU will do when the watchdog timer 4667e2fcbf42SPeter Maydell expires. The default is ``reset`` (forcefully reset the guest). 4668e2fcbf42SPeter Maydell Other possible actions are: ``shutdown`` (attempt to gracefully 4669e2fcbf42SPeter Maydell shutdown the guest), ``poweroff`` (forcefully poweroff the guest), 4670e2fcbf42SPeter Maydell ``inject-nmi`` (inject a NMI into the guest), ``pause`` (pause the 4671e2fcbf42SPeter Maydell guest), ``debug`` (print a debug message and continue), or ``none`` 4672e2fcbf42SPeter Maydell (do nothing). 4673e2fcbf42SPeter Maydell 4674e2fcbf42SPeter Maydell Note that the ``shutdown`` action requires that the guest responds 4675e2fcbf42SPeter Maydell to ACPI signals, which it may not be able to do in the sort of 4676e2fcbf42SPeter Maydell situations where the watchdog would have expired, and thus 4677e2fcbf42SPeter Maydell ``-watchdog-action shutdown`` is not recommended for production use. 4678e2fcbf42SPeter Maydell 4679e2fcbf42SPeter Maydell Examples: 4680e2fcbf42SPeter Maydell 46815433af76SPaolo Bonzini ``-device i6300esb -watchdog-action pause`` 4682e2fcbf42SPeter Maydell 4683e2fcbf42SPeter MaydellERST 46849dd986ccSRichard W.M. Jones 46855824d651Sblueswir1DEF("echr", HAS_ARG, QEMU_OPTION_echr, \ 4686ad96090aSBlue Swirl "-echr chr set terminal escape character instead of ctrl-a\n", 4687ad96090aSBlue Swirl QEMU_ARCH_ALL) 4688e2fcbf42SPeter MaydellSRST 4689e2fcbf42SPeter Maydell``-echr numeric_ascii_value`` 4690e2fcbf42SPeter Maydell Change the escape character used for switching to the monitor when 4691e2fcbf42SPeter Maydell using monitor and serial sharing. The default is ``0x01`` when using 4692e2fcbf42SPeter Maydell the ``-nographic`` option. ``0x01`` is equal to pressing 4693e2fcbf42SPeter Maydell ``Control-a``. You can select a different character from the ascii 4694e2fcbf42SPeter Maydell control keys where 1 through 26 map to Control-a through Control-z. 4695e2fcbf42SPeter Maydell For instance you could use the either of the following to change the 4696e2fcbf42SPeter Maydell escape character to Control-t. 4697e2fcbf42SPeter Maydell 4698e2fcbf42SPeter Maydell ``-echr 0x14``; \ ``-echr 20`` 4699e2fcbf42SPeter Maydell 4700e2fcbf42SPeter MaydellERST 47015824d651Sblueswir1 47025824d651Sblueswir1DEF("incoming", HAS_ARG, QEMU_OPTION_incoming, \ 4703bf24095fSDaniel P. Berrangé "-incoming tcp:[host]:port[,to=maxport][,ipv4=on|off][,ipv6=on|off]\n" \ 4704bf24095fSDaniel P. Berrangé "-incoming rdma:host:port[,ipv4=on|off][,ipv6=on|off]\n" \ 47057c601803SMichael Tokarev "-incoming unix:socketpath\n" \ 47067c601803SMichael Tokarev " prepare for incoming migration, listen on\n" \ 47077c601803SMichael Tokarev " specified protocol and socket address\n" \ 47087c601803SMichael Tokarev "-incoming fd:fd\n" \ 4709*2a9e2e59SSteve Sistare "-incoming file:filename\n" \ 47107c601803SMichael Tokarev "-incoming exec:cmdline\n" \ 47117c601803SMichael Tokarev " accept incoming migration on given file descriptor\n" \ 47121597051bSDr. David Alan Gilbert " or from given external command\n" \ 47131597051bSDr. David Alan Gilbert "-incoming defer\n" \ 47141597051bSDr. David Alan Gilbert " wait for the URI to be specified via migrate_incoming\n", 4715ad96090aSBlue Swirl QEMU_ARCH_ALL) 4716e2fcbf42SPeter MaydellSRST 4717bf24095fSDaniel P. Berrangé``-incoming tcp:[host]:port[,to=maxport][,ipv4=on|off][,ipv6=on|off]`` 471809ce5f2dSPeter Maydell \ 4719bf24095fSDaniel P. Berrangé``-incoming rdma:host:port[,ipv4=on|off][,ipv6=on|off]`` 4720e2fcbf42SPeter Maydell Prepare for incoming migration, listen on a given tcp port. 4721e2fcbf42SPeter Maydell 4722e2fcbf42SPeter Maydell``-incoming unix:socketpath`` 4723e2fcbf42SPeter Maydell Prepare for incoming migration, listen on a given unix socket. 4724e2fcbf42SPeter Maydell 4725e2fcbf42SPeter Maydell``-incoming fd:fd`` 4726e2fcbf42SPeter Maydell Accept incoming migration from a given file descriptor. 4727e2fcbf42SPeter Maydell 4728*2a9e2e59SSteve Sistare``-incoming file:filename`` 4729*2a9e2e59SSteve Sistare Accept incoming migration from a given file. 4730*2a9e2e59SSteve Sistare 4731e2fcbf42SPeter Maydell``-incoming exec:cmdline`` 4732e2fcbf42SPeter Maydell Accept incoming migration as an output from specified external 4733e2fcbf42SPeter Maydell command. 4734e2fcbf42SPeter Maydell 4735e2fcbf42SPeter Maydell``-incoming defer`` 4736e2fcbf42SPeter Maydell Wait for the URI to be specified via migrate\_incoming. The monitor 4737e2fcbf42SPeter Maydell can be used to change settings (such as migration parameters) prior 4738e2fcbf42SPeter Maydell to issuing the migrate\_incoming to allow the migration to begin. 4739e2fcbf42SPeter MaydellERST 47405824d651Sblueswir1 4741d15c05fcSAshijeet AcharyaDEF("only-migratable", 0, QEMU_OPTION_only_migratable, \ 4742d15c05fcSAshijeet Acharya "-only-migratable allow only migratable devices\n", QEMU_ARCH_ALL) 4743e2fcbf42SPeter MaydellSRST 4744e2fcbf42SPeter Maydell``-only-migratable`` 4745e2fcbf42SPeter Maydell Only allow migratable devices. Devices will not be allowed to enter 4746e2fcbf42SPeter Maydell an unmigratable state. 4747e2fcbf42SPeter MaydellERST 4748d15c05fcSAshijeet Acharya 4749d8c208ddSGerd HoffmannDEF("nodefaults", 0, QEMU_OPTION_nodefaults, \ 4750ad96090aSBlue Swirl "-nodefaults don't create default devices\n", QEMU_ARCH_ALL) 4751e2fcbf42SPeter MaydellSRST 4752e2fcbf42SPeter Maydell``-nodefaults`` 4753e2fcbf42SPeter Maydell Don't create default devices. Normally, QEMU sets the default 4754e2fcbf42SPeter Maydell devices like serial port, parallel port, virtual console, monitor 4755e2fcbf42SPeter Maydell device, VGA adapter, floppy and CD-ROM drive and others. The 4756e2fcbf42SPeter Maydell ``-nodefaults`` option will disable all those default devices. 4757e2fcbf42SPeter MaydellERST 4758d8c208ddSGerd Hoffmann 47595824d651Sblueswir1#ifndef _WIN32 47605824d651Sblueswir1DEF("chroot", HAS_ARG, QEMU_OPTION_chroot, \ 47619ffcbe2aSThomas Huth "-chroot dir chroot to dir just before starting the VM (deprecated)\n", 4762ad96090aSBlue Swirl QEMU_ARCH_ALL) 47635824d651Sblueswir1#endif 4764e2fcbf42SPeter MaydellSRST 4765e2fcbf42SPeter Maydell``-chroot dir`` 47669ffcbe2aSThomas Huth Deprecated, use '-run-with chroot=...' instead. 4767e2fcbf42SPeter Maydell Immediately before starting guest execution, chroot to the specified 4768e2fcbf42SPeter Maydell directory. Especially useful in combination with -runas. 4769e2fcbf42SPeter MaydellERST 47705824d651Sblueswir1 47715824d651Sblueswir1#ifndef _WIN32 47725824d651Sblueswir1DEF("runas", HAS_ARG, QEMU_OPTION_runas, \ 47732c42f1e8SIan Jackson "-runas user change to user id user just before starting the VM\n" \ 47742c42f1e8SIan Jackson " user can be numeric uid:gid instead\n", 4775ad96090aSBlue Swirl QEMU_ARCH_ALL) 47765824d651Sblueswir1#endif 4777e2fcbf42SPeter MaydellSRST 4778e2fcbf42SPeter Maydell``-runas user`` 4779e2fcbf42SPeter Maydell Immediately before starting guest execution, drop root privileges, 4780e2fcbf42SPeter Maydell switching to the specified user. 4781e2fcbf42SPeter MaydellERST 47825824d651Sblueswir1 47835824d651Sblueswir1DEF("prom-env", HAS_ARG, QEMU_OPTION_prom_env, 47845824d651Sblueswir1 "-prom-env variable=value\n" 4785ad96090aSBlue Swirl " set OpenBIOS nvram variables\n", 4786ad96090aSBlue Swirl QEMU_ARCH_PPC | QEMU_ARCH_SPARC) 4787e2fcbf42SPeter MaydellSRST 4788e2fcbf42SPeter Maydell``-prom-env variable=value`` 4789e2fcbf42SPeter Maydell Set OpenBIOS nvram variable to given value (PPC, SPARC only). 4790e2fcbf42SPeter Maydell 4791e2fcbf42SPeter Maydell :: 4792e2fcbf42SPeter Maydell 4793e2fcbf42SPeter Maydell qemu-system-sparc -prom-env 'auto-boot?=false' \ 4794e2fcbf42SPeter Maydell -prom-env 'boot-device=sd(0,2,0):d' -prom-env 'boot-args=linux single' 4795e2fcbf42SPeter Maydell 4796e2fcbf42SPeter Maydell :: 4797e2fcbf42SPeter Maydell 4798e2fcbf42SPeter Maydell qemu-system-ppc -prom-env 'auto-boot?=false' \ 4799e2fcbf42SPeter Maydell -prom-env 'boot-device=hd:2,\yaboot' \ 4800e2fcbf42SPeter Maydell -prom-env 'boot-args=conf=hd:2,\yaboot.conf' 4801e2fcbf42SPeter MaydellERST 48025824d651Sblueswir1DEF("semihosting", 0, QEMU_OPTION_semihosting, 4803f7bbcfb5SMichael Walle "-semihosting semihosting mode\n", 48049d49bcf6SMarkus Armbruster QEMU_ARCH_ARM | QEMU_ARCH_M68K | QEMU_ARCH_XTENSA | 4805a10b9d93SKeith Packard QEMU_ARCH_MIPS | QEMU_ARCH_NIOS2 | QEMU_ARCH_RISCV) 4806e2fcbf42SPeter MaydellSRST 4807e2fcbf42SPeter Maydell``-semihosting`` 48082da9d213SAlex Bennée Enable :ref:`Semihosting` mode (ARM, M68K, Xtensa, MIPS, Nios II, RISC-V only). 4809e2fcbf42SPeter Maydell 48102da9d213SAlex Bennée .. warning:: 4811e2fcbf42SPeter Maydell Note that this allows guest direct access to the host filesystem, so 4812e2fcbf42SPeter Maydell should only be used with a trusted guest OS. 4813e2fcbf42SPeter Maydell 4814e2fcbf42SPeter Maydell See the -semihosting-config option documentation for further 4815e2fcbf42SPeter Maydell information about the facilities this enables. 4816e2fcbf42SPeter MaydellERST 4817a38bb079SLiviu IonescuDEF("semihosting-config", HAS_ARG, QEMU_OPTION_semihosting_config, 48185202861bSPeter Maydell "-semihosting-config [enable=on|off][,target=native|gdb|auto][,chardev=id][,userspace=on|off][,arg=str[,...]]\n" \ 4819a59d31a1SLeon Alrae " semihosting configuration\n", 48209d49bcf6SMarkus ArmbrusterQEMU_ARCH_ARM | QEMU_ARCH_M68K | QEMU_ARCH_XTENSA | 4821a10b9d93SKeith PackardQEMU_ARCH_MIPS | QEMU_ARCH_NIOS2 | QEMU_ARCH_RISCV) 4822e2fcbf42SPeter MaydellSRST 48235202861bSPeter Maydell``-semihosting-config [enable=on|off][,target=native|gdb|auto][,chardev=id][,userspace=on|off][,arg=str[,...]]`` 48242da9d213SAlex Bennée Enable and configure :ref:`Semihosting` (ARM, M68K, Xtensa, MIPS, Nios II, RISC-V 4825e2fcbf42SPeter Maydell only). 4826e2fcbf42SPeter Maydell 48272da9d213SAlex Bennée .. warning:: 4828e2fcbf42SPeter Maydell Note that this allows guest direct access to the host filesystem, so 4829e2fcbf42SPeter Maydell should only be used with a trusted guest OS. 4830e2fcbf42SPeter Maydell 4831e2fcbf42SPeter Maydell ``target=native|gdb|auto`` 4832e2fcbf42SPeter Maydell Defines where the semihosting calls will be addressed, to QEMU 4833e2fcbf42SPeter Maydell (``native``) or to GDB (``gdb``). The default is ``auto``, which 4834e2fcbf42SPeter Maydell means ``gdb`` during debug sessions and ``native`` otherwise. 4835e2fcbf42SPeter Maydell 4836e2fcbf42SPeter Maydell ``chardev=str1`` 4837e2fcbf42SPeter Maydell Send the output to a chardev backend output for native or auto 4838e2fcbf42SPeter Maydell output when not in gdb 4839e2fcbf42SPeter Maydell 48405202861bSPeter Maydell ``userspace=on|off`` 48415202861bSPeter Maydell Allows code running in guest userspace to access the semihosting 48425202861bSPeter Maydell interface. The default is that only privileged guest code can 48435202861bSPeter Maydell make semihosting calls. Note that setting ``userspace=on`` should 48445202861bSPeter Maydell only be used if all guest code is trusted (for example, in 48455202861bSPeter Maydell bare-metal test case code). 48465202861bSPeter Maydell 4847e2fcbf42SPeter Maydell ``arg=str1,arg=str2,...`` 4848e2fcbf42SPeter Maydell Allows the user to pass input arguments, and can be used 4849e2fcbf42SPeter Maydell multiple times to build up a list. The old-style 4850e2fcbf42SPeter Maydell ``-kernel``/``-append`` method of passing a command line is 4851e2fcbf42SPeter Maydell still supported for backward compatibility. If both the 4852e2fcbf42SPeter Maydell ``--semihosting-config arg`` and the ``-kernel``/``-append`` are 4853e2fcbf42SPeter Maydell specified, the former is passed to semihosting as it always 4854e2fcbf42SPeter Maydell takes precedence. 4855e2fcbf42SPeter MaydellERST 48565824d651Sblueswir1DEF("old-param", 0, QEMU_OPTION_old_param, 4857ad96090aSBlue Swirl "-old-param old param mode\n", QEMU_ARCH_ARM) 4858e2fcbf42SPeter MaydellSRST 4859e2fcbf42SPeter Maydell``-old-param`` 4860e2fcbf42SPeter Maydell Old param mode (ARM only). 4861e2fcbf42SPeter MaydellERST 486295d5f08bSStefan Weil 48637d76ad4fSEduardo OtuboDEF("sandbox", HAS_ARG, QEMU_OPTION_sandbox, \ 486473a1e647SEduardo Otubo "-sandbox on[,obsolete=allow|deny][,elevateprivileges=allow|deny|children]\n" \ 486524f8cdc5SEduardo Otubo " [,spawn=allow|deny][,resourcecontrol=allow|deny]\n" \ 48662b716fa6SEduardo Otubo " Enable seccomp mode 2 system call filter (default 'off').\n" \ 48672b716fa6SEduardo Otubo " use 'obsolete' to allow obsolete system calls that are provided\n" \ 48682b716fa6SEduardo Otubo " by the kernel, but typically no longer used by modern\n" \ 486973a1e647SEduardo Otubo " C library implementations.\n" \ 4870d42304b1SPhilippe Mathieu-Daudé " use 'elevateprivileges' to allow or deny the QEMU process ability\n" \ 4871d42304b1SPhilippe Mathieu-Daudé " to elevate privileges using set*uid|gid system calls.\n" \ 487273a1e647SEduardo Otubo " The value 'children' will deny set*uid|gid system calls for\n" \ 4873995a226fSEduardo Otubo " main QEMU process but will allow forks and execves to run unprivileged\n" \ 4874995a226fSEduardo Otubo " use 'spawn' to avoid QEMU to spawn new threads or processes by\n" \ 4875d42304b1SPhilippe Mathieu-Daudé " blocking *fork and execve\n" \ 487624f8cdc5SEduardo Otubo " use 'resourcecontrol' to disable process affinity and schedular priority\n", 48777d76ad4fSEduardo Otubo QEMU_ARCH_ALL) 4878e2fcbf42SPeter MaydellSRST 4879e2fcbf42SPeter Maydell``-sandbox arg[,obsolete=string][,elevateprivileges=string][,spawn=string][,resourcecontrol=string]`` 4880e2fcbf42SPeter Maydell Enable Seccomp mode 2 system call filter. 'on' will enable syscall 4881e2fcbf42SPeter Maydell filtering and 'off' will disable it. The default is 'off'. 4882e2fcbf42SPeter Maydell 4883e2fcbf42SPeter Maydell ``obsolete=string`` 4884e2fcbf42SPeter Maydell Enable Obsolete system calls 4885e2fcbf42SPeter Maydell 4886e2fcbf42SPeter Maydell ``elevateprivileges=string`` 4887e2fcbf42SPeter Maydell Disable set\*uid\|gid system calls 4888e2fcbf42SPeter Maydell 4889e2fcbf42SPeter Maydell ``spawn=string`` 4890e2fcbf42SPeter Maydell Disable \*fork and execve 4891e2fcbf42SPeter Maydell 4892e2fcbf42SPeter Maydell ``resourcecontrol=string`` 4893e2fcbf42SPeter Maydell Disable process affinity and schedular priority 4894e2fcbf42SPeter MaydellERST 48957d76ad4fSEduardo Otubo 4896715a664aSGerd HoffmannDEF("readconfig", HAS_ARG, QEMU_OPTION_readconfig, 4897e960a7eeSPaolo Bonzini "-readconfig <file>\n" 4898e960a7eeSPaolo Bonzini " read config file\n", QEMU_ARCH_ALL) 4899e2fcbf42SPeter MaydellSRST 4900e2fcbf42SPeter Maydell``-readconfig file`` 4901e2fcbf42SPeter Maydell Read device configuration from file. This approach is useful when 4902e2fcbf42SPeter Maydell you want to spawn QEMU process with many command line options but 4903e2fcbf42SPeter Maydell you don't want to exceed the command line character limit. 4904e2fcbf42SPeter MaydellERST 49052feac451SThomas Huth 4906f29a5614SEduardo HabkostDEF("no-user-config", 0, QEMU_OPTION_nouserconfig, 4907f29a5614SEduardo Habkost "-no-user-config\n" 49083478eae9SEduardo Habkost " do not load default user-provided config files at startup\n", 4909f29a5614SEduardo Habkost QEMU_ARCH_ALL) 4910e2fcbf42SPeter MaydellSRST 4911e2fcbf42SPeter Maydell``-no-user-config`` 4912e2fcbf42SPeter Maydell The ``-no-user-config`` option makes QEMU not load any of the 4913e2fcbf42SPeter Maydell user-provided config files on sysconfdir. 4914e2fcbf42SPeter MaydellERST 49152feac451SThomas Huth 4916ab6540d5SPrerna SaxenaDEF("trace", HAS_ARG, QEMU_OPTION_trace, 491710578a25SPaolo Bonzini "-trace [[enable=]<pattern>][,events=<file>][,file=<file>]\n" 491823d15e86SLluís " specify tracing options\n", 4919ab6540d5SPrerna Saxena QEMU_ARCH_ALL) 4920e2fcbf42SPeter MaydellSRST 4921e2fcbf42SPeter Maydell``-trace [[enable=]pattern][,events=file][,file=file]`` 492209ce5f2dSPeter Maydell .. include:: ../qemu-option-trace.rst.inc 4923e2fcbf42SPeter Maydell 4924e2fcbf42SPeter MaydellERST 492542229a75SLluís VilanovaDEF("plugin", HAS_ARG, QEMU_OPTION_plugin, 49263a445acbSMahmoud Mandour "-plugin [file=]<file>[,<argname>=<argvalue>]\n" 492742229a75SLluís Vilanova " load a plugin\n", 492842229a75SLluís Vilanova QEMU_ARCH_ALL) 4929e2fcbf42SPeter MaydellSRST 49303a445acbSMahmoud Mandour``-plugin file=file[,argname=argvalue]`` 4931e2fcbf42SPeter Maydell Load a plugin. 4932e2fcbf42SPeter Maydell 4933e2fcbf42SPeter Maydell ``file=file`` 4934e2fcbf42SPeter Maydell Load the given plugin from a shared library file. 4935e2fcbf42SPeter Maydell 49363a445acbSMahmoud Mandour ``argname=argvalue`` 49373a445acbSMahmoud Mandour Argument passed to the plugin. (Can be given multiple times.) 4938e2fcbf42SPeter MaydellERST 49393dbf2c7fSStefan Weil 494031e70d6cSMarkus ArmbrusterHXCOMM Internal use 494131e70d6cSMarkus ArmbrusterDEF("qtest", HAS_ARG, QEMU_OPTION_qtest, "", QEMU_ARCH_ALL) 494231e70d6cSMarkus ArmbrusterDEF("qtest-log", HAS_ARG, QEMU_OPTION_qtest_log, "", QEMU_ARCH_ALL) 4943c7f0f3b1SAnthony Liguori 4944c891c24bSClaudio Imbrenda#ifdef __linux__ 4945c891c24bSClaudio ImbrendaDEF("async-teardown", 0, QEMU_OPTION_asyncteardown, 4946c891c24bSClaudio Imbrenda "-async-teardown enable asynchronous teardown\n", 4947c891c24bSClaudio Imbrenda QEMU_ARCH_ALL) 4948c891c24bSClaudio ImbrendaSRST 4949c891c24bSClaudio Imbrenda``-async-teardown`` 495080bd81caSClaudio Imbrenda This option is deprecated and should no longer be used. The new option 495180bd81caSClaudio Imbrenda ``-run-with async-teardown=on`` is a replacement. 4952c891c24bSClaudio ImbrendaERST 49539ffcbe2aSThomas Huth#endif 49549ffcbe2aSThomas Huth#ifdef CONFIG_POSIX 495580bd81caSClaudio ImbrendaDEF("run-with", HAS_ARG, QEMU_OPTION_run_with, 49569ffcbe2aSThomas Huth "-run-with [async-teardown=on|off][,chroot=dir]\n" 49579ffcbe2aSThomas Huth " Set miscellaneous QEMU process lifecycle options:\n" 49589ffcbe2aSThomas Huth " async-teardown=on enables asynchronous teardown (Linux only)\n" 49599ffcbe2aSThomas Huth " chroot=dir chroot to dir just before starting the VM\n", 496080bd81caSClaudio Imbrenda QEMU_ARCH_ALL) 496180bd81caSClaudio ImbrendaSRST 49629ffcbe2aSThomas Huth``-run-with [async-teardown=on|off][,chroot=dir]`` 496380bd81caSClaudio Imbrenda Set QEMU process lifecycle options. 496480bd81caSClaudio Imbrenda 496580bd81caSClaudio Imbrenda ``async-teardown=on`` enables asynchronous teardown. A new process called 496680bd81caSClaudio Imbrenda "cleanup/<QEMU_PID>" will be created at startup sharing the address 496780bd81caSClaudio Imbrenda space with the main QEMU process, using clone. It will wait for the 496880bd81caSClaudio Imbrenda main QEMU process to terminate completely, and then exit. This allows 496980bd81caSClaudio Imbrenda QEMU to terminate very quickly even if the guest was huge, leaving the 497080bd81caSClaudio Imbrenda teardown of the address space to the cleanup process. Since the cleanup 497180bd81caSClaudio Imbrenda process shares the same cgroups as the main QEMU process, accounting is 497280bd81caSClaudio Imbrenda performed correctly. This only works if the cleanup process is not 497380bd81caSClaudio Imbrenda forcefully killed with SIGKILL before the main QEMU process has 497480bd81caSClaudio Imbrenda terminated completely. 49759ffcbe2aSThomas Huth 49769ffcbe2aSThomas Huth ``chroot=dir`` can be used for doing a chroot to the specified directory 49779ffcbe2aSThomas Huth immediately before starting the guest execution. This is especially useful 49789ffcbe2aSThomas Huth in combination with -runas. 497980bd81caSClaudio ImbrendaERST 498080bd81caSClaudio Imbrenda#endif 4981c891c24bSClaudio Imbrenda 49825e2ac519SSeiji AguchiDEF("msg", HAS_ARG, QEMU_OPTION_msg, 49832880ffb0SMario Smarduch "-msg [timestamp[=on|off]][,guest-name=[on|off]]\n" 4984deda497bSMarkus Armbruster " control error message format\n" 49852880ffb0SMario Smarduch " timestamp=on enables timestamps (default: off)\n" 49862880ffb0SMario Smarduch " guest-name=on enables guest name prefix but only if\n" 49872880ffb0SMario Smarduch " -name guest option is set (default: off)\n", 49885e2ac519SSeiji Aguchi QEMU_ARCH_ALL) 4989e2fcbf42SPeter MaydellSRST 49902880ffb0SMario Smarduch``-msg [timestamp[=on|off]][,guest-name[=on|off]]`` 4991e2fcbf42SPeter Maydell Control error message format. 4992e2fcbf42SPeter Maydell 4993e2fcbf42SPeter Maydell ``timestamp=on|off`` 4994e2fcbf42SPeter Maydell Prefix messages with a timestamp. Default is off. 49952880ffb0SMario Smarduch 49962880ffb0SMario Smarduch ``guest-name=on|off`` 49972880ffb0SMario Smarduch Prefix messages with guest name but only if -name guest option is set 49982880ffb0SMario Smarduch otherwise the option is ignored. Default is off. 4999e2fcbf42SPeter MaydellERST 50005e2ac519SSeiji Aguchi 5001abfd9ce3SAmit ShahDEF("dump-vmstate", HAS_ARG, QEMU_OPTION_dump_vmstate, 5002abfd9ce3SAmit Shah "-dump-vmstate <file>\n" 5003abfd9ce3SAmit Shah " Output vmstate information in JSON format to file.\n" 5004abfd9ce3SAmit Shah " Use the scripts/vmstate-static-checker.py file to\n" 5005abfd9ce3SAmit Shah " check for possible regressions in migration code\n" 50062382053fSLaurent Vivier " by comparing two such vmstate dumps.\n", 5007abfd9ce3SAmit Shah QEMU_ARCH_ALL) 5008e2fcbf42SPeter MaydellSRST 5009e2fcbf42SPeter Maydell``-dump-vmstate file`` 5010e2fcbf42SPeter Maydell Dump json-encoded vmstate information for current machine type to 5011e2fcbf42SPeter Maydell file in file 5012e2fcbf42SPeter MaydellERST 5013abfd9ce3SAmit Shah 501412df189dSEmilio G. CotaDEF("enable-sync-profile", 0, QEMU_OPTION_enable_sync_profile, 501512df189dSEmilio G. Cota "-enable-sync-profile\n" 501612df189dSEmilio G. Cota " enable synchronization profiling\n", 501712df189dSEmilio G. Cota QEMU_ARCH_ALL) 5018e2fcbf42SPeter MaydellSRST 5019e2fcbf42SPeter Maydell``-enable-sync-profile`` 5020e2fcbf42SPeter Maydell Enable synchronization profiling. 5021e2fcbf42SPeter MaydellERST 502212df189dSEmilio G. Cota 50235584e2dbSIlya Leoshkevich#if defined(CONFIG_TCG) && defined(CONFIG_LINUX) 50245584e2dbSIlya LeoshkevichDEF("perfmap", 0, QEMU_OPTION_perfmap, 50255584e2dbSIlya Leoshkevich "-perfmap generate a /tmp/perf-${pid}.map file for perf\n", 50265584e2dbSIlya Leoshkevich QEMU_ARCH_ALL) 50275584e2dbSIlya LeoshkevichSRST 50285584e2dbSIlya Leoshkevich``-perfmap`` 50295584e2dbSIlya Leoshkevich Generate a map file for Linux perf tools that will allow basic profiling 50305584e2dbSIlya Leoshkevich information to be broken down into basic blocks. 50315584e2dbSIlya LeoshkevichERST 50325584e2dbSIlya Leoshkevich 50335584e2dbSIlya LeoshkevichDEF("jitdump", 0, QEMU_OPTION_jitdump, 50345584e2dbSIlya Leoshkevich "-jitdump generate a jit-${pid}.dump file for perf\n", 50355584e2dbSIlya Leoshkevich QEMU_ARCH_ALL) 50365584e2dbSIlya LeoshkevichSRST 50375584e2dbSIlya Leoshkevich``-jitdump`` 50385584e2dbSIlya Leoshkevich Generate a dump file for Linux perf tools that maps basic blocks to symbol 50395584e2dbSIlya Leoshkevich names, line numbers and JITted code. 50405584e2dbSIlya LeoshkevichERST 50415584e2dbSIlya Leoshkevich#endif 50425584e2dbSIlya Leoshkevich 504343f187a5SPaolo BonziniDEFHEADING() 5044de6b4f90SMarkus Armbruster 5045de6b4f90SMarkus ArmbrusterDEFHEADING(Generic object creation:) 5046b9174d4fSDaniel P. Berrange 5047b9174d4fSDaniel P. BerrangeDEF("object", HAS_ARG, QEMU_OPTION_object, 5048b9174d4fSDaniel P. Berrange "-object TYPENAME[,PROP1=VALUE1,...]\n" 5049b9174d4fSDaniel P. Berrange " create a new object of type TYPENAME setting properties\n" 5050b9174d4fSDaniel P. Berrange " in the order they are specified. Note that the 'id'\n" 5051b9174d4fSDaniel P. Berrange " property must be set. These objects are placed in the\n" 5052b9174d4fSDaniel P. Berrange " '/objects' path.\n", 5053b9174d4fSDaniel P. Berrange QEMU_ARCH_ALL) 5054e2fcbf42SPeter MaydellSRST 5055e2fcbf42SPeter Maydell``-object typename[,prop1=value1,...]`` 5056e2fcbf42SPeter Maydell Create a new object of type typename setting properties in the order 5057e2fcbf42SPeter Maydell they are specified. Note that the 'id' property must be set. These 5058e2fcbf42SPeter Maydell objects are placed in the '/objects' path. 5059e2fcbf42SPeter Maydell 5060e92666b0SDavid Hildenbrand ``-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,offset=offset,readonly=on|off,rom=on|off|auto`` 5061e2fcbf42SPeter Maydell Creates a memory file backend object, which can be used to back 5062e2fcbf42SPeter Maydell the guest RAM with huge pages. 5063e2fcbf42SPeter Maydell 5064e2fcbf42SPeter Maydell The ``id`` parameter is a unique ID that will be used to 506556c9f00eSRobert Hoo reference this memory region in other parameters, e.g. ``-numa``, 506656c9f00eSRobert Hoo ``-device nvdimm``, etc. 5067e2fcbf42SPeter Maydell 5068e2fcbf42SPeter Maydell The ``size`` option provides the size of the memory region, and 506956c9f00eSRobert Hoo accepts common suffixes, e.g. ``500M``. 5070e2fcbf42SPeter Maydell 5071e2fcbf42SPeter Maydell The ``mem-path`` provides the path to either a shared memory or 5072e2fcbf42SPeter Maydell huge page filesystem mount. 5073e2fcbf42SPeter Maydell 5074e2fcbf42SPeter Maydell The ``share`` boolean option determines whether the memory 5075e2fcbf42SPeter Maydell region is marked as private to QEMU, or shared. The latter 5076e2fcbf42SPeter Maydell allows a co-operating external process to access the QEMU memory 5077e2fcbf42SPeter Maydell region. 5078e2fcbf42SPeter Maydell 5079e2fcbf42SPeter Maydell The ``share`` is also required for pvrdma devices due to 5080e2fcbf42SPeter Maydell limitations in the RDMA API provided by Linux. 5081e2fcbf42SPeter Maydell 5082e2fcbf42SPeter Maydell Setting share=on might affect the ability to configure NUMA 5083e2fcbf42SPeter Maydell bindings for the memory backend under some circumstances, see 5084e2fcbf42SPeter Maydell Documentation/vm/numa\_memory\_policy.txt on the Linux kernel 5085e2fcbf42SPeter Maydell source tree for additional details. 5086e2fcbf42SPeter Maydell 5087e2fcbf42SPeter Maydell Setting the ``discard-data`` boolean option to on indicates that 5088e2fcbf42SPeter Maydell file contents can be destroyed when QEMU exits, to avoid 5089e2fcbf42SPeter Maydell unnecessarily flushing data to the backing file. Note that 5090e2fcbf42SPeter Maydell ``discard-data`` is only an optimization, and QEMU might not 5091e2fcbf42SPeter Maydell discard file contents if it aborts unexpectedly or is terminated 5092e2fcbf42SPeter Maydell using SIGKILL. 5093e2fcbf42SPeter Maydell 5094e2fcbf42SPeter Maydell The ``merge`` boolean option enables memory merge, also known as 5095e2fcbf42SPeter Maydell MADV\_MERGEABLE, so that Kernel Samepage Merging will consider 5096e2fcbf42SPeter Maydell the pages for memory deduplication. 5097e2fcbf42SPeter Maydell 5098e2fcbf42SPeter Maydell Setting the ``dump`` boolean option to off excludes the memory 5099e2fcbf42SPeter Maydell from core dumps. This feature is also known as MADV\_DONTDUMP. 5100e2fcbf42SPeter Maydell 5101e2fcbf42SPeter Maydell The ``prealloc`` boolean option enables memory preallocation. 5102e2fcbf42SPeter Maydell 5103e2fcbf42SPeter Maydell The ``host-nodes`` option binds the memory range to a list of 5104e2fcbf42SPeter Maydell NUMA host nodes. 5105e2fcbf42SPeter Maydell 5106e2fcbf42SPeter Maydell The ``policy`` option sets the NUMA policy to one of the 5107e2fcbf42SPeter Maydell following values: 5108e2fcbf42SPeter Maydell 5109e2fcbf42SPeter Maydell ``default`` 5110e2fcbf42SPeter Maydell default host policy 5111e2fcbf42SPeter Maydell 5112e2fcbf42SPeter Maydell ``preferred`` 5113e2fcbf42SPeter Maydell prefer the given host node list for allocation 5114e2fcbf42SPeter Maydell 5115e2fcbf42SPeter Maydell ``bind`` 5116e2fcbf42SPeter Maydell restrict memory allocation to the given host node list 5117e2fcbf42SPeter Maydell 5118e2fcbf42SPeter Maydell ``interleave`` 5119e2fcbf42SPeter Maydell interleave memory allocations across the given host node 5120e2fcbf42SPeter Maydell list 5121e2fcbf42SPeter Maydell 5122e2fcbf42SPeter Maydell The ``align`` option specifies the base address alignment when 5123e2fcbf42SPeter Maydell QEMU mmap(2) ``mem-path``, and accepts common suffixes, eg 5124e2fcbf42SPeter Maydell ``2M``. Some backend store specified by ``mem-path`` requires an 5125e2fcbf42SPeter Maydell alignment different than the default one used by QEMU, eg the 5126e2fcbf42SPeter Maydell device DAX /dev/dax0.0 requires 2M alignment rather than 4K. In 5127e2fcbf42SPeter Maydell such cases, users can specify the required alignment via this 5128e2fcbf42SPeter Maydell option. 5129e2fcbf42SPeter Maydell 51304b870dc4SAlexander Graf The ``offset`` option specifies the offset into the target file 51314b870dc4SAlexander Graf that the region starts at. You can use this parameter to back 51324b870dc4SAlexander Graf multiple regions with a single file. 51334b870dc4SAlexander Graf 5134e2fcbf42SPeter Maydell The ``pmem`` option specifies whether the backing file specified 5135e2fcbf42SPeter Maydell by ``mem-path`` is in host persistent memory that can be 5136e2fcbf42SPeter Maydell accessed using the SNIA NVM programming model (e.g. Intel 5137e2fcbf42SPeter Maydell NVDIMM). If ``pmem`` is set to 'on', QEMU will take necessary 5138e2fcbf42SPeter Maydell operations to guarantee the persistence of its own writes to 5139e2fcbf42SPeter Maydell ``mem-path`` (e.g. in vNVDIMM label emulation and live 5140e2fcbf42SPeter Maydell migration). Also, we will map the backend-file with MAP\_SYNC 5141e2fcbf42SPeter Maydell flag, which ensures the file metadata is in sync for 5142e2fcbf42SPeter Maydell ``mem-path`` in case of host crash or a power failure. MAP\_SYNC 5143e2fcbf42SPeter Maydell requires support from both the host kernel (since Linux kernel 5144e2fcbf42SPeter Maydell 4.15) and the filesystem of ``mem-path`` mounted with DAX 5145e2fcbf42SPeter Maydell option. 5146e2fcbf42SPeter Maydell 514786635aa4SStefan Hajnoczi The ``readonly`` option specifies whether the backing file is opened 514886635aa4SStefan Hajnoczi read-only or read-write (default). 514986635aa4SStefan Hajnoczi 5150e92666b0SDavid Hildenbrand The ``rom`` option specifies whether to create Read Only Memory 5151e92666b0SDavid Hildenbrand (ROM) that cannot be modified by the VM. Any write attempts to such 5152e92666b0SDavid Hildenbrand ROM will be denied. Most use cases want proper RAM instead of ROM. 5153e92666b0SDavid Hildenbrand However, selected use cases, like R/O NVDIMMs, can benefit from 5154e92666b0SDavid Hildenbrand ROM. If set to ``on``, create ROM; if set to ``off``, create 5155e92666b0SDavid Hildenbrand writable RAM; if set to ``auto`` (default), the value of the 5156e92666b0SDavid Hildenbrand ``readonly`` option is used. This option is primarily helpful when 5157e92666b0SDavid Hildenbrand we want to have writable RAM in configurations that would 5158e92666b0SDavid Hildenbrand traditionally create ROM before the ``rom`` option was introduced: 5159e92666b0SDavid Hildenbrand VM templating, where we want to open a file readonly 5160e92666b0SDavid Hildenbrand (``readonly=on``) and mark the memory to be private for QEMU 5161e92666b0SDavid Hildenbrand (``share=off``). For this use case, we need writable RAM instead 5162e92666b0SDavid Hildenbrand of ROM, and want to also set ``rom=off``. 5163e92666b0SDavid Hildenbrand 5164e2fcbf42SPeter 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`` 5165e2fcbf42SPeter Maydell Creates a memory backend object, which can be used to back the 5166e2fcbf42SPeter Maydell guest RAM. Memory backend objects offer more control than the 5167e2fcbf42SPeter Maydell ``-m`` option that is traditionally used to define guest RAM. 5168e2fcbf42SPeter Maydell Please refer to ``memory-backend-file`` for a description of the 5169e2fcbf42SPeter Maydell options. 5170e2fcbf42SPeter Maydell 5171e2fcbf42SPeter 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`` 5172e2fcbf42SPeter Maydell Creates an anonymous memory file backend object, which allows 5173e2fcbf42SPeter Maydell QEMU to share the memory with an external process (e.g. when 5174e2fcbf42SPeter Maydell using vhost-user). The memory is allocated with memfd and 5175e2fcbf42SPeter Maydell optional sealing. (Linux only) 5176e2fcbf42SPeter Maydell 5177e2fcbf42SPeter Maydell The ``seal`` option creates a sealed-file, that will block 5178e2fcbf42SPeter Maydell further resizing the memory ('on' by default). 5179e2fcbf42SPeter Maydell 5180e2fcbf42SPeter Maydell The ``hugetlb`` option specify the file to be created resides in 5181e2fcbf42SPeter Maydell the hugetlbfs filesystem (since Linux 4.14). Used in conjunction 5182e2fcbf42SPeter Maydell with the ``hugetlb`` option, the ``hugetlbsize`` option specify 5183e2fcbf42SPeter Maydell the hugetlb page size on systems that support multiple hugetlb 5184e2fcbf42SPeter Maydell page sizes (it must be a power of 2 value supported by the 5185e2fcbf42SPeter Maydell system). 5186e2fcbf42SPeter Maydell 5187e2fcbf42SPeter Maydell In some versions of Linux, the ``hugetlb`` option is 5188e2fcbf42SPeter Maydell incompatible with the ``seal`` option (requires at least Linux 5189e2fcbf42SPeter Maydell 4.16). 5190e2fcbf42SPeter Maydell 5191e2fcbf42SPeter Maydell Please refer to ``memory-backend-file`` for a description of the 5192e2fcbf42SPeter Maydell other options. 5193e2fcbf42SPeter Maydell 5194e2fcbf42SPeter Maydell The ``share`` boolean option is on by default with memfd. 5195e2fcbf42SPeter Maydell 5196e2fcbf42SPeter Maydell ``-object rng-builtin,id=id`` 5197e2fcbf42SPeter Maydell Creates a random number generator backend which obtains entropy 5198e2fcbf42SPeter Maydell from QEMU builtin functions. The ``id`` parameter is a unique ID 5199e2fcbf42SPeter Maydell that will be used to reference this entropy backend from the 5200e2fcbf42SPeter Maydell ``virtio-rng`` device. By default, the ``virtio-rng`` device 5201e2fcbf42SPeter Maydell uses this RNG backend. 5202e2fcbf42SPeter Maydell 5203e2fcbf42SPeter Maydell ``-object rng-random,id=id,filename=/dev/random`` 5204e2fcbf42SPeter Maydell Creates a random number generator backend which obtains entropy 5205e2fcbf42SPeter Maydell from a device on the host. The ``id`` parameter is a unique ID 5206e2fcbf42SPeter Maydell that will be used to reference this entropy backend from the 5207e2fcbf42SPeter Maydell ``virtio-rng`` device. The ``filename`` parameter specifies 5208e2fcbf42SPeter Maydell which file to obtain entropy from and if omitted defaults to 5209e2fcbf42SPeter Maydell ``/dev/urandom``. 5210e2fcbf42SPeter Maydell 5211e2fcbf42SPeter Maydell ``-object rng-egd,id=id,chardev=chardevid`` 5212e2fcbf42SPeter Maydell Creates a random number generator backend which obtains entropy 5213e2fcbf42SPeter Maydell from an external daemon running on the host. The ``id`` 5214e2fcbf42SPeter Maydell parameter is a unique ID that will be used to reference this 5215e2fcbf42SPeter Maydell entropy backend from the ``virtio-rng`` device. The ``chardev`` 5216e2fcbf42SPeter Maydell parameter is the unique ID of a character device backend that 5217e2fcbf42SPeter Maydell provides the connection to the RNG daemon. 5218e2fcbf42SPeter Maydell 5219e2fcbf42SPeter Maydell ``-object tls-creds-anon,id=id,endpoint=endpoint,dir=/path/to/cred/dir,verify-peer=on|off`` 5220e2fcbf42SPeter Maydell Creates a TLS anonymous credentials object, which can be used to 5221e2fcbf42SPeter Maydell provide TLS support on network backends. The ``id`` parameter is 5222e2fcbf42SPeter Maydell a unique ID which network backends will use to access the 5223e2fcbf42SPeter Maydell credentials. The ``endpoint`` is either ``server`` or ``client`` 5224e2fcbf42SPeter Maydell depending on whether the QEMU network backend that uses the 5225e2fcbf42SPeter Maydell credentials will be acting as a client or as a server. If 5226e2fcbf42SPeter Maydell ``verify-peer`` is enabled (the default) then once the handshake 5227e2fcbf42SPeter Maydell is completed, the peer credentials will be verified, though this 5228e2fcbf42SPeter Maydell is a no-op for anonymous credentials. 5229e2fcbf42SPeter Maydell 5230e2fcbf42SPeter Maydell The dir parameter tells QEMU where to find the credential files. 5231e2fcbf42SPeter Maydell For server endpoints, this directory may contain a file 5232e2fcbf42SPeter Maydell dh-params.pem providing diffie-hellman parameters to use for the 5233e2fcbf42SPeter Maydell TLS server. If the file is missing, QEMU will generate a set of 5234e2fcbf42SPeter Maydell DH parameters at startup. This is a computationally expensive 5235e2fcbf42SPeter Maydell operation that consumes random pool entropy, so it is 5236e2fcbf42SPeter Maydell recommended that a persistent set of parameters be generated 5237e2fcbf42SPeter Maydell upfront and saved. 5238e2fcbf42SPeter Maydell 5239e2fcbf42SPeter Maydell ``-object tls-creds-psk,id=id,endpoint=endpoint,dir=/path/to/keys/dir[,username=username]`` 5240e2fcbf42SPeter Maydell Creates a TLS Pre-Shared Keys (PSK) credentials object, which 5241e2fcbf42SPeter Maydell can be used to provide TLS support on network backends. The 5242e2fcbf42SPeter Maydell ``id`` parameter is a unique ID which network backends will use 5243e2fcbf42SPeter Maydell to access the credentials. The ``endpoint`` is either ``server`` 5244e2fcbf42SPeter Maydell or ``client`` depending on whether the QEMU network backend that 5245e2fcbf42SPeter Maydell uses the credentials will be acting as a client or as a server. 5246e2fcbf42SPeter Maydell For clients only, ``username`` is the username which will be 5247e2fcbf42SPeter Maydell sent to the server. If omitted it defaults to "qemu". 5248e2fcbf42SPeter Maydell 5249e2fcbf42SPeter Maydell The dir parameter tells QEMU where to find the keys file. It is 5250e2fcbf42SPeter Maydell called "dir/keys.psk" and contains "username:key" pairs. This 5251e2fcbf42SPeter Maydell file can most easily be created using the GnuTLS ``psktool`` 5252e2fcbf42SPeter Maydell program. 5253e2fcbf42SPeter Maydell 5254e2fcbf42SPeter Maydell For server endpoints, dir may also contain a file dh-params.pem 5255e2fcbf42SPeter Maydell providing diffie-hellman parameters to use for the TLS server. 5256e2fcbf42SPeter Maydell If the file is missing, QEMU will generate a set of DH 5257e2fcbf42SPeter Maydell parameters at startup. This is a computationally expensive 5258e2fcbf42SPeter Maydell operation that consumes random pool entropy, so it is 5259e2fcbf42SPeter Maydell recommended that a persistent set of parameters be generated up 5260e2fcbf42SPeter Maydell front and saved. 5261e2fcbf42SPeter Maydell 5262e2fcbf42SPeter Maydell ``-object tls-creds-x509,id=id,endpoint=endpoint,dir=/path/to/cred/dir,priority=priority,verify-peer=on|off,passwordid=id`` 5263e2fcbf42SPeter Maydell Creates a TLS anonymous credentials object, which can be used to 5264e2fcbf42SPeter Maydell provide TLS support on network backends. The ``id`` parameter is 5265e2fcbf42SPeter Maydell a unique ID which network backends will use to access the 5266e2fcbf42SPeter Maydell credentials. The ``endpoint`` is either ``server`` or ``client`` 5267e2fcbf42SPeter Maydell depending on whether the QEMU network backend that uses the 5268e2fcbf42SPeter Maydell credentials will be acting as a client or as a server. If 5269e2fcbf42SPeter Maydell ``verify-peer`` is enabled (the default) then once the handshake 5270e2fcbf42SPeter Maydell is completed, the peer credentials will be verified. With x509 5271e2fcbf42SPeter Maydell certificates, this implies that the clients must be provided 5272e2fcbf42SPeter Maydell with valid client certificates too. 5273e2fcbf42SPeter Maydell 5274e2fcbf42SPeter Maydell The dir parameter tells QEMU where to find the credential files. 5275e2fcbf42SPeter Maydell For server endpoints, this directory may contain a file 5276e2fcbf42SPeter Maydell dh-params.pem providing diffie-hellman parameters to use for the 5277e2fcbf42SPeter Maydell TLS server. If the file is missing, QEMU will generate a set of 5278e2fcbf42SPeter Maydell DH parameters at startup. This is a computationally expensive 5279e2fcbf42SPeter Maydell operation that consumes random pool entropy, so it is 5280e2fcbf42SPeter Maydell recommended that a persistent set of parameters be generated 5281e2fcbf42SPeter Maydell upfront and saved. 5282e2fcbf42SPeter Maydell 5283e2fcbf42SPeter Maydell For x509 certificate credentials the directory will contain 5284e2fcbf42SPeter Maydell further files providing the x509 certificates. The certificates 5285e2fcbf42SPeter Maydell must be stored in PEM format, in filenames ca-cert.pem, 5286e2fcbf42SPeter Maydell ca-crl.pem (optional), server-cert.pem (only servers), 5287e2fcbf42SPeter Maydell server-key.pem (only servers), client-cert.pem (only clients), 5288e2fcbf42SPeter Maydell and client-key.pem (only clients). 5289e2fcbf42SPeter Maydell 5290e2fcbf42SPeter Maydell For the server-key.pem and client-key.pem files which contain 5291e2fcbf42SPeter Maydell sensitive private keys, it is possible to use an encrypted 5292e2fcbf42SPeter Maydell version by providing the passwordid parameter. This provides the 5293e2fcbf42SPeter Maydell ID of a previously created ``secret`` object containing the 5294e2fcbf42SPeter Maydell password for decryption. 5295e2fcbf42SPeter Maydell 5296e2fcbf42SPeter Maydell The priority parameter allows to override the global default 5297e2fcbf42SPeter Maydell priority used by gnutls. This can be useful if the system 5298e2fcbf42SPeter Maydell administrator needs to use a weaker set of crypto priorities for 5299e2fcbf42SPeter Maydell QEMU without potentially forcing the weakness onto all 5300e2fcbf42SPeter Maydell applications. Or conversely if one wants wants a stronger 5301e2fcbf42SPeter Maydell default for QEMU than for all other applications, they can do 5302e2fcbf42SPeter Maydell this through this parameter. Its format is a gnutls priority 5303e2fcbf42SPeter Maydell string as described at 5304e2fcbf42SPeter Maydell https://gnutls.org/manual/html_node/Priority-Strings.html. 5305e2fcbf42SPeter Maydell 5306993aec27SPhilippe Mathieu-Daudé ``-object tls-cipher-suites,id=id,priority=priority`` 5307993aec27SPhilippe Mathieu-Daudé Creates a TLS cipher suites object, which can be used to control 5308993aec27SPhilippe Mathieu-Daudé the TLS cipher/protocol algorithms that applications are permitted 5309993aec27SPhilippe Mathieu-Daudé to use. 5310993aec27SPhilippe Mathieu-Daudé 5311993aec27SPhilippe Mathieu-Daudé The ``id`` parameter is a unique ID which frontends will use to 5312993aec27SPhilippe Mathieu-Daudé access the ordered list of permitted TLS cipher suites from the 5313993aec27SPhilippe Mathieu-Daudé host. 5314993aec27SPhilippe Mathieu-Daudé 5315993aec27SPhilippe Mathieu-Daudé The ``priority`` parameter allows to override the global default 5316993aec27SPhilippe Mathieu-Daudé priority used by gnutls. This can be useful if the system 5317993aec27SPhilippe Mathieu-Daudé administrator needs to use a weaker set of crypto priorities for 5318993aec27SPhilippe Mathieu-Daudé QEMU without potentially forcing the weakness onto all 5319993aec27SPhilippe Mathieu-Daudé applications. Or conversely if one wants wants a stronger 5320993aec27SPhilippe Mathieu-Daudé default for QEMU than for all other applications, they can do 5321993aec27SPhilippe Mathieu-Daudé this through this parameter. Its format is a gnutls priority 5322993aec27SPhilippe Mathieu-Daudé string as described at 5323993aec27SPhilippe Mathieu-Daudé https://gnutls.org/manual/html_node/Priority-Strings.html. 5324993aec27SPhilippe Mathieu-Daudé 532569699f30SPhilippe Mathieu-Daudé An example of use of this object is to control UEFI HTTPS Boot. 532669699f30SPhilippe Mathieu-Daudé The tls-cipher-suites object exposes the ordered list of permitted 532769699f30SPhilippe Mathieu-Daudé TLS cipher suites from the host side to the guest firmware, via 532869699f30SPhilippe Mathieu-Daudé fw_cfg. The list is represented as an array of IANA_TLS_CIPHER 532969699f30SPhilippe Mathieu-Daudé objects. The firmware uses the IANA_TLS_CIPHER array for configuring 533069699f30SPhilippe Mathieu-Daudé guest-side TLS. 533169699f30SPhilippe Mathieu-Daudé 533269699f30SPhilippe Mathieu-Daudé In the following example, the priority at which the host-side policy 533369699f30SPhilippe Mathieu-Daudé is retrieved is given by the ``priority`` property. 533469699f30SPhilippe Mathieu-Daudé Given that QEMU uses GNUTLS, ``priority=@SYSTEM`` may be used to 533569699f30SPhilippe Mathieu-Daudé refer to /etc/crypto-policies/back-ends/gnutls.config. 533669699f30SPhilippe Mathieu-Daudé 533769699f30SPhilippe Mathieu-Daudé .. parsed-literal:: 533869699f30SPhilippe Mathieu-Daudé 5339353a06b4SLaszlo Ersek # |qemu_system| \\ 5340353a06b4SLaszlo Ersek -object tls-cipher-suites,id=mysuite0,priority=@SYSTEM \\ 534169699f30SPhilippe Mathieu-Daudé -fw_cfg name=etc/edk2/https/ciphers,gen_id=mysuite0 534269699f30SPhilippe Mathieu-Daudé 5343e2fcbf42SPeter 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]`` 5344e2fcbf42SPeter Maydell Interval t can't be 0, this filter batches the packet delivery: 5345e2fcbf42SPeter Maydell all packets arriving in a given interval on netdev netdevid are 5346e2fcbf42SPeter Maydell delayed until the end of the interval. Interval is in 5347e2fcbf42SPeter Maydell microseconds. ``status`` is optional that indicate whether the 5348e2fcbf42SPeter Maydell netfilter is on (enabled) or off (disabled), the default status 5349e2fcbf42SPeter Maydell for netfilter will be 'on'. 5350e2fcbf42SPeter Maydell 5351e2fcbf42SPeter Maydell queue all\|rx\|tx is an option that can be applied to any 5352e2fcbf42SPeter Maydell netfilter. 5353e2fcbf42SPeter Maydell 5354e2fcbf42SPeter Maydell ``all``: the filter is attached both to the receive and the 5355e2fcbf42SPeter Maydell transmit queue of the netdev (default). 5356e2fcbf42SPeter Maydell 5357e2fcbf42SPeter Maydell ``rx``: the filter is attached to the receive queue of the 5358e2fcbf42SPeter Maydell netdev, where it will receive packets sent to the netdev. 5359e2fcbf42SPeter Maydell 5360e2fcbf42SPeter Maydell ``tx``: the filter is attached to the transmit queue of the 5361e2fcbf42SPeter Maydell netdev, where it will receive packets sent by the netdev. 5362e2fcbf42SPeter Maydell 5363e2fcbf42SPeter Maydell position head\|tail\|id=<id> is an option to specify where the 5364e2fcbf42SPeter Maydell filter should be inserted in the filter list. It can be applied 5365e2fcbf42SPeter Maydell to any netfilter. 5366e2fcbf42SPeter Maydell 5367e2fcbf42SPeter Maydell ``head``: the filter is inserted at the head of the filter list, 5368e2fcbf42SPeter Maydell before any existing filters. 5369e2fcbf42SPeter Maydell 5370e2fcbf42SPeter Maydell ``tail``: the filter is inserted at the tail of the filter list, 5371e2fcbf42SPeter Maydell behind any existing filters (default). 5372e2fcbf42SPeter Maydell 5373e2fcbf42SPeter Maydell ``id=<id>``: the filter is inserted before or behind the filter 5374e2fcbf42SPeter Maydell specified by <id>, see the insert option below. 5375e2fcbf42SPeter Maydell 5376e2fcbf42SPeter Maydell insert behind\|before is an option to specify where to insert 5377e2fcbf42SPeter Maydell the new filter relative to the one specified with 5378e2fcbf42SPeter Maydell position=id=<id>. It can be applied to any netfilter. 5379e2fcbf42SPeter Maydell 5380e2fcbf42SPeter Maydell ``before``: insert before the specified filter. 5381e2fcbf42SPeter Maydell 5382e2fcbf42SPeter Maydell ``behind``: insert behind the specified filter (default). 5383e2fcbf42SPeter Maydell 5384e2fcbf42SPeter 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]`` 5385e2fcbf42SPeter Maydell filter-mirror on netdev netdevid,mirror net packet to 5386e2fcbf42SPeter Maydell chardevchardevid, if it has the vnet\_hdr\_support flag, 5387e2fcbf42SPeter Maydell filter-mirror will mirror packet with vnet\_hdr\_len. 5388e2fcbf42SPeter Maydell 5389e2fcbf42SPeter 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]`` 5390e2fcbf42SPeter Maydell filter-redirector on netdev netdevid,redirect filter's net 5391e2fcbf42SPeter Maydell packet to chardev chardevid,and redirect indev's packet to 5392e2fcbf42SPeter Maydell filter.if it has the vnet\_hdr\_support flag, filter-redirector 5393e2fcbf42SPeter Maydell will redirect packet with vnet\_hdr\_len. Create a 5394e2fcbf42SPeter Maydell filter-redirector we need to differ outdev id from indev id, id 5395e2fcbf42SPeter Maydell can not be the same. we can just use indev or outdev, but at 5396e2fcbf42SPeter Maydell least one of indev or outdev need to be specified. 5397e2fcbf42SPeter Maydell 5398e2fcbf42SPeter Maydell ``-object filter-rewriter,id=id,netdev=netdevid,queue=all|rx|tx,[vnet_hdr_support][,position=head|tail|id=<id>][,insert=behind|before]`` 5399e2fcbf42SPeter Maydell Filter-rewriter is a part of COLO project.It will rewrite tcp 5400e2fcbf42SPeter Maydell packet to secondary from primary to keep secondary tcp 5401e2fcbf42SPeter Maydell connection,and rewrite tcp packet to primary from secondary make 5402e2fcbf42SPeter Maydell tcp packet can be handled by client.if it has the 5403e2fcbf42SPeter Maydell vnet\_hdr\_support flag, we can parse packet with vnet header. 5404e2fcbf42SPeter Maydell 5405e2fcbf42SPeter Maydell usage: colo secondary: -object 5406e2fcbf42SPeter Maydell filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0 -object 5407e2fcbf42SPeter Maydell filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1 -object 5408e2fcbf42SPeter Maydell filter-rewriter,id=rew0,netdev=hn0,queue=all 5409e2fcbf42SPeter Maydell 5410e2fcbf42SPeter Maydell ``-object filter-dump,id=id,netdev=dev[,file=filename][,maxlen=len][,position=head|tail|id=<id>][,insert=behind|before]`` 5411e2fcbf42SPeter Maydell Dump the network traffic on netdev dev to the file specified by 5412e2fcbf42SPeter Maydell filename. At most len bytes (64k by default) per packet are 5413e2fcbf42SPeter Maydell stored. The file format is libpcap, so it can be analyzed with 5414e2fcbf42SPeter Maydell tools such as tcpdump or Wireshark. 5415e2fcbf42SPeter Maydell 5416a2e5cb7aSZhang 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}]`` 5417e2fcbf42SPeter Maydell Colo-compare gets packet from primary\_in chardevid and 54182b28a7efSZhang Chen secondary\_in, then compare whether the payload of primary packet 54192b28a7efSZhang Chen and secondary packet are the same. If same, it will output 54202b28a7efSZhang Chen primary packet to out\_dev, else it will notify COLO-framework to do 54212b28a7efSZhang Chen checkpoint and send primary packet to out\_dev. In order to 54222b28a7efSZhang Chen improve efficiency, we need to put the task of comparison in 54232b28a7efSZhang Chen another iothread. If it has the vnet\_hdr\_support flag, 54242b28a7efSZhang Chen colo compare will send/recv packet with vnet\_hdr\_len. 54252b28a7efSZhang Chen The compare\_timeout=@var{ms} determines the maximum time of the 54262b28a7efSZhang Chen colo-compare hold the packet. The expired\_scan\_cycle=@var{ms} 54272b28a7efSZhang Chen is to set the period of scanning expired primary node network packets. 54282b28a7efSZhang Chen The max\_queue\_size=@var{size} is to set the max compare queue 54292b28a7efSZhang Chen size depend on user environment. 54302b28a7efSZhang Chen If user want to use Xen COLO, need to add the notify\_dev to 54319cc43c94SZhang Chen notify Xen colo-frame to do checkpoint. 5432e2fcbf42SPeter Maydell 54332b28a7efSZhang Chen COLO-compare must be used with the help of filter-mirror, 54342b28a7efSZhang Chen filter-redirector and filter-rewriter. 5435e2fcbf42SPeter Maydell 5436e2fcbf42SPeter Maydell :: 5437e2fcbf42SPeter Maydell 5438e2fcbf42SPeter Maydell KVM COLO 5439e2fcbf42SPeter Maydell 5440e2fcbf42SPeter Maydell primary: 5441e2fcbf42SPeter Maydell -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown 5442e2fcbf42SPeter Maydell -device e1000,id=e0,netdev=hn0,mac=52:a4:00:12:78:66 5443bfdc1267SDaniel P. Berrangé -chardev socket,id=mirror0,host=3.3.3.3,port=9003,server=on,wait=off 5444bfdc1267SDaniel P. Berrangé -chardev socket,id=compare1,host=3.3.3.3,port=9004,server=on,wait=off 5445bfdc1267SDaniel P. Berrangé -chardev socket,id=compare0,host=3.3.3.3,port=9001,server=on,wait=off 5446e2fcbf42SPeter Maydell -chardev socket,id=compare0-0,host=3.3.3.3,port=9001 5447bfdc1267SDaniel P. Berrangé -chardev socket,id=compare_out,host=3.3.3.3,port=9005,server=on,wait=off 5448e2fcbf42SPeter Maydell -chardev socket,id=compare_out0,host=3.3.3.3,port=9005 5449e2fcbf42SPeter Maydell -object iothread,id=iothread1 5450e2fcbf42SPeter Maydell -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0 5451e2fcbf42SPeter Maydell -object filter-redirector,netdev=hn0,id=redire0,queue=rx,indev=compare_out 5452e2fcbf42SPeter Maydell -object filter-redirector,netdev=hn0,id=redire1,queue=rx,outdev=compare0 5453e2fcbf42SPeter Maydell -object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0,iothread=iothread1 5454e2fcbf42SPeter Maydell 5455e2fcbf42SPeter Maydell secondary: 5456e2fcbf42SPeter Maydell -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,down script=/etc/qemu-ifdown 5457e2fcbf42SPeter Maydell -device e1000,netdev=hn0,mac=52:a4:00:12:78:66 5458e2fcbf42SPeter Maydell -chardev socket,id=red0,host=3.3.3.3,port=9003 5459e2fcbf42SPeter Maydell -chardev socket,id=red1,host=3.3.3.3,port=9004 5460e2fcbf42SPeter Maydell -object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0 5461e2fcbf42SPeter Maydell -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1 5462e2fcbf42SPeter Maydell 5463e2fcbf42SPeter Maydell 5464e2fcbf42SPeter Maydell Xen COLO 5465e2fcbf42SPeter Maydell 5466e2fcbf42SPeter Maydell primary: 5467e2fcbf42SPeter Maydell -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown 5468e2fcbf42SPeter Maydell -device e1000,id=e0,netdev=hn0,mac=52:a4:00:12:78:66 5469bfdc1267SDaniel P. Berrangé -chardev socket,id=mirror0,host=3.3.3.3,port=9003,server=on,wait=off 5470bfdc1267SDaniel P. Berrangé -chardev socket,id=compare1,host=3.3.3.3,port=9004,server=on,wait=off 5471bfdc1267SDaniel P. Berrangé -chardev socket,id=compare0,host=3.3.3.3,port=9001,server=on,wait=off 5472e2fcbf42SPeter Maydell -chardev socket,id=compare0-0,host=3.3.3.3,port=9001 5473bfdc1267SDaniel P. Berrangé -chardev socket,id=compare_out,host=3.3.3.3,port=9005,server=on,wait=off 5474e2fcbf42SPeter Maydell -chardev socket,id=compare_out0,host=3.3.3.3,port=9005 5475bfdc1267SDaniel P. Berrangé -chardev socket,id=notify_way,host=3.3.3.3,port=9009,server=on,wait=off 5476e2fcbf42SPeter Maydell -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0 5477e2fcbf42SPeter Maydell -object filter-redirector,netdev=hn0,id=redire0,queue=rx,indev=compare_out 5478e2fcbf42SPeter Maydell -object filter-redirector,netdev=hn0,id=redire1,queue=rx,outdev=compare0 5479e2fcbf42SPeter Maydell -object iothread,id=iothread1 5480e2fcbf42SPeter Maydell -object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0,notify_dev=nofity_way,iothread=iothread1 5481e2fcbf42SPeter Maydell 5482e2fcbf42SPeter Maydell secondary: 5483e2fcbf42SPeter Maydell -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,down script=/etc/qemu-ifdown 5484e2fcbf42SPeter Maydell -device e1000,netdev=hn0,mac=52:a4:00:12:78:66 5485e2fcbf42SPeter Maydell -chardev socket,id=red0,host=3.3.3.3,port=9003 5486e2fcbf42SPeter Maydell -chardev socket,id=red1,host=3.3.3.3,port=9004 5487e2fcbf42SPeter Maydell -object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0 5488e2fcbf42SPeter Maydell -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1 5489e2fcbf42SPeter Maydell 5490e2fcbf42SPeter Maydell If you want to know the detail of above command line, you can 5491e2fcbf42SPeter Maydell read the colo-compare git log. 5492e2fcbf42SPeter Maydell 5493e2fcbf42SPeter Maydell ``-object cryptodev-backend-builtin,id=id[,queues=queues]`` 54941e458f11SStefan Weil Creates a cryptodev backend which executes crypto operations from 54951e458f11SStefan Weil the QEMU cipher APIs. The id parameter is a unique ID that will 5496e2fcbf42SPeter Maydell be used to reference this cryptodev backend from the 5497e2fcbf42SPeter Maydell ``virtio-crypto`` device. The queues parameter is optional, 5498e2fcbf42SPeter Maydell which specify the queue number of cryptodev backend, the default 5499e2fcbf42SPeter Maydell of queues is 1. 5500e2fcbf42SPeter Maydell 550109ce5f2dSPeter Maydell .. parsed-literal:: 5502e2fcbf42SPeter Maydell 5503353a06b4SLaszlo Ersek # |qemu_system| \\ 5504353a06b4SLaszlo Ersek [...] \\ 5505353a06b4SLaszlo Ersek -object cryptodev-backend-builtin,id=cryptodev0 \\ 5506353a06b4SLaszlo Ersek -device virtio-crypto-pci,id=crypto0,cryptodev=cryptodev0 \\ 5507e2fcbf42SPeter Maydell [...] 5508e2fcbf42SPeter Maydell 5509e2fcbf42SPeter Maydell ``-object cryptodev-vhost-user,id=id,chardev=chardevid[,queues=queues]`` 5510e2fcbf42SPeter Maydell Creates a vhost-user cryptodev backend, backed by a chardev 5511e2fcbf42SPeter Maydell chardevid. The id parameter is a unique ID that will be used to 5512e2fcbf42SPeter Maydell reference this cryptodev backend from the ``virtio-crypto`` 5513e2fcbf42SPeter Maydell device. The chardev should be a unix domain socket backed one. 5514e2fcbf42SPeter Maydell The vhost-user uses a specifically defined protocol to pass 5515e2fcbf42SPeter Maydell vhost ioctl replacement messages to an application on the other 5516e2fcbf42SPeter Maydell end of the socket. The queues parameter is optional, which 5517e2fcbf42SPeter Maydell specify the queue number of cryptodev backend for multiqueue 5518e2fcbf42SPeter Maydell vhost-user, the default of queues is 1. 5519e2fcbf42SPeter Maydell 552009ce5f2dSPeter Maydell .. parsed-literal:: 5521e2fcbf42SPeter Maydell 5522353a06b4SLaszlo Ersek # |qemu_system| \\ 5523353a06b4SLaszlo Ersek [...] \\ 5524353a06b4SLaszlo Ersek -chardev socket,id=chardev0,path=/path/to/socket \\ 5525353a06b4SLaszlo Ersek -object cryptodev-vhost-user,id=cryptodev0,chardev=chardev0 \\ 5526353a06b4SLaszlo Ersek -device virtio-crypto-pci,id=crypto0,cryptodev=cryptodev0 \\ 5527e2fcbf42SPeter Maydell [...] 5528e2fcbf42SPeter Maydell 5529e2fcbf42SPeter Maydell ``-object secret,id=id,data=string,format=raw|base64[,keyid=secretid,iv=string]`` 553009ce5f2dSPeter Maydell \ 5531e2fcbf42SPeter Maydell ``-object secret,id=id,file=filename,format=raw|base64[,keyid=secretid,iv=string]`` 5532e2fcbf42SPeter Maydell Defines a secret to store a password, encryption key, or some 5533e2fcbf42SPeter Maydell other sensitive data. The sensitive data can either be passed 5534e2fcbf42SPeter Maydell directly via the data parameter, or indirectly via the file 5535e2fcbf42SPeter Maydell parameter. Using the data parameter is insecure unless the 5536e2fcbf42SPeter Maydell sensitive data is encrypted. 5537e2fcbf42SPeter Maydell 5538e2fcbf42SPeter Maydell The sensitive data can be provided in raw format (the default), 5539e2fcbf42SPeter Maydell or base64. When encoded as JSON, the raw format only supports 5540e2fcbf42SPeter Maydell valid UTF-8 characters, so base64 is recommended for sending 5541e2fcbf42SPeter Maydell binary data. QEMU will convert from which ever format is 5542e2fcbf42SPeter Maydell provided to the format it needs internally. eg, an RBD password 5543e2fcbf42SPeter Maydell can be provided in raw format, even though it will be base64 5544e2fcbf42SPeter Maydell encoded when passed onto the RBD sever. 5545e2fcbf42SPeter Maydell 5546e2fcbf42SPeter Maydell For added protection, it is possible to encrypt the data 5547e2fcbf42SPeter Maydell associated with a secret using the AES-256-CBC cipher. Use of 5548e2fcbf42SPeter Maydell encryption is indicated by providing the keyid and iv 5549e2fcbf42SPeter Maydell parameters. The keyid parameter provides the ID of a previously 5550e2fcbf42SPeter Maydell defined secret that contains the AES-256 decryption key. This 5551e2fcbf42SPeter Maydell key should be 32-bytes long and be base64 encoded. The iv 5552e2fcbf42SPeter Maydell parameter provides the random initialization vector used for 5553e2fcbf42SPeter Maydell encryption of this particular secret and should be a base64 5554e2fcbf42SPeter Maydell encrypted string of the 16-byte IV. 5555e2fcbf42SPeter Maydell 5556e2fcbf42SPeter Maydell The simplest (insecure) usage is to provide the secret inline 5557e2fcbf42SPeter Maydell 555809ce5f2dSPeter Maydell .. parsed-literal:: 5559e2fcbf42SPeter Maydell 5560e2fcbf42SPeter Maydell # |qemu_system| -object secret,id=sec0,data=letmein,format=raw 5561e2fcbf42SPeter Maydell 5562e2fcbf42SPeter Maydell The simplest secure usage is to provide the secret via a file 5563e2fcbf42SPeter Maydell 5564e2fcbf42SPeter Maydell # printf "letmein" > mypasswd.txt # QEMU\_SYSTEM\_MACRO -object 5565e2fcbf42SPeter Maydell secret,id=sec0,file=mypasswd.txt,format=raw 5566e2fcbf42SPeter Maydell 5567e2fcbf42SPeter Maydell For greater security, AES-256-CBC should be used. To illustrate 5568e2fcbf42SPeter Maydell usage, consider the openssl command line tool which can encrypt 5569e2fcbf42SPeter Maydell the data. Note that when encrypting, the plaintext must be 5570e2fcbf42SPeter Maydell padded to the cipher block size (32 bytes) using the standard 5571e2fcbf42SPeter Maydell PKCS#5/6 compatible padding algorithm. 5572e2fcbf42SPeter Maydell 5573e2fcbf42SPeter Maydell First a master key needs to be created in base64 encoding: 5574e2fcbf42SPeter Maydell 5575e2fcbf42SPeter Maydell :: 5576e2fcbf42SPeter Maydell 5577e2fcbf42SPeter Maydell # openssl rand -base64 32 > key.b64 5578e2fcbf42SPeter Maydell # KEY=$(base64 -d key.b64 | hexdump -v -e '/1 "%02X"') 5579e2fcbf42SPeter Maydell 5580e2fcbf42SPeter Maydell Each secret to be encrypted needs to have a random 5581e2fcbf42SPeter Maydell initialization vector generated. These do not need to be kept 5582e2fcbf42SPeter Maydell secret 5583e2fcbf42SPeter Maydell 5584e2fcbf42SPeter Maydell :: 5585e2fcbf42SPeter Maydell 5586e2fcbf42SPeter Maydell # openssl rand -base64 16 > iv.b64 5587e2fcbf42SPeter Maydell # IV=$(base64 -d iv.b64 | hexdump -v -e '/1 "%02X"') 5588e2fcbf42SPeter Maydell 5589e2fcbf42SPeter Maydell The secret to be defined can now be encrypted, in this case 5590e2fcbf42SPeter Maydell we're telling openssl to base64 encode the result, but it could 5591e2fcbf42SPeter Maydell be left as raw bytes if desired. 5592e2fcbf42SPeter Maydell 5593e2fcbf42SPeter Maydell :: 5594e2fcbf42SPeter Maydell 5595e2fcbf42SPeter Maydell # SECRET=$(printf "letmein" | 5596e2fcbf42SPeter Maydell openssl enc -aes-256-cbc -a -K $KEY -iv $IV) 5597e2fcbf42SPeter Maydell 5598e2fcbf42SPeter Maydell When launching QEMU, create a master secret pointing to 5599e2fcbf42SPeter Maydell ``key.b64`` and specify that to be used to decrypt the user 5600e2fcbf42SPeter Maydell password. Pass the contents of ``iv.b64`` to the second secret 5601e2fcbf42SPeter Maydell 560209ce5f2dSPeter Maydell .. parsed-literal:: 5603e2fcbf42SPeter Maydell 5604353a06b4SLaszlo Ersek # |qemu_system| \\ 5605353a06b4SLaszlo Ersek -object secret,id=secmaster0,format=base64,file=key.b64 \\ 5606353a06b4SLaszlo Ersek -object secret,id=sec0,keyid=secmaster0,format=base64,\\ 5607e2fcbf42SPeter Maydell data=$SECRET,iv=$(<iv.b64) 5608e2fcbf42SPeter Maydell 560955cdf566SDov 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]`` 5610e2fcbf42SPeter Maydell Create a Secure Encrypted Virtualization (SEV) guest object, 5611e2fcbf42SPeter Maydell which can be used to provide the guest memory encryption support 5612e2fcbf42SPeter Maydell on AMD processors. 5613e2fcbf42SPeter Maydell 5614e2fcbf42SPeter Maydell When memory encryption is enabled, one of the physical address 5615e2fcbf42SPeter Maydell bit (aka the C-bit) is utilized to mark if a memory page is 5616e2fcbf42SPeter Maydell protected. The ``cbitpos`` is used to provide the C-bit 5617e2fcbf42SPeter Maydell position. The C-bit position is Host family dependent hence user 5618e2fcbf42SPeter Maydell must provide this value. On EPYC, the value should be 47. 5619e2fcbf42SPeter Maydell 5620e2fcbf42SPeter Maydell When memory encryption is enabled, we loose certain bits in 5621e2fcbf42SPeter Maydell physical address space. The ``reduced-phys-bits`` is used to 5622e2fcbf42SPeter Maydell provide the number of bits we loose in physical address space. 5623e2fcbf42SPeter Maydell Similar to C-bit, the value is Host family dependent. On EPYC, 5624326e3015STom Lendacky a guest will lose a maximum of 1 bit, so the value should be 1. 5625e2fcbf42SPeter Maydell 5626e2fcbf42SPeter Maydell The ``sev-device`` provides the device file to use for 5627e2fcbf42SPeter Maydell communicating with the SEV firmware running inside AMD Secure 5628e2fcbf42SPeter Maydell Processor. The default device is '/dev/sev'. If hardware 5629e2fcbf42SPeter Maydell supports memory encryption then /dev/sev devices are created by 5630e2fcbf42SPeter Maydell CCP driver. 5631e2fcbf42SPeter Maydell 5632e2fcbf42SPeter Maydell The ``policy`` provides the guest policy to be enforced by the 5633e2fcbf42SPeter Maydell SEV firmware and restrict what configuration and operational 5634e2fcbf42SPeter Maydell commands can be performed on this guest by the hypervisor. The 5635e2fcbf42SPeter Maydell policy should be provided by the guest owner and is bound to the 5636e2fcbf42SPeter Maydell guest and cannot be changed throughout the lifetime of the 5637e2fcbf42SPeter Maydell guest. The default is 0. 5638e2fcbf42SPeter Maydell 5639e2fcbf42SPeter Maydell If guest ``policy`` allows sharing the key with another SEV 5640e2fcbf42SPeter Maydell guest then ``handle`` can be use to provide handle of the guest 5641e2fcbf42SPeter Maydell from which to share the key. 5642e2fcbf42SPeter Maydell 5643e2fcbf42SPeter Maydell The ``dh-cert-file`` and ``session-file`` provides the guest 5644e2fcbf42SPeter Maydell owner's Public Diffie-Hillman key defined in SEV spec. The PDH 5645e2fcbf42SPeter Maydell and session parameters are used for establishing a cryptographic 5646e2fcbf42SPeter Maydell session with the guest owner to negotiate keys used for 5647e2fcbf42SPeter Maydell attestation. The file must be encoded in base64. 5648e2fcbf42SPeter Maydell 564955cdf566SDov Murik The ``kernel-hashes`` adds the hashes of given kernel/initrd/ 565055cdf566SDov Murik cmdline to a designated guest firmware page for measured Linux 565155cdf566SDov Murik boot with -kernel. The default is off. (Since 6.2) 565255cdf566SDov Murik 5653e2fcbf42SPeter Maydell e.g to launch a SEV guest 5654e2fcbf42SPeter Maydell 565509ce5f2dSPeter Maydell .. parsed-literal:: 5656e2fcbf42SPeter Maydell 5657353a06b4SLaszlo Ersek # |qemu_system_x86| \\ 5658353a06b4SLaszlo Ersek ...... \\ 5659326e3015STom Lendacky -object sev-guest,id=sev0,cbitpos=47,reduced-phys-bits=1 \\ 5660353a06b4SLaszlo Ersek -machine ...,memory-encryption=sev0 \\ 5661e2fcbf42SPeter Maydell ..... 5662e2fcbf42SPeter Maydell 5663e2fcbf42SPeter Maydell ``-object authz-simple,id=id,identity=string`` 5664e2fcbf42SPeter Maydell Create an authorization object that will control access to 5665e2fcbf42SPeter Maydell network services. 5666e2fcbf42SPeter Maydell 5667e2fcbf42SPeter Maydell The ``identity`` parameter is identifies the user and its format 5668e2fcbf42SPeter Maydell depends on the network service that authorization object is 5669e2fcbf42SPeter Maydell associated with. For authorizing based on TLS x509 certificates, 5670e2fcbf42SPeter Maydell the identity must be the x509 distinguished name. Note that care 5671e2fcbf42SPeter Maydell must be taken to escape any commas in the distinguished name. 5672e2fcbf42SPeter Maydell 5673e2fcbf42SPeter Maydell An example authorization object to validate a x509 distinguished 5674e2fcbf42SPeter Maydell name would look like: 5675e2fcbf42SPeter Maydell 567609ce5f2dSPeter Maydell .. parsed-literal:: 5677e2fcbf42SPeter Maydell 5678353a06b4SLaszlo Ersek # |qemu_system| \\ 5679353a06b4SLaszlo Ersek ... \\ 5680353a06b4SLaszlo Ersek -object 'authz-simple,id=auth0,identity=CN=laptop.example.com,,O=Example Org,,L=London,,ST=London,,C=GB' \\ 5681e2fcbf42SPeter Maydell ... 5682e2fcbf42SPeter Maydell 5683e2fcbf42SPeter Maydell Note the use of quotes due to the x509 distinguished name 5684e2fcbf42SPeter Maydell containing whitespace, and escaping of ','. 5685e2fcbf42SPeter Maydell 56864d7beeabSDaniel P. Berrangé ``-object authz-listfile,id=id,filename=path,refresh=on|off`` 5687e2fcbf42SPeter Maydell Create an authorization object that will control access to 5688e2fcbf42SPeter Maydell network services. 5689e2fcbf42SPeter Maydell 5690e2fcbf42SPeter Maydell The ``filename`` parameter is the fully qualified path to a file 5691e2fcbf42SPeter Maydell containing the access control list rules in JSON format. 5692e2fcbf42SPeter Maydell 5693e2fcbf42SPeter Maydell An example set of rules that match against SASL usernames might 5694e2fcbf42SPeter Maydell look like: 5695e2fcbf42SPeter Maydell 5696e2fcbf42SPeter Maydell :: 5697e2fcbf42SPeter Maydell 5698e2fcbf42SPeter Maydell { 5699e2fcbf42SPeter Maydell "rules": [ 5700e2fcbf42SPeter Maydell { "match": "fred", "policy": "allow", "format": "exact" }, 5701e2fcbf42SPeter Maydell { "match": "bob", "policy": "allow", "format": "exact" }, 5702e2fcbf42SPeter Maydell { "match": "danb", "policy": "deny", "format": "glob" }, 5703e2fcbf42SPeter Maydell { "match": "dan*", "policy": "allow", "format": "exact" }, 5704e2fcbf42SPeter Maydell ], 5705e2fcbf42SPeter Maydell "policy": "deny" 5706e2fcbf42SPeter Maydell } 5707e2fcbf42SPeter Maydell 5708e2fcbf42SPeter Maydell When checking access the object will iterate over all the rules 5709e2fcbf42SPeter Maydell and the first rule to match will have its ``policy`` value 5710e2fcbf42SPeter Maydell returned as the result. If no rules match, then the default 5711e2fcbf42SPeter Maydell ``policy`` value is returned. 5712e2fcbf42SPeter Maydell 5713e2fcbf42SPeter Maydell The rules can either be an exact string match, or they can use 5714e2fcbf42SPeter Maydell the simple UNIX glob pattern matching to allow wildcards to be 5715e2fcbf42SPeter Maydell used. 5716e2fcbf42SPeter Maydell 5717e2fcbf42SPeter Maydell If ``refresh`` is set to true the file will be monitored and 5718e2fcbf42SPeter Maydell automatically reloaded whenever its content changes. 5719e2fcbf42SPeter Maydell 5720e2fcbf42SPeter Maydell As with the ``authz-simple`` object, the format of the identity 5721e2fcbf42SPeter Maydell strings being matched depends on the network service, but is 5722e2fcbf42SPeter Maydell usually a TLS x509 distinguished name, or a SASL username. 5723e2fcbf42SPeter Maydell 5724e2fcbf42SPeter Maydell An example authorization object to validate a SASL username 5725e2fcbf42SPeter Maydell would look like: 5726e2fcbf42SPeter Maydell 572709ce5f2dSPeter Maydell .. parsed-literal:: 5728e2fcbf42SPeter Maydell 5729353a06b4SLaszlo Ersek # |qemu_system| \\ 5730353a06b4SLaszlo Ersek ... \\ 57314d7beeabSDaniel P. Berrangé -object authz-simple,id=auth0,filename=/etc/qemu/vnc-sasl.acl,refresh=on \\ 5732e2fcbf42SPeter Maydell ... 5733e2fcbf42SPeter Maydell 5734e2fcbf42SPeter Maydell ``-object authz-pam,id=id,service=string`` 5735e2fcbf42SPeter Maydell Create an authorization object that will control access to 5736e2fcbf42SPeter Maydell network services. 5737e2fcbf42SPeter Maydell 5738e2fcbf42SPeter Maydell The ``service`` parameter provides the name of a PAM service to 5739e2fcbf42SPeter Maydell use for authorization. It requires that a file 5740e2fcbf42SPeter Maydell ``/etc/pam.d/service`` exist to provide the configuration for 5741e2fcbf42SPeter Maydell the ``account`` subsystem. 5742e2fcbf42SPeter Maydell 5743e2fcbf42SPeter Maydell An example authorization object to validate a TLS x509 5744e2fcbf42SPeter Maydell distinguished name would look like: 5745e2fcbf42SPeter Maydell 574609ce5f2dSPeter Maydell .. parsed-literal:: 5747e2fcbf42SPeter Maydell 5748353a06b4SLaszlo Ersek # |qemu_system| \\ 5749353a06b4SLaszlo Ersek ... \\ 5750353a06b4SLaszlo Ersek -object authz-pam,id=auth0,service=qemu-vnc \\ 5751e2fcbf42SPeter Maydell ... 5752e2fcbf42SPeter Maydell 5753e2fcbf42SPeter Maydell There would then be a corresponding config file for PAM at 5754e2fcbf42SPeter Maydell ``/etc/pam.d/qemu-vnc`` that contains: 5755e2fcbf42SPeter Maydell 5756e2fcbf42SPeter Maydell :: 5757e2fcbf42SPeter Maydell 5758e2fcbf42SPeter Maydell account requisite pam_listfile.so item=user sense=allow \ 5759e2fcbf42SPeter Maydell file=/etc/qemu/vnc.allow 5760e2fcbf42SPeter Maydell 5761e2fcbf42SPeter Maydell Finally the ``/etc/qemu/vnc.allow`` file would contain the list 57621e458f11SStefan Weil of x509 distinguished names that are permitted access 5763e2fcbf42SPeter Maydell 5764e2fcbf42SPeter Maydell :: 5765e2fcbf42SPeter Maydell 5766e2fcbf42SPeter Maydell CN=laptop.example.com,O=Example Home,L=London,ST=London,C=GB 5767e2fcbf42SPeter Maydell 57681793ad02SStefano 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`` 5769e2fcbf42SPeter Maydell Creates a dedicated event loop thread that devices can be 5770e2fcbf42SPeter Maydell assigned to. This is known as an IOThread. By default device 5771e2fcbf42SPeter Maydell emulation happens in vCPU threads or the main event loop thread. 5772e2fcbf42SPeter Maydell This can become a scalability bottleneck. IOThreads allow device 5773e2fcbf42SPeter Maydell emulation and I/O to run on other host CPUs. 5774e2fcbf42SPeter Maydell 5775e2fcbf42SPeter Maydell The ``id`` parameter is a unique ID that will be used to 5776e2fcbf42SPeter Maydell reference this IOThread from ``-device ...,iothread=id``. 5777e2fcbf42SPeter Maydell Multiple devices can be assigned to an IOThread. Note that not 5778e2fcbf42SPeter Maydell all devices support an ``iothread`` parameter. 5779e2fcbf42SPeter Maydell 5780e2fcbf42SPeter Maydell The ``query-iothreads`` QMP command lists IOThreads and reports 5781e2fcbf42SPeter Maydell their thread IDs so that the user can configure host CPU 5782e2fcbf42SPeter Maydell pinning/affinity. 5783e2fcbf42SPeter Maydell 5784e2fcbf42SPeter Maydell IOThreads use an adaptive polling algorithm to reduce event loop 5785e2fcbf42SPeter Maydell latency. Instead of entering a blocking system call to monitor 5786e2fcbf42SPeter Maydell file descriptors and then pay the cost of being woken up when an 5787e2fcbf42SPeter Maydell event occurs, the polling algorithm spins waiting for events for 5788e2fcbf42SPeter Maydell a short time. The algorithm's default parameters are suitable 5789e2fcbf42SPeter Maydell for many cases but can be adjusted based on knowledge of the 5790e2fcbf42SPeter Maydell workload and/or host device latency. 5791e2fcbf42SPeter Maydell 5792e2fcbf42SPeter Maydell The ``poll-max-ns`` parameter is the maximum number of 5793e2fcbf42SPeter Maydell nanoseconds to busy wait for events. Polling can be disabled by 5794e2fcbf42SPeter Maydell setting this value to 0. 5795e2fcbf42SPeter Maydell 5796e2fcbf42SPeter Maydell The ``poll-grow`` parameter is the multiplier used to increase 5797e2fcbf42SPeter Maydell the polling time when the algorithm detects it is missing events 5798e2fcbf42SPeter Maydell due to not polling long enough. 5799e2fcbf42SPeter Maydell 5800e2fcbf42SPeter Maydell The ``poll-shrink`` parameter is the divisor used to decrease 5801e2fcbf42SPeter Maydell the polling time when the algorithm detects it is spending too 5802e2fcbf42SPeter Maydell long polling without encountering events. 5803e2fcbf42SPeter Maydell 58041793ad02SStefano Garzarella The ``aio-max-batch`` parameter is the maximum number of requests 58051793ad02SStefano Garzarella in a batch for the AIO engine, 0 means that the engine will use 58061793ad02SStefano Garzarella its default. 58071793ad02SStefano Garzarella 58081793ad02SStefano Garzarella The IOThread parameters can be modified at run-time using the 5809e2fcbf42SPeter Maydell ``qom-set`` command (where ``iothread1`` is the IOThread's 5810e2fcbf42SPeter Maydell ``id``): 5811e2fcbf42SPeter Maydell 5812e2fcbf42SPeter Maydell :: 5813e2fcbf42SPeter Maydell 5814e2fcbf42SPeter Maydell (qemu) qom-set /objects/iothread1 poll-max-ns 100000 5815e2fcbf42SPeter MaydellERST 5816b9174d4fSDaniel P. Berrange 5817b9174d4fSDaniel P. Berrange 58183dbf2c7fSStefan WeilHXCOMM This is the last statement. Insert new options before this line! 5819fd5fc4b1SPaolo Bonzini 5820fd5fc4b1SPaolo Bonzini#undef DEF 5821fd5fc4b1SPaolo Bonzini#undef DEFHEADING 5822fd5fc4b1SPaolo Bonzini#undef ARCHHEADING 5823