blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 1 | HXCOMM Use DEFHEADING() to define headings in both help text and texi |
| 2 | HXCOMM Text between STEXI and ETEXI are copied to texi version and |
| 3 | HXCOMM discarded from C version |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 4 | HXCOMM DEF(option, HAS_ARG/0, opt_enum, opt_help, arch_mask) is used to |
| 5 | HXCOMM construct option structures, enums and help message for specified |
| 6 | HXCOMM architectures. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 7 | HXCOMM HXCOMM can be used for comments, discarded from both texi and C |
| 8 | |
Markus Armbruster | de6b4f9 | 2017-10-02 16:03:00 +0200 | [diff] [blame] | 9 | DEFHEADING(Standard options:) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 10 | STEXI |
| 11 | @table @option |
| 12 | ETEXI |
| 13 | |
| 14 | DEF("help", 0, QEMU_OPTION_h, |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 15 | "-h or -help display this help and exit\n", QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 16 | STEXI |
| 17 | @item -h |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 18 | @findex -h |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 19 | Display help and exit |
| 20 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 21 | SRST |
| 22 | ``-h`` |
| 23 | Display help and exit |
| 24 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 25 | |
pbrook | 9bd7e6d | 2009-04-07 22:58:45 +0000 | [diff] [blame] | 26 | DEF("version", 0, QEMU_OPTION_version, |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 27 | "-version display version information and exit\n", QEMU_ARCH_ALL) |
pbrook | 9bd7e6d | 2009-04-07 22:58:45 +0000 | [diff] [blame] | 28 | STEXI |
| 29 | @item -version |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 30 | @findex -version |
pbrook | 9bd7e6d | 2009-04-07 22:58:45 +0000 | [diff] [blame] | 31 | Display version information and exit |
| 32 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 33 | SRST |
| 34 | ``-version`` |
| 35 | Display version information and exit |
| 36 | ERST |
pbrook | 9bd7e6d | 2009-04-07 22:58:45 +0000 | [diff] [blame] | 37 | |
Jan Kiszka | 80f52a6 | 2011-07-23 12:39:46 +0200 | [diff] [blame] | 38 | DEF("machine", HAS_ARG, QEMU_OPTION_machine, \ |
| 39 | "-machine [type=]name[,prop[=value][,...]]\n" |
Peter Maydell | 585f603 | 2012-10-04 16:22:01 +0100 | [diff] [blame] | 40 | " selects emulated machine ('-machine help' for list)\n" |
Jan Kiszka | 80f52a6 | 2011-07-23 12:39:46 +0200 | [diff] [blame] | 41 | " property accel=accel1[:accel2[:...]] selects accelerator\n" |
Justin Terry (VM) | d661d9a | 2018-01-22 13:07:46 -0800 | [diff] [blame] | 42 | " supported accelerators are kvm, xen, hax, hvf, whpx or tcg (default: tcg)\n" |
Don Slutz | d1048be | 2014-11-21 11:18:52 -0500 | [diff] [blame] | 43 | " vmport=on|off|auto controls emulation of vmport (default: auto)\n" |
Luiz Capitulino | 8490fc7 | 2012-09-05 16:50:16 -0300 | [diff] [blame] | 44 | " dump-guest-core=on|off include guest memory in a core dump (default=on)\n" |
Le Tan | a52a7fd | 2014-08-16 13:55:40 +0800 | [diff] [blame] | 45 | " mem-merge=on|off controls memory merge support (default: on)\n" |
Tony Krowiak | 2eb1cd0 | 2015-03-12 13:53:51 +0100 | [diff] [blame] | 46 | " aes-key-wrap=on|off controls support for AES key wrapping (default=on)\n" |
Alexander Graf | 9850c60 | 2015-02-23 13:56:42 +0100 | [diff] [blame] | 47 | " dea-key-wrap=on|off controls support for DEA key wrapping (default=on)\n" |
Xiao Guangrong | 87252e1 | 2015-12-02 15:20:58 +0800 | [diff] [blame] | 48 | " suppress-vmdesc=on|off disables self-describing migration (default=off)\n" |
Greg Kurz | 902c053 | 2016-02-18 12:32:25 +0100 | [diff] [blame] | 49 | " nvdimm=on|off controls NVDIMM support (default=off)\n" |
Xiao Feng Ren | 274250c | 2017-05-17 02:48:03 +0200 | [diff] [blame] | 50 | " enforce-config-section=on|off enforce configuration section migration (default=off)\n" |
Tao Xu | 244b3f4 | 2019-12-13 09:19:22 +0800 | [diff] [blame] | 51 | " memory-encryption=@var{} memory encryption object to use (default=none)\n" |
| 52 | " hmat=on|off controls ACPI HMAT support (default=off)\n", |
Jan Kiszka | 80f52a6 | 2011-07-23 12:39:46 +0200 | [diff] [blame] | 53 | QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 54 | STEXI |
Jan Kiszka | 80f52a6 | 2011-07-23 12:39:46 +0200 | [diff] [blame] | 55 | @item -machine [type=]@var{name}[,prop=@var{value}[,...]] |
| 56 | @findex -machine |
Peter Maydell | 585f603 | 2012-10-04 16:22:01 +0100 | [diff] [blame] | 57 | Select the emulated machine by @var{name}. Use @code{-machine help} to list |
Daniel P. Berrange | 8bfce83 | 2017-07-25 15:10:41 +0100 | [diff] [blame] | 58 | available machines. |
| 59 | |
| 60 | For architectures which aim to support live migration compatibility |
| 61 | across releases, each release will introduce a new versioned machine |
| 62 | type. For example, the 2.8.0 release introduced machine types |
| 63 | ``pc-i440fx-2.8'' and ``pc-q35-2.8'' for the x86_64/i686 architectures. |
| 64 | |
| 65 | To allow live migration of guests from QEMU version 2.8.0, to QEMU |
| 66 | version 2.9.0, the 2.9.0 version must support the ``pc-i440fx-2.8'' |
| 67 | and ``pc-q35-2.8'' machines too. To allow users live migrating VMs |
| 68 | to skip multiple intermediate releases when upgrading, new releases |
| 69 | of QEMU will support machine types from many previous versions. |
| 70 | |
| 71 | Supported machine properties are: |
Jan Kiszka | 80f52a6 | 2011-07-23 12:39:46 +0200 | [diff] [blame] | 72 | @table @option |
| 73 | @item accel=@var{accels1}[:@var{accels2}[:...]] |
| 74 | This is used to enable an accelerator. Depending on the target architecture, |
Justin Terry (VM) | d661d9a | 2018-01-22 13:07:46 -0800 | [diff] [blame] | 75 | kvm, xen, hax, hvf, whpx or tcg can be available. By default, tcg is used. If there is |
Thomas Huth | bde4d92 | 2017-05-04 07:24:41 +0200 | [diff] [blame] | 76 | more than one accelerator specified, the next one is used if the previous one |
| 77 | fails to initialize. |
Don Slutz | d1048be | 2014-11-21 11:18:52 -0500 | [diff] [blame] | 78 | @item vmport=on|off|auto |
| 79 | Enables emulation of VMWare IO port, for vmmouse etc. auto says to select the |
| 80 | value based on accel. For accel=xen the default is off otherwise the default |
| 81 | is on. |
Jason Baron | ddb97f1 | 2012-08-02 15:44:16 -0400 | [diff] [blame] | 82 | @item dump-guest-core=on|off |
| 83 | Include guest memory in a core dump. The default is on. |
Luiz Capitulino | 8490fc7 | 2012-09-05 16:50:16 -0300 | [diff] [blame] | 84 | @item mem-merge=on|off |
| 85 | Enables or disables memory merge support. This feature, when supported by |
| 86 | the host, de-duplicates identical memory pages among VMs instances |
| 87 | (enabled by default). |
Tony Krowiak | 2eb1cd0 | 2015-03-12 13:53:51 +0100 | [diff] [blame] | 88 | @item aes-key-wrap=on|off |
| 89 | Enables or disables AES key wrapping support on s390-ccw hosts. This feature |
| 90 | controls whether AES wrapping keys will be created to allow |
| 91 | execution of AES cryptographic functions. The default is on. |
| 92 | @item dea-key-wrap=on|off |
| 93 | Enables or disables DEA key wrapping support on s390-ccw hosts. This feature |
| 94 | controls whether DEA wrapping keys will be created to allow |
| 95 | execution of DEA cryptographic functions. The default is on. |
Xiao Guangrong | 87252e1 | 2015-12-02 15:20:58 +0800 | [diff] [blame] | 96 | @item nvdimm=on|off |
| 97 | Enables or disables NVDIMM support. The default is off. |
Peter Xu | 16f7244 | 2017-07-07 10:54:08 +0800 | [diff] [blame] | 98 | @item enforce-config-section=on|off |
| 99 | If @option{enforce-config-section} is set to @var{on}, force migration |
| 100 | code to send configuration section even if the machine-type sets the |
| 101 | @option{migration.send-configuration} property to @var{off}. |
| 102 | NOTE: this parameter is deprecated. Please use @option{-global} |
| 103 | @option{migration.send-configuration}=@var{on|off} instead. |
Brijesh Singh | db58819 | 2018-03-08 06:48:38 -0600 | [diff] [blame] | 104 | @item memory-encryption=@var{} |
| 105 | Memory encryption object to use. The default is none. |
Tao Xu | 244b3f4 | 2019-12-13 09:19:22 +0800 | [diff] [blame] | 106 | @item hmat=on|off |
| 107 | Enables or disables ACPI Heterogeneous Memory Attribute Table (HMAT) support. |
| 108 | The default is off. |
Jan Kiszka | 80f52a6 | 2011-07-23 12:39:46 +0200 | [diff] [blame] | 109 | @end table |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 110 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 111 | SRST |
| 112 | ``-machine [type=]name[,prop=value[,...]]`` |
| 113 | Select the emulated machine by name. Use ``-machine help`` to list |
| 114 | available machines. |
| 115 | |
| 116 | For architectures which aim to support live migration compatibility |
| 117 | across releases, each release will introduce a new versioned machine |
| 118 | type. For example, the 2.8.0 release introduced machine types |
| 119 | "pc-i440fx-2.8" and "pc-q35-2.8" for the x86\_64/i686 architectures. |
| 120 | |
| 121 | To allow live migration of guests from QEMU version 2.8.0, to QEMU |
| 122 | version 2.9.0, the 2.9.0 version must support the "pc-i440fx-2.8" |
| 123 | and "pc-q35-2.8" machines too. To allow users live migrating VMs to |
| 124 | skip multiple intermediate releases when upgrading, new releases of |
| 125 | QEMU will support machine types from many previous versions. |
| 126 | |
| 127 | Supported machine properties are: |
| 128 | |
| 129 | ``accel=accels1[:accels2[:...]]`` |
| 130 | This is used to enable an accelerator. Depending on the target |
| 131 | architecture, kvm, xen, hax, hvf, whpx or tcg can be available. |
| 132 | By default, tcg is used. If there is more than one accelerator |
| 133 | specified, the next one is used if the previous one fails to |
| 134 | initialize. |
| 135 | |
| 136 | ``vmport=on|off|auto`` |
| 137 | Enables emulation of VMWare IO port, for vmmouse etc. auto says |
| 138 | to select the value based on accel. For accel=xen the default is |
| 139 | off otherwise the default is on. |
| 140 | |
| 141 | ``dump-guest-core=on|off`` |
| 142 | Include guest memory in a core dump. The default is on. |
| 143 | |
| 144 | ``mem-merge=on|off`` |
| 145 | Enables or disables memory merge support. This feature, when |
| 146 | supported by the host, de-duplicates identical memory pages |
| 147 | among VMs instances (enabled by default). |
| 148 | |
| 149 | ``aes-key-wrap=on|off`` |
| 150 | Enables or disables AES key wrapping support on s390-ccw hosts. |
| 151 | This feature controls whether AES wrapping keys will be created |
| 152 | to allow execution of AES cryptographic functions. The default |
| 153 | is on. |
| 154 | |
| 155 | ``dea-key-wrap=on|off`` |
| 156 | Enables or disables DEA key wrapping support on s390-ccw hosts. |
| 157 | This feature controls whether DEA wrapping keys will be created |
| 158 | to allow execution of DEA cryptographic functions. The default |
| 159 | is on. |
| 160 | |
| 161 | ``nvdimm=on|off`` |
| 162 | Enables or disables NVDIMM support. The default is off. |
| 163 | |
| 164 | ``enforce-config-section=on|off`` |
| 165 | If ``enforce-config-section`` is set to on, force migration code |
| 166 | to send configuration section even if the machine-type sets the |
| 167 | ``migration.send-configuration`` property to off. NOTE: this |
| 168 | parameter is deprecated. Please use ``-global`` |
| 169 | ``migration.send-configuration``\ =on\|off instead. |
| 170 | |
| 171 | ``memory-encryption=`` |
| 172 | Memory encryption object to use. The default is none. |
| 173 | |
| 174 | ``hmat=on|off`` |
| 175 | Enables or disables ACPI Heterogeneous Memory Attribute Table |
| 176 | (HMAT) support. The default is off. |
| 177 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 178 | |
Jan Kiszka | 80f52a6 | 2011-07-23 12:39:46 +0200 | [diff] [blame] | 179 | HXCOMM Deprecated by -machine |
| 180 | DEF("M", HAS_ARG, QEMU_OPTION_M, "", QEMU_ARCH_ALL) |
| 181 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 182 | DEF("cpu", HAS_ARG, QEMU_OPTION_cpu, |
Peter Maydell | 585f603 | 2012-10-04 16:22:01 +0100 | [diff] [blame] | 183 | "-cpu cpu select CPU ('-cpu help' for list)\n", QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 184 | STEXI |
| 185 | @item -cpu @var{model} |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 186 | @findex -cpu |
Peter Maydell | 585f603 | 2012-10-04 16:22:01 +0100 | [diff] [blame] | 187 | Select CPU model (@code{-cpu help} for list and additional feature selection) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 188 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 189 | SRST |
| 190 | ``-cpu model`` |
| 191 | Select CPU model (``-cpu help`` for list and additional feature |
| 192 | selection) |
| 193 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 194 | |
KONRAD Frederic | 8d4e914 | 2017-02-23 18:29:08 +0000 | [diff] [blame] | 195 | DEF("accel", HAS_ARG, QEMU_OPTION_accel, |
Paolo Bonzini | fe17413 | 2019-11-13 15:16:44 +0100 | [diff] [blame] | 196 | "-accel [accel=]accelerator[,prop[=value][,...]]\n" |
Justin Terry (VM) | d661d9a | 2018-01-22 13:07:46 -0800 | [diff] [blame] | 197 | " select accelerator (kvm, xen, hax, hvf, whpx or tcg; use 'help' for a list)\n" |
Paolo Bonzini | 46472d8 | 2019-11-13 10:56:53 +0100 | [diff] [blame] | 198 | " igd-passthru=on|off (enable Xen integrated Intel graphics passthrough, default=off)\n" |
Paolo Bonzini | 11bc4a1 | 2019-11-13 10:56:53 +0100 | [diff] [blame] | 199 | " kernel-irqchip=on|off|split controls accelerated irqchip support (default=on)\n" |
Paolo Bonzini | 23b0898 | 2019-11-13 10:56:53 +0100 | [diff] [blame] | 200 | " kvm-shadow-mem=size of KVM shadow MMU in bytes\n" |
Paolo Bonzini | fe17413 | 2019-11-13 15:16:44 +0100 | [diff] [blame] | 201 | " tb-size=n (TCG translation block cache size)\n" |
Eduardo Habkost | 0b3c5c8 | 2018-06-11 16:56:07 -0300 | [diff] [blame] | 202 | " thread=single|multi (enable multi-threaded TCG)\n", QEMU_ARCH_ALL) |
KONRAD Frederic | 8d4e914 | 2017-02-23 18:29:08 +0000 | [diff] [blame] | 203 | STEXI |
| 204 | @item -accel @var{name}[,prop=@var{value}[,...]] |
| 205 | @findex -accel |
| 206 | This is used to enable an accelerator. Depending on the target architecture, |
Justin Terry (VM) | d661d9a | 2018-01-22 13:07:46 -0800 | [diff] [blame] | 207 | kvm, xen, hax, hvf, whpx or tcg can be available. By default, tcg is used. If there is |
Thomas Huth | bde4d92 | 2017-05-04 07:24:41 +0200 | [diff] [blame] | 208 | more than one accelerator specified, the next one is used if the previous one |
| 209 | fails to initialize. |
KONRAD Frederic | 8d4e914 | 2017-02-23 18:29:08 +0000 | [diff] [blame] | 210 | @table @option |
Paolo Bonzini | 46472d8 | 2019-11-13 10:56:53 +0100 | [diff] [blame] | 211 | @item igd-passthru=on|off |
| 212 | When Xen is in use, this option controls whether Intel integrated graphics |
| 213 | devices can be passed through to the guest (default=off) |
Paolo Bonzini | 11bc4a1 | 2019-11-13 10:56:53 +0100 | [diff] [blame] | 214 | @item kernel-irqchip=on|off|split |
| 215 | Controls KVM in-kernel irqchip support. The default is full acceleration of the |
| 216 | interrupt controllers. On x86, split irqchip reduces the kernel attack |
| 217 | surface, at a performance cost for non-MSI interrupts. Disabling the in-kernel |
| 218 | irqchip completely is not recommended except for debugging purposes. |
Paolo Bonzini | 23b0898 | 2019-11-13 10:56:53 +0100 | [diff] [blame] | 219 | @item kvm-shadow-mem=size |
| 220 | Defines the size of the KVM shadow MMU. |
Paolo Bonzini | fe17413 | 2019-11-13 15:16:44 +0100 | [diff] [blame] | 221 | @item tb-size=@var{n} |
| 222 | Controls the size (in MiB) of the TCG translation block cache. |
KONRAD Frederic | 8d4e914 | 2017-02-23 18:29:08 +0000 | [diff] [blame] | 223 | @item thread=single|multi |
| 224 | Controls number of TCG threads. When the TCG is multi-threaded there will be one |
| 225 | thread per vCPU therefor taking advantage of additional host cores. The default |
| 226 | is to enable multi-threading where both the back-end and front-ends support it and |
| 227 | no incompatible TCG features have been enabled (e.g. icount/replay). |
| 228 | @end table |
| 229 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 230 | SRST |
| 231 | ``-accel name[,prop=value[,...]]`` |
| 232 | This is used to enable an accelerator. Depending on the target |
| 233 | architecture, kvm, xen, hax, hvf, whpx or tcg can be available. By |
| 234 | default, tcg is used. If there is more than one accelerator |
| 235 | specified, the next one is used if the previous one fails to |
| 236 | initialize. |
| 237 | |
| 238 | ``igd-passthru=on|off`` |
| 239 | When Xen is in use, this option controls whether Intel |
| 240 | integrated graphics devices can be passed through to the guest |
| 241 | (default=off) |
| 242 | |
| 243 | ``kernel-irqchip=on|off|split`` |
| 244 | Controls KVM in-kernel irqchip support. The default is full |
| 245 | acceleration of the interrupt controllers. On x86, split irqchip |
| 246 | reduces the kernel attack surface, at a performance cost for |
| 247 | non-MSI interrupts. Disabling the in-kernel irqchip completely |
| 248 | is not recommended except for debugging purposes. |
| 249 | |
| 250 | ``kvm-shadow-mem=size`` |
| 251 | Defines the size of the KVM shadow MMU. |
| 252 | |
| 253 | ``tb-size=n`` |
| 254 | Controls the size (in MiB) of the TCG translation block cache. |
| 255 | |
| 256 | ``thread=single|multi`` |
| 257 | Controls number of TCG threads. When the TCG is multi-threaded |
| 258 | there will be one thread per vCPU therefor taking advantage of |
| 259 | additional host cores. The default is to enable multi-threading |
| 260 | where both the back-end and front-ends support it and no |
| 261 | incompatible TCG features have been enabled (e.g. |
| 262 | icount/replay). |
| 263 | ERST |
KONRAD Frederic | 8d4e914 | 2017-02-23 18:29:08 +0000 | [diff] [blame] | 264 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 265 | DEF("smp", HAS_ARG, QEMU_OPTION_smp, |
Like Xu | 1b45842 | 2019-06-20 13:45:25 +0800 | [diff] [blame] | 266 | "-smp [cpus=]n[,maxcpus=cpus][,cores=cores][,threads=threads][,dies=dies][,sockets=sockets]\n" |
Jes Sorensen | 6be68d7 | 2009-07-23 17:03:42 +0200 | [diff] [blame] | 267 | " set the number of CPUs to 'n' [default=1]\n" |
| 268 | " maxcpus= maximum number of total cpus, including\n" |
Bruce Rogers | ca1a8a0 | 2010-01-06 12:33:57 -0700 | [diff] [blame] | 269 | " offline CPUs for hotplug, etc\n" |
Like Xu | 1b45842 | 2019-06-20 13:45:25 +0800 | [diff] [blame] | 270 | " cores= number of CPU cores on one socket (for PC, it's on one die)\n" |
Andre Przywara | 58a04db | 2009-08-28 10:49:57 +0200 | [diff] [blame] | 271 | " threads= number of threads on one CPU core\n" |
Like Xu | 1b45842 | 2019-06-20 13:45:25 +0800 | [diff] [blame] | 272 | " dies= number of CPU dies on one socket (for PC only)\n" |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 273 | " sockets= number of discrete sockets in the system\n", |
| 274 | QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 275 | STEXI |
Like Xu | 1b45842 | 2019-06-20 13:45:25 +0800 | [diff] [blame] | 276 | @item -smp [cpus=]@var{n}[,cores=@var{cores}][,threads=@var{threads}][,dies=dies][,sockets=@var{sockets}][,maxcpus=@var{maxcpus}] |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 277 | @findex -smp |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 278 | Simulate an SMP system with @var{n} CPUs. On the PC target, up to 255 |
| 279 | CPUs are supported. On Sparc32 target, Linux limits the number of usable CPUs |
| 280 | to 4. |
Like Xu | 1b45842 | 2019-06-20 13:45:25 +0800 | [diff] [blame] | 281 | For the PC target, the number of @var{cores} per die, the number of @var{threads} |
| 282 | per cores, the number of @var{dies} per packages and the total number of |
| 283 | @var{sockets} can be specified. Missing values will be computed. |
| 284 | If any on the three values is given, the total number of CPUs @var{n} can be omitted. |
| 285 | @var{maxcpus} specifies the maximum number of hotpluggable CPUs. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 286 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 287 | SRST |
| 288 | ``-smp [cpus=]n[,cores=cores][,threads=threads][,dies=dies][,sockets=sockets][,maxcpus=maxcpus]`` |
| 289 | Simulate an SMP system with n CPUs. On the PC target, up to 255 CPUs |
| 290 | are supported. On Sparc32 target, Linux limits the number of usable |
| 291 | CPUs to 4. For the PC target, the number of cores per die, the |
| 292 | number of threads per cores, the number of dies per packages and the |
| 293 | total number of sockets can be specified. Missing values will be |
| 294 | computed. If any on the three values is given, the total number of |
| 295 | CPUs n can be omitted. maxcpus specifies the maximum number of |
| 296 | hotpluggable CPUs. |
| 297 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 298 | |
aliguori | 268a362 | 2009-04-21 22:30:27 +0000 | [diff] [blame] | 299 | DEF("numa", HAS_ARG, QEMU_OPTION_numa, |
Tao Xu | 244b3f4 | 2019-12-13 09:19:22 +0800 | [diff] [blame] | 300 | "-numa node[,mem=size][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=node]\n" |
| 301 | "-numa node[,memdev=id][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=node]\n" |
Igor Mammedov | 2d19c65 | 2017-11-28 15:53:58 +0100 | [diff] [blame] | 302 | "-numa dist,src=source,dst=destination,val=distance\n" |
Liu Jingqi | 9b12dfa | 2019-12-13 09:19:23 +0800 | [diff] [blame] | 303 | "-numa cpu,node-id=node[,socket-id=x][,core-id=y][,thread-id=z]\n" |
Liu Jingqi | c412a48 | 2019-12-13 09:19:24 +0800 | [diff] [blame] | 304 | "-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" |
| 305 | "-numa hmat-cache,node-id=node,size=size,level=level[,associativity=none|direct|complex][,policy=none|write-back|write-through][,line=size]\n", |
Igor Mammedov | 2d19c65 | 2017-11-28 15:53:58 +0100 | [diff] [blame] | 306 | QEMU_ARCH_ALL) |
aliguori | 268a362 | 2009-04-21 22:30:27 +0000 | [diff] [blame] | 307 | STEXI |
Tao Xu | 244b3f4 | 2019-12-13 09:19:22 +0800 | [diff] [blame] | 308 | @item -numa node[,mem=@var{size}][,cpus=@var{firstcpu}[-@var{lastcpu}]][,nodeid=@var{node}][,initiator=@var{initiator}] |
| 309 | @itemx -numa node[,memdev=@var{id}][,cpus=@var{firstcpu}[-@var{lastcpu}]][,nodeid=@var{node}][,initiator=@var{initiator}] |
He Chen | 0f20343 | 2017-04-27 10:35:58 +0800 | [diff] [blame] | 310 | @itemx -numa dist,src=@var{source},dst=@var{destination},val=@var{distance} |
Igor Mammedov | 419fcde | 2017-05-10 13:30:01 +0200 | [diff] [blame] | 311 | @itemx -numa cpu,node-id=@var{node}[,socket-id=@var{x}][,core-id=@var{y}][,thread-id=@var{z}] |
Liu Jingqi | 9b12dfa | 2019-12-13 09:19:23 +0800 | [diff] [blame] | 312 | @itemx -numa hmat-lb,initiator=@var{node},target=@var{node},hierarchy=@var{hierarchy},data-type=@var{tpye}[,latency=@var{lat}][,bandwidth=@var{bw}] |
Liu Jingqi | c412a48 | 2019-12-13 09:19:24 +0800 | [diff] [blame] | 313 | @itemx -numa hmat-cache,node-id=@var{node},size=@var{size},level=@var{level}[,associativity=@var{str}][,policy=@var{str}][,line=@var{size}] |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 314 | @findex -numa |
Eduardo Habkost | 4b9a5dd | 2017-01-23 16:06:32 -0200 | [diff] [blame] | 315 | Define a NUMA node and assign RAM and VCPUs to it. |
He Chen | 0f20343 | 2017-04-27 10:35:58 +0800 | [diff] [blame] | 316 | Set the NUMA distance from a source node to a destination node. |
Liu Jingqi | 9b12dfa | 2019-12-13 09:19:23 +0800 | [diff] [blame] | 317 | Set the ACPI Heterogeneous Memory Attributes for the given nodes. |
Paolo Bonzini | 7febe36 | 2014-05-14 17:43:17 +0800 | [diff] [blame] | 318 | |
Igor Mammedov | 419fcde | 2017-05-10 13:30:01 +0200 | [diff] [blame] | 319 | Legacy VCPU assignment uses @samp{cpus} option where |
Eduardo Habkost | 4b9a5dd | 2017-01-23 16:06:32 -0200 | [diff] [blame] | 320 | @var{firstcpu} and @var{lastcpu} are CPU indexes. Each |
| 321 | @samp{cpus} option represent a contiguous range of CPU indexes |
| 322 | (or a single VCPU if @var{lastcpu} is omitted). A non-contiguous |
| 323 | set of VCPUs can be represented by providing multiple @samp{cpus} |
| 324 | options. If @samp{cpus} is omitted on all nodes, VCPUs are automatically |
| 325 | split between them. |
| 326 | |
| 327 | For example, the following option assigns VCPUs 0, 1, 2 and 5 to |
| 328 | a NUMA node: |
| 329 | @example |
| 330 | -numa node,cpus=0-2,cpus=5 |
| 331 | @end example |
| 332 | |
Igor Mammedov | 419fcde | 2017-05-10 13:30:01 +0200 | [diff] [blame] | 333 | @samp{cpu} option is a new alternative to @samp{cpus} option |
| 334 | which uses @samp{socket-id|core-id|thread-id} properties to assign |
| 335 | CPU objects to a @var{node} using topology layout properties of CPU. |
| 336 | The set of properties is machine specific, and depends on used |
| 337 | machine type/@samp{smp} options. It could be queried with |
| 338 | @samp{hotpluggable-cpus} monitor command. |
| 339 | @samp{node-id} property specifies @var{node} to which CPU object |
| 340 | will be assigned, it's required for @var{node} to be declared |
| 341 | with @samp{node} option before it's used with @samp{cpu} option. |
| 342 | |
| 343 | For example: |
| 344 | @example |
| 345 | -M pc \ |
| 346 | -smp 1,sockets=2,maxcpus=2 \ |
| 347 | -numa node,nodeid=0 -numa node,nodeid=1 \ |
| 348 | -numa cpu,node-id=0,socket-id=0 -numa cpu,node-id=1,socket-id=1 |
| 349 | @end example |
| 350 | |
Eduardo Habkost | 4b9a5dd | 2017-01-23 16:06:32 -0200 | [diff] [blame] | 351 | @samp{mem} assigns a given RAM amount to a node. @samp{memdev} |
| 352 | assigns RAM from a given memory backend device to a node. If |
| 353 | @samp{mem} and @samp{memdev} are omitted in all nodes, RAM is |
| 354 | split equally between them. |
| 355 | |
| 356 | @samp{mem} and @samp{memdev} are mutually exclusive. Furthermore, |
| 357 | if one node uses @samp{memdev}, all of them have to use it. |
| 358 | |
Tao Xu | 244b3f4 | 2019-12-13 09:19:22 +0800 | [diff] [blame] | 359 | @samp{initiator} is an additional option that points to an @var{initiator} |
| 360 | NUMA node that has best performance (the lowest latency or largest bandwidth) |
| 361 | to this NUMA @var{node}. Note that this option can be set only when |
| 362 | the machine property 'hmat' is set to 'on'. |
| 363 | |
| 364 | Following example creates a machine with 2 NUMA nodes, node 0 has CPU. |
| 365 | node 1 has only memory, and its initiator is node 0. Note that because |
| 366 | node 0 has CPU, by default the initiator of node 0 is itself and must be |
| 367 | itself. |
| 368 | @example |
| 369 | -machine hmat=on \ |
| 370 | -m 2G,slots=2,maxmem=4G \ |
| 371 | -object memory-backend-ram,size=1G,id=m0 \ |
| 372 | -object memory-backend-ram,size=1G,id=m1 \ |
| 373 | -numa node,nodeid=0,memdev=m0 \ |
| 374 | -numa node,nodeid=1,memdev=m1,initiator=0 \ |
| 375 | -smp 2,sockets=2,maxcpus=2 \ |
| 376 | -numa cpu,node-id=0,socket-id=0 \ |
| 377 | -numa cpu,node-id=0,socket-id=1 |
| 378 | @end example |
| 379 | |
He Chen | 0f20343 | 2017-04-27 10:35:58 +0800 | [diff] [blame] | 380 | @var{source} and @var{destination} are NUMA node IDs. |
| 381 | @var{distance} is the NUMA distance from @var{source} to @var{destination}. |
| 382 | The distance from a node to itself is always 10. If any pair of nodes is |
| 383 | given a distance, then all pairs must be given distances. Although, when |
| 384 | distances are only given in one direction for each pair of nodes, then |
| 385 | the distances in the opposite directions are assumed to be the same. If, |
| 386 | however, an asymmetrical pair of distances is given for even one node |
| 387 | pair, then all node pairs must be provided distance values for both |
| 388 | directions, even when they are symmetrical. When a node is unreachable |
| 389 | from another node, set the pair's distance to 255. |
| 390 | |
Eduardo Habkost | 4b9a5dd | 2017-01-23 16:06:32 -0200 | [diff] [blame] | 391 | Note that the -@option{numa} option doesn't allocate any of the |
| 392 | specified resources, it just assigns existing resources to NUMA |
| 393 | nodes. This means that one still has to use the @option{-m}, |
| 394 | @option{-smp} options to allocate RAM and VCPUs respectively. |
| 395 | |
Liu Jingqi | 9b12dfa | 2019-12-13 09:19:23 +0800 | [diff] [blame] | 396 | Use @samp{hmat-lb} to set System Locality Latency and Bandwidth Information |
| 397 | between initiator and target NUMA nodes in ACPI Heterogeneous Attribute Memory Table (HMAT). |
| 398 | Initiator NUMA node can create memory requests, usually it has one or more processors. |
| 399 | Target NUMA node contains addressable memory. |
| 400 | |
| 401 | In @samp{hmat-lb} option, @var{node} are NUMA node IDs. @var{hierarchy} is the memory |
| 402 | hierarchy of the target NUMA node: if @var{hierarchy} is 'memory', the structure |
| 403 | represents the memory performance; if @var{hierarchy} is 'first-level|second-level|third-level', |
| 404 | this structure represents aggregated performance of memory side caches for each domain. |
| 405 | @var{type} of 'data-type' is type of data represented by this structure instance: |
| 406 | if 'hierarchy' is 'memory', 'data-type' is 'access|read|write' latency or 'access|read|write' |
| 407 | bandwidth of the target memory; if 'hierarchy' is 'first-level|second-level|third-level', |
| 408 | 'data-type' is 'access|read|write' hit latency or 'access|read|write' hit bandwidth of the |
| 409 | target memory side cache. |
| 410 | |
| 411 | @var{lat} is latency value in nanoseconds. @var{bw} is bandwidth value, |
| 412 | the possible value and units are NUM[M|G|T], mean that the bandwidth value are |
| 413 | NUM byte per second (or MB/s, GB/s or TB/s depending on used suffix). |
| 414 | Note that if latency or bandwidth value is 0, means the corresponding latency or |
| 415 | bandwidth information is not provided. |
| 416 | |
Liu Jingqi | c412a48 | 2019-12-13 09:19:24 +0800 | [diff] [blame] | 417 | In @samp{hmat-cache} option, @var{node-id} is the NUMA-id of the memory belongs. |
| 418 | @var{size} is the size of memory side cache in bytes. @var{level} is the cache |
| 419 | level described in this structure, note that the cache level 0 should not be used |
| 420 | with @samp{hmat-cache} option. @var{associativity} is the cache associativity, |
| 421 | the possible value is 'none/direct(direct-mapped)/complex(complex cache indexing)'. |
| 422 | @var{policy} is the write policy. @var{line} is the cache Line size in bytes. |
| 423 | |
Liu Jingqi | 9b12dfa | 2019-12-13 09:19:23 +0800 | [diff] [blame] | 424 | For example, the following options describe 2 NUMA nodes. Node 0 has 2 cpus and |
| 425 | a ram, node 1 has only a ram. The processors in node 0 access memory in node |
| 426 | 0 with access-latency 5 nanoseconds, access-bandwidth is 200 MB/s; |
| 427 | The processors in NUMA node 0 access memory in NUMA node 1 with access-latency 10 |
| 428 | nanoseconds, access-bandwidth is 100 MB/s. |
Liu Jingqi | c412a48 | 2019-12-13 09:19:24 +0800 | [diff] [blame] | 429 | And for memory side cache information, NUMA node 0 and 1 both have 1 level memory |
| 430 | cache, size is 10KB, policy is write-back, the cache Line size is 8 bytes: |
Liu Jingqi | 9b12dfa | 2019-12-13 09:19:23 +0800 | [diff] [blame] | 431 | @example |
| 432 | -machine hmat=on \ |
| 433 | -m 2G \ |
| 434 | -object memory-backend-ram,size=1G,id=m0 \ |
| 435 | -object memory-backend-ram,size=1G,id=m1 \ |
| 436 | -smp 2 \ |
| 437 | -numa node,nodeid=0,memdev=m0 \ |
| 438 | -numa node,nodeid=1,memdev=m1,initiator=0 \ |
| 439 | -numa cpu,node-id=0,socket-id=0 \ |
| 440 | -numa cpu,node-id=0,socket-id=1 \ |
| 441 | -numa hmat-lb,initiator=0,target=0,hierarchy=memory,data-type=access-latency,latency=5 \ |
| 442 | -numa hmat-lb,initiator=0,target=0,hierarchy=memory,data-type=access-bandwidth,bandwidth=200M \ |
| 443 | -numa hmat-lb,initiator=0,target=1,hierarchy=memory,data-type=access-latency,latency=10 \ |
Liu Jingqi | c412a48 | 2019-12-13 09:19:24 +0800 | [diff] [blame] | 444 | -numa hmat-lb,initiator=0,target=1,hierarchy=memory,data-type=access-bandwidth,bandwidth=100M \ |
| 445 | -numa hmat-cache,node-id=0,size=10K,level=1,associativity=direct,policy=write-back,line=8 \ |
| 446 | -numa hmat-cache,node-id=1,size=10K,level=1,associativity=direct,policy=write-back,line=8 |
Liu Jingqi | 9b12dfa | 2019-12-13 09:19:23 +0800 | [diff] [blame] | 447 | @end example |
| 448 | |
aliguori | 268a362 | 2009-04-21 22:30:27 +0000 | [diff] [blame] | 449 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 450 | SRST |
Peter Maydell | 09ce5f2 | 2020-02-28 15:36:13 +0000 | [diff] [blame^] | 451 | ``-numa node[,mem=size][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=initiator]`` |
| 452 | \ |
| 453 | ``-numa node[,memdev=id][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=initiator]`` |
| 454 | \ |
| 455 | ``-numa dist,src=source,dst=destination,val=distance`` |
| 456 | \ |
| 457 | ``-numa cpu,node-id=node[,socket-id=x][,core-id=y][,thread-id=z]`` |
| 458 | \ |
| 459 | ``-numa hmat-lb,initiator=node,target=node,hierarchy=hierarchy,data-type=tpye[,latency=lat][,bandwidth=bw]`` |
| 460 | \ |
| 461 | ``-numa hmat-cache,node-id=node,size=size,level=level[,associativity=str][,policy=str][,line=size]`` |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 462 | Define a NUMA node and assign RAM and VCPUs to it. Set the NUMA |
| 463 | distance from a source node to a destination node. Set the ACPI |
| 464 | Heterogeneous Memory Attributes for the given nodes. |
| 465 | |
| 466 | Legacy VCPU assignment uses '\ ``cpus``\ ' option where firstcpu and |
| 467 | lastcpu are CPU indexes. Each '\ ``cpus``\ ' option represent a |
| 468 | contiguous range of CPU indexes (or a single VCPU if lastcpu is |
| 469 | omitted). A non-contiguous set of VCPUs can be represented by |
| 470 | providing multiple '\ ``cpus``\ ' options. If '\ ``cpus``\ ' is |
| 471 | omitted on all nodes, VCPUs are automatically split between them. |
| 472 | |
| 473 | For example, the following option assigns VCPUs 0, 1, 2 and 5 to a |
| 474 | NUMA node: |
| 475 | |
| 476 | :: |
| 477 | |
| 478 | -numa node,cpus=0-2,cpus=5 |
| 479 | |
| 480 | '\ ``cpu``\ ' option is a new alternative to '\ ``cpus``\ ' option |
| 481 | which uses '\ ``socket-id|core-id|thread-id``\ ' properties to |
| 482 | assign CPU objects to a node using topology layout properties of |
| 483 | CPU. The set of properties is machine specific, and depends on used |
| 484 | machine type/'\ ``smp``\ ' options. It could be queried with |
| 485 | '\ ``hotpluggable-cpus``\ ' monitor command. '\ ``node-id``\ ' |
| 486 | property specifies node to which CPU object will be assigned, it's |
| 487 | required for node to be declared with '\ ``node``\ ' option before |
| 488 | it's used with '\ ``cpu``\ ' option. |
| 489 | |
| 490 | For example: |
| 491 | |
| 492 | :: |
| 493 | |
| 494 | -M pc \ |
| 495 | -smp 1,sockets=2,maxcpus=2 \ |
| 496 | -numa node,nodeid=0 -numa node,nodeid=1 \ |
| 497 | -numa cpu,node-id=0,socket-id=0 -numa cpu,node-id=1,socket-id=1 |
| 498 | |
| 499 | '\ ``mem``\ ' assigns a given RAM amount to a node. '\ ``memdev``\ ' |
| 500 | assigns RAM from a given memory backend device to a node. If |
| 501 | '\ ``mem``\ ' and '\ ``memdev``\ ' are omitted in all nodes, RAM is |
| 502 | split equally between them. |
| 503 | |
| 504 | '\ ``mem``\ ' and '\ ``memdev``\ ' are mutually exclusive. |
| 505 | Furthermore, if one node uses '\ ``memdev``\ ', all of them have to |
| 506 | use it. |
| 507 | |
| 508 | '\ ``initiator``\ ' is an additional option that points to an |
| 509 | initiator NUMA node that has best performance (the lowest latency or |
| 510 | largest bandwidth) to this NUMA node. Note that this option can be |
| 511 | set only when the machine property 'hmat' is set to 'on'. |
| 512 | |
| 513 | Following example creates a machine with 2 NUMA nodes, node 0 has |
| 514 | CPU. node 1 has only memory, and its initiator is node 0. Note that |
| 515 | because node 0 has CPU, by default the initiator of node 0 is itself |
| 516 | and must be itself. |
| 517 | |
| 518 | :: |
| 519 | |
| 520 | -machine hmat=on \ |
| 521 | -m 2G,slots=2,maxmem=4G \ |
| 522 | -object memory-backend-ram,size=1G,id=m0 \ |
| 523 | -object memory-backend-ram,size=1G,id=m1 \ |
| 524 | -numa node,nodeid=0,memdev=m0 \ |
| 525 | -numa node,nodeid=1,memdev=m1,initiator=0 \ |
| 526 | -smp 2,sockets=2,maxcpus=2 \ |
| 527 | -numa cpu,node-id=0,socket-id=0 \ |
| 528 | -numa cpu,node-id=0,socket-id=1 |
| 529 | |
| 530 | source and destination are NUMA node IDs. distance is the NUMA |
| 531 | distance from source to destination. The distance from a node to |
| 532 | itself is always 10. If any pair of nodes is given a distance, then |
| 533 | all pairs must be given distances. Although, when distances are only |
| 534 | given in one direction for each pair of nodes, then the distances in |
| 535 | the opposite directions are assumed to be the same. If, however, an |
| 536 | asymmetrical pair of distances is given for even one node pair, then |
| 537 | all node pairs must be provided distance values for both directions, |
| 538 | even when they are symmetrical. When a node is unreachable from |
| 539 | another node, set the pair's distance to 255. |
| 540 | |
| 541 | Note that the -``numa`` option doesn't allocate any of the specified |
| 542 | resources, it just assigns existing resources to NUMA nodes. This |
| 543 | means that one still has to use the ``-m``, ``-smp`` options to |
| 544 | allocate RAM and VCPUs respectively. |
| 545 | |
| 546 | Use '\ ``hmat-lb``\ ' to set System Locality Latency and Bandwidth |
| 547 | Information between initiator and target NUMA nodes in ACPI |
| 548 | Heterogeneous Attribute Memory Table (HMAT). Initiator NUMA node can |
| 549 | create memory requests, usually it has one or more processors. |
| 550 | Target NUMA node contains addressable memory. |
| 551 | |
| 552 | In '\ ``hmat-lb``\ ' option, node are NUMA node IDs. hierarchy is |
| 553 | the memory hierarchy of the target NUMA node: if hierarchy is |
| 554 | 'memory', the structure represents the memory performance; if |
| 555 | hierarchy is 'first-level\|second-level\|third-level', this |
| 556 | structure represents aggregated performance of memory side caches |
| 557 | for each domain. type of 'data-type' is type of data represented by |
| 558 | this structure instance: if 'hierarchy' is 'memory', 'data-type' is |
| 559 | 'access\|read\|write' latency or 'access\|read\|write' bandwidth of |
| 560 | the target memory; if 'hierarchy' is |
| 561 | 'first-level\|second-level\|third-level', 'data-type' is |
| 562 | 'access\|read\|write' hit latency or 'access\|read\|write' hit |
| 563 | bandwidth of the target memory side cache. |
| 564 | |
| 565 | lat is latency value in nanoseconds. bw is bandwidth value, the |
| 566 | possible value and units are NUM[M\|G\|T], mean that the bandwidth |
| 567 | value are NUM byte per second (or MB/s, GB/s or TB/s depending on |
| 568 | used suffix). Note that if latency or bandwidth value is 0, means |
| 569 | the corresponding latency or bandwidth information is not provided. |
| 570 | |
| 571 | In '\ ``hmat-cache``\ ' option, node-id is the NUMA-id of the memory |
| 572 | belongs. size is the size of memory side cache in bytes. level is |
| 573 | the cache level described in this structure, note that the cache |
| 574 | level 0 should not be used with '\ ``hmat-cache``\ ' option. |
| 575 | associativity is the cache associativity, the possible value is |
| 576 | 'none/direct(direct-mapped)/complex(complex cache indexing)'. policy |
| 577 | is the write policy. line is the cache Line size in bytes. |
| 578 | |
| 579 | For example, the following options describe 2 NUMA nodes. Node 0 has |
| 580 | 2 cpus and a ram, node 1 has only a ram. The processors in node 0 |
| 581 | access memory in node 0 with access-latency 5 nanoseconds, |
| 582 | access-bandwidth is 200 MB/s; The processors in NUMA node 0 access |
| 583 | memory in NUMA node 1 with access-latency 10 nanoseconds, |
| 584 | access-bandwidth is 100 MB/s. And for memory side cache information, |
| 585 | NUMA node 0 and 1 both have 1 level memory cache, size is 10KB, |
| 586 | policy is write-back, the cache Line size is 8 bytes: |
| 587 | |
| 588 | :: |
| 589 | |
| 590 | -machine hmat=on \ |
| 591 | -m 2G \ |
| 592 | -object memory-backend-ram,size=1G,id=m0 \ |
| 593 | -object memory-backend-ram,size=1G,id=m1 \ |
| 594 | -smp 2 \ |
| 595 | -numa node,nodeid=0,memdev=m0 \ |
| 596 | -numa node,nodeid=1,memdev=m1,initiator=0 \ |
| 597 | -numa cpu,node-id=0,socket-id=0 \ |
| 598 | -numa cpu,node-id=0,socket-id=1 \ |
| 599 | -numa hmat-lb,initiator=0,target=0,hierarchy=memory,data-type=access-latency,latency=5 \ |
| 600 | -numa hmat-lb,initiator=0,target=0,hierarchy=memory,data-type=access-bandwidth,bandwidth=200M \ |
| 601 | -numa hmat-lb,initiator=0,target=1,hierarchy=memory,data-type=access-latency,latency=10 \ |
| 602 | -numa hmat-lb,initiator=0,target=1,hierarchy=memory,data-type=access-bandwidth,bandwidth=100M \ |
| 603 | -numa hmat-cache,node-id=0,size=10K,level=1,associativity=direct,policy=write-back,line=8 \ |
| 604 | -numa hmat-cache,node-id=1,size=10K,level=1,associativity=direct,policy=write-back,line=8 |
| 605 | ERST |
aliguori | 268a362 | 2009-04-21 22:30:27 +0000 | [diff] [blame] | 606 | |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 607 | DEF("add-fd", HAS_ARG, QEMU_OPTION_add_fd, |
| 608 | "-add-fd fd=fd,set=set[,opaque=opaque]\n" |
| 609 | " Add 'fd' to fd 'set'\n", QEMU_ARCH_ALL) |
| 610 | STEXI |
| 611 | @item -add-fd fd=@var{fd},set=@var{set}[,opaque=@var{opaque}] |
| 612 | @findex -add-fd |
| 613 | |
| 614 | Add a file descriptor to an fd set. Valid options are: |
| 615 | |
| 616 | @table @option |
| 617 | @item fd=@var{fd} |
| 618 | This option defines the file descriptor of which a duplicate is added to fd set. |
| 619 | The file descriptor cannot be stdin, stdout, or stderr. |
| 620 | @item set=@var{set} |
| 621 | This option defines the ID of the fd set to add the file descriptor to. |
| 622 | @item opaque=@var{opaque} |
| 623 | This option defines a free-form string that can be used to describe @var{fd}. |
| 624 | @end table |
| 625 | |
| 626 | You can open an image using pre-opened file descriptors from an fd set: |
| 627 | @example |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 628 | @value{qemu_system} \ |
| 629 | -add-fd fd=3,set=2,opaque="rdwr:/path/to/file" \ |
| 630 | -add-fd fd=4,set=2,opaque="rdonly:/path/to/file" \ |
| 631 | -drive file=/dev/fdset/2,index=0,media=disk |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 632 | @end example |
| 633 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 634 | SRST |
| 635 | ``-add-fd fd=fd,set=set[,opaque=opaque]`` |
| 636 | Add a file descriptor to an fd set. Valid options are: |
| 637 | |
| 638 | ``fd=fd`` |
| 639 | This option defines the file descriptor of which a duplicate is |
| 640 | added to fd set. The file descriptor cannot be stdin, stdout, or |
| 641 | stderr. |
| 642 | |
| 643 | ``set=set`` |
| 644 | This option defines the ID of the fd set to add the file |
| 645 | descriptor to. |
| 646 | |
| 647 | ``opaque=opaque`` |
| 648 | This option defines a free-form string that can be used to |
| 649 | describe fd. |
| 650 | |
| 651 | You can open an image using pre-opened file descriptors from an fd |
| 652 | set: |
| 653 | |
| 654 | .. parsed-literal:: |
| 655 | |
| 656 | |qemu_system| \ |
| 657 | -add-fd fd=3,set=2,opaque="rdwr:/path/to/file" \ |
| 658 | -add-fd fd=4,set=2,opaque="rdonly:/path/to/file" \ |
| 659 | -drive file=/dev/fdset/2,index=0,media=disk |
| 660 | ERST |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 661 | |
| 662 | DEF("set", HAS_ARG, QEMU_OPTION_set, |
| 663 | "-set group.id.arg=value\n" |
| 664 | " set <arg> parameter for item <id> of type <group>\n" |
| 665 | " i.e. -set drive.$id.file=/path/to/image\n", QEMU_ARCH_ALL) |
| 666 | STEXI |
| 667 | @item -set @var{group}.@var{id}.@var{arg}=@var{value} |
| 668 | @findex -set |
Michael Tokarev | e1f3b97 | 2016-10-16 17:21:37 +0300 | [diff] [blame] | 669 | Set parameter @var{arg} for item @var{id} of type @var{group} |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 670 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 671 | SRST |
| 672 | ``-set group.id.arg=value`` |
| 673 | Set parameter arg for item id of type group |
| 674 | ERST |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 675 | |
| 676 | DEF("global", HAS_ARG, QEMU_OPTION_global, |
Paolo Bonzini | 3751d7c | 2015-04-09 14:16:19 +0200 | [diff] [blame] | 677 | "-global driver.property=value\n" |
| 678 | "-global driver=driver,property=property,value=value\n" |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 679 | " set a global default for a driver property\n", |
| 680 | QEMU_ARCH_ALL) |
| 681 | STEXI |
| 682 | @item -global @var{driver}.@var{prop}=@var{value} |
Paolo Bonzini | 3751d7c | 2015-04-09 14:16:19 +0200 | [diff] [blame] | 683 | @itemx -global driver=@var{driver},property=@var{property},value=@var{value} |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 684 | @findex -global |
| 685 | Set default value of @var{driver}'s property @var{prop} to @var{value}, e.g.: |
| 686 | |
| 687 | @example |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 688 | @value{qemu_system_x86} -global ide-hd.physical_block_size=4096 disk-image.img |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 689 | @end example |
| 690 | |
Michael Tokarev | a295d24 | 2017-09-23 19:31:59 +0300 | [diff] [blame] | 691 | In particular, you can use this to set driver properties for devices which are |
| 692 | created automatically by the machine model. To create a device which is not |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 693 | created automatically and set properties on it, use -@option{device}. |
Paolo Bonzini | 3751d7c | 2015-04-09 14:16:19 +0200 | [diff] [blame] | 694 | |
Markus Armbruster | ae08fd5 | 2015-06-15 14:35:58 +0200 | [diff] [blame] | 695 | -global @var{driver}.@var{prop}=@var{value} is shorthand for -global |
| 696 | driver=@var{driver},property=@var{prop},value=@var{value}. The |
| 697 | longhand syntax works even when @var{driver} contains a dot. |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 698 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 699 | SRST |
Peter Maydell | 09ce5f2 | 2020-02-28 15:36:13 +0000 | [diff] [blame^] | 700 | ``-global driver.prop=value`` |
| 701 | \ |
| 702 | ``-global driver=driver,property=property,value=value`` |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 703 | Set default value of driver's property prop to value, e.g.: |
| 704 | |
| 705 | .. parsed-literal:: |
| 706 | |
| 707 | |qemu_system_x86| -global ide-hd.physical_block_size=4096 disk-image.img |
| 708 | |
| 709 | In particular, you can use this to set driver properties for devices |
| 710 | which are created automatically by the machine model. To create a |
| 711 | device which is not created automatically and set properties on it, |
| 712 | use -``device``. |
| 713 | |
| 714 | -global driver.prop=value is shorthand for -global |
| 715 | driver=driver,property=prop,value=value. The longhand syntax works |
| 716 | even when driver contains a dot. |
| 717 | ERST |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 718 | |
| 719 | DEF("boot", HAS_ARG, QEMU_OPTION_boot, |
| 720 | "-boot [order=drives][,once=drives][,menu=on|off]\n" |
Amos Kong | c8a6ae8 | 2013-03-19 14:23:27 +0800 | [diff] [blame] | 721 | " [,splash=sp_name][,splash-time=sp_time][,reboot-timeout=rb_time][,strict=on|off]\n" |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 722 | " 'drives': floppy (a), hard disk (c), CD-ROM (d), network (n)\n" |
| 723 | " 'sp_name': the file's name that would be passed to bios as logo picture, if menu=on\n" |
| 724 | " 'sp_time': the period that splash picture last if menu=on, unit is ms\n" |
| 725 | " 'rb_timeout': the timeout before guest reboot when boot failed, unit is ms\n", |
| 726 | QEMU_ARCH_ALL) |
| 727 | STEXI |
Amos Kong | c8a6ae8 | 2013-03-19 14:23:27 +0800 | [diff] [blame] | 728 | @item -boot [order=@var{drives}][,once=@var{drives}][,menu=on|off][,splash=@var{sp_name}][,splash-time=@var{sp_time}][,reboot-timeout=@var{rb_timeout}][,strict=on|off] |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 729 | @findex -boot |
| 730 | Specify boot order @var{drives} as a string of drive letters. Valid |
Gonglei | d274e07 | 2015-07-03 17:50:57 +0800 | [diff] [blame] | 731 | drive letters depend on the target architecture. The x86 PC uses: a, b |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 732 | (floppy 1 and 2), c (first hard disk), d (first CD-ROM), n-p (Etherboot |
| 733 | from network adapter 1-4), hard disk boot is the default. To apply a |
| 734 | particular boot order only on the first startup, specify it via |
Thomas Huth | c0d9f7d | 2017-02-28 18:40:01 +0100 | [diff] [blame] | 735 | @option{once}. Note that the @option{order} or @option{once} parameter |
| 736 | should not be used together with the @option{bootindex} property of |
| 737 | devices, since the firmware implementations normally do not support both |
| 738 | at the same time. |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 739 | |
| 740 | Interactive boot menus/prompts can be enabled via @option{menu=on} as far |
| 741 | as firmware/BIOS supports them. The default is non-interactive boot. |
| 742 | |
| 743 | A splash picture could be passed to bios, enabling user to show it as logo, |
| 744 | when option splash=@var{sp_name} is given and menu=on, If firmware/BIOS |
| 745 | supports them. Currently Seabios for X86 system support it. |
| 746 | limitation: The splash file could be a jpeg file or a BMP file in 24 BPP |
| 747 | format(true color). The resolution should be supported by the SVGA mode, so |
| 748 | the recommended is 320x240, 640x480, 800x640. |
| 749 | |
| 750 | A timeout could be passed to bios, guest will pause for @var{rb_timeout} ms |
Han Han | 8937a39 | 2019-12-05 10:48:21 +0800 | [diff] [blame] | 751 | when boot failed, then reboot. If @var{rb_timeout} is '-1', guest will not |
| 752 | reboot, qemu passes '-1' to bios by default. Currently Seabios for X86 |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 753 | system support it. |
| 754 | |
Amos Kong | c8a6ae8 | 2013-03-19 14:23:27 +0800 | [diff] [blame] | 755 | Do strict boot via @option{strict=on} as far as firmware/BIOS |
| 756 | supports it. This only effects when boot priority is changed by |
| 757 | bootindex options. The default is non-strict boot. |
| 758 | |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 759 | @example |
| 760 | # try to boot from network first, then from hard disk |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 761 | @value{qemu_system_x86} -boot order=nc |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 762 | # boot from CD-ROM first, switch back to default order after reboot |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 763 | @value{qemu_system_x86} -boot once=d |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 764 | # boot with a splash picture for 5 seconds. |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 765 | @value{qemu_system_x86} -boot menu=on,splash=/root/boot.bmp,splash-time=5000 |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 766 | @end example |
| 767 | |
| 768 | Note: The legacy format '-boot @var{drives}' is still supported but its |
| 769 | use is discouraged as it may be removed from future versions. |
| 770 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 771 | SRST |
| 772 | ``-boot [order=drives][,once=drives][,menu=on|off][,splash=sp_name][,splash-time=sp_time][,reboot-timeout=rb_timeout][,strict=on|off]`` |
| 773 | Specify boot order drives as a string of drive letters. Valid drive |
| 774 | letters depend on the target architecture. The x86 PC uses: a, b |
| 775 | (floppy 1 and 2), c (first hard disk), d (first CD-ROM), n-p |
| 776 | (Etherboot from network adapter 1-4), hard disk boot is the default. |
| 777 | To apply a particular boot order only on the first startup, specify |
| 778 | it via ``once``. Note that the ``order`` or ``once`` parameter |
| 779 | should not be used together with the ``bootindex`` property of |
| 780 | devices, since the firmware implementations normally do not support |
| 781 | both at the same time. |
| 782 | |
| 783 | Interactive boot menus/prompts can be enabled via ``menu=on`` as far |
| 784 | as firmware/BIOS supports them. The default is non-interactive boot. |
| 785 | |
| 786 | A splash picture could be passed to bios, enabling user to show it |
| 787 | as logo, when option splash=sp\_name is given and menu=on, If |
| 788 | firmware/BIOS supports them. Currently Seabios for X86 system |
| 789 | support it. limitation: The splash file could be a jpeg file or a |
| 790 | BMP file in 24 BPP format(true color). The resolution should be |
| 791 | supported by the SVGA mode, so the recommended is 320x240, 640x480, |
| 792 | 800x640. |
| 793 | |
| 794 | A timeout could be passed to bios, guest will pause for rb\_timeout |
| 795 | ms when boot failed, then reboot. If rb\_timeout is '-1', guest will |
| 796 | not reboot, qemu passes '-1' to bios by default. Currently Seabios |
| 797 | for X86 system support it. |
| 798 | |
| 799 | Do strict boot via ``strict=on`` as far as firmware/BIOS supports |
| 800 | it. This only effects when boot priority is changed by bootindex |
| 801 | options. The default is non-strict boot. |
| 802 | |
Peter Maydell | 09ce5f2 | 2020-02-28 15:36:13 +0000 | [diff] [blame^] | 803 | .. parsed-literal:: |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 804 | |
| 805 | # try to boot from network first, then from hard disk |
| 806 | |qemu_system_x86| -boot order=nc |
| 807 | # boot from CD-ROM first, switch back to default order after reboot |
| 808 | |qemu_system_x86| -boot once=d |
| 809 | # boot with a splash picture for 5 seconds. |
| 810 | |qemu_system_x86| -boot menu=on,splash=/root/boot.bmp,splash-time=5000 |
| 811 | |
| 812 | Note: The legacy format '-boot drives' is still supported but its |
| 813 | use is discouraged as it may be removed from future versions. |
| 814 | ERST |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 815 | |
| 816 | DEF("m", HAS_ARG, QEMU_OPTION_m, |
Michael Tokarev | 89f3ea2 | 2016-11-10 17:51:32 +0300 | [diff] [blame] | 817 | "-m [size=]megs[,slots=n,maxmem=size]\n" |
Igor Mammedov | 6e1d3c1 | 2013-11-27 01:27:35 +0100 | [diff] [blame] | 818 | " configure guest RAM\n" |
Alexander Graf | 0daba1f | 2015-06-05 11:05:03 +0200 | [diff] [blame] | 819 | " size: initial amount of guest memory\n" |
Igor Mammedov | c270fb9 | 2014-06-02 15:25:02 +0200 | [diff] [blame] | 820 | " slots: number of hotplug slots (default: none)\n" |
Matthew Rosato | b6fe012 | 2014-08-28 11:25:33 -0400 | [diff] [blame] | 821 | " maxmem: maximum amount of guest memory (default: none)\n" |
| 822 | "NOTE: Some architectures might enforce a specific granularity\n", |
Igor Mammedov | 6e1d3c1 | 2013-11-27 01:27:35 +0100 | [diff] [blame] | 823 | QEMU_ARCH_ALL) |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 824 | STEXI |
Luiz Capitulino | 9fcc079 | 2015-02-26 14:35:45 -0500 | [diff] [blame] | 825 | @item -m [size=]@var{megs}[,slots=n,maxmem=size] |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 826 | @findex -m |
Luiz Capitulino | 9fcc079 | 2015-02-26 14:35:45 -0500 | [diff] [blame] | 827 | Sets guest startup RAM size to @var{megs} megabytes. Default is 128 MiB. |
| 828 | Optionally, a suffix of ``M'' or ``G'' can be used to signify a value in |
| 829 | megabytes or gigabytes respectively. Optional pair @var{slots}, @var{maxmem} |
| 830 | could be used to set amount of hotpluggable memory slots and maximum amount of |
| 831 | memory. Note that @var{maxmem} must be aligned to the page size. |
| 832 | |
| 833 | For example, the following command-line sets the guest startup RAM size to |
| 834 | 1GB, creates 3 slots to hotplug additional memory and sets the maximum |
| 835 | memory the guest can reach to 4GB: |
| 836 | |
| 837 | @example |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 838 | @value{qemu_system} -m 1G,slots=3,maxmem=4G |
Luiz Capitulino | 9fcc079 | 2015-02-26 14:35:45 -0500 | [diff] [blame] | 839 | @end example |
| 840 | |
| 841 | If @var{slots} and @var{maxmem} are not specified, memory hotplug won't |
| 842 | be enabled and the guest startup RAM will never increase. |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 843 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 844 | SRST |
| 845 | ``-m [size=]megs[,slots=n,maxmem=size]`` |
| 846 | Sets guest startup RAM size to megs megabytes. Default is 128 MiB. |
| 847 | Optionally, a suffix of "M" or "G" can be used to signify a value in |
| 848 | megabytes or gigabytes respectively. Optional pair slots, maxmem |
| 849 | could be used to set amount of hotpluggable memory slots and maximum |
| 850 | amount of memory. Note that maxmem must be aligned to the page size. |
| 851 | |
| 852 | For example, the following command-line sets the guest startup RAM |
| 853 | size to 1GB, creates 3 slots to hotplug additional memory and sets |
| 854 | the maximum memory the guest can reach to 4GB: |
| 855 | |
| 856 | .. parsed-literal:: |
| 857 | |
| 858 | |qemu_system| -m 1G,slots=3,maxmem=4G |
| 859 | |
| 860 | If slots and maxmem are not specified, memory hotplug won't be |
| 861 | enabled and the guest startup RAM will never increase. |
| 862 | ERST |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 863 | |
| 864 | DEF("mem-path", HAS_ARG, QEMU_OPTION_mempath, |
| 865 | "-mem-path FILE provide backing storage for guest RAM\n", QEMU_ARCH_ALL) |
| 866 | STEXI |
| 867 | @item -mem-path @var{path} |
| 868 | @findex -mem-path |
| 869 | Allocate guest RAM from a temporarily created file in @var{path}. |
| 870 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 871 | SRST |
| 872 | ``-mem-path path`` |
| 873 | Allocate guest RAM from a temporarily created file in path. |
| 874 | ERST |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 875 | |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 876 | DEF("mem-prealloc", 0, QEMU_OPTION_mem_prealloc, |
| 877 | "-mem-prealloc preallocate guest memory (use with -mem-path)\n", |
| 878 | QEMU_ARCH_ALL) |
| 879 | STEXI |
| 880 | @item -mem-prealloc |
| 881 | @findex -mem-prealloc |
| 882 | Preallocate memory when using -mem-path. |
| 883 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 884 | SRST |
| 885 | ``-mem-prealloc`` |
| 886 | Preallocate memory when using -mem-path. |
| 887 | ERST |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 888 | |
| 889 | DEF("k", HAS_ARG, QEMU_OPTION_k, |
| 890 | "-k language use keyboard layout (for example 'fr' for French)\n", |
| 891 | QEMU_ARCH_ALL) |
| 892 | STEXI |
| 893 | @item -k @var{language} |
| 894 | @findex -k |
| 895 | Use keyboard layout @var{language} (for example @code{fr} for |
| 896 | French). This option is only needed where it is not easy to get raw PC |
Samuel Thibault | 3294547 | 2016-06-22 17:48:31 +0200 | [diff] [blame] | 897 | keycodes (e.g. on Macs, with some X11 servers or with a VNC or curses |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 898 | display). You don't normally need to use it on PC/Linux or PC/Windows |
| 899 | hosts. |
| 900 | |
| 901 | The available layouts are: |
| 902 | @example |
| 903 | ar de-ch es fo fr-ca hu ja mk no pt-br sv |
| 904 | da en-gb et fr fr-ch is lt nl pl ru th |
| 905 | de en-us fi fr-be hr it lv nl-be pt sl tr |
| 906 | @end example |
| 907 | |
| 908 | The default is @code{en-us}. |
| 909 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 910 | SRST |
| 911 | ``-k language`` |
| 912 | Use keyboard layout language (for example ``fr`` for French). This |
| 913 | option is only needed where it is not easy to get raw PC keycodes |
| 914 | (e.g. on Macs, with some X11 servers or with a VNC or curses |
| 915 | display). You don't normally need to use it on PC/Linux or |
| 916 | PC/Windows hosts. |
| 917 | |
| 918 | The available layouts are: |
| 919 | |
| 920 | :: |
| 921 | |
| 922 | ar de-ch es fo fr-ca hu ja mk no pt-br sv |
| 923 | da en-gb et fr fr-ch is lt nl pl ru th |
| 924 | de en-us fi fr-be hr it lv nl-be pt sl tr |
| 925 | |
| 926 | The default is ``en-us``. |
| 927 | ERST |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 928 | |
| 929 | |
Kővágó, Zoltán | f0b3d81 | 2019-03-08 23:34:14 +0100 | [diff] [blame] | 930 | HXCOMM Deprecated by -audiodev |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 931 | DEF("audio-help", 0, QEMU_OPTION_audio_help, |
Kővágó, Zoltán | f0b3d81 | 2019-03-08 23:34:14 +0100 | [diff] [blame] | 932 | "-audio-help show -audiodev equivalent of the currently specified audio settings\n", |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 933 | QEMU_ARCH_ALL) |
| 934 | STEXI |
| 935 | @item -audio-help |
| 936 | @findex -audio-help |
Kővágó, Zoltán | f0b3d81 | 2019-03-08 23:34:14 +0100 | [diff] [blame] | 937 | Will show the -audiodev equivalent of the currently specified |
| 938 | (deprecated) environment variables. |
| 939 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 940 | SRST |
| 941 | ``-audio-help`` |
| 942 | Will show the -audiodev equivalent of the currently specified |
| 943 | (deprecated) environment variables. |
| 944 | ERST |
Kővágó, Zoltán | f0b3d81 | 2019-03-08 23:34:14 +0100 | [diff] [blame] | 945 | |
| 946 | DEF("audiodev", HAS_ARG, QEMU_OPTION_audiodev, |
| 947 | "-audiodev [driver=]driver,id=id[,prop[=value][,...]]\n" |
| 948 | " specifies the audio backend to use\n" |
| 949 | " id= identifier of the backend\n" |
| 950 | " timer-period= timer period in microseconds\n" |
Kővágó, Zoltán | 8efac07 | 2019-10-13 21:57:58 +0200 | [diff] [blame] | 951 | " in|out.mixing-engine= use mixing engine to mix streams inside QEMU\n" |
Kővágó, Zoltán | f0b3d81 | 2019-03-08 23:34:14 +0100 | [diff] [blame] | 952 | " in|out.fixed-settings= use fixed settings for host audio\n" |
| 953 | " in|out.frequency= frequency to use with fixed settings\n" |
| 954 | " in|out.channels= number of channels to use with fixed settings\n" |
| 955 | " in|out.format= sample format to use with fixed settings\n" |
| 956 | " valid values: s8, s16, s32, u8, u16, u32\n" |
| 957 | " in|out.voices= number of voices to use\n" |
Stefan Hajnoczi | 8624725 | 2019-09-18 10:53:33 +0100 | [diff] [blame] | 958 | " in|out.buffer-length= length of buffer in microseconds\n" |
Kővágó, Zoltán | f0b3d81 | 2019-03-08 23:34:14 +0100 | [diff] [blame] | 959 | "-audiodev none,id=id,[,prop[=value][,...]]\n" |
| 960 | " dummy driver that discards all output\n" |
| 961 | #ifdef CONFIG_AUDIO_ALSA |
| 962 | "-audiodev alsa,id=id[,prop[=value][,...]]\n" |
| 963 | " in|out.dev= name of the audio device to use\n" |
Stefan Hajnoczi | dfc5434 | 2019-09-18 10:53:35 +0100 | [diff] [blame] | 964 | " in|out.period-length= length of period in microseconds\n" |
Kővágó, Zoltán | f0b3d81 | 2019-03-08 23:34:14 +0100 | [diff] [blame] | 965 | " in|out.try-poll= attempt to use poll mode\n" |
| 966 | " threshold= threshold (in microseconds) when playback starts\n" |
| 967 | #endif |
| 968 | #ifdef CONFIG_AUDIO_COREAUDIO |
| 969 | "-audiodev coreaudio,id=id[,prop[=value][,...]]\n" |
| 970 | " in|out.buffer-count= number of buffers\n" |
| 971 | #endif |
| 972 | #ifdef CONFIG_AUDIO_DSOUND |
| 973 | "-audiodev dsound,id=id[,prop[=value][,...]]\n" |
| 974 | " latency= add extra latency to playback in microseconds\n" |
| 975 | #endif |
| 976 | #ifdef CONFIG_AUDIO_OSS |
| 977 | "-audiodev oss,id=id[,prop[=value][,...]]\n" |
| 978 | " in|out.dev= path of the audio device to use\n" |
| 979 | " in|out.buffer-count= number of buffers\n" |
| 980 | " in|out.try-poll= attempt to use poll mode\n" |
| 981 | " try-mmap= try using memory mapped access\n" |
| 982 | " exclusive= open device in exclusive mode\n" |
| 983 | " dsp-policy= set timing policy (0..10), -1 to use fragment mode\n" |
| 984 | #endif |
| 985 | #ifdef CONFIG_AUDIO_PA |
| 986 | "-audiodev pa,id=id[,prop[=value][,...]]\n" |
| 987 | " server= PulseAudio server address\n" |
| 988 | " in|out.name= source/sink device name\n" |
Stefan Hajnoczi | 14d4f01 | 2019-10-04 13:56:41 +0100 | [diff] [blame] | 989 | " in|out.latency= desired latency in microseconds\n" |
Kővágó, Zoltán | f0b3d81 | 2019-03-08 23:34:14 +0100 | [diff] [blame] | 990 | #endif |
| 991 | #ifdef CONFIG_AUDIO_SDL |
| 992 | "-audiodev sdl,id=id[,prop[=value][,...]]\n" |
| 993 | #endif |
| 994 | #ifdef CONFIG_SPICE |
| 995 | "-audiodev spice,id=id[,prop[=value][,...]]\n" |
| 996 | #endif |
| 997 | "-audiodev wav,id=id[,prop[=value][,...]]\n" |
| 998 | " path= path of wav file to record\n", |
| 999 | QEMU_ARCH_ALL) |
| 1000 | STEXI |
| 1001 | @item -audiodev [driver=]@var{driver},id=@var{id}[,@var{prop}[=@var{value}][,...]] |
| 1002 | @findex -audiodev |
| 1003 | Adds a new audio backend @var{driver} identified by @var{id}. There are |
| 1004 | global and driver specific properties. Some values can be set |
| 1005 | differently for input and output, they're marked with @code{in|out.}. |
| 1006 | You can set the input's property with @code{in.@var{prop}} and the |
| 1007 | output's property with @code{out.@var{prop}}. For example: |
| 1008 | @example |
| 1009 | -audiodev alsa,id=example,in.frequency=44110,out.frequency=8000 |
| 1010 | -audiodev alsa,id=example,out.channels=1 # leaves in.channels unspecified |
| 1011 | @end example |
| 1012 | |
Kővágó, Zoltán | 8efac07 | 2019-10-13 21:57:58 +0200 | [diff] [blame] | 1013 | NOTE: parameter validation is known to be incomplete, in many cases |
| 1014 | specifying an invalid option causes QEMU to print an error message and |
| 1015 | continue emulation without sound. |
| 1016 | |
Kővágó, Zoltán | f0b3d81 | 2019-03-08 23:34:14 +0100 | [diff] [blame] | 1017 | Valid global options are: |
| 1018 | |
| 1019 | @table @option |
| 1020 | @item id=@var{identifier} |
| 1021 | Identifies the audio backend. |
| 1022 | |
| 1023 | @item timer-period=@var{period} |
| 1024 | Sets the timer @var{period} used by the audio subsystem in microseconds. |
| 1025 | Default is 10000 (10 ms). |
| 1026 | |
Kővágó, Zoltán | 8efac07 | 2019-10-13 21:57:58 +0200 | [diff] [blame] | 1027 | @item in|out.mixing-engine=on|off |
| 1028 | Use QEMU's mixing engine to mix all streams inside QEMU and convert |
| 1029 | audio formats when not supported by the backend. When off, |
| 1030 | @var{fixed-settings} must be off too. Note that disabling this option |
| 1031 | means that the selected backend must support multiple streams and the |
| 1032 | audio formats used by the virtual cards, otherwise you'll get no sound. |
| 1033 | It's not recommended to disable this option unless you want to use 5.1 |
| 1034 | or 7.1 audio, as mixing engine only supports mono and stereo audio. |
| 1035 | Default is on. |
| 1036 | |
Kővágó, Zoltán | f0b3d81 | 2019-03-08 23:34:14 +0100 | [diff] [blame] | 1037 | @item in|out.fixed-settings=on|off |
| 1038 | Use fixed settings for host audio. When off, it will change based on |
| 1039 | how the guest opens the sound card. In this case you must not specify |
| 1040 | @var{frequency}, @var{channels} or @var{format}. Default is on. |
| 1041 | |
| 1042 | @item in|out.frequency=@var{frequency} |
| 1043 | Specify the @var{frequency} to use when using @var{fixed-settings}. |
| 1044 | Default is 44100Hz. |
| 1045 | |
| 1046 | @item in|out.channels=@var{channels} |
| 1047 | Specify the number of @var{channels} to use when using |
| 1048 | @var{fixed-settings}. Default is 2 (stereo). |
| 1049 | |
| 1050 | @item in|out.format=@var{format} |
| 1051 | Specify the sample @var{format} to use when using @var{fixed-settings}. |
| 1052 | Valid values are: @code{s8}, @code{s16}, @code{s32}, @code{u8}, |
| 1053 | @code{u16}, @code{u32}. Default is @code{s16}. |
| 1054 | |
| 1055 | @item in|out.voices=@var{voices} |
| 1056 | Specify the number of @var{voices} to use. Default is 1. |
| 1057 | |
Stefan Hajnoczi | 8624725 | 2019-09-18 10:53:33 +0100 | [diff] [blame] | 1058 | @item in|out.buffer-length=@var{usecs} |
Kővágó, Zoltán | f0b3d81 | 2019-03-08 23:34:14 +0100 | [diff] [blame] | 1059 | Sets the size of the buffer in microseconds. |
| 1060 | |
| 1061 | @end table |
| 1062 | |
| 1063 | @item -audiodev none,id=@var{id}[,@var{prop}[=@var{value}][,...]] |
| 1064 | Creates a dummy backend that discards all outputs. This backend has no |
| 1065 | backend specific properties. |
| 1066 | |
| 1067 | @item -audiodev alsa,id=@var{id}[,@var{prop}[=@var{value}][,...]] |
| 1068 | Creates backend using the ALSA. This backend is only available on |
| 1069 | Linux. |
| 1070 | |
| 1071 | ALSA specific options are: |
| 1072 | |
| 1073 | @table @option |
| 1074 | |
| 1075 | @item in|out.dev=@var{device} |
| 1076 | Specify the ALSA @var{device} to use for input and/or output. Default |
| 1077 | is @code{default}. |
| 1078 | |
Stefan Hajnoczi | dfc5434 | 2019-09-18 10:53:35 +0100 | [diff] [blame] | 1079 | @item in|out.period-length=@var{usecs} |
Kővágó, Zoltán | f0b3d81 | 2019-03-08 23:34:14 +0100 | [diff] [blame] | 1080 | Sets the period length in microseconds. |
| 1081 | |
| 1082 | @item in|out.try-poll=on|off |
| 1083 | Attempt to use poll mode with the device. Default is on. |
| 1084 | |
| 1085 | @item threshold=@var{threshold} |
| 1086 | Threshold (in microseconds) when playback starts. Default is 0. |
| 1087 | |
| 1088 | @end table |
| 1089 | |
| 1090 | @item -audiodev coreaudio,id=@var{id}[,@var{prop}[=@var{value}][,...]] |
| 1091 | Creates a backend using Apple's Core Audio. This backend is only |
| 1092 | available on Mac OS and only supports playback. |
| 1093 | |
| 1094 | Core Audio specific options are: |
| 1095 | |
| 1096 | @table @option |
| 1097 | |
| 1098 | @item in|out.buffer-count=@var{count} |
| 1099 | Sets the @var{count} of the buffers. |
| 1100 | |
| 1101 | @end table |
| 1102 | |
| 1103 | @item -audiodev dsound,id=@var{id}[,@var{prop}[=@var{value}][,...]] |
| 1104 | Creates a backend using Microsoft's DirectSound. This backend is only |
| 1105 | available on Windows and only supports playback. |
| 1106 | |
| 1107 | DirectSound specific options are: |
| 1108 | |
| 1109 | @table @option |
| 1110 | |
| 1111 | @item latency=@var{usecs} |
| 1112 | Add extra @var{usecs} microseconds latency to playback. Default is |
| 1113 | 10000 (10 ms). |
| 1114 | |
| 1115 | @end table |
| 1116 | |
| 1117 | @item -audiodev oss,id=@var{id}[,@var{prop}[=@var{value}][,...]] |
| 1118 | Creates a backend using OSS. This backend is available on most |
| 1119 | Unix-like systems. |
| 1120 | |
| 1121 | OSS specific options are: |
| 1122 | |
| 1123 | @table @option |
| 1124 | |
| 1125 | @item in|out.dev=@var{device} |
| 1126 | Specify the file name of the OSS @var{device} to use. Default is |
| 1127 | @code{/dev/dsp}. |
| 1128 | |
| 1129 | @item in|out.buffer-count=@var{count} |
| 1130 | Sets the @var{count} of the buffers. |
| 1131 | |
| 1132 | @item in|out.try-poll=on|of |
| 1133 | Attempt to use poll mode with the device. Default is on. |
| 1134 | |
| 1135 | @item try-mmap=on|off |
| 1136 | Try using memory mapped device access. Default is off. |
| 1137 | |
| 1138 | @item exclusive=on|off |
| 1139 | Open the device in exclusive mode (vmix won't work in this case). |
| 1140 | Default is off. |
| 1141 | |
| 1142 | @item dsp-policy=@var{policy} |
| 1143 | Sets the timing policy (between 0 and 10, where smaller number means |
| 1144 | smaller latency but higher CPU usage). Use -1 to use buffer sizes |
| 1145 | specified by @code{buffer} and @code{buffer-count}. This option is |
| 1146 | ignored if you do not have OSS 4. Default is 5. |
| 1147 | |
| 1148 | @end table |
| 1149 | |
| 1150 | @item -audiodev pa,id=@var{id}[,@var{prop}[=@var{value}][,...]] |
| 1151 | Creates a backend using PulseAudio. This backend is available on most |
| 1152 | systems. |
| 1153 | |
| 1154 | PulseAudio specific options are: |
| 1155 | |
| 1156 | @table @option |
| 1157 | |
| 1158 | @item server=@var{server} |
| 1159 | Sets the PulseAudio @var{server} to connect to. |
| 1160 | |
| 1161 | @item in|out.name=@var{sink} |
| 1162 | Use the specified source/sink for recording/playback. |
| 1163 | |
Stefan Hajnoczi | 14d4f01 | 2019-10-04 13:56:41 +0100 | [diff] [blame] | 1164 | @item in|out.latency=@var{usecs} |
| 1165 | Desired latency in microseconds. The PulseAudio server will try to honor this |
| 1166 | value but actual latencies may be lower or higher. |
| 1167 | |
Kővágó, Zoltán | f0b3d81 | 2019-03-08 23:34:14 +0100 | [diff] [blame] | 1168 | @end table |
| 1169 | |
| 1170 | @item -audiodev sdl,id=@var{id}[,@var{prop}[=@var{value}][,...]] |
| 1171 | Creates a backend using SDL. This backend is available on most systems, |
| 1172 | but you should use your platform's native backend if possible. This |
| 1173 | backend has no backend specific properties. |
| 1174 | |
| 1175 | @item -audiodev spice,id=@var{id}[,@var{prop}[=@var{value}][,...]] |
| 1176 | Creates a backend that sends audio through SPICE. This backend requires |
| 1177 | @code{-spice} and automatically selected in that case, so usually you |
| 1178 | can ignore this option. This backend has no backend specific |
| 1179 | properties. |
| 1180 | |
| 1181 | @item -audiodev wav,id=@var{id}[,@var{prop}[=@var{value}][,...]] |
| 1182 | Creates a backend that writes audio to a WAV file. |
| 1183 | |
| 1184 | Backend specific options are: |
| 1185 | |
| 1186 | @table @option |
| 1187 | |
| 1188 | @item path=@var{path} |
| 1189 | Write recorded audio into the specified file. Default is |
| 1190 | @code{qemu.wav}. |
| 1191 | |
| 1192 | @end table |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 1193 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 1194 | SRST |
| 1195 | ``-audiodev [driver=]driver,id=id[,prop[=value][,...]]`` |
| 1196 | Adds a new audio backend driver identified by id. There are global |
| 1197 | and driver specific properties. Some values can be set differently |
| 1198 | for input and output, they're marked with ``in|out.``. You can set |
| 1199 | the input's property with ``in.prop`` and the output's property with |
| 1200 | ``out.prop``. For example: |
| 1201 | |
| 1202 | :: |
| 1203 | |
| 1204 | -audiodev alsa,id=example,in.frequency=44110,out.frequency=8000 |
| 1205 | -audiodev alsa,id=example,out.channels=1 # leaves in.channels unspecified |
| 1206 | |
| 1207 | NOTE: parameter validation is known to be incomplete, in many cases |
| 1208 | specifying an invalid option causes QEMU to print an error message |
| 1209 | and continue emulation without sound. |
| 1210 | |
| 1211 | Valid global options are: |
| 1212 | |
| 1213 | ``id=identifier`` |
| 1214 | Identifies the audio backend. |
| 1215 | |
| 1216 | ``timer-period=period`` |
| 1217 | Sets the timer period used by the audio subsystem in |
| 1218 | microseconds. Default is 10000 (10 ms). |
| 1219 | |
| 1220 | ``in|out.mixing-engine=on|off`` |
| 1221 | Use QEMU's mixing engine to mix all streams inside QEMU and |
| 1222 | convert audio formats when not supported by the backend. When |
| 1223 | off, fixed-settings must be off too. Note that disabling this |
| 1224 | option means that the selected backend must support multiple |
| 1225 | streams and the audio formats used by the virtual cards, |
| 1226 | otherwise you'll get no sound. It's not recommended to disable |
| 1227 | this option unless you want to use 5.1 or 7.1 audio, as mixing |
| 1228 | engine only supports mono and stereo audio. Default is on. |
| 1229 | |
| 1230 | ``in|out.fixed-settings=on|off`` |
| 1231 | Use fixed settings for host audio. When off, it will change |
| 1232 | based on how the guest opens the sound card. In this case you |
| 1233 | must not specify frequency, channels or format. Default is on. |
| 1234 | |
| 1235 | ``in|out.frequency=frequency`` |
| 1236 | Specify the frequency to use when using fixed-settings. Default |
| 1237 | is 44100Hz. |
| 1238 | |
| 1239 | ``in|out.channels=channels`` |
| 1240 | Specify the number of channels to use when using fixed-settings. |
| 1241 | Default is 2 (stereo). |
| 1242 | |
| 1243 | ``in|out.format=format`` |
| 1244 | Specify the sample format to use when using fixed-settings. |
| 1245 | Valid values are: ``s8``, ``s16``, ``s32``, ``u8``, ``u16``, |
| 1246 | ``u32``. Default is ``s16``. |
| 1247 | |
| 1248 | ``in|out.voices=voices`` |
| 1249 | Specify the number of voices to use. Default is 1. |
| 1250 | |
| 1251 | ``in|out.buffer-length=usecs`` |
| 1252 | Sets the size of the buffer in microseconds. |
| 1253 | |
| 1254 | ``-audiodev none,id=id[,prop[=value][,...]]`` |
| 1255 | Creates a dummy backend that discards all outputs. This backend has |
| 1256 | no backend specific properties. |
| 1257 | |
| 1258 | ``-audiodev alsa,id=id[,prop[=value][,...]]`` |
| 1259 | Creates backend using the ALSA. This backend is only available on |
| 1260 | Linux. |
| 1261 | |
| 1262 | ALSA specific options are: |
| 1263 | |
| 1264 | ``in|out.dev=device`` |
| 1265 | Specify the ALSA device to use for input and/or output. Default |
| 1266 | is ``default``. |
| 1267 | |
| 1268 | ``in|out.period-length=usecs`` |
| 1269 | Sets the period length in microseconds. |
| 1270 | |
| 1271 | ``in|out.try-poll=on|off`` |
| 1272 | Attempt to use poll mode with the device. Default is on. |
| 1273 | |
| 1274 | ``threshold=threshold`` |
| 1275 | Threshold (in microseconds) when playback starts. Default is 0. |
| 1276 | |
| 1277 | ``-audiodev coreaudio,id=id[,prop[=value][,...]]`` |
| 1278 | Creates a backend using Apple's Core Audio. This backend is only |
| 1279 | available on Mac OS and only supports playback. |
| 1280 | |
| 1281 | Core Audio specific options are: |
| 1282 | |
| 1283 | ``in|out.buffer-count=count`` |
| 1284 | Sets the count of the buffers. |
| 1285 | |
| 1286 | ``-audiodev dsound,id=id[,prop[=value][,...]]`` |
| 1287 | Creates a backend using Microsoft's DirectSound. This backend is |
| 1288 | only available on Windows and only supports playback. |
| 1289 | |
| 1290 | DirectSound specific options are: |
| 1291 | |
| 1292 | ``latency=usecs`` |
| 1293 | Add extra usecs microseconds latency to playback. Default is |
| 1294 | 10000 (10 ms). |
| 1295 | |
| 1296 | ``-audiodev oss,id=id[,prop[=value][,...]]`` |
| 1297 | Creates a backend using OSS. This backend is available on most |
| 1298 | Unix-like systems. |
| 1299 | |
| 1300 | OSS specific options are: |
| 1301 | |
| 1302 | ``in|out.dev=device`` |
| 1303 | Specify the file name of the OSS device to use. Default is |
| 1304 | ``/dev/dsp``. |
| 1305 | |
| 1306 | ``in|out.buffer-count=count`` |
| 1307 | Sets the count of the buffers. |
| 1308 | |
| 1309 | ``in|out.try-poll=on|of`` |
| 1310 | Attempt to use poll mode with the device. Default is on. |
| 1311 | |
| 1312 | ``try-mmap=on|off`` |
| 1313 | Try using memory mapped device access. Default is off. |
| 1314 | |
| 1315 | ``exclusive=on|off`` |
| 1316 | Open the device in exclusive mode (vmix won't work in this |
| 1317 | case). Default is off. |
| 1318 | |
| 1319 | ``dsp-policy=policy`` |
| 1320 | Sets the timing policy (between 0 and 10, where smaller number |
| 1321 | means smaller latency but higher CPU usage). Use -1 to use |
| 1322 | buffer sizes specified by ``buffer`` and ``buffer-count``. This |
| 1323 | option is ignored if you do not have OSS 4. Default is 5. |
| 1324 | |
| 1325 | ``-audiodev pa,id=id[,prop[=value][,...]]`` |
| 1326 | Creates a backend using PulseAudio. This backend is available on |
| 1327 | most systems. |
| 1328 | |
| 1329 | PulseAudio specific options are: |
| 1330 | |
| 1331 | ``server=server`` |
| 1332 | Sets the PulseAudio server to connect to. |
| 1333 | |
| 1334 | ``in|out.name=sink`` |
| 1335 | Use the specified source/sink for recording/playback. |
| 1336 | |
| 1337 | ``in|out.latency=usecs`` |
| 1338 | Desired latency in microseconds. The PulseAudio server will try |
| 1339 | to honor this value but actual latencies may be lower or higher. |
| 1340 | |
| 1341 | ``-audiodev sdl,id=id[,prop[=value][,...]]`` |
| 1342 | Creates a backend using SDL. This backend is available on most |
| 1343 | systems, but you should use your platform's native backend if |
| 1344 | possible. This backend has no backend specific properties. |
| 1345 | |
| 1346 | ``-audiodev spice,id=id[,prop[=value][,...]]`` |
| 1347 | Creates a backend that sends audio through SPICE. This backend |
| 1348 | requires ``-spice`` and automatically selected in that case, so |
| 1349 | usually you can ignore this option. This backend has no backend |
| 1350 | specific properties. |
| 1351 | |
| 1352 | ``-audiodev wav,id=id[,prop[=value][,...]]`` |
| 1353 | Creates a backend that writes audio to a WAV file. |
| 1354 | |
| 1355 | Backend specific options are: |
| 1356 | |
| 1357 | ``path=path`` |
| 1358 | Write recorded audio into the specified file. Default is |
| 1359 | ``qemu.wav``. |
| 1360 | ERST |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 1361 | |
| 1362 | DEF("soundhw", HAS_ARG, QEMU_OPTION_soundhw, |
| 1363 | "-soundhw c1,... enable audio support\n" |
| 1364 | " and only specified sound cards (comma separated list)\n" |
| 1365 | " use '-soundhw help' to get the list of supported cards\n" |
| 1366 | " use '-soundhw all' to enable all of them\n", QEMU_ARCH_ALL) |
| 1367 | STEXI |
| 1368 | @item -soundhw @var{card1}[,@var{card2},...] or -soundhw all |
| 1369 | @findex -soundhw |
| 1370 | Enable audio and selected sound hardware. Use 'help' to print all |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 1371 | available sound hardware. For example: |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 1372 | |
| 1373 | @example |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 1374 | @value{qemu_system_x86} -soundhw sb16,adlib disk.img |
| 1375 | @value{qemu_system_x86} -soundhw es1370 disk.img |
| 1376 | @value{qemu_system_x86} -soundhw ac97 disk.img |
| 1377 | @value{qemu_system_x86} -soundhw hda disk.img |
| 1378 | @value{qemu_system_x86} -soundhw all disk.img |
| 1379 | @value{qemu_system_x86} -soundhw help |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 1380 | @end example |
| 1381 | |
| 1382 | Note that Linux's i810_audio OSS kernel (for AC97) module might |
| 1383 | require manually specifying clocking. |
| 1384 | |
| 1385 | @example |
| 1386 | modprobe i810_audio clocking=48000 |
| 1387 | @end example |
| 1388 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 1389 | SRST |
| 1390 | ``-soundhw card1[,card2,...] or -soundhw all`` |
| 1391 | Enable audio and selected sound hardware. Use 'help' to print all |
| 1392 | available sound hardware. For example: |
| 1393 | |
| 1394 | .. parsed-literal:: |
| 1395 | |
| 1396 | |qemu_system_x86| -soundhw sb16,adlib disk.img |
| 1397 | |qemu_system_x86| -soundhw es1370 disk.img |
| 1398 | |qemu_system_x86| -soundhw ac97 disk.img |
| 1399 | |qemu_system_x86| -soundhw hda disk.img |
| 1400 | |qemu_system_x86| -soundhw all disk.img |
| 1401 | |qemu_system_x86| -soundhw help |
| 1402 | |
| 1403 | Note that Linux's i810\_audio OSS kernel (for AC97) module might |
| 1404 | require manually specifying clocking. |
| 1405 | |
| 1406 | :: |
| 1407 | |
| 1408 | modprobe i810_audio clocking=48000 |
| 1409 | ERST |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 1410 | |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 1411 | DEF("device", HAS_ARG, QEMU_OPTION_device, |
| 1412 | "-device driver[,prop[=value][,...]]\n" |
| 1413 | " add device (based on driver)\n" |
| 1414 | " prop=value,... sets driver properties\n" |
| 1415 | " use '-device help' to print all possible drivers\n" |
| 1416 | " use '-device driver,help' to print all possible properties\n", |
| 1417 | QEMU_ARCH_ALL) |
| 1418 | STEXI |
| 1419 | @item -device @var{driver}[,@var{prop}[=@var{value}][,...]] |
| 1420 | @findex -device |
| 1421 | Add device @var{driver}. @var{prop}=@var{value} sets driver |
| 1422 | properties. Valid properties depend on the driver. To get help on |
| 1423 | possible drivers and properties, use @code{-device help} and |
| 1424 | @code{-device @var{driver},help}. |
Corey Minyard | f849045 | 2015-12-17 12:50:10 -0600 | [diff] [blame] | 1425 | |
| 1426 | Some drivers are: |
Corey Minyard | 7b0cd78 | 2017-09-06 15:57:07 -0500 | [diff] [blame] | 1427 | @item -device ipmi-bmc-sim,id=@var{id}[,slave_addr=@var{val}][,sdrfile=@var{file}][,furareasize=@var{val}][,furdatafile=@var{file}][,guid=@var{uuid}] |
Corey Minyard | f849045 | 2015-12-17 12:50:10 -0600 | [diff] [blame] | 1428 | |
| 1429 | Add an IPMI BMC. This is a simulation of a hardware management |
| 1430 | interface processor that normally sits on a system. It provides |
| 1431 | a watchdog and the ability to reset and power control the system. |
| 1432 | You need to connect this to an IPMI interface to make it useful |
| 1433 | |
| 1434 | The IPMI slave address to use for the BMC. The default is 0x20. |
| 1435 | This address is the BMC's address on the I2C network of management |
| 1436 | controllers. If you don't know what this means, it is safe to ignore |
| 1437 | it. |
| 1438 | |
Cédric Le Goater | 8c6fd7f | 2017-04-05 14:41:31 +0200 | [diff] [blame] | 1439 | @table @option |
Corey Minyard | 7b0cd78 | 2017-09-06 15:57:07 -0500 | [diff] [blame] | 1440 | @item id=@var{id} |
| 1441 | The BMC id for interfaces to use this device. |
Cédric Le Goater | 8c6fd7f | 2017-04-05 14:41:31 +0200 | [diff] [blame] | 1442 | @item slave_addr=@var{val} |
| 1443 | Define slave address to use for the BMC. The default is 0x20. |
| 1444 | @item sdrfile=@var{file} |
Cédric Le Goater | 540c07d | 2017-04-05 14:41:32 +0200 | [diff] [blame] | 1445 | file containing raw Sensor Data Records (SDR) data. The default is none. |
| 1446 | @item fruareasize=@var{val} |
| 1447 | size of a Field Replaceable Unit (FRU) area. The default is 1024. |
| 1448 | @item frudatafile=@var{file} |
| 1449 | file containing raw Field Replaceable Unit (FRU) inventory data. The default is none. |
Corey Minyard | 7b0cd78 | 2017-09-06 15:57:07 -0500 | [diff] [blame] | 1450 | @item guid=@var{uuid} |
| 1451 | value for the GUID for the BMC, in standard UUID format. If this is set, |
| 1452 | get "Get GUID" command to the BMC will return it. Otherwise "Get GUID" |
| 1453 | will return an error. |
Cédric Le Goater | 8c6fd7f | 2017-04-05 14:41:31 +0200 | [diff] [blame] | 1454 | @end table |
| 1455 | |
Corey Minyard | f849045 | 2015-12-17 12:50:10 -0600 | [diff] [blame] | 1456 | @item -device ipmi-bmc-extern,id=@var{id},chardev=@var{id}[,slave_addr=@var{val}] |
| 1457 | |
| 1458 | Add a connection to an external IPMI BMC simulator. Instead of |
| 1459 | locally emulating the BMC like the above item, instead connect |
| 1460 | to an external entity that provides the IPMI services. |
| 1461 | |
| 1462 | A connection is made to an external BMC simulator. If you do this, it |
| 1463 | is strongly recommended that you use the "reconnect=" chardev option |
| 1464 | to reconnect to the simulator if the connection is lost. Note that if |
| 1465 | this is not used carefully, it can be a security issue, as the |
| 1466 | interface has the ability to send resets, NMIs, and power off the VM. |
| 1467 | It's best if QEMU makes a connection to an external simulator running |
| 1468 | on a secure port on localhost, so neither the simulator nor QEMU is |
| 1469 | exposed to any outside network. |
| 1470 | |
| 1471 | See the "lanserv/README.vm" file in the OpenIPMI library for more |
| 1472 | details on the external interface. |
| 1473 | |
| 1474 | @item -device isa-ipmi-kcs,bmc=@var{id}[,ioport=@var{val}][,irq=@var{val}] |
| 1475 | |
| 1476 | Add a KCS IPMI interafce on the ISA bus. This also adds a |
| 1477 | corresponding ACPI and SMBIOS entries, if appropriate. |
| 1478 | |
| 1479 | @table @option |
| 1480 | @item bmc=@var{id} |
| 1481 | The BMC to connect to, one of ipmi-bmc-sim or ipmi-bmc-extern above. |
| 1482 | @item ioport=@var{val} |
| 1483 | Define the I/O address of the interface. The default is 0xca0 for KCS. |
| 1484 | @item irq=@var{val} |
| 1485 | Define the interrupt to use. The default is 5. To disable interrupts, |
| 1486 | set this to 0. |
| 1487 | @end table |
| 1488 | |
| 1489 | @item -device isa-ipmi-bt,bmc=@var{id}[,ioport=@var{val}][,irq=@var{val}] |
| 1490 | |
| 1491 | Like the KCS interface, but defines a BT interface. The default port is |
| 1492 | 0xe4 and the default interrupt is 5. |
| 1493 | |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 1494 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 1495 | SRST |
| 1496 | ``-device driver[,prop[=value][,...]]`` |
| 1497 | Add device driver. prop=value sets driver properties. Valid |
| 1498 | properties depend on the driver. To get help on possible drivers and |
| 1499 | properties, use ``-device help`` and ``-device driver,help``. |
| 1500 | |
| 1501 | Some drivers are: |
| 1502 | |
| 1503 | ``-device ipmi-bmc-sim,id=id[,slave_addr=val][,sdrfile=file][,furareasize=val][,furdatafile=file][,guid=uuid]`` |
| 1504 | Add an IPMI BMC. This is a simulation of a hardware management |
| 1505 | interface processor that normally sits on a system. It provides a |
| 1506 | watchdog and the ability to reset and power control the system. You |
| 1507 | need to connect this to an IPMI interface to make it useful |
| 1508 | |
| 1509 | The IPMI slave address to use for the BMC. The default is 0x20. This |
| 1510 | address is the BMC's address on the I2C network of management |
| 1511 | controllers. If you don't know what this means, it is safe to ignore |
| 1512 | it. |
| 1513 | |
| 1514 | ``id=id`` |
| 1515 | The BMC id for interfaces to use this device. |
| 1516 | |
| 1517 | ``slave_addr=val`` |
| 1518 | Define slave address to use for the BMC. The default is 0x20. |
| 1519 | |
| 1520 | ``sdrfile=file`` |
| 1521 | file containing raw Sensor Data Records (SDR) data. The default |
| 1522 | is none. |
| 1523 | |
| 1524 | ``fruareasize=val`` |
| 1525 | size of a Field Replaceable Unit (FRU) area. The default is |
| 1526 | 1024. |
| 1527 | |
| 1528 | ``frudatafile=file`` |
| 1529 | file containing raw Field Replaceable Unit (FRU) inventory data. |
| 1530 | The default is none. |
| 1531 | |
| 1532 | ``guid=uuid`` |
| 1533 | value for the GUID for the BMC, in standard UUID format. If this |
| 1534 | is set, get "Get GUID" command to the BMC will return it. |
| 1535 | Otherwise "Get GUID" will return an error. |
| 1536 | |
| 1537 | ``-device ipmi-bmc-extern,id=id,chardev=id[,slave_addr=val]`` |
| 1538 | Add a connection to an external IPMI BMC simulator. Instead of |
| 1539 | locally emulating the BMC like the above item, instead connect to an |
| 1540 | external entity that provides the IPMI services. |
| 1541 | |
| 1542 | A connection is made to an external BMC simulator. If you do this, |
| 1543 | it is strongly recommended that you use the "reconnect=" chardev |
| 1544 | option to reconnect to the simulator if the connection is lost. Note |
| 1545 | that if this is not used carefully, it can be a security issue, as |
| 1546 | the interface has the ability to send resets, NMIs, and power off |
| 1547 | the VM. It's best if QEMU makes a connection to an external |
| 1548 | simulator running on a secure port on localhost, so neither the |
| 1549 | simulator nor QEMU is exposed to any outside network. |
| 1550 | |
| 1551 | See the "lanserv/README.vm" file in the OpenIPMI library for more |
| 1552 | details on the external interface. |
| 1553 | |
| 1554 | ``-device isa-ipmi-kcs,bmc=id[,ioport=val][,irq=val]`` |
| 1555 | Add a KCS IPMI interafce on the ISA bus. This also adds a |
| 1556 | corresponding ACPI and SMBIOS entries, if appropriate. |
| 1557 | |
| 1558 | ``bmc=id`` |
| 1559 | The BMC to connect to, one of ipmi-bmc-sim or ipmi-bmc-extern |
| 1560 | above. |
| 1561 | |
| 1562 | ``ioport=val`` |
| 1563 | Define the I/O address of the interface. The default is 0xca0 |
| 1564 | for KCS. |
| 1565 | |
| 1566 | ``irq=val`` |
| 1567 | Define the interrupt to use. The default is 5. To disable |
| 1568 | interrupts, set this to 0. |
| 1569 | |
| 1570 | ``-device isa-ipmi-bt,bmc=id[,ioport=val][,irq=val]`` |
| 1571 | Like the KCS interface, but defines a BT interface. The default port |
| 1572 | is 0xe4 and the default interrupt is 5. |
| 1573 | ERST |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 1574 | |
| 1575 | DEF("name", HAS_ARG, QEMU_OPTION_name, |
Dr. David Alan Gilbert | 8f480de | 2014-01-30 10:20:31 +0000 | [diff] [blame] | 1576 | "-name string1[,process=string2][,debug-threads=on|off]\n" |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 1577 | " set the name of the guest\n" |
Roman Bolshakov | 479a574 | 2018-12-17 23:26:01 +0300 | [diff] [blame] | 1578 | " string1 sets the window title and string2 the process name\n" |
| 1579 | " When debug-threads is enabled, individual threads are given a separate name\n" |
Dr. David Alan Gilbert | 8f480de | 2014-01-30 10:20:31 +0000 | [diff] [blame] | 1580 | " NOTE: The thread names are for debugging and not a stable API.\n", |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 1581 | QEMU_ARCH_ALL) |
| 1582 | STEXI |
| 1583 | @item -name @var{name} |
| 1584 | @findex -name |
| 1585 | Sets the @var{name} of the guest. |
| 1586 | This name will be displayed in the SDL window caption. |
| 1587 | The @var{name} will also be used for the VNC server. |
| 1588 | Also optionally set the top visible process name in Linux. |
Dr. David Alan Gilbert | 8f480de | 2014-01-30 10:20:31 +0000 | [diff] [blame] | 1589 | Naming of individual threads can also be enabled on Linux to aid debugging. |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 1590 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 1591 | SRST |
| 1592 | ``-name name`` |
| 1593 | Sets the name of the guest. This name will be displayed in the SDL |
| 1594 | window caption. The name will also be used for the VNC server. Also |
| 1595 | optionally set the top visible process name in Linux. Naming of |
| 1596 | individual threads can also be enabled on Linux to aid debugging. |
| 1597 | ERST |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 1598 | |
| 1599 | DEF("uuid", HAS_ARG, QEMU_OPTION_uuid, |
| 1600 | "-uuid %08x-%04x-%04x-%04x-%012x\n" |
| 1601 | " specify machine UUID\n", QEMU_ARCH_ALL) |
| 1602 | STEXI |
| 1603 | @item -uuid @var{uuid} |
| 1604 | @findex -uuid |
| 1605 | Set system UUID. |
| 1606 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 1607 | SRST |
| 1608 | ``-uuid uuid`` |
| 1609 | Set system UUID. |
| 1610 | ERST |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 1611 | |
| 1612 | STEXI |
| 1613 | @end table |
| 1614 | ETEXI |
| 1615 | DEFHEADING() |
| 1616 | |
Markus Armbruster | de6b4f9 | 2017-10-02 16:03:00 +0200 | [diff] [blame] | 1617 | DEFHEADING(Block device options:) |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 1618 | STEXI |
| 1619 | @table @option |
| 1620 | ETEXI |
| 1621 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 1622 | DEF("fda", HAS_ARG, QEMU_OPTION_fda, |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 1623 | "-fda/-fdb file use 'file' as floppy disk 0/1 image\n", QEMU_ARCH_ALL) |
| 1624 | DEF("fdb", HAS_ARG, QEMU_OPTION_fdb, "", QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 1625 | STEXI |
| 1626 | @item -fda @var{file} |
Markus Armbruster | f9cfd65 | 2015-06-15 14:35:59 +0200 | [diff] [blame] | 1627 | @itemx -fdb @var{file} |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 1628 | @findex -fda |
| 1629 | @findex -fdb |
Markus Armbruster | 92a539d | 2015-03-17 17:02:20 +0100 | [diff] [blame] | 1630 | Use @var{file} as floppy disk 0/1 image (@pxref{disk_images}). |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 1631 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 1632 | SRST |
Peter Maydell | 09ce5f2 | 2020-02-28 15:36:13 +0000 | [diff] [blame^] | 1633 | ``-fda file`` |
| 1634 | \ |
| 1635 | ``-fdb file`` |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 1636 | Use file as floppy disk 0/1 image (see |
| 1637 | :ref:`disk_005fimages`). |
| 1638 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 1639 | |
| 1640 | DEF("hda", HAS_ARG, QEMU_OPTION_hda, |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 1641 | "-hda/-hdb file use 'file' as IDE hard disk 0/1 image\n", QEMU_ARCH_ALL) |
| 1642 | DEF("hdb", HAS_ARG, QEMU_OPTION_hdb, "", QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 1643 | DEF("hdc", HAS_ARG, QEMU_OPTION_hdc, |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 1644 | "-hdc/-hdd file use 'file' as IDE hard disk 2/3 image\n", QEMU_ARCH_ALL) |
| 1645 | DEF("hdd", HAS_ARG, QEMU_OPTION_hdd, "", QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 1646 | STEXI |
| 1647 | @item -hda @var{file} |
Markus Armbruster | f9cfd65 | 2015-06-15 14:35:59 +0200 | [diff] [blame] | 1648 | @itemx -hdb @var{file} |
| 1649 | @itemx -hdc @var{file} |
| 1650 | @itemx -hdd @var{file} |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 1651 | @findex -hda |
| 1652 | @findex -hdb |
| 1653 | @findex -hdc |
| 1654 | @findex -hdd |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 1655 | Use @var{file} as hard disk 0, 1, 2 or 3 image (@pxref{disk_images}). |
| 1656 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 1657 | SRST |
Peter Maydell | 09ce5f2 | 2020-02-28 15:36:13 +0000 | [diff] [blame^] | 1658 | ``-hda file`` |
| 1659 | \ |
| 1660 | ``-hdb file`` |
| 1661 | \ |
| 1662 | ``-hdc file`` |
| 1663 | \ |
| 1664 | ``-hdd file`` |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 1665 | Use file as hard disk 0, 1, 2 or 3 image (see |
| 1666 | :ref:`disk_005fimages`). |
| 1667 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 1668 | |
| 1669 | DEF("cdrom", HAS_ARG, QEMU_OPTION_cdrom, |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 1670 | "-cdrom file use 'file' as IDE cdrom image (cdrom is ide1 master)\n", |
| 1671 | QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 1672 | STEXI |
| 1673 | @item -cdrom @var{file} |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 1674 | @findex -cdrom |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 1675 | Use @var{file} as CD-ROM image (you cannot use @option{-hdc} and |
| 1676 | @option{-cdrom} at the same time). You can use the host CD-ROM by |
Peter Maydell | acab923 | 2020-01-23 15:22:40 +0000 | [diff] [blame] | 1677 | using @file{/dev/cdrom} as filename. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 1678 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 1679 | SRST |
| 1680 | ``-cdrom file`` |
| 1681 | Use file as CD-ROM image (you cannot use ``-hdc`` and ``-cdrom`` at |
| 1682 | the same time). You can use the host CD-ROM by using ``/dev/cdrom`` |
| 1683 | as filename. |
| 1684 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 1685 | |
Markus Armbruster | 42e5f39 | 2017-02-28 22:27:07 +0100 | [diff] [blame] | 1686 | DEF("blockdev", HAS_ARG, QEMU_OPTION_blockdev, |
| 1687 | "-blockdev [driver=]driver[,node-name=N][,discard=ignore|unmap]\n" |
| 1688 | " [,cache.direct=on|off][,cache.no-flush=on|off]\n" |
Kevin Wolf | c9b749d | 2019-10-15 12:29:58 +0200 | [diff] [blame] | 1689 | " [,read-only=on|off][,auto-read-only=on|off]\n" |
| 1690 | " [,force-share=on|off][,detect-zeroes=on|off|unmap]\n" |
Markus Armbruster | 42e5f39 | 2017-02-28 22:27:07 +0100 | [diff] [blame] | 1691 | " [,driver specific parameters...]\n" |
| 1692 | " configure a block backend\n", QEMU_ARCH_ALL) |
Kevin Wolf | dfaca46 | 2016-09-22 16:53:24 +0200 | [diff] [blame] | 1693 | STEXI |
| 1694 | @item -blockdev @var{option}[,@var{option}[,@var{option}[,...]]] |
| 1695 | @findex -blockdev |
| 1696 | |
Kevin Wolf | 370e832 | 2016-09-22 17:24:38 +0200 | [diff] [blame] | 1697 | Define a new block driver node. Some of the options apply to all block drivers, |
| 1698 | other options are only accepted for a specific block driver. See below for a |
| 1699 | list of generic options and options for the most common block drivers. |
| 1700 | |
| 1701 | Options that expect a reference to another node (e.g. @code{file}) can be |
| 1702 | given in two ways. Either you specify the node name of an already existing node |
| 1703 | (file=@var{node-name}), or you define a new node inline, adding options |
| 1704 | for the referenced node after a dot (file.filename=@var{path},file.aio=native). |
| 1705 | |
| 1706 | A block driver node created with @option{-blockdev} can be used for a guest |
| 1707 | device by specifying its node name for the @code{drive} property in a |
| 1708 | @option{-device} argument that defines a block device. |
Kevin Wolf | dfaca46 | 2016-09-22 16:53:24 +0200 | [diff] [blame] | 1709 | |
| 1710 | @table @option |
| 1711 | @item Valid options for any block driver node: |
| 1712 | |
| 1713 | @table @code |
| 1714 | @item driver |
| 1715 | Specifies the block driver to use for the given node. |
| 1716 | @item node-name |
| 1717 | This defines the name of the block driver node by which it will be referenced |
| 1718 | later. The name must be unique, i.e. it must not match the name of a different |
| 1719 | block driver node, or (if you use @option{-drive} as well) the ID of a drive. |
| 1720 | |
| 1721 | If no node name is specified, it is automatically generated. The generated node |
| 1722 | name is not intended to be predictable and changes between QEMU invocations. |
| 1723 | For the top level, an explicit node name must be specified. |
| 1724 | @item read-only |
| 1725 | Open the node read-only. Guest write attempts will fail. |
Kevin Wolf | c9b749d | 2019-10-15 12:29:58 +0200 | [diff] [blame] | 1726 | |
| 1727 | Note that some block drivers support only read-only access, either generally or |
| 1728 | in certain configurations. In this case, the default value |
| 1729 | @option{read-only=off} does not work and the option must be specified |
| 1730 | explicitly. |
| 1731 | @item auto-read-only |
| 1732 | If @option{auto-read-only=on} is set, QEMU may fall back to read-only usage |
| 1733 | even when @option{read-only=off} is requested, or even switch between modes as |
| 1734 | needed, e.g. depending on whether the image file is writable or whether a |
| 1735 | writing user is attached to the node. |
| 1736 | @item force-share |
| 1737 | Override the image locking system of QEMU by forcing the node to utilize |
| 1738 | weaker shared access for permissions where it would normally request exclusive |
| 1739 | access. When there is the potential for multiple instances to have the same |
| 1740 | file open (whether this invocation of QEMU is the first or the second |
| 1741 | instance), both instances must permit shared access for the second instance to |
| 1742 | succeed at opening the file. |
| 1743 | |
| 1744 | Enabling @option{force-share=on} requires @option{read-only=on}. |
Kevin Wolf | dfaca46 | 2016-09-22 16:53:24 +0200 | [diff] [blame] | 1745 | @item cache.direct |
| 1746 | The host page cache can be avoided with @option{cache.direct=on}. This will |
| 1747 | attempt to do disk IO directly to the guest's memory. QEMU may still perform an |
| 1748 | internal copy of the data. |
| 1749 | @item cache.no-flush |
| 1750 | In case you don't care about data integrity over host failures, you can use |
| 1751 | @option{cache.no-flush=on}. This option tells QEMU that it never needs to write |
| 1752 | any data to the disk but can instead keep things in cache. If anything goes |
| 1753 | wrong, like your host losing power, the disk storage getting disconnected |
| 1754 | accidentally, etc. your image will most probably be rendered unusable. |
| 1755 | @item discard=@var{discard} |
| 1756 | @var{discard} is one of "ignore" (or "off") or "unmap" (or "on") and controls |
| 1757 | whether @code{discard} (also known as @code{trim} or @code{unmap}) requests are |
| 1758 | ignored or passed to the filesystem. Some machine types may not support |
| 1759 | discard requests. |
| 1760 | @item detect-zeroes=@var{detect-zeroes} |
| 1761 | @var{detect-zeroes} is "off", "on" or "unmap" and enables the automatic |
| 1762 | conversion of plain zero writes by the OS to driver specific optimized |
| 1763 | zero write commands. You may even choose "unmap" if @var{discard} is set |
| 1764 | to "unmap" to allow a zero write to be converted to an @code{unmap} operation. |
| 1765 | @end table |
| 1766 | |
Kevin Wolf | 370e832 | 2016-09-22 17:24:38 +0200 | [diff] [blame] | 1767 | @item Driver-specific options for @code{file} |
| 1768 | |
| 1769 | This is the protocol-level block driver for accessing regular files. |
| 1770 | |
| 1771 | @table @code |
| 1772 | @item filename |
| 1773 | The path to the image file in the local filesystem |
| 1774 | @item aio |
| 1775 | Specifies the AIO backend (threads/native, default: threads) |
Fam Zheng | 1878eaf | 2017-11-24 16:53:51 +0800 | [diff] [blame] | 1776 | @item locking |
| 1777 | Specifies whether the image file is protected with Linux OFD / POSIX locks. The |
| 1778 | default is to use the Linux Open File Descriptor API if available, otherwise no |
| 1779 | lock is applied. (auto/on/off, default: auto) |
Kevin Wolf | 370e832 | 2016-09-22 17:24:38 +0200 | [diff] [blame] | 1780 | @end table |
| 1781 | Example: |
| 1782 | @example |
| 1783 | -blockdev driver=file,node-name=disk,filename=disk.img |
| 1784 | @end example |
| 1785 | |
| 1786 | @item Driver-specific options for @code{raw} |
| 1787 | |
| 1788 | This is the image format block driver for raw images. It is usually |
| 1789 | stacked on top of a protocol level block driver such as @code{file}. |
| 1790 | |
| 1791 | @table @code |
| 1792 | @item file |
| 1793 | Reference to or definition of the data source block driver node |
| 1794 | (e.g. a @code{file} driver node) |
| 1795 | @end table |
| 1796 | Example 1: |
| 1797 | @example |
| 1798 | -blockdev driver=file,node-name=disk_file,filename=disk.img |
| 1799 | -blockdev driver=raw,node-name=disk,file=disk_file |
| 1800 | @end example |
| 1801 | Example 2: |
| 1802 | @example |
| 1803 | -blockdev driver=raw,node-name=disk,file.driver=file,file.filename=disk.img |
| 1804 | @end example |
| 1805 | |
| 1806 | @item Driver-specific options for @code{qcow2} |
| 1807 | |
| 1808 | This is the image format block driver for qcow2 images. It is usually |
| 1809 | stacked on top of a protocol level block driver such as @code{file}. |
| 1810 | |
| 1811 | @table @code |
| 1812 | @item file |
| 1813 | Reference to or definition of the data source block driver node |
| 1814 | (e.g. a @code{file} driver node) |
| 1815 | |
| 1816 | @item backing |
| 1817 | Reference to or definition of the backing file block device (default is taken |
Max Reitz | 4f7be28 | 2018-02-24 16:40:33 +0100 | [diff] [blame] | 1818 | from the image file). It is allowed to pass @code{null} here in order to disable |
| 1819 | the default backing file. |
Kevin Wolf | 370e832 | 2016-09-22 17:24:38 +0200 | [diff] [blame] | 1820 | |
| 1821 | @item lazy-refcounts |
| 1822 | Whether to enable the lazy refcounts feature (on/off; default is taken from the |
| 1823 | image file) |
| 1824 | |
| 1825 | @item cache-size |
| 1826 | The maximum total size of the L2 table and refcount block caches in bytes |
Leonid Bloch | 40fb215 | 2018-09-26 19:04:39 +0300 | [diff] [blame] | 1827 | (default: the sum of l2-cache-size and refcount-cache-size) |
Kevin Wolf | 370e832 | 2016-09-22 17:24:38 +0200 | [diff] [blame] | 1828 | |
| 1829 | @item l2-cache-size |
| 1830 | The maximum size of the L2 table cache in bytes |
Leonid Bloch | 80668d0 | 2018-09-26 19:04:44 +0300 | [diff] [blame] | 1831 | (default: if cache-size is not specified - 32M on Linux platforms, and 8M on |
| 1832 | non-Linux platforms; otherwise, as large as possible within the cache-size, |
| 1833 | while permitting the requested or the minimal refcount cache size) |
Kevin Wolf | 370e832 | 2016-09-22 17:24:38 +0200 | [diff] [blame] | 1834 | |
| 1835 | @item refcount-cache-size |
| 1836 | The maximum size of the refcount block cache in bytes |
Leonid Bloch | 40fb215 | 2018-09-26 19:04:39 +0300 | [diff] [blame] | 1837 | (default: 4 times the cluster size; or if cache-size is specified, the part of |
| 1838 | it which is not used for the L2 cache) |
Kevin Wolf | 370e832 | 2016-09-22 17:24:38 +0200 | [diff] [blame] | 1839 | |
| 1840 | @item cache-clean-interval |
| 1841 | Clean unused entries in the L2 and refcount caches. The interval is in seconds. |
Leonid Bloch | e3a7b45 | 2018-09-29 12:54:54 +0300 | [diff] [blame] | 1842 | The default value is 600 on supporting platforms, and 0 on other platforms. |
| 1843 | Setting it to 0 disables this feature. |
Kevin Wolf | 370e832 | 2016-09-22 17:24:38 +0200 | [diff] [blame] | 1844 | |
| 1845 | @item pass-discard-request |
| 1846 | Whether discard requests to the qcow2 device should be forwarded to the data |
| 1847 | source (on/off; default: on if discard=unmap is specified, off otherwise) |
| 1848 | |
| 1849 | @item pass-discard-snapshot |
| 1850 | Whether discard requests for the data source should be issued when a snapshot |
| 1851 | operation (e.g. deleting a snapshot) frees clusters in the qcow2 file (on/off; |
| 1852 | default: on) |
| 1853 | |
| 1854 | @item pass-discard-other |
| 1855 | Whether discard requests for the data source should be issued on other |
| 1856 | occasions where a cluster gets freed (on/off; default: off) |
| 1857 | |
| 1858 | @item overlap-check |
| 1859 | Which overlap checks to perform for writes to the image |
| 1860 | (none/constant/cached/all; default: cached). For details or finer |
| 1861 | granularity control refer to the QAPI documentation of @code{blockdev-add}. |
| 1862 | @end table |
| 1863 | |
| 1864 | Example 1: |
| 1865 | @example |
| 1866 | -blockdev driver=file,node-name=my_file,filename=/tmp/disk.qcow2 |
| 1867 | -blockdev driver=qcow2,node-name=hda,file=my_file,overlap-check=none,cache-size=16777216 |
| 1868 | @end example |
| 1869 | Example 2: |
| 1870 | @example |
| 1871 | -blockdev driver=qcow2,node-name=disk,file.driver=http,file.filename=http://example.com/image.qcow2 |
| 1872 | @end example |
| 1873 | |
| 1874 | @item Driver-specific options for other drivers |
| 1875 | Please refer to the QAPI documentation of the @code{blockdev-add} QMP command. |
| 1876 | |
Kevin Wolf | dfaca46 | 2016-09-22 16:53:24 +0200 | [diff] [blame] | 1877 | @end table |
| 1878 | |
| 1879 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 1880 | SRST |
| 1881 | ``-blockdev option[,option[,option[,...]]]`` |
| 1882 | Define a new block driver node. Some of the options apply to all |
| 1883 | block drivers, other options are only accepted for a specific block |
| 1884 | driver. See below for a list of generic options and options for the |
| 1885 | most common block drivers. |
| 1886 | |
| 1887 | Options that expect a reference to another node (e.g. ``file``) can |
| 1888 | be given in two ways. Either you specify the node name of an already |
| 1889 | existing node (file=node-name), or you define a new node inline, |
| 1890 | adding options for the referenced node after a dot |
| 1891 | (file.filename=path,file.aio=native). |
| 1892 | |
| 1893 | A block driver node created with ``-blockdev`` can be used for a |
| 1894 | guest device by specifying its node name for the ``drive`` property |
| 1895 | in a ``-device`` argument that defines a block device. |
| 1896 | |
| 1897 | ``Valid options for any block driver node:`` |
| 1898 | ``driver`` |
| 1899 | Specifies the block driver to use for the given node. |
| 1900 | |
| 1901 | ``node-name`` |
| 1902 | This defines the name of the block driver node by which it |
| 1903 | will be referenced later. The name must be unique, i.e. it |
| 1904 | must not match the name of a different block driver node, or |
| 1905 | (if you use ``-drive`` as well) the ID of a drive. |
| 1906 | |
| 1907 | If no node name is specified, it is automatically generated. |
| 1908 | The generated node name is not intended to be predictable |
| 1909 | and changes between QEMU invocations. For the top level, an |
| 1910 | explicit node name must be specified. |
| 1911 | |
| 1912 | ``read-only`` |
| 1913 | Open the node read-only. Guest write attempts will fail. |
| 1914 | |
| 1915 | Note that some block drivers support only read-only access, |
| 1916 | either generally or in certain configurations. In this case, |
| 1917 | the default value ``read-only=off`` does not work and the |
| 1918 | option must be specified explicitly. |
| 1919 | |
| 1920 | ``auto-read-only`` |
| 1921 | If ``auto-read-only=on`` is set, QEMU may fall back to |
| 1922 | read-only usage even when ``read-only=off`` is requested, or |
| 1923 | even switch between modes as needed, e.g. depending on |
| 1924 | whether the image file is writable or whether a writing user |
| 1925 | is attached to the node. |
| 1926 | |
| 1927 | ``force-share`` |
| 1928 | Override the image locking system of QEMU by forcing the |
| 1929 | node to utilize weaker shared access for permissions where |
| 1930 | it would normally request exclusive access. When there is |
| 1931 | the potential for multiple instances to have the same file |
| 1932 | open (whether this invocation of QEMU is the first or the |
| 1933 | second instance), both instances must permit shared access |
| 1934 | for the second instance to succeed at opening the file. |
| 1935 | |
| 1936 | Enabling ``force-share=on`` requires ``read-only=on``. |
| 1937 | |
| 1938 | ``cache.direct`` |
| 1939 | The host page cache can be avoided with ``cache.direct=on``. |
| 1940 | This will attempt to do disk IO directly to the guest's |
| 1941 | memory. QEMU may still perform an internal copy of the data. |
| 1942 | |
| 1943 | ``cache.no-flush`` |
| 1944 | In case you don't care about data integrity over host |
| 1945 | failures, you can use ``cache.no-flush=on``. This option |
| 1946 | tells QEMU that it never needs to write any data to the disk |
| 1947 | but can instead keep things in cache. If anything goes |
| 1948 | wrong, like your host losing power, the disk storage getting |
| 1949 | disconnected accidentally, etc. your image will most |
| 1950 | probably be rendered unusable. |
| 1951 | |
| 1952 | ``discard=discard`` |
| 1953 | discard is one of "ignore" (or "off") or "unmap" (or "on") |
| 1954 | and controls whether ``discard`` (also known as ``trim`` or |
| 1955 | ``unmap``) requests are ignored or passed to the filesystem. |
| 1956 | Some machine types may not support discard requests. |
| 1957 | |
| 1958 | ``detect-zeroes=detect-zeroes`` |
| 1959 | detect-zeroes is "off", "on" or "unmap" and enables the |
| 1960 | automatic conversion of plain zero writes by the OS to |
| 1961 | driver specific optimized zero write commands. You may even |
| 1962 | choose "unmap" if discard is set to "unmap" to allow a zero |
| 1963 | write to be converted to an ``unmap`` operation. |
| 1964 | |
| 1965 | ``Driver-specific options for file`` |
| 1966 | This is the protocol-level block driver for accessing regular |
| 1967 | files. |
| 1968 | |
| 1969 | ``filename`` |
| 1970 | The path to the image file in the local filesystem |
| 1971 | |
| 1972 | ``aio`` |
| 1973 | Specifies the AIO backend (threads/native, default: threads) |
| 1974 | |
| 1975 | ``locking`` |
| 1976 | Specifies whether the image file is protected with Linux OFD |
| 1977 | / POSIX locks. The default is to use the Linux Open File |
| 1978 | Descriptor API if available, otherwise no lock is applied. |
| 1979 | (auto/on/off, default: auto) |
| 1980 | |
| 1981 | Example: |
| 1982 | |
| 1983 | :: |
| 1984 | |
| 1985 | -blockdev driver=file,node-name=disk,filename=disk.img |
| 1986 | |
| 1987 | ``Driver-specific options for raw`` |
| 1988 | This is the image format block driver for raw images. It is |
| 1989 | usually stacked on top of a protocol level block driver such as |
| 1990 | ``file``. |
| 1991 | |
| 1992 | ``file`` |
| 1993 | Reference to or definition of the data source block driver |
| 1994 | node (e.g. a ``file`` driver node) |
| 1995 | |
| 1996 | Example 1: |
| 1997 | |
| 1998 | :: |
| 1999 | |
| 2000 | -blockdev driver=file,node-name=disk_file,filename=disk.img |
| 2001 | -blockdev driver=raw,node-name=disk,file=disk_file |
| 2002 | |
| 2003 | Example 2: |
| 2004 | |
| 2005 | :: |
| 2006 | |
| 2007 | -blockdev driver=raw,node-name=disk,file.driver=file,file.filename=disk.img |
| 2008 | |
| 2009 | ``Driver-specific options for qcow2`` |
| 2010 | This is the image format block driver for qcow2 images. It is |
| 2011 | usually stacked on top of a protocol level block driver such as |
| 2012 | ``file``. |
| 2013 | |
| 2014 | ``file`` |
| 2015 | Reference to or definition of the data source block driver |
| 2016 | node (e.g. a ``file`` driver node) |
| 2017 | |
| 2018 | ``backing`` |
| 2019 | Reference to or definition of the backing file block device |
| 2020 | (default is taken from the image file). It is allowed to |
| 2021 | pass ``null`` here in order to disable the default backing |
| 2022 | file. |
| 2023 | |
| 2024 | ``lazy-refcounts`` |
| 2025 | Whether to enable the lazy refcounts feature (on/off; |
| 2026 | default is taken from the image file) |
| 2027 | |
| 2028 | ``cache-size`` |
| 2029 | The maximum total size of the L2 table and refcount block |
| 2030 | caches in bytes (default: the sum of l2-cache-size and |
| 2031 | refcount-cache-size) |
| 2032 | |
| 2033 | ``l2-cache-size`` |
| 2034 | The maximum size of the L2 table cache in bytes (default: if |
| 2035 | cache-size is not specified - 32M on Linux platforms, and 8M |
| 2036 | on non-Linux platforms; otherwise, as large as possible |
| 2037 | within the cache-size, while permitting the requested or the |
| 2038 | minimal refcount cache size) |
| 2039 | |
| 2040 | ``refcount-cache-size`` |
| 2041 | The maximum size of the refcount block cache in bytes |
| 2042 | (default: 4 times the cluster size; or if cache-size is |
| 2043 | specified, the part of it which is not used for the L2 |
| 2044 | cache) |
| 2045 | |
| 2046 | ``cache-clean-interval`` |
| 2047 | Clean unused entries in the L2 and refcount caches. The |
| 2048 | interval is in seconds. The default value is 600 on |
| 2049 | supporting platforms, and 0 on other platforms. Setting it |
| 2050 | to 0 disables this feature. |
| 2051 | |
| 2052 | ``pass-discard-request`` |
| 2053 | Whether discard requests to the qcow2 device should be |
| 2054 | forwarded to the data source (on/off; default: on if |
| 2055 | discard=unmap is specified, off otherwise) |
| 2056 | |
| 2057 | ``pass-discard-snapshot`` |
| 2058 | Whether discard requests for the data source should be |
| 2059 | issued when a snapshot operation (e.g. deleting a snapshot) |
| 2060 | frees clusters in the qcow2 file (on/off; default: on) |
| 2061 | |
| 2062 | ``pass-discard-other`` |
| 2063 | Whether discard requests for the data source should be |
| 2064 | issued on other occasions where a cluster gets freed |
| 2065 | (on/off; default: off) |
| 2066 | |
| 2067 | ``overlap-check`` |
| 2068 | Which overlap checks to perform for writes to the image |
| 2069 | (none/constant/cached/all; default: cached). For details or |
| 2070 | finer granularity control refer to the QAPI documentation of |
| 2071 | ``blockdev-add``. |
| 2072 | |
| 2073 | Example 1: |
| 2074 | |
| 2075 | :: |
| 2076 | |
| 2077 | -blockdev driver=file,node-name=my_file,filename=/tmp/disk.qcow2 |
| 2078 | -blockdev driver=qcow2,node-name=hda,file=my_file,overlap-check=none,cache-size=16777216 |
| 2079 | |
| 2080 | Example 2: |
| 2081 | |
| 2082 | :: |
| 2083 | |
| 2084 | -blockdev driver=qcow2,node-name=disk,file.driver=http,file.filename=http://example.com/image.qcow2 |
| 2085 | |
| 2086 | ``Driver-specific options for other drivers`` |
| 2087 | Please refer to the QAPI documentation of the ``blockdev-add`` |
| 2088 | QMP command. |
| 2089 | ERST |
Markus Armbruster | 42e5f39 | 2017-02-28 22:27:07 +0100 | [diff] [blame] | 2090 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2091 | DEF("drive", HAS_ARG, QEMU_OPTION_drive, |
| 2092 | "-drive [file=file][,if=type][,bus=n][,unit=m][,media=d][,index=i]\n" |
Stefan Hajnoczi | 92196b2 | 2011-08-04 12:26:52 +0100 | [diff] [blame] | 2093 | " [,cache=writethrough|writeback|none|directsync|unsafe][,format=f]\n" |
Kevin Wolf | 572023f | 2018-06-13 11:01:30 +0200 | [diff] [blame] | 2094 | " [,snapshot=on|off][,rerror=ignore|stop|report]\n" |
Stefan Hajnoczi | d1db760 | 2014-04-23 13:55:37 +0200 | [diff] [blame] | 2095 | " [,werror=ignore|stop|report|enospc][,id=name][,aio=threads|native]\n" |
Stefan Hajnoczi | fb0490f | 2011-11-17 13:40:32 +0000 | [diff] [blame] | 2096 | " [,readonly=on|off][,copy-on-read=on|off]\n" |
Peter Lieven | 2f7133b | 2014-07-28 21:53:02 +0200 | [diff] [blame] | 2097 | " [,discard=ignore|unmap][,detect-zeroes=on|off|unmap]\n" |
Benoît Canet | 3e9fab6 | 2013-09-02 14:14:40 +0200 | [diff] [blame] | 2098 | " [[,bps=b]|[[,bps_rd=r][,bps_wr=w]]]\n" |
| 2099 | " [[,iops=i]|[[,iops_rd=r][,iops_wr=w]]]\n" |
| 2100 | " [[,bps_max=bm]|[[,bps_rd_max=rm][,bps_wr_max=wm]]]\n" |
| 2101 | " [[,iops_max=im]|[[,iops_rd_max=irm][,iops_wr_max=iwm]]]\n" |
Benoît Canet | 2024c1d | 2013-09-02 14:14:41 +0200 | [diff] [blame] | 2102 | " [[,iops_size=is]]\n" |
Alberto Garcia | 76f4afb | 2015-06-08 18:17:44 +0200 | [diff] [blame] | 2103 | " [[,group=g]]\n" |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 2104 | " use 'file' as a drive image\n", QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2105 | STEXI |
| 2106 | @item -drive @var{option}[,@var{option}[,@var{option}[,...]]] |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 2107 | @findex -drive |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2108 | |
Kevin Wolf | dfaca46 | 2016-09-22 16:53:24 +0200 | [diff] [blame] | 2109 | Define a new drive. This includes creating a block driver node (the backend) as |
| 2110 | well as a guest device, and is mostly a shortcut for defining the corresponding |
| 2111 | @option{-blockdev} and @option{-device} options. |
| 2112 | |
| 2113 | @option{-drive} accepts all options that are accepted by @option{-blockdev}. In |
| 2114 | addition, it knows the following options: |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2115 | |
Kevin Wolf | b3f046c | 2009-10-09 10:58:35 +0200 | [diff] [blame] | 2116 | @table @option |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2117 | @item file=@var{file} |
| 2118 | This option defines which disk image (@pxref{disk_images}) to use with |
| 2119 | this drive. If the filename contains comma, you must double it |
| 2120 | (for instance, "file=my,,file" to use file "my,file"). |
Ronnie Sahlberg | 0f5314a | 2011-10-26 23:51:37 +1100 | [diff] [blame] | 2121 | |
| 2122 | Special files such as iSCSI devices can be specified using protocol |
| 2123 | specific URLs. See the section for "Device URL Syntax" for more information. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2124 | @item if=@var{interface} |
| 2125 | This option defines on which type on interface the drive is connected. |
Craig Jellick | ed1fcd0 | 2017-03-17 08:49:55 -0700 | [diff] [blame] | 2126 | Available types are: ide, scsi, sd, mtd, floppy, pflash, virtio, none. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2127 | @item bus=@var{bus},unit=@var{unit} |
| 2128 | These options define where is connected the drive by defining the bus number and |
| 2129 | the unit id. |
| 2130 | @item index=@var{index} |
| 2131 | This option defines where is connected the drive by using an index in the list |
| 2132 | of available connectors of a given interface type. |
| 2133 | @item media=@var{media} |
| 2134 | This option defines the type of the media: disk or cdrom. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2135 | @item snapshot=@var{snapshot} |
Michael Tokarev | 9d85d55 | 2014-04-07 13:34:58 +0400 | [diff] [blame] | 2136 | @var{snapshot} is "on" or "off" and controls snapshot mode for the given drive |
| 2137 | (see @option{-snapshot}). |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2138 | @item cache=@var{cache} |
Kevin Wolf | dfaca46 | 2016-09-22 16:53:24 +0200 | [diff] [blame] | 2139 | @var{cache} is "none", "writeback", "unsafe", "directsync" or "writethrough" |
| 2140 | and controls how the host cache is used to access block data. This is a |
| 2141 | shortcut that sets the @option{cache.direct} and @option{cache.no-flush} |
| 2142 | options (as in @option{-blockdev}), and additionally @option{cache.writeback}, |
| 2143 | which provides a default for the @option{write-cache} option of block guest |
| 2144 | devices (as in @option{-device}). The modes correspond to the following |
| 2145 | settings: |
| 2146 | |
| 2147 | @c Our texi2pod.pl script doesn't support @multitable, so fall back to using |
| 2148 | @c plain ASCII art (well, UTF-8 art really). This looks okay both in the manpage |
| 2149 | @c and the HTML output. |
| 2150 | @example |
| 2151 | @ │ cache.writeback cache.direct cache.no-flush |
| 2152 | ─────────────┼───────────────────────────────────────────────── |
| 2153 | writeback │ on off off |
| 2154 | none │ on on off |
| 2155 | writethrough │ off off off |
| 2156 | directsync │ off on off |
| 2157 | unsafe │ on off on |
| 2158 | @end example |
| 2159 | |
| 2160 | The default mode is @option{cache=writeback}. |
| 2161 | |
Christoph Hellwig | 5c6c3a6 | 2009-08-20 16:58:35 +0200 | [diff] [blame] | 2162 | @item aio=@var{aio} |
| 2163 | @var{aio} is "threads", or "native" and selects between pthread based disk I/O and native Linux AIO. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2164 | @item format=@var{format} |
| 2165 | Specify which disk @var{format} will be used rather than detecting |
Michael Tokarev | d33c8a7 | 2016-05-18 15:47:53 +0300 | [diff] [blame] | 2166 | the format. Can be used to specify format=raw to avoid interpreting |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2167 | an untrusted format header. |
Luiz Capitulino | ae73e59 | 2011-07-12 17:35:08 -0300 | [diff] [blame] | 2168 | @item werror=@var{action},rerror=@var{action} |
| 2169 | Specify which @var{action} to take on write and read errors. Valid actions are: |
| 2170 | "ignore" (ignore the error and try to continue), "stop" (pause QEMU), |
| 2171 | "report" (report the error to the guest), "enospc" (pause QEMU only if the |
| 2172 | host disk is full; report the error to the guest otherwise). |
| 2173 | The default setting is @option{werror=enospc} and @option{rerror=report}. |
Stefan Hajnoczi | fb0490f | 2011-11-17 13:40:32 +0000 | [diff] [blame] | 2174 | @item copy-on-read=@var{copy-on-read} |
| 2175 | @var{copy-on-read} is "on" or "off" and enables whether to copy read backing |
| 2176 | file sectors into the image file. |
Stefan Hajnoczi | 01f9cfa | 2017-03-01 11:50:24 +0000 | [diff] [blame] | 2177 | @item bps=@var{b},bps_rd=@var{r},bps_wr=@var{w} |
| 2178 | Specify bandwidth throttling limits in bytes per second, either for all request |
| 2179 | types or for reads or writes only. Small values can lead to timeouts or hangs |
| 2180 | inside the guest. A safe minimum for disks is 2 MB/s. |
| 2181 | @item bps_max=@var{bm},bps_rd_max=@var{rm},bps_wr_max=@var{wm} |
| 2182 | Specify bursts in bytes per second, either for all request types or for reads |
| 2183 | or writes only. Bursts allow the guest I/O to spike above the limit |
| 2184 | temporarily. |
| 2185 | @item iops=@var{i},iops_rd=@var{r},iops_wr=@var{w} |
| 2186 | Specify request rate limits in requests per second, either for all request |
| 2187 | types or for reads or writes only. |
| 2188 | @item iops_max=@var{bm},iops_rd_max=@var{rm},iops_wr_max=@var{wm} |
| 2189 | Specify bursts in requests per second, either for all request types or for reads |
| 2190 | or writes only. Bursts allow the guest I/O to spike above the limit |
| 2191 | temporarily. |
| 2192 | @item iops_size=@var{is} |
| 2193 | Let every @var{is} bytes of a request count as a new request for iops |
| 2194 | throttling purposes. Use this option to prevent guests from circumventing iops |
| 2195 | limits by sending fewer but larger requests. |
| 2196 | @item group=@var{g} |
| 2197 | Join a throttling quota group with given name @var{g}. All drives that are |
| 2198 | members of the same group are accounted for together. Use this option to |
| 2199 | prevent guests from circumventing throttling limits by using many small disks |
| 2200 | instead of a single larger disk. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2201 | @end table |
| 2202 | |
Kevin Wolf | dfaca46 | 2016-09-22 16:53:24 +0200 | [diff] [blame] | 2203 | By default, the @option{cache.writeback=on} mode is used. It will report data |
Kevin Wolf | a13e5e0 | 2012-11-21 12:26:56 +0100 | [diff] [blame] | 2204 | writes as completed as soon as the data is present in the host page cache. |
| 2205 | This is safe as long as your guest OS makes sure to correctly flush disk caches |
| 2206 | where needed. If your guest OS does not handle volatile disk write caches |
| 2207 | correctly and your host crashes or loses power, then the guest may experience |
| 2208 | data corruption. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2209 | |
Kevin Wolf | dfaca46 | 2016-09-22 16:53:24 +0200 | [diff] [blame] | 2210 | For such guests, you should consider using @option{cache.writeback=off}. This |
Kevin Wolf | a13e5e0 | 2012-11-21 12:26:56 +0100 | [diff] [blame] | 2211 | means that the host page cache will be used to read and write data, but write |
| 2212 | notification will be sent to the guest only after QEMU has made sure to flush |
| 2213 | each write to the disk. Be aware that this has a major impact on performance. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2214 | |
Kevin Wolf | dfaca46 | 2016-09-22 16:53:24 +0200 | [diff] [blame] | 2215 | When using the @option{-snapshot} option, unsafe caching is always used. |
Alexander Graf | 016f5cf | 2010-05-26 17:51:49 +0200 | [diff] [blame] | 2216 | |
Stefan Hajnoczi | fb0490f | 2011-11-17 13:40:32 +0000 | [diff] [blame] | 2217 | Copy-on-read avoids accessing the same backing file sectors repeatedly and is |
| 2218 | useful when the backing file is over a slow network. By default copy-on-read |
| 2219 | is off. |
| 2220 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2221 | Instead of @option{-cdrom} you can use: |
| 2222 | @example |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 2223 | @value{qemu_system} -drive file=file,index=2,media=cdrom |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2224 | @end example |
| 2225 | |
| 2226 | Instead of @option{-hda}, @option{-hdb}, @option{-hdc}, @option{-hdd}, you can |
| 2227 | use: |
| 2228 | @example |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 2229 | @value{qemu_system} -drive file=file,index=0,media=disk |
| 2230 | @value{qemu_system} -drive file=file,index=1,media=disk |
| 2231 | @value{qemu_system} -drive file=file,index=2,media=disk |
| 2232 | @value{qemu_system} -drive file=file,index=3,media=disk |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2233 | @end example |
| 2234 | |
Corey Bryant | 587ed6b | 2012-10-18 15:19:34 -0400 | [diff] [blame] | 2235 | You can open an image using pre-opened file descriptors from an fd set: |
| 2236 | @example |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 2237 | @value{qemu_system} \ |
| 2238 | -add-fd fd=3,set=2,opaque="rdwr:/path/to/file" \ |
| 2239 | -add-fd fd=4,set=2,opaque="rdonly:/path/to/file" \ |
| 2240 | -drive file=/dev/fdset/2,index=0,media=disk |
Corey Bryant | 587ed6b | 2012-10-18 15:19:34 -0400 | [diff] [blame] | 2241 | @end example |
| 2242 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2243 | You can connect a CDROM to the slave of ide0: |
| 2244 | @example |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 2245 | @value{qemu_system_x86} -drive file=file,if=ide,index=1,media=cdrom |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2246 | @end example |
| 2247 | |
| 2248 | If you don't specify the "file=" argument, you define an empty drive: |
| 2249 | @example |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 2250 | @value{qemu_system_x86} -drive if=ide,index=1,media=cdrom |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2251 | @end example |
| 2252 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2253 | Instead of @option{-fda}, @option{-fdb}, you can use: |
| 2254 | @example |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 2255 | @value{qemu_system_x86} -drive file=file,index=0,if=floppy |
| 2256 | @value{qemu_system_x86} -drive file=file,index=1,if=floppy |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2257 | @end example |
| 2258 | |
| 2259 | By default, @var{interface} is "ide" and @var{index} is automatically |
| 2260 | incremented: |
| 2261 | @example |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 2262 | @value{qemu_system_x86} -drive file=a -drive file=b" |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2263 | @end example |
| 2264 | is interpreted like: |
| 2265 | @example |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 2266 | @value{qemu_system_x86} -hda a -hdb b |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2267 | @end example |
| 2268 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 2269 | SRST |
| 2270 | ``-drive option[,option[,option[,...]]]`` |
| 2271 | Define a new drive. This includes creating a block driver node (the |
| 2272 | backend) as well as a guest device, and is mostly a shortcut for |
| 2273 | defining the corresponding ``-blockdev`` and ``-device`` options. |
| 2274 | |
| 2275 | ``-drive`` accepts all options that are accepted by ``-blockdev``. |
| 2276 | In addition, it knows the following options: |
| 2277 | |
| 2278 | ``file=file`` |
| 2279 | This option defines which disk image (see |
| 2280 | :ref:`disk_005fimages`) to use with this drive. If |
| 2281 | the filename contains comma, you must double it (for instance, |
| 2282 | "file=my,,file" to use file "my,file"). |
| 2283 | |
| 2284 | Special files such as iSCSI devices can be specified using |
| 2285 | protocol specific URLs. See the section for "Device URL Syntax" |
| 2286 | for more information. |
| 2287 | |
| 2288 | ``if=interface`` |
| 2289 | This option defines on which type on interface the drive is |
| 2290 | connected. Available types are: ide, scsi, sd, mtd, floppy, |
| 2291 | pflash, virtio, none. |
| 2292 | |
| 2293 | ``bus=bus,unit=unit`` |
| 2294 | These options define where is connected the drive by defining |
| 2295 | the bus number and the unit id. |
| 2296 | |
| 2297 | ``index=index`` |
| 2298 | This option defines where is connected the drive by using an |
| 2299 | index in the list of available connectors of a given interface |
| 2300 | type. |
| 2301 | |
| 2302 | ``media=media`` |
| 2303 | This option defines the type of the media: disk or cdrom. |
| 2304 | |
| 2305 | ``snapshot=snapshot`` |
| 2306 | snapshot is "on" or "off" and controls snapshot mode for the |
| 2307 | given drive (see ``-snapshot``). |
| 2308 | |
| 2309 | ``cache=cache`` |
| 2310 | cache is "none", "writeback", "unsafe", "directsync" or |
| 2311 | "writethrough" and controls how the host cache is used to access |
| 2312 | block data. This is a shortcut that sets the ``cache.direct`` |
| 2313 | and ``cache.no-flush`` options (as in ``-blockdev``), and |
| 2314 | additionally ``cache.writeback``, which provides a default for |
| 2315 | the ``write-cache`` option of block guest devices (as in |
| 2316 | ``-device``). The modes correspond to the following settings: |
| 2317 | |
Peter Maydell | 09ce5f2 | 2020-02-28 15:36:13 +0000 | [diff] [blame^] | 2318 | ============= =============== ============ ============== |
| 2319 | \ cache.writeback cache.direct cache.no-flush |
| 2320 | ============= =============== ============ ============== |
| 2321 | writeback on off off |
| 2322 | none on on off |
| 2323 | writethrough off off off |
| 2324 | directsync off on off |
| 2325 | unsafe on off on |
| 2326 | ============= =============== ============ ============== |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 2327 | |
| 2328 | The default mode is ``cache=writeback``. |
| 2329 | |
| 2330 | ``aio=aio`` |
| 2331 | aio is "threads", or "native" and selects between pthread based |
| 2332 | disk I/O and native Linux AIO. |
| 2333 | |
| 2334 | ``format=format`` |
| 2335 | Specify which disk format will be used rather than detecting the |
| 2336 | format. Can be used to specify format=raw to avoid interpreting |
| 2337 | an untrusted format header. |
| 2338 | |
| 2339 | ``werror=action,rerror=action`` |
| 2340 | Specify which action to take on write and read errors. Valid |
| 2341 | actions are: "ignore" (ignore the error and try to continue), |
| 2342 | "stop" (pause QEMU), "report" (report the error to the guest), |
| 2343 | "enospc" (pause QEMU only if the host disk is full; report the |
| 2344 | error to the guest otherwise). The default setting is |
| 2345 | ``werror=enospc`` and ``rerror=report``. |
| 2346 | |
| 2347 | ``copy-on-read=copy-on-read`` |
| 2348 | copy-on-read is "on" or "off" and enables whether to copy read |
| 2349 | backing file sectors into the image file. |
| 2350 | |
| 2351 | ``bps=b,bps_rd=r,bps_wr=w`` |
| 2352 | Specify bandwidth throttling limits in bytes per second, either |
| 2353 | for all request types or for reads or writes only. Small values |
| 2354 | can lead to timeouts or hangs inside the guest. A safe minimum |
| 2355 | for disks is 2 MB/s. |
| 2356 | |
| 2357 | ``bps_max=bm,bps_rd_max=rm,bps_wr_max=wm`` |
| 2358 | Specify bursts in bytes per second, either for all request types |
| 2359 | or for reads or writes only. Bursts allow the guest I/O to spike |
| 2360 | above the limit temporarily. |
| 2361 | |
| 2362 | ``iops=i,iops_rd=r,iops_wr=w`` |
| 2363 | Specify request rate limits in requests per second, either for |
| 2364 | all request types or for reads or writes only. |
| 2365 | |
| 2366 | ``iops_max=bm,iops_rd_max=rm,iops_wr_max=wm`` |
| 2367 | Specify bursts in requests per second, either for all request |
| 2368 | types or for reads or writes only. Bursts allow the guest I/O to |
| 2369 | spike above the limit temporarily. |
| 2370 | |
| 2371 | ``iops_size=is`` |
| 2372 | Let every is bytes of a request count as a new request for iops |
| 2373 | throttling purposes. Use this option to prevent guests from |
| 2374 | circumventing iops limits by sending fewer but larger requests. |
| 2375 | |
| 2376 | ``group=g`` |
| 2377 | Join a throttling quota group with given name g. All drives that |
| 2378 | are members of the same group are accounted for together. Use |
| 2379 | this option to prevent guests from circumventing throttling |
| 2380 | limits by using many small disks instead of a single larger |
| 2381 | disk. |
| 2382 | |
| 2383 | By default, the ``cache.writeback=on`` mode is used. It will report |
| 2384 | data writes as completed as soon as the data is present in the host |
| 2385 | page cache. This is safe as long as your guest OS makes sure to |
| 2386 | correctly flush disk caches where needed. If your guest OS does not |
| 2387 | handle volatile disk write caches correctly and your host crashes or |
| 2388 | loses power, then the guest may experience data corruption. |
| 2389 | |
| 2390 | For such guests, you should consider using ``cache.writeback=off``. |
| 2391 | This means that the host page cache will be used to read and write |
| 2392 | data, but write notification will be sent to the guest only after |
| 2393 | QEMU has made sure to flush each write to the disk. Be aware that |
| 2394 | this has a major impact on performance. |
| 2395 | |
| 2396 | When using the ``-snapshot`` option, unsafe caching is always used. |
| 2397 | |
| 2398 | Copy-on-read avoids accessing the same backing file sectors |
| 2399 | repeatedly and is useful when the backing file is over a slow |
| 2400 | network. By default copy-on-read is off. |
| 2401 | |
| 2402 | Instead of ``-cdrom`` you can use: |
| 2403 | |
| 2404 | .. parsed-literal:: |
| 2405 | |
| 2406 | |qemu_system| -drive file=file,index=2,media=cdrom |
| 2407 | |
| 2408 | Instead of ``-hda``, ``-hdb``, ``-hdc``, ``-hdd``, you can use: |
| 2409 | |
| 2410 | .. parsed-literal:: |
| 2411 | |
| 2412 | |qemu_system| -drive file=file,index=0,media=disk |
| 2413 | |qemu_system| -drive file=file,index=1,media=disk |
| 2414 | |qemu_system| -drive file=file,index=2,media=disk |
| 2415 | |qemu_system| -drive file=file,index=3,media=disk |
| 2416 | |
| 2417 | You can open an image using pre-opened file descriptors from an fd |
| 2418 | set: |
| 2419 | |
| 2420 | .. parsed-literal:: |
| 2421 | |
| 2422 | |qemu_system| \ |
| 2423 | -add-fd fd=3,set=2,opaque="rdwr:/path/to/file" \ |
| 2424 | -add-fd fd=4,set=2,opaque="rdonly:/path/to/file" \ |
| 2425 | -drive file=/dev/fdset/2,index=0,media=disk |
| 2426 | |
| 2427 | You can connect a CDROM to the slave of ide0: |
| 2428 | |
| 2429 | .. parsed-literal:: |
| 2430 | |
| 2431 | |qemu_system_x86| -drive file=file,if=ide,index=1,media=cdrom |
| 2432 | |
| 2433 | If you don't specify the "file=" argument, you define an empty |
| 2434 | drive: |
| 2435 | |
| 2436 | .. parsed-literal:: |
| 2437 | |
| 2438 | |qemu_system_x86| -drive if=ide,index=1,media=cdrom |
| 2439 | |
| 2440 | Instead of ``-fda``, ``-fdb``, you can use: |
| 2441 | |
| 2442 | .. parsed-literal:: |
| 2443 | |
| 2444 | |qemu_system_x86| -drive file=file,index=0,if=floppy |
| 2445 | |qemu_system_x86| -drive file=file,index=1,if=floppy |
| 2446 | |
| 2447 | By default, interface is "ide" and index is automatically |
| 2448 | incremented: |
| 2449 | |
| 2450 | .. parsed-literal:: |
| 2451 | |
| 2452 | |qemu_system_x86| -drive file=a -drive file=b" |
| 2453 | |
| 2454 | is interpreted like: |
| 2455 | |
| 2456 | .. parsed-literal:: |
| 2457 | |
| 2458 | |qemu_system_x86| -hda a -hdb b |
| 2459 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2460 | |
| 2461 | DEF("mtdblock", HAS_ARG, QEMU_OPTION_mtdblock, |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 2462 | "-mtdblock file use 'file' as on-board Flash memory image\n", |
| 2463 | QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2464 | STEXI |
Kevin Wolf | 4e257e5 | 2009-10-09 10:58:36 +0200 | [diff] [blame] | 2465 | @item -mtdblock @var{file} |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 2466 | @findex -mtdblock |
Kevin Wolf | 4e257e5 | 2009-10-09 10:58:36 +0200 | [diff] [blame] | 2467 | Use @var{file} as on-board Flash memory image. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2468 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 2469 | SRST |
| 2470 | ``-mtdblock file`` |
| 2471 | Use file as on-board Flash memory image. |
| 2472 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2473 | |
| 2474 | DEF("sd", HAS_ARG, QEMU_OPTION_sd, |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 2475 | "-sd file use 'file' as SecureDigital card image\n", QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2476 | STEXI |
Kevin Wolf | 4e257e5 | 2009-10-09 10:58:36 +0200 | [diff] [blame] | 2477 | @item -sd @var{file} |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 2478 | @findex -sd |
Kevin Wolf | 4e257e5 | 2009-10-09 10:58:36 +0200 | [diff] [blame] | 2479 | Use @var{file} as SecureDigital card image. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2480 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 2481 | SRST |
| 2482 | ``-sd file`` |
| 2483 | Use file as SecureDigital card image. |
| 2484 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2485 | |
| 2486 | DEF("pflash", HAS_ARG, QEMU_OPTION_pflash, |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 2487 | "-pflash file use 'file' as a parallel flash image\n", QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2488 | STEXI |
Kevin Wolf | 4e257e5 | 2009-10-09 10:58:36 +0200 | [diff] [blame] | 2489 | @item -pflash @var{file} |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 2490 | @findex -pflash |
Kevin Wolf | 4e257e5 | 2009-10-09 10:58:36 +0200 | [diff] [blame] | 2491 | Use @var{file} as a parallel flash image. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2492 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 2493 | SRST |
| 2494 | ``-pflash file`` |
| 2495 | Use file as a parallel flash image. |
| 2496 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2497 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2498 | DEF("snapshot", 0, QEMU_OPTION_snapshot, |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 2499 | "-snapshot write to temporary files instead of disk image files\n", |
| 2500 | QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2501 | STEXI |
| 2502 | @item -snapshot |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 2503 | @findex -snapshot |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2504 | Write to temporary files instead of disk image files. In this case, |
| 2505 | the raw disk image you use is not written back. You can however force |
| 2506 | the write back by pressing @key{C-a s} (@pxref{disk_images}). |
| 2507 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 2508 | SRST |
| 2509 | ``-snapshot`` |
| 2510 | Write to temporary files instead of disk image files. In this case, |
| 2511 | the raw disk image you use is not written back. You can however |
| 2512 | force the write back by pressing C-a s (see |
| 2513 | :ref:`disk_005fimages`). |
| 2514 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2515 | |
Gautham R Shenoy | 74db920 | 2010-04-29 17:44:43 +0530 | [diff] [blame] | 2516 | DEF("fsdev", HAS_ARG, QEMU_OPTION_fsdev, |
Greg Kurz | b44a6b0 | 2019-05-17 17:34:49 +0200 | [diff] [blame] | 2517 | "-fsdev local,id=id,path=path,security_model=mapped-xattr|mapped-file|passthrough|none\n" |
| 2518 | " [,writeout=immediate][,readonly][,fmode=fmode][,dmode=dmode]\n" |
Pradeep Jagadeesh | b8bbdb8 | 2017-02-28 10:31:46 +0100 | [diff] [blame] | 2519 | " [[,throttling.bps-total=b]|[[,throttling.bps-read=r][,throttling.bps-write=w]]]\n" |
| 2520 | " [[,throttling.iops-total=i]|[[,throttling.iops-read=r][,throttling.iops-write=w]]]\n" |
| 2521 | " [[,throttling.bps-total-max=bm]|[[,throttling.bps-read-max=rm][,throttling.bps-write-max=wm]]]\n" |
| 2522 | " [[,throttling.iops-total-max=im]|[[,throttling.iops-read-max=irm][,throttling.iops-write-max=iwm]]]\n" |
Greg Kurz | b44a6b0 | 2019-05-17 17:34:49 +0200 | [diff] [blame] | 2523 | " [[,throttling.iops-size=is]]\n" |
| 2524 | "-fsdev proxy,id=id,socket=socket[,writeout=immediate][,readonly]\n" |
| 2525 | "-fsdev proxy,id=id,sock_fd=sock_fd[,writeout=immediate][,readonly]\n" |
| 2526 | "-fsdev synth,id=id\n", |
Gautham R Shenoy | 74db920 | 2010-04-29 17:44:43 +0530 | [diff] [blame] | 2527 | QEMU_ARCH_ALL) |
| 2528 | |
| 2529 | STEXI |
| 2530 | |
Greg Kurz | b44a6b0 | 2019-05-17 17:34:49 +0200 | [diff] [blame] | 2531 | @item -fsdev local,id=@var{id},path=@var{path},security_model=@var{security_model} [,writeout=@var{writeout}][,readonly][,fmode=@var{fmode}][,dmode=@var{dmode}] [,throttling.@var{option}=@var{value}[,throttling.@var{option}=@var{value}[,...]]] |
| 2532 | @itemx -fsdev proxy,id=@var{id},socket=@var{socket}[,writeout=@var{writeout}][,readonly] |
| 2533 | @itemx -fsdev proxy,id=@var{id},sock_fd=@var{sock_fd}[,writeout=@var{writeout}][,readonly] |
| 2534 | @itemx -fsdev synth,id=@var{id}[,readonly] |
Gautham R Shenoy | 74db920 | 2010-04-29 17:44:43 +0530 | [diff] [blame] | 2535 | @findex -fsdev |
Aneesh Kumar K.V | 7c92a3d | 2011-10-12 19:11:24 +0530 | [diff] [blame] | 2536 | Define a new file system device. Valid options are: |
| 2537 | @table @option |
Greg Kurz | b44a6b0 | 2019-05-17 17:34:49 +0200 | [diff] [blame] | 2538 | @item local |
| 2539 | Accesses to the filesystem are done by QEMU. |
| 2540 | @item proxy |
| 2541 | Accesses to the filesystem are done by virtfs-proxy-helper(1). |
| 2542 | @item synth |
| 2543 | Synthetic filesystem, only used by QTests. |
Aneesh Kumar K.V | 7c92a3d | 2011-10-12 19:11:24 +0530 | [diff] [blame] | 2544 | @item id=@var{id} |
Greg Kurz | b44a6b0 | 2019-05-17 17:34:49 +0200 | [diff] [blame] | 2545 | Specifies identifier for this device. |
Aneesh Kumar K.V | 7c92a3d | 2011-10-12 19:11:24 +0530 | [diff] [blame] | 2546 | @item path=@var{path} |
| 2547 | Specifies the export path for the file system device. Files under |
| 2548 | this path will be available to the 9p client on the guest. |
| 2549 | @item security_model=@var{security_model} |
| 2550 | Specifies the security model to be used for this export path. |
Aneesh Kumar K.V | 2c30dd7 | 2012-01-19 12:21:11 +0530 | [diff] [blame] | 2551 | Supported security models are "passthrough", "mapped-xattr", "mapped-file" and "none". |
Aneesh Kumar K.V | 7c92a3d | 2011-10-12 19:11:24 +0530 | [diff] [blame] | 2552 | In "passthrough" security model, files are stored using the same |
Stefan Weil | b65ee4f | 2012-05-11 22:25:50 +0200 | [diff] [blame] | 2553 | credentials as they are created on the guest. This requires QEMU |
Aneesh Kumar K.V | 2c30dd7 | 2012-01-19 12:21:11 +0530 | [diff] [blame] | 2554 | to run as root. In "mapped-xattr" security model, some of the file |
Aneesh Kumar K.V | 7c92a3d | 2011-10-12 19:11:24 +0530 | [diff] [blame] | 2555 | attributes like uid, gid, mode bits and link target are stored as |
Aneesh Kumar K.V | 2c30dd7 | 2012-01-19 12:21:11 +0530 | [diff] [blame] | 2556 | file attributes. For "mapped-file" these attributes are stored in the |
| 2557 | hidden .virtfs_metadata directory. Directories exported by this security model cannot |
Aneesh Kumar K.V | 7c92a3d | 2011-10-12 19:11:24 +0530 | [diff] [blame] | 2558 | interact with other unix tools. "none" security model is same as |
| 2559 | passthrough except the sever won't report failures if it fails to |
M. Mohan Kumar | d9b36a6 | 2011-10-14 12:59:37 +0530 | [diff] [blame] | 2560 | set file attributes like ownership. Security model is mandatory |
Greg Kurz | 93aee84 | 2018-12-12 14:18:10 +0100 | [diff] [blame] | 2561 | only for local fsdriver. Other fsdrivers (like proxy) don't take |
M. Mohan Kumar | d9b36a6 | 2011-10-14 12:59:37 +0530 | [diff] [blame] | 2562 | security model as a parameter. |
Aneesh Kumar K.V | 7c92a3d | 2011-10-12 19:11:24 +0530 | [diff] [blame] | 2563 | @item writeout=@var{writeout} |
| 2564 | This is an optional argument. The only supported value is "immediate". |
| 2565 | This means that host page cache will be used to read and write data but |
| 2566 | write notification will be sent to the guest only when the data has been |
| 2567 | reported as written by the storage subsystem. |
M. Mohan Kumar | 2c74c2c | 2011-10-25 12:10:39 +0530 | [diff] [blame] | 2568 | @item readonly |
| 2569 | Enables exporting 9p share as a readonly mount for guests. By default |
| 2570 | read-write access is given. |
M. Mohan Kumar | 84a87cc | 2011-12-14 13:58:47 +0530 | [diff] [blame] | 2571 | @item socket=@var{socket} |
| 2572 | Enables proxy filesystem driver to use passed socket file for communicating |
Greg Kurz | b44a6b0 | 2019-05-17 17:34:49 +0200 | [diff] [blame] | 2573 | with virtfs-proxy-helper(1). |
M. Mohan Kumar | f67e3ff | 2011-12-14 13:58:46 +0530 | [diff] [blame] | 2574 | @item sock_fd=@var{sock_fd} |
| 2575 | Enables proxy filesystem driver to use passed socket descriptor for |
Greg Kurz | b44a6b0 | 2019-05-17 17:34:49 +0200 | [diff] [blame] | 2576 | communicating with virtfs-proxy-helper(1). Usually a helper like libvirt |
| 2577 | will create socketpair and pass one of the fds as sock_fd. |
Tobias Schramm | b96feb2 | 2017-06-29 15:11:50 +0200 | [diff] [blame] | 2578 | @item fmode=@var{fmode} |
| 2579 | Specifies the default mode for newly created files on the host. Works only |
| 2580 | with security models "mapped-xattr" and "mapped-file". |
| 2581 | @item dmode=@var{dmode} |
| 2582 | Specifies the default mode for newly created directories on the host. Works |
| 2583 | only with security models "mapped-xattr" and "mapped-file". |
Greg Kurz | b44a6b0 | 2019-05-17 17:34:49 +0200 | [diff] [blame] | 2584 | @item throttling.bps-total=@var{b},throttling.bps-read=@var{r},throttling.bps-write=@var{w} |
| 2585 | Specify bandwidth throttling limits in bytes per second, either for all request |
| 2586 | types or for reads or writes only. |
| 2587 | @item throttling.bps-total-max=@var{bm},bps-read-max=@var{rm},bps-write-max=@var{wm} |
| 2588 | Specify bursts in bytes per second, either for all request types or for reads |
| 2589 | or writes only. Bursts allow the guest I/O to spike above the limit |
| 2590 | temporarily. |
| 2591 | @item throttling.iops-total=@var{i},throttling.iops-read=@var{r}, throttling.iops-write=@var{w} |
| 2592 | Specify request rate limits in requests per second, either for all request |
| 2593 | types or for reads or writes only. |
| 2594 | @item throttling.iops-total-max=@var{im},throttling.iops-read-max=@var{irm}, throttling.iops-write-max=@var{iwm} |
| 2595 | Specify bursts in requests per second, either for all request types or for reads |
| 2596 | or writes only. Bursts allow the guest I/O to spike above the limit temporarily. |
| 2597 | @item throttling.iops-size=@var{is} |
| 2598 | Let every @var{is} bytes of a request count as a new request for iops |
| 2599 | throttling purposes. |
Gautham R Shenoy | 74db920 | 2010-04-29 17:44:43 +0530 | [diff] [blame] | 2600 | @end table |
Aneesh Kumar K.V | 7c92a3d | 2011-10-12 19:11:24 +0530 | [diff] [blame] | 2601 | |
Greg Kurz | b44a6b0 | 2019-05-17 17:34:49 +0200 | [diff] [blame] | 2602 | -fsdev option is used along with -device driver "virtio-9p-...". |
| 2603 | @item -device virtio-9p-@var{type},fsdev=@var{id},mount_tag=@var{mount_tag} |
| 2604 | Options for virtio-9p-... driver are: |
Aneesh Kumar K.V | 7c92a3d | 2011-10-12 19:11:24 +0530 | [diff] [blame] | 2605 | @table @option |
Greg Kurz | b44a6b0 | 2019-05-17 17:34:49 +0200 | [diff] [blame] | 2606 | @item @var{type} |
| 2607 | Specifies the variant to be used. Supported values are "pci", "ccw" or "device", |
| 2608 | depending on the machine type. |
Aneesh Kumar K.V | 7c92a3d | 2011-10-12 19:11:24 +0530 | [diff] [blame] | 2609 | @item fsdev=@var{id} |
Greg Kurz | b44a6b0 | 2019-05-17 17:34:49 +0200 | [diff] [blame] | 2610 | Specifies the id value specified along with -fsdev option. |
Aneesh Kumar K.V | 7c92a3d | 2011-10-12 19:11:24 +0530 | [diff] [blame] | 2611 | @item mount_tag=@var{mount_tag} |
Greg Kurz | b44a6b0 | 2019-05-17 17:34:49 +0200 | [diff] [blame] | 2612 | Specifies the tag name to be used by the guest to mount this export point. |
Aneesh Kumar K.V | 7c92a3d | 2011-10-12 19:11:24 +0530 | [diff] [blame] | 2613 | @end table |
| 2614 | |
Gautham R Shenoy | 74db920 | 2010-04-29 17:44:43 +0530 | [diff] [blame] | 2615 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 2616 | SRST |
Peter Maydell | 09ce5f2 | 2020-02-28 15:36:13 +0000 | [diff] [blame^] | 2617 | ``-fsdev local,id=id,path=path,security_model=security_model [,writeout=writeout][,readonly][,fmode=fmode][,dmode=dmode] [,throttling.option=value[,throttling.option=value[,...]]]`` |
| 2618 | \ |
| 2619 | ``-fsdev proxy,id=id,socket=socket[,writeout=writeout][,readonly]`` |
| 2620 | \ |
| 2621 | ``-fsdev proxy,id=id,sock_fd=sock_fd[,writeout=writeout][,readonly]`` |
| 2622 | \ |
| 2623 | ``-fsdev synth,id=id[,readonly]`` |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 2624 | Define a new file system device. Valid options are: |
| 2625 | |
| 2626 | ``local`` |
| 2627 | Accesses to the filesystem are done by QEMU. |
| 2628 | |
| 2629 | ``proxy`` |
| 2630 | Accesses to the filesystem are done by virtfs-proxy-helper(1). |
| 2631 | |
| 2632 | ``synth`` |
| 2633 | Synthetic filesystem, only used by QTests. |
| 2634 | |
| 2635 | ``id=id`` |
| 2636 | Specifies identifier for this device. |
| 2637 | |
| 2638 | ``path=path`` |
| 2639 | Specifies the export path for the file system device. Files |
| 2640 | under this path will be available to the 9p client on the guest. |
| 2641 | |
| 2642 | ``security_model=security_model`` |
| 2643 | Specifies the security model to be used for this export path. |
| 2644 | Supported security models are "passthrough", "mapped-xattr", |
| 2645 | "mapped-file" and "none". In "passthrough" security model, files |
| 2646 | are stored using the same credentials as they are created on the |
| 2647 | guest. This requires QEMU to run as root. In "mapped-xattr" |
| 2648 | security model, some of the file attributes like uid, gid, mode |
| 2649 | bits and link target are stored as file attributes. For |
| 2650 | "mapped-file" these attributes are stored in the hidden |
| 2651 | .virtfs\_metadata directory. Directories exported by this |
| 2652 | security model cannot interact with other unix tools. "none" |
| 2653 | security model is same as passthrough except the sever won't |
| 2654 | report failures if it fails to set file attributes like |
| 2655 | ownership. Security model is mandatory only for local fsdriver. |
| 2656 | Other fsdrivers (like proxy) don't take security model as a |
| 2657 | parameter. |
| 2658 | |
| 2659 | ``writeout=writeout`` |
| 2660 | This is an optional argument. The only supported value is |
| 2661 | "immediate". This means that host page cache will be used to |
| 2662 | read and write data but write notification will be sent to the |
| 2663 | guest only when the data has been reported as written by the |
| 2664 | storage subsystem. |
| 2665 | |
| 2666 | ``readonly`` |
| 2667 | Enables exporting 9p share as a readonly mount for guests. By |
| 2668 | default read-write access is given. |
| 2669 | |
| 2670 | ``socket=socket`` |
| 2671 | Enables proxy filesystem driver to use passed socket file for |
| 2672 | communicating with virtfs-proxy-helper(1). |
| 2673 | |
| 2674 | ``sock_fd=sock_fd`` |
| 2675 | Enables proxy filesystem driver to use passed socket descriptor |
| 2676 | for communicating with virtfs-proxy-helper(1). Usually a helper |
| 2677 | like libvirt will create socketpair and pass one of the fds as |
| 2678 | sock\_fd. |
| 2679 | |
| 2680 | ``fmode=fmode`` |
| 2681 | Specifies the default mode for newly created files on the host. |
| 2682 | Works only with security models "mapped-xattr" and |
| 2683 | "mapped-file". |
| 2684 | |
| 2685 | ``dmode=dmode`` |
| 2686 | Specifies the default mode for newly created directories on the |
| 2687 | host. Works only with security models "mapped-xattr" and |
| 2688 | "mapped-file". |
| 2689 | |
| 2690 | ``throttling.bps-total=b,throttling.bps-read=r,throttling.bps-write=w`` |
| 2691 | Specify bandwidth throttling limits in bytes per second, either |
| 2692 | for all request types or for reads or writes only. |
| 2693 | |
| 2694 | ``throttling.bps-total-max=bm,bps-read-max=rm,bps-write-max=wm`` |
| 2695 | Specify bursts in bytes per second, either for all request types |
| 2696 | or for reads or writes only. Bursts allow the guest I/O to spike |
| 2697 | above the limit temporarily. |
| 2698 | |
| 2699 | ``throttling.iops-total=i,throttling.iops-read=r, throttling.iops-write=w`` |
| 2700 | Specify request rate limits in requests per second, either for |
| 2701 | all request types or for reads or writes only. |
| 2702 | |
| 2703 | ``throttling.iops-total-max=im,throttling.iops-read-max=irm, throttling.iops-write-max=iwm`` |
| 2704 | Specify bursts in requests per second, either for all request |
| 2705 | types or for reads or writes only. Bursts allow the guest I/O to |
| 2706 | spike above the limit temporarily. |
| 2707 | |
| 2708 | ``throttling.iops-size=is`` |
| 2709 | Let every is bytes of a request count as a new request for iops |
| 2710 | throttling purposes. |
| 2711 | |
| 2712 | -fsdev option is used along with -device driver "virtio-9p-...". |
| 2713 | |
| 2714 | ``-device virtio-9p-type,fsdev=id,mount_tag=mount_tag`` |
| 2715 | Options for virtio-9p-... driver are: |
| 2716 | |
| 2717 | ``type`` |
| 2718 | Specifies the variant to be used. Supported values are "pci", |
| 2719 | "ccw" or "device", depending on the machine type. |
| 2720 | |
| 2721 | ``fsdev=id`` |
| 2722 | Specifies the id value specified along with -fsdev option. |
| 2723 | |
| 2724 | ``mount_tag=mount_tag`` |
| 2725 | Specifies the tag name to be used by the guest to mount this |
| 2726 | export point. |
| 2727 | ERST |
Gautham R Shenoy | 74db920 | 2010-04-29 17:44:43 +0530 | [diff] [blame] | 2728 | |
Gautham R Shenoy | 3d54abc | 2010-04-29 17:45:03 +0530 | [diff] [blame] | 2729 | DEF("virtfs", HAS_ARG, QEMU_OPTION_virtfs, |
Greg Kurz | b44a6b0 | 2019-05-17 17:34:49 +0200 | [diff] [blame] | 2730 | "-virtfs local,path=path,mount_tag=tag,security_model=mapped-xattr|mapped-file|passthrough|none\n" |
Antonios Motakis | 1a6ed33 | 2019-10-10 11:36:05 +0200 | [diff] [blame] | 2731 | " [,id=id][,writeout=immediate][,readonly][,fmode=fmode][,dmode=dmode][,multidevs=remap|forbid|warn]\n" |
Greg Kurz | b44a6b0 | 2019-05-17 17:34:49 +0200 | [diff] [blame] | 2732 | "-virtfs proxy,mount_tag=tag,socket=socket[,id=id][,writeout=immediate][,readonly]\n" |
| 2733 | "-virtfs proxy,mount_tag=tag,sock_fd=sock_fd[,id=id][,writeout=immediate][,readonly]\n" |
| 2734 | "-virtfs synth,mount_tag=tag[,id=id][,readonly]\n", |
Gautham R Shenoy | 3d54abc | 2010-04-29 17:45:03 +0530 | [diff] [blame] | 2735 | QEMU_ARCH_ALL) |
| 2736 | |
| 2737 | STEXI |
| 2738 | |
Antonios Motakis | 1a6ed33 | 2019-10-10 11:36:05 +0200 | [diff] [blame] | 2739 | @item -virtfs local,path=@var{path},mount_tag=@var{mount_tag} ,security_model=@var{security_model}[,writeout=@var{writeout}][,readonly] [,fmode=@var{fmode}][,dmode=@var{dmode}][,multidevs=@var{multidevs}] |
Greg Kurz | b44a6b0 | 2019-05-17 17:34:49 +0200 | [diff] [blame] | 2740 | @itemx -virtfs proxy,socket=@var{socket},mount_tag=@var{mount_tag} [,writeout=@var{writeout}][,readonly] |
| 2741 | @itemx -virtfs proxy,sock_fd=@var{sock_fd},mount_tag=@var{mount_tag} [,writeout=@var{writeout}][,readonly] |
| 2742 | @itemx -virtfs synth,mount_tag=@var{mount_tag} |
Gautham R Shenoy | 3d54abc | 2010-04-29 17:45:03 +0530 | [diff] [blame] | 2743 | @findex -virtfs |
Gautham R Shenoy | 3d54abc | 2010-04-29 17:45:03 +0530 | [diff] [blame] | 2744 | |
Greg Kurz | b44a6b0 | 2019-05-17 17:34:49 +0200 | [diff] [blame] | 2745 | Define a new filesystem device and expose it to the guest using a virtio-9p-device. The general form of a Virtual File system pass-through options are: |
Aneesh Kumar K.V | 7c92a3d | 2011-10-12 19:11:24 +0530 | [diff] [blame] | 2746 | @table @option |
Greg Kurz | b44a6b0 | 2019-05-17 17:34:49 +0200 | [diff] [blame] | 2747 | @item local |
| 2748 | Accesses to the filesystem are done by QEMU. |
| 2749 | @item proxy |
| 2750 | Accesses to the filesystem are done by virtfs-proxy-helper(1). |
| 2751 | @item synth |
| 2752 | Synthetic filesystem, only used by QTests. |
Aneesh Kumar K.V | 7c92a3d | 2011-10-12 19:11:24 +0530 | [diff] [blame] | 2753 | @item id=@var{id} |
Greg Kurz | b44a6b0 | 2019-05-17 17:34:49 +0200 | [diff] [blame] | 2754 | Specifies identifier for the filesystem device |
Aneesh Kumar K.V | 7c92a3d | 2011-10-12 19:11:24 +0530 | [diff] [blame] | 2755 | @item path=@var{path} |
| 2756 | Specifies the export path for the file system device. Files under |
| 2757 | this path will be available to the 9p client on the guest. |
| 2758 | @item security_model=@var{security_model} |
| 2759 | Specifies the security model to be used for this export path. |
Aneesh Kumar K.V | 2c30dd7 | 2012-01-19 12:21:11 +0530 | [diff] [blame] | 2760 | Supported security models are "passthrough", "mapped-xattr", "mapped-file" and "none". |
Aneesh Kumar K.V | 7c92a3d | 2011-10-12 19:11:24 +0530 | [diff] [blame] | 2761 | In "passthrough" security model, files are stored using the same |
Stefan Weil | b65ee4f | 2012-05-11 22:25:50 +0200 | [diff] [blame] | 2762 | credentials as they are created on the guest. This requires QEMU |
Aneesh Kumar K.V | 2c30dd7 | 2012-01-19 12:21:11 +0530 | [diff] [blame] | 2763 | to run as root. In "mapped-xattr" security model, some of the file |
Aneesh Kumar K.V | 7c92a3d | 2011-10-12 19:11:24 +0530 | [diff] [blame] | 2764 | attributes like uid, gid, mode bits and link target are stored as |
Aneesh Kumar K.V | 2c30dd7 | 2012-01-19 12:21:11 +0530 | [diff] [blame] | 2765 | file attributes. For "mapped-file" these attributes are stored in the |
| 2766 | hidden .virtfs_metadata directory. Directories exported by this security model cannot |
Aneesh Kumar K.V | 7c92a3d | 2011-10-12 19:11:24 +0530 | [diff] [blame] | 2767 | interact with other unix tools. "none" security model is same as |
| 2768 | passthrough except the sever won't report failures if it fails to |
M. Mohan Kumar | d9b36a6 | 2011-10-14 12:59:37 +0530 | [diff] [blame] | 2769 | set file attributes like ownership. Security model is mandatory only |
Greg Kurz | 93aee84 | 2018-12-12 14:18:10 +0100 | [diff] [blame] | 2770 | for local fsdriver. Other fsdrivers (like proxy) don't take security |
M. Mohan Kumar | d9b36a6 | 2011-10-14 12:59:37 +0530 | [diff] [blame] | 2771 | model as a parameter. |
Aneesh Kumar K.V | 7c92a3d | 2011-10-12 19:11:24 +0530 | [diff] [blame] | 2772 | @item writeout=@var{writeout} |
| 2773 | This is an optional argument. The only supported value is "immediate". |
| 2774 | This means that host page cache will be used to read and write data but |
| 2775 | write notification will be sent to the guest only when the data has been |
| 2776 | reported as written by the storage subsystem. |
M. Mohan Kumar | 2c74c2c | 2011-10-25 12:10:39 +0530 | [diff] [blame] | 2777 | @item readonly |
| 2778 | Enables exporting 9p share as a readonly mount for guests. By default |
| 2779 | read-write access is given. |
M. Mohan Kumar | 84a87cc | 2011-12-14 13:58:47 +0530 | [diff] [blame] | 2780 | @item socket=@var{socket} |
| 2781 | Enables proxy filesystem driver to use passed socket file for |
Greg Kurz | b44a6b0 | 2019-05-17 17:34:49 +0200 | [diff] [blame] | 2782 | communicating with virtfs-proxy-helper(1). Usually a helper like libvirt |
| 2783 | will create socketpair and pass one of the fds as sock_fd. |
M. Mohan Kumar | f67e3ff | 2011-12-14 13:58:46 +0530 | [diff] [blame] | 2784 | @item sock_fd |
| 2785 | Enables proxy filesystem driver to use passed 'sock_fd' as the socket |
Greg Kurz | b44a6b0 | 2019-05-17 17:34:49 +0200 | [diff] [blame] | 2786 | descriptor for interfacing with virtfs-proxy-helper(1). |
Tobias Schramm | b96feb2 | 2017-06-29 15:11:50 +0200 | [diff] [blame] | 2787 | @item fmode=@var{fmode} |
| 2788 | Specifies the default mode for newly created files on the host. Works only |
| 2789 | with security models "mapped-xattr" and "mapped-file". |
| 2790 | @item dmode=@var{dmode} |
| 2791 | Specifies the default mode for newly created directories on the host. Works |
| 2792 | only with security models "mapped-xattr" and "mapped-file". |
Greg Kurz | b44a6b0 | 2019-05-17 17:34:49 +0200 | [diff] [blame] | 2793 | @item mount_tag=@var{mount_tag} |
| 2794 | Specifies the tag name to be used by the guest to mount this export point. |
Antonios Motakis | 1a6ed33 | 2019-10-10 11:36:05 +0200 | [diff] [blame] | 2795 | @item multidevs=@var{multidevs} |
| 2796 | Specifies how to deal with multiple devices being shared with a 9p export. |
| 2797 | Supported behaviours are either "remap", "forbid" or "warn". The latter is |
| 2798 | the default behaviour on which virtfs 9p expects only one device to be |
| 2799 | shared with the same export, and if more than one device is shared and |
| 2800 | accessed via the same 9p export then only a warning message is logged |
| 2801 | (once) by qemu on host side. In order to avoid file ID collisions on guest |
| 2802 | you should either create a separate virtfs export for each device to be |
| 2803 | shared with guests (recommended way) or you might use "remap" instead which |
| 2804 | allows you to share multiple devices with only one export instead, which is |
| 2805 | achieved by remapping the original inode numbers from host to guest in a |
| 2806 | way that would prevent such collisions. Remapping inodes in such use cases |
| 2807 | is required because the original device IDs from host are never passed and |
| 2808 | exposed on guest. Instead all files of an export shared with virtfs always |
| 2809 | share the same device id on guest. So two files with identical inode |
| 2810 | numbers but from actually different devices on host would otherwise cause a |
| 2811 | file ID collision and hence potential misbehaviours on guest. "forbid" on |
| 2812 | the other hand assumes like "warn" that only one device is shared by the |
| 2813 | same export, however it will not only log a warning message but also |
| 2814 | deny access to additional devices on guest. Note though that "forbid" does |
| 2815 | currently not block all possible file access operations (e.g. readdir() |
| 2816 | would still return entries from other devices). |
Gautham R Shenoy | 3d54abc | 2010-04-29 17:45:03 +0530 | [diff] [blame] | 2817 | @end table |
| 2818 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 2819 | SRST |
Peter Maydell | 09ce5f2 | 2020-02-28 15:36:13 +0000 | [diff] [blame^] | 2820 | ``-virtfs local,path=path,mount_tag=mount_tag ,security_model=security_model[,writeout=writeout][,readonly] [,fmode=fmode][,dmode=dmode][,multidevs=multidevs]`` |
| 2821 | \ |
| 2822 | ``-virtfs proxy,socket=socket,mount_tag=mount_tag [,writeout=writeout][,readonly]`` |
| 2823 | \ |
| 2824 | ``-virtfs proxy,sock_fd=sock_fd,mount_tag=mount_tag [,writeout=writeout][,readonly]`` |
| 2825 | \ |
| 2826 | ``-virtfs synth,mount_tag=mount_tag`` |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 2827 | Define a new filesystem device and expose it to the guest using a |
| 2828 | virtio-9p-device. The general form of a Virtual File system |
| 2829 | pass-through options are: |
| 2830 | |
| 2831 | ``local`` |
| 2832 | Accesses to the filesystem are done by QEMU. |
| 2833 | |
| 2834 | ``proxy`` |
| 2835 | Accesses to the filesystem are done by virtfs-proxy-helper(1). |
| 2836 | |
| 2837 | ``synth`` |
| 2838 | Synthetic filesystem, only used by QTests. |
| 2839 | |
| 2840 | ``id=id`` |
| 2841 | Specifies identifier for the filesystem device |
| 2842 | |
| 2843 | ``path=path`` |
| 2844 | Specifies the export path for the file system device. Files |
| 2845 | under this path will be available to the 9p client on the guest. |
| 2846 | |
| 2847 | ``security_model=security_model`` |
| 2848 | Specifies the security model to be used for this export path. |
| 2849 | Supported security models are "passthrough", "mapped-xattr", |
| 2850 | "mapped-file" and "none". In "passthrough" security model, files |
| 2851 | are stored using the same credentials as they are created on the |
| 2852 | guest. This requires QEMU to run as root. In "mapped-xattr" |
| 2853 | security model, some of the file attributes like uid, gid, mode |
| 2854 | bits and link target are stored as file attributes. For |
| 2855 | "mapped-file" these attributes are stored in the hidden |
| 2856 | .virtfs\_metadata directory. Directories exported by this |
| 2857 | security model cannot interact with other unix tools. "none" |
| 2858 | security model is same as passthrough except the sever won't |
| 2859 | report failures if it fails to set file attributes like |
| 2860 | ownership. Security model is mandatory only for local fsdriver. |
| 2861 | Other fsdrivers (like proxy) don't take security model as a |
| 2862 | parameter. |
| 2863 | |
| 2864 | ``writeout=writeout`` |
| 2865 | This is an optional argument. The only supported value is |
| 2866 | "immediate". This means that host page cache will be used to |
| 2867 | read and write data but write notification will be sent to the |
| 2868 | guest only when the data has been reported as written by the |
| 2869 | storage subsystem. |
| 2870 | |
| 2871 | ``readonly`` |
| 2872 | Enables exporting 9p share as a readonly mount for guests. By |
| 2873 | default read-write access is given. |
| 2874 | |
| 2875 | ``socket=socket`` |
| 2876 | Enables proxy filesystem driver to use passed socket file for |
| 2877 | communicating with virtfs-proxy-helper(1). Usually a helper like |
| 2878 | libvirt will create socketpair and pass one of the fds as |
| 2879 | sock\_fd. |
| 2880 | |
| 2881 | ``sock_fd`` |
| 2882 | Enables proxy filesystem driver to use passed 'sock\_fd' as the |
| 2883 | socket descriptor for interfacing with virtfs-proxy-helper(1). |
| 2884 | |
| 2885 | ``fmode=fmode`` |
| 2886 | Specifies the default mode for newly created files on the host. |
| 2887 | Works only with security models "mapped-xattr" and |
| 2888 | "mapped-file". |
| 2889 | |
| 2890 | ``dmode=dmode`` |
| 2891 | Specifies the default mode for newly created directories on the |
| 2892 | host. Works only with security models "mapped-xattr" and |
| 2893 | "mapped-file". |
| 2894 | |
| 2895 | ``mount_tag=mount_tag`` |
| 2896 | Specifies the tag name to be used by the guest to mount this |
| 2897 | export point. |
| 2898 | |
| 2899 | ``multidevs=multidevs`` |
| 2900 | Specifies how to deal with multiple devices being shared with a |
| 2901 | 9p export. Supported behaviours are either "remap", "forbid" or |
| 2902 | "warn". The latter is the default behaviour on which virtfs 9p |
| 2903 | expects only one device to be shared with the same export, and |
| 2904 | if more than one device is shared and accessed via the same 9p |
| 2905 | export then only a warning message is logged (once) by qemu on |
| 2906 | host side. In order to avoid file ID collisions on guest you |
| 2907 | should either create a separate virtfs export for each device to |
| 2908 | be shared with guests (recommended way) or you might use "remap" |
| 2909 | instead which allows you to share multiple devices with only one |
| 2910 | export instead, which is achieved by remapping the original |
| 2911 | inode numbers from host to guest in a way that would prevent |
| 2912 | such collisions. Remapping inodes in such use cases is required |
| 2913 | because the original device IDs from host are never passed and |
| 2914 | exposed on guest. Instead all files of an export shared with |
| 2915 | virtfs always share the same device id on guest. So two files |
| 2916 | with identical inode numbers but from actually different devices |
| 2917 | on host would otherwise cause a file ID collision and hence |
| 2918 | potential misbehaviours on guest. "forbid" on the other hand |
| 2919 | assumes like "warn" that only one device is shared by the same |
| 2920 | export, however it will not only log a warning message but also |
| 2921 | deny access to additional devices on guest. Note though that |
| 2922 | "forbid" does currently not block all possible file access |
| 2923 | operations (e.g. readdir() would still return entries from other |
| 2924 | devices). |
| 2925 | ERST |
Gautham R Shenoy | 3d54abc | 2010-04-29 17:45:03 +0530 | [diff] [blame] | 2926 | |
Markus Armbruster | 61d7048 | 2017-10-02 16:03:03 +0200 | [diff] [blame] | 2927 | DEF("iscsi", HAS_ARG, QEMU_OPTION_iscsi, |
| 2928 | "-iscsi [user=user][,password=password]\n" |
| 2929 | " [,header-digest=CRC32C|CR32C-NONE|NONE-CRC32C|NONE\n" |
| 2930 | " [,initiator-name=initiator-iqn][,id=target-iqn]\n" |
| 2931 | " [,timeout=timeout]\n" |
| 2932 | " iSCSI session parameters\n", QEMU_ARCH_ALL) |
| 2933 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2934 | STEXI |
Markus Armbruster | 4474314 | 2017-10-02 16:03:04 +0200 | [diff] [blame] | 2935 | @item -iscsi |
| 2936 | @findex -iscsi |
| 2937 | Configure iSCSI session parameters. |
| 2938 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 2939 | SRST |
| 2940 | ``-iscsi`` |
| 2941 | Configure iSCSI session parameters. |
| 2942 | ERST |
Markus Armbruster | 4474314 | 2017-10-02 16:03:04 +0200 | [diff] [blame] | 2943 | |
| 2944 | STEXI |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2945 | @end table |
| 2946 | ETEXI |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 2947 | DEFHEADING() |
| 2948 | |
Markus Armbruster | de6b4f9 | 2017-10-02 16:03:00 +0200 | [diff] [blame] | 2949 | DEFHEADING(USB options:) |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 2950 | STEXI |
| 2951 | @table @option |
| 2952 | ETEXI |
| 2953 | |
| 2954 | DEF("usb", 0, QEMU_OPTION_usb, |
Stefan Hajnoczi | 73f46fe | 2019-08-15 15:14:28 +0100 | [diff] [blame] | 2955 | "-usb enable on-board USB host controller (if not enabled by default)\n", |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 2956 | QEMU_ARCH_ALL) |
| 2957 | STEXI |
| 2958 | @item -usb |
| 2959 | @findex -usb |
Stefan Hajnoczi | 73f46fe | 2019-08-15 15:14:28 +0100 | [diff] [blame] | 2960 | Enable USB emulation on machine types with an on-board USB host controller (if |
| 2961 | not enabled by default). Note that on-board USB host controllers may not |
| 2962 | support USB 3.0. In this case @option{-device qemu-xhci} can be used instead |
| 2963 | on machines with PCI. |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 2964 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 2965 | SRST |
| 2966 | ``-usb`` |
| 2967 | Enable USB emulation on machine types with an on-board USB host |
| 2968 | controller (if not enabled by default). Note that on-board USB host |
| 2969 | controllers may not support USB 3.0. In this case |
| 2970 | ``-device qemu-xhci`` can be used instead on machines with PCI. |
| 2971 | ERST |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 2972 | |
| 2973 | DEF("usbdevice", HAS_ARG, QEMU_OPTION_usbdevice, |
| 2974 | "-usbdevice name add the host or guest USB device 'name'\n", |
| 2975 | QEMU_ARCH_ALL) |
| 2976 | STEXI |
| 2977 | |
| 2978 | @item -usbdevice @var{devname} |
| 2979 | @findex -usbdevice |
Thomas Huth | a358a3a | 2017-05-19 08:35:16 +0200 | [diff] [blame] | 2980 | Add the USB device @var{devname}. Note that this option is deprecated, |
| 2981 | please use @code{-device usb-...} instead. @xref{usb_devices}. |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 2982 | |
| 2983 | @table @option |
| 2984 | |
| 2985 | @item mouse |
| 2986 | Virtual Mouse. This will override the PS/2 mouse emulation when activated. |
| 2987 | |
| 2988 | @item tablet |
| 2989 | Pointer device that uses absolute coordinates (like a touchscreen). This |
| 2990 | means QEMU is able to report the mouse position without having to grab the |
| 2991 | mouse. Also overrides the PS/2 mouse emulation when activated. |
| 2992 | |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 2993 | @item braille |
| 2994 | Braille device. This will use BrlAPI to display the braille output on a real |
| 2995 | or fake device. |
| 2996 | |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 2997 | @end table |
| 2998 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 2999 | SRST |
| 3000 | ``-usbdevice devname`` |
| 3001 | Add the USB device devname. Note that this option is deprecated, |
| 3002 | please use ``-device usb-...`` instead. See |
| 3003 | :ref:`usb_005fdevices`. |
| 3004 | |
| 3005 | ``mouse`` |
| 3006 | Virtual Mouse. This will override the PS/2 mouse emulation when |
| 3007 | activated. |
| 3008 | |
| 3009 | ``tablet`` |
| 3010 | Pointer device that uses absolute coordinates (like a |
| 3011 | touchscreen). This means QEMU is able to report the mouse |
| 3012 | position without having to grab the mouse. Also overrides the |
| 3013 | PS/2 mouse emulation when activated. |
| 3014 | |
| 3015 | ``braille`` |
| 3016 | Braille device. This will use BrlAPI to display the braille |
| 3017 | output on a real or fake device. |
| 3018 | ERST |
Markus Armbruster | 10adb8b | 2013-02-13 19:49:43 +0100 | [diff] [blame] | 3019 | |
| 3020 | STEXI |
| 3021 | @end table |
| 3022 | ETEXI |
| 3023 | DEFHEADING() |
| 3024 | |
Markus Armbruster | de6b4f9 | 2017-10-02 16:03:00 +0200 | [diff] [blame] | 3025 | DEFHEADING(Display options:) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3026 | STEXI |
| 3027 | @table @option |
| 3028 | ETEXI |
| 3029 | |
Jes Sorensen | 1472a95 | 2011-03-16 13:33:31 +0100 | [diff] [blame] | 3030 | DEF("display", HAS_ARG, QEMU_OPTION_display, |
Thomas Huth | 88b40c6 | 2019-10-23 14:01:28 +0200 | [diff] [blame] | 3031 | #if defined(CONFIG_SPICE) |
Marc-André Lureau | d8aec9d | 2019-02-21 12:07:03 +0100 | [diff] [blame] | 3032 | "-display spice-app[,gl=on|off]\n" |
Thomas Huth | 88b40c6 | 2019-10-23 14:01:28 +0200 | [diff] [blame] | 3033 | #endif |
| 3034 | #if defined(CONFIG_SDL) |
| 3035 | "-display sdl[,alt_grab=on|off][,ctrl_grab=on|off]\n" |
Elie Tournier | 4867e47 | 2018-04-13 14:58:42 +0100 | [diff] [blame] | 3036 | " [,window_close=on|off][,gl=on|core|es|off]\n" |
Thomas Huth | 88b40c6 | 2019-10-23 14:01:28 +0200 | [diff] [blame] | 3037 | #endif |
Robert Ho | f04ec5a | 2016-07-26 18:17:11 +0800 | [diff] [blame] | 3038 | #if defined(CONFIG_GTK) |
Thomas Huth | 88b40c6 | 2019-10-23 14:01:28 +0200 | [diff] [blame] | 3039 | "-display gtk[,grab_on_hover=on|off][,gl=on|off]|\n" |
| 3040 | #endif |
| 3041 | #if defined(CONFIG_VNC) |
| 3042 | "-display vnc=<display>[,<optargs>]\n" |
| 3043 | #endif |
| 3044 | #if defined(CONFIG_CURSES) |
| 3045 | "-display curses[,charset=<encoding>]\n" |
| 3046 | #endif |
| 3047 | #if defined(CONFIG_OPENGL) |
| 3048 | "-display egl-headless[,rendernode=<file>]\n" |
| 3049 | #endif |
| 3050 | "-display none\n" |
| 3051 | " select display backend type\n" |
| 3052 | " The default display is equivalent to\n " |
| 3053 | #if defined(CONFIG_GTK) |
| 3054 | "\"-display gtk\"\n" |
Robert Ho | f04ec5a | 2016-07-26 18:17:11 +0800 | [diff] [blame] | 3055 | #elif defined(CONFIG_SDL) |
Thomas Huth | 88b40c6 | 2019-10-23 14:01:28 +0200 | [diff] [blame] | 3056 | "\"-display sdl\"\n" |
Robert Ho | f04ec5a | 2016-07-26 18:17:11 +0800 | [diff] [blame] | 3057 | #elif defined(CONFIG_COCOA) |
Thomas Huth | 88b40c6 | 2019-10-23 14:01:28 +0200 | [diff] [blame] | 3058 | "\"-display cocoa\"\n" |
Robert Ho | f04ec5a | 2016-07-26 18:17:11 +0800 | [diff] [blame] | 3059 | #elif defined(CONFIG_VNC) |
Thomas Huth | 88b40c6 | 2019-10-23 14:01:28 +0200 | [diff] [blame] | 3060 | "\"-vnc localhost:0,to=99,id=default\"\n" |
Robert Ho | f04ec5a | 2016-07-26 18:17:11 +0800 | [diff] [blame] | 3061 | #else |
Thomas Huth | 88b40c6 | 2019-10-23 14:01:28 +0200 | [diff] [blame] | 3062 | "\"-display none\"\n" |
Robert Ho | f04ec5a | 2016-07-26 18:17:11 +0800 | [diff] [blame] | 3063 | #endif |
| 3064 | , QEMU_ARCH_ALL) |
Jes Sorensen | 1472a95 | 2011-03-16 13:33:31 +0100 | [diff] [blame] | 3065 | STEXI |
| 3066 | @item -display @var{type} |
| 3067 | @findex -display |
| 3068 | Select type of display to use. This option is a replacement for the |
Thomas Huth | c388f40 | 2020-01-08 15:47:02 +0100 | [diff] [blame] | 3069 | old style -sdl/-curses/... options. Use @code{-display help} to list |
| 3070 | the available display types. Valid values for @var{type} are |
Jes Sorensen | 1472a95 | 2011-03-16 13:33:31 +0100 | [diff] [blame] | 3071 | @table @option |
| 3072 | @item sdl |
| 3073 | Display video output via SDL (usually in a separate graphics |
| 3074 | window; see the SDL documentation for other possibilities). |
| 3075 | @item curses |
| 3076 | Display video output via curses. For graphics device models which |
| 3077 | support a text mode, QEMU can display this output using a |
| 3078 | curses/ncurses interface. Nothing is displayed when the graphics |
| 3079 | device is in graphical mode or if the graphics device does not support |
| 3080 | a text mode. Generally only the VGA device models support text mode. |
Samuel Thibault | 2f8b7cd | 2019-03-11 14:51:27 +0100 | [diff] [blame] | 3081 | The font charset used by the guest can be specified with the |
| 3082 | @code{charset} option, for example @code{charset=CP850} for IBM CP850 |
| 3083 | encoding. The default is @code{CP437}. |
Jes Sorensen | 4171d32 | 2011-03-16 13:33:32 +0100 | [diff] [blame] | 3084 | @item none |
| 3085 | Do not display video output. The guest will still see an emulated |
| 3086 | graphics card, but its output will not be displayed to the QEMU |
| 3087 | user. This option differs from the -nographic option in that it |
| 3088 | only affects what is done with video output; -nographic also changes |
| 3089 | the destination of the serial and parallel port data. |
Jan Kiszka | 881249c | 2014-03-12 08:33:50 +0100 | [diff] [blame] | 3090 | @item gtk |
| 3091 | Display video output in a GTK window. This interface provides drop-down |
| 3092 | menus and other UI elements to configure and control the VM during |
| 3093 | runtime. |
Jes Sorensen | 3264ff1 | 2011-03-16 13:33:33 +0100 | [diff] [blame] | 3094 | @item vnc |
| 3095 | Start a VNC server on display <arg> |
Erik Skultety | 144aaa9 | 2018-11-16 11:14:44 +0100 | [diff] [blame] | 3096 | @item egl-headless |
| 3097 | Offload all OpenGL operations to a local DRI device. For any graphical display, |
| 3098 | this display needs to be paired with either VNC or SPICE displays. |
Marc-André Lureau | d8aec9d | 2019-02-21 12:07:03 +0100 | [diff] [blame] | 3099 | @item spice-app |
| 3100 | Start QEMU as a Spice server and launch the default Spice client |
| 3101 | application. The Spice server will redirect the serial consoles and |
| 3102 | QEMU monitors. (Since 4.0) |
Jes Sorensen | 1472a95 | 2011-03-16 13:33:31 +0100 | [diff] [blame] | 3103 | @end table |
| 3104 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 3105 | SRST |
| 3106 | ``-display type`` |
| 3107 | Select type of display to use. This option is a replacement for the |
| 3108 | old style -sdl/-curses/... options. Use ``-display help`` to list |
| 3109 | the available display types. Valid values for type are |
| 3110 | |
| 3111 | ``sdl`` |
| 3112 | Display video output via SDL (usually in a separate graphics |
| 3113 | window; see the SDL documentation for other possibilities). |
| 3114 | |
| 3115 | ``curses`` |
| 3116 | Display video output via curses. For graphics device models |
| 3117 | which support a text mode, QEMU can display this output using a |
| 3118 | curses/ncurses interface. Nothing is displayed when the graphics |
| 3119 | device is in graphical mode or if the graphics device does not |
| 3120 | support a text mode. Generally only the VGA device models |
| 3121 | support text mode. The font charset used by the guest can be |
| 3122 | specified with the ``charset`` option, for example |
| 3123 | ``charset=CP850`` for IBM CP850 encoding. The default is |
| 3124 | ``CP437``. |
| 3125 | |
| 3126 | ``none`` |
| 3127 | Do not display video output. The guest will still see an |
| 3128 | emulated graphics card, but its output will not be displayed to |
| 3129 | the QEMU user. This option differs from the -nographic option in |
| 3130 | that it only affects what is done with video output; -nographic |
| 3131 | also changes the destination of the serial and parallel port |
| 3132 | data. |
| 3133 | |
| 3134 | ``gtk`` |
| 3135 | Display video output in a GTK window. This interface provides |
| 3136 | drop-down menus and other UI elements to configure and control |
| 3137 | the VM during runtime. |
| 3138 | |
| 3139 | ``vnc`` |
| 3140 | Start a VNC server on display <arg> |
| 3141 | |
| 3142 | ``egl-headless`` |
| 3143 | Offload all OpenGL operations to a local DRI device. For any |
| 3144 | graphical display, this display needs to be paired with either |
| 3145 | VNC or SPICE displays. |
| 3146 | |
| 3147 | ``spice-app`` |
| 3148 | Start QEMU as a Spice server and launch the default Spice client |
| 3149 | application. The Spice server will redirect the serial consoles |
| 3150 | and QEMU monitors. (Since 4.0) |
| 3151 | ERST |
Jes Sorensen | 1472a95 | 2011-03-16 13:33:31 +0100 | [diff] [blame] | 3152 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3153 | DEF("nographic", 0, QEMU_OPTION_nographic, |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 3154 | "-nographic disable graphical output and redirect serial I/Os to console\n", |
| 3155 | QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3156 | STEXI |
| 3157 | @item -nographic |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 3158 | @findex -nographic |
Colin Lord | dc0a3e4 | 2016-08-12 15:30:48 -0400 | [diff] [blame] | 3159 | Normally, if QEMU is compiled with graphical window support, it displays |
| 3160 | output such as guest graphics, guest console, and the QEMU monitor in a |
| 3161 | window. With this option, you can totally disable graphical output so |
| 3162 | that QEMU is a simple command line application. The emulated serial port |
| 3163 | is redirected on the console and muxed with the monitor (unless |
| 3164 | redirected elsewhere explicitly). Therefore, you can still use QEMU to |
| 3165 | debug a Linux kernel with a serial console. Use @key{C-a h} for help on |
| 3166 | switching between the console and monitor. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3167 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 3168 | SRST |
| 3169 | ``-nographic`` |
| 3170 | Normally, if QEMU is compiled with graphical window support, it |
| 3171 | displays output such as guest graphics, guest console, and the QEMU |
| 3172 | monitor in a window. With this option, you can totally disable |
| 3173 | graphical output so that QEMU is a simple command line application. |
| 3174 | The emulated serial port is redirected on the console and muxed with |
| 3175 | the monitor (unless redirected elsewhere explicitly). Therefore, you |
| 3176 | can still use QEMU to debug a Linux kernel with a serial console. |
| 3177 | Use C-a h for help on switching between the console and monitor. |
| 3178 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3179 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3180 | DEF("curses", 0, QEMU_OPTION_curses, |
Robert Ho | f04ec5a | 2016-07-26 18:17:11 +0800 | [diff] [blame] | 3181 | "-curses shorthand for -display curses\n", |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 3182 | QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3183 | STEXI |
| 3184 | @item -curses |
Markus Armbruster | b8f490e | 2013-02-13 19:49:38 +0100 | [diff] [blame] | 3185 | @findex -curses |
Colin Lord | dc0a3e4 | 2016-08-12 15:30:48 -0400 | [diff] [blame] | 3186 | Normally, if QEMU is compiled with graphical window support, it displays |
| 3187 | output such as guest graphics, guest console, and the QEMU monitor in a |
| 3188 | window. With this option, QEMU can display the VGA output when in text |
| 3189 | mode using a curses/ncurses interface. Nothing is displayed in graphical |
| 3190 | mode. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3191 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 3192 | SRST |
| 3193 | ``-curses`` |
| 3194 | Normally, if QEMU is compiled with graphical window support, it |
| 3195 | displays output such as guest graphics, guest console, and the QEMU |
| 3196 | monitor in a window. With this option, QEMU can display the VGA |
| 3197 | output when in text mode using a curses/ncurses interface. Nothing |
| 3198 | is displayed in graphical mode. |
| 3199 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3200 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3201 | DEF("alt-grab", 0, QEMU_OPTION_alt_grab, |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 3202 | "-alt-grab use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt)\n", |
| 3203 | QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3204 | STEXI |
| 3205 | @item -alt-grab |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 3206 | @findex -alt-grab |
Brad Hards | de1db2a | 2011-04-29 21:46:12 +1000 | [diff] [blame] | 3207 | Use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt). Note that this also |
| 3208 | affects the special keys (for fullscreen, monitor-mode switching, etc). |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3209 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 3210 | SRST |
| 3211 | ``-alt-grab`` |
| 3212 | Use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt). Note that |
| 3213 | this also affects the special keys (for fullscreen, monitor-mode |
| 3214 | switching, etc). |
| 3215 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3216 | |
Dustin Kirkland | 0ca9f8a | 2009-09-17 15:48:04 -0500 | [diff] [blame] | 3217 | DEF("ctrl-grab", 0, QEMU_OPTION_ctrl_grab, |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 3218 | "-ctrl-grab use Right-Ctrl to grab mouse (instead of Ctrl-Alt)\n", |
| 3219 | QEMU_ARCH_ALL) |
Dustin Kirkland | 0ca9f8a | 2009-09-17 15:48:04 -0500 | [diff] [blame] | 3220 | STEXI |
| 3221 | @item -ctrl-grab |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 3222 | @findex -ctrl-grab |
Brad Hards | de1db2a | 2011-04-29 21:46:12 +1000 | [diff] [blame] | 3223 | Use Right-Ctrl to grab mouse (instead of Ctrl-Alt). Note that this also |
| 3224 | affects the special keys (for fullscreen, monitor-mode switching, etc). |
Dustin Kirkland | 0ca9f8a | 2009-09-17 15:48:04 -0500 | [diff] [blame] | 3225 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 3226 | SRST |
| 3227 | ``-ctrl-grab`` |
| 3228 | Use Right-Ctrl to grab mouse (instead of Ctrl-Alt). Note that this |
| 3229 | also affects the special keys (for fullscreen, monitor-mode |
| 3230 | switching, etc). |
| 3231 | ERST |
Dustin Kirkland | 0ca9f8a | 2009-09-17 15:48:04 -0500 | [diff] [blame] | 3232 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3233 | DEF("no-quit", 0, QEMU_OPTION_no_quit, |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 3234 | "-no-quit disable SDL window close capability\n", QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3235 | STEXI |
| 3236 | @item -no-quit |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 3237 | @findex -no-quit |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3238 | Disable SDL window close capability. |
| 3239 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 3240 | SRST |
| 3241 | ``-no-quit`` |
| 3242 | Disable SDL window close capability. |
| 3243 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3244 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3245 | DEF("sdl", 0, QEMU_OPTION_sdl, |
Robert Ho | f04ec5a | 2016-07-26 18:17:11 +0800 | [diff] [blame] | 3246 | "-sdl shorthand for -display sdl\n", QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3247 | STEXI |
| 3248 | @item -sdl |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 3249 | @findex -sdl |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3250 | Enable SDL. |
| 3251 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 3252 | SRST |
| 3253 | ``-sdl`` |
| 3254 | Enable SDL. |
| 3255 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3256 | |
Gerd Hoffmann | 29b0040 | 2010-03-11 11:13:27 -0300 | [diff] [blame] | 3257 | DEF("spice", HAS_ARG, QEMU_OPTION_spice, |
Yonit Halperin | 27af778 | 2012-08-21 13:54:20 +0300 | [diff] [blame] | 3258 | "-spice [port=port][,tls-port=secured-port][,x509-dir=<dir>]\n" |
| 3259 | " [,x509-key-file=<file>][,x509-key-password=<file>]\n" |
| 3260 | " [,x509-cert-file=<file>][,x509-cacert-file=<file>]\n" |
Marc-André Lureau | fe4831b | 2015-01-13 17:57:51 +0100 | [diff] [blame] | 3261 | " [,x509-dh-key-file=<file>][,addr=addr][,ipv4|ipv6|unix]\n" |
Yonit Halperin | 27af778 | 2012-08-21 13:54:20 +0300 | [diff] [blame] | 3262 | " [,tls-ciphers=<list>]\n" |
| 3263 | " [,tls-channel=[main|display|cursor|inputs|record|playback]]\n" |
| 3264 | " [,plaintext-channel=[main|display|cursor|inputs|record|playback]]\n" |
| 3265 | " [,sasl][,password=<secret>][,disable-ticketing]\n" |
| 3266 | " [,image-compression=[auto_glz|auto_lz|quic|glz|lz|off]]\n" |
| 3267 | " [,jpeg-wan-compression=[auto|never|always]]\n" |
| 3268 | " [,zlib-glz-wan-compression=[auto|never|always]]\n" |
| 3269 | " [,streaming-video=[off|all|filter]][,disable-copy-paste]\n" |
Hans de Goede | 5ad24e5 | 2013-06-08 15:37:27 +0200 | [diff] [blame] | 3270 | " [,disable-agent-file-xfer][,agent-mouse=[on|off]]\n" |
| 3271 | " [,playback-compression=[on|off]][,seamless-migration=[on|off]]\n" |
Marc-André Lureau | 7b52550 | 2017-02-12 15:21:18 +0400 | [diff] [blame] | 3272 | " [,gl=[on|off]][,rendernode=<file>]\n" |
Yonit Halperin | 27af778 | 2012-08-21 13:54:20 +0300 | [diff] [blame] | 3273 | " enable spice\n" |
| 3274 | " at least one of {port, tls-port} is mandatory\n", |
| 3275 | QEMU_ARCH_ALL) |
Gerd Hoffmann | 29b0040 | 2010-03-11 11:13:27 -0300 | [diff] [blame] | 3276 | STEXI |
| 3277 | @item -spice @var{option}[,@var{option}[,...]] |
| 3278 | @findex -spice |
| 3279 | Enable the spice remote desktop protocol. Valid options are |
| 3280 | |
| 3281 | @table @option |
| 3282 | |
| 3283 | @item port=<nr> |
Gerd Hoffmann | c448e85 | 2010-03-11 11:13:32 -0300 | [diff] [blame] | 3284 | Set the TCP port spice is listening on for plaintext channels. |
Gerd Hoffmann | 29b0040 | 2010-03-11 11:13:27 -0300 | [diff] [blame] | 3285 | |
Gerd Hoffmann | 333b0ee | 2010-08-27 14:29:16 +0200 | [diff] [blame] | 3286 | @item addr=<addr> |
| 3287 | Set the IP address spice is listening on. Default is any address. |
| 3288 | |
| 3289 | @item ipv4 |
Markus Armbruster | f9cfd65 | 2015-06-15 14:35:59 +0200 | [diff] [blame] | 3290 | @itemx ipv6 |
| 3291 | @itemx unix |
Gerd Hoffmann | 333b0ee | 2010-08-27 14:29:16 +0200 | [diff] [blame] | 3292 | Force using the specified IP version. |
| 3293 | |
Gerd Hoffmann | 29b0040 | 2010-03-11 11:13:27 -0300 | [diff] [blame] | 3294 | @item password=<secret> |
| 3295 | Set the password you need to authenticate. |
| 3296 | |
Marc-André Lureau | 48b3ed0 | 2011-05-17 10:40:33 +0200 | [diff] [blame] | 3297 | @item sasl |
| 3298 | Require that the client use SASL to authenticate with the spice. |
| 3299 | The exact choice of authentication method used is controlled from the |
| 3300 | system / user's SASL configuration file for the 'qemu' service. This |
| 3301 | is typically found in /etc/sasl2/qemu.conf. If running QEMU as an |
| 3302 | unprivileged user, an environment variable SASL_CONF_PATH can be used |
| 3303 | to make it search alternate locations for the service config. |
| 3304 | While some SASL auth methods can also provide data encryption (eg GSSAPI), |
| 3305 | it is recommended that SASL always be combined with the 'tls' and |
| 3306 | 'x509' settings to enable use of SSL and server certificates. This |
| 3307 | ensures a data encryption preventing compromise of authentication |
| 3308 | credentials. |
| 3309 | |
Gerd Hoffmann | 29b0040 | 2010-03-11 11:13:27 -0300 | [diff] [blame] | 3310 | @item disable-ticketing |
| 3311 | Allow client connects without authentication. |
| 3312 | |
Hans de Goede | d4970b0 | 2011-03-27 16:43:54 +0200 | [diff] [blame] | 3313 | @item disable-copy-paste |
| 3314 | Disable copy paste between the client and the guest. |
| 3315 | |
Hans de Goede | 5ad24e5 | 2013-06-08 15:37:27 +0200 | [diff] [blame] | 3316 | @item disable-agent-file-xfer |
| 3317 | Disable spice-vdagent based file-xfer between the client and the guest. |
| 3318 | |
Gerd Hoffmann | c448e85 | 2010-03-11 11:13:32 -0300 | [diff] [blame] | 3319 | @item tls-port=<nr> |
| 3320 | Set the TCP port spice is listening on for encrypted channels. |
| 3321 | |
| 3322 | @item x509-dir=<dir> |
| 3323 | Set the x509 file directory. Expects same filenames as -vnc $display,x509=$dir |
| 3324 | |
| 3325 | @item x509-key-file=<file> |
Markus Armbruster | f9cfd65 | 2015-06-15 14:35:59 +0200 | [diff] [blame] | 3326 | @itemx x509-key-password=<file> |
| 3327 | @itemx x509-cert-file=<file> |
| 3328 | @itemx x509-cacert-file=<file> |
| 3329 | @itemx x509-dh-key-file=<file> |
Gerd Hoffmann | c448e85 | 2010-03-11 11:13:32 -0300 | [diff] [blame] | 3330 | The x509 file names can also be configured individually. |
| 3331 | |
| 3332 | @item tls-ciphers=<list> |
| 3333 | Specify which ciphers to use. |
| 3334 | |
Alon Levy | d70d6b3 | 2011-12-20 13:05:18 +0200 | [diff] [blame] | 3335 | @item tls-channel=[main|display|cursor|inputs|record|playback] |
Markus Armbruster | f9cfd65 | 2015-06-15 14:35:59 +0200 | [diff] [blame] | 3336 | @itemx plaintext-channel=[main|display|cursor|inputs|record|playback] |
Gerd Hoffmann | 17b6dea | 2010-08-27 14:09:56 +0200 | [diff] [blame] | 3337 | Force specific channel to be used with or without TLS encryption. The |
| 3338 | options can be specified multiple times to configure multiple |
| 3339 | channels. The special name "default" can be used to set the default |
| 3340 | mode. For channels which are not explicitly forced into one mode the |
| 3341 | spice client is allowed to pick tls/plaintext as he pleases. |
| 3342 | |
Yonit Halperin | 9f04e09 | 2010-07-14 13:26:34 +0300 | [diff] [blame] | 3343 | @item image-compression=[auto_glz|auto_lz|quic|glz|lz|off] |
| 3344 | Configure image compression (lossless). |
| 3345 | Default is auto_glz. |
| 3346 | |
| 3347 | @item jpeg-wan-compression=[auto|never|always] |
Markus Armbruster | f9cfd65 | 2015-06-15 14:35:59 +0200 | [diff] [blame] | 3348 | @itemx zlib-glz-wan-compression=[auto|never|always] |
Yonit Halperin | 9f04e09 | 2010-07-14 13:26:34 +0300 | [diff] [blame] | 3349 | Configure wan image compression (lossy for slow links). |
| 3350 | Default is auto. |
| 3351 | |
Gerd Hoffmann | 84a23f2 | 2010-08-30 16:36:53 +0200 | [diff] [blame] | 3352 | @item streaming-video=[off|all|filter] |
Li Zhijian | 93ca519 | 2016-08-01 12:06:59 +0800 | [diff] [blame] | 3353 | Configure video stream detection. Default is off. |
Gerd Hoffmann | 84a23f2 | 2010-08-30 16:36:53 +0200 | [diff] [blame] | 3354 | |
| 3355 | @item agent-mouse=[on|off] |
| 3356 | Enable/disable passing mouse events via vdagent. Default is on. |
| 3357 | |
| 3358 | @item playback-compression=[on|off] |
| 3359 | Enable/disable audio stream compression (using celt 0.5.1). Default is on. |
| 3360 | |
Yonit Halperin | 8c95705 | 2012-08-21 11:51:59 +0300 | [diff] [blame] | 3361 | @item seamless-migration=[on|off] |
| 3362 | Enable/disable spice seamless migration. Default is off. |
| 3363 | |
Gerd Hoffmann | 474114b | 2015-10-13 15:39:34 +0200 | [diff] [blame] | 3364 | @item gl=[on|off] |
| 3365 | Enable/disable OpenGL context. Default is off. |
| 3366 | |
Marc-André Lureau | 7b52550 | 2017-02-12 15:21:18 +0400 | [diff] [blame] | 3367 | @item rendernode=<file> |
| 3368 | DRM render node for OpenGL rendering. If not specified, it will pick |
| 3369 | the first available. (Since 2.9) |
| 3370 | |
Gerd Hoffmann | 29b0040 | 2010-03-11 11:13:27 -0300 | [diff] [blame] | 3371 | @end table |
| 3372 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 3373 | SRST |
| 3374 | ``-spice option[,option[,...]]`` |
| 3375 | Enable the spice remote desktop protocol. Valid options are |
| 3376 | |
| 3377 | ``port=<nr>`` |
| 3378 | Set the TCP port spice is listening on for plaintext channels. |
| 3379 | |
| 3380 | ``addr=<addr>`` |
| 3381 | Set the IP address spice is listening on. Default is any |
| 3382 | address. |
| 3383 | |
| 3384 | ``ipv4``; \ ``ipv6``; \ ``unix`` |
| 3385 | Force using the specified IP version. |
| 3386 | |
| 3387 | ``password=<secret>`` |
| 3388 | Set the password you need to authenticate. |
| 3389 | |
| 3390 | ``sasl`` |
| 3391 | Require that the client use SASL to authenticate with the spice. |
| 3392 | The exact choice of authentication method used is controlled |
| 3393 | from the system / user's SASL configuration file for the 'qemu' |
| 3394 | service. This is typically found in /etc/sasl2/qemu.conf. If |
| 3395 | running QEMU as an unprivileged user, an environment variable |
| 3396 | SASL\_CONF\_PATH can be used to make it search alternate |
| 3397 | locations for the service config. While some SASL auth methods |
| 3398 | can also provide data encryption (eg GSSAPI), it is recommended |
| 3399 | that SASL always be combined with the 'tls' and 'x509' settings |
| 3400 | to enable use of SSL and server certificates. This ensures a |
| 3401 | data encryption preventing compromise of authentication |
| 3402 | credentials. |
| 3403 | |
| 3404 | ``disable-ticketing`` |
| 3405 | Allow client connects without authentication. |
| 3406 | |
| 3407 | ``disable-copy-paste`` |
| 3408 | Disable copy paste between the client and the guest. |
| 3409 | |
| 3410 | ``disable-agent-file-xfer`` |
| 3411 | Disable spice-vdagent based file-xfer between the client and the |
| 3412 | guest. |
| 3413 | |
| 3414 | ``tls-port=<nr>`` |
| 3415 | Set the TCP port spice is listening on for encrypted channels. |
| 3416 | |
| 3417 | ``x509-dir=<dir>`` |
| 3418 | Set the x509 file directory. Expects same filenames as -vnc |
| 3419 | $display,x509=$dir |
| 3420 | |
| 3421 | ``x509-key-file=<file>``; \ ``x509-key-password=<file>``; \ ``x509-cert-file=<file>``; \ ``x509-cacert-file=<file>``; \ ``x509-dh-key-file=<file>`` |
| 3422 | The x509 file names can also be configured individually. |
| 3423 | |
| 3424 | ``tls-ciphers=<list>`` |
| 3425 | Specify which ciphers to use. |
| 3426 | |
| 3427 | ``tls-channel=[main|display|cursor|inputs|record|playback]``; \ ``plaintext-channel=[main|display|cursor|inputs|record|playback]`` |
| 3428 | Force specific channel to be used with or without TLS |
| 3429 | encryption. The options can be specified multiple times to |
| 3430 | configure multiple channels. The special name "default" can be |
| 3431 | used to set the default mode. For channels which are not |
| 3432 | explicitly forced into one mode the spice client is allowed to |
| 3433 | pick tls/plaintext as he pleases. |
| 3434 | |
| 3435 | ``image-compression=[auto_glz|auto_lz|quic|glz|lz|off]`` |
| 3436 | Configure image compression (lossless). Default is auto\_glz. |
| 3437 | |
| 3438 | ``jpeg-wan-compression=[auto|never|always]``; \ ``zlib-glz-wan-compression=[auto|never|always]`` |
| 3439 | Configure wan image compression (lossy for slow links). Default |
| 3440 | is auto. |
| 3441 | |
| 3442 | ``streaming-video=[off|all|filter]`` |
| 3443 | Configure video stream detection. Default is off. |
| 3444 | |
| 3445 | ``agent-mouse=[on|off]`` |
| 3446 | Enable/disable passing mouse events via vdagent. Default is on. |
| 3447 | |
| 3448 | ``playback-compression=[on|off]`` |
| 3449 | Enable/disable audio stream compression (using celt 0.5.1). |
| 3450 | Default is on. |
| 3451 | |
| 3452 | ``seamless-migration=[on|off]`` |
| 3453 | Enable/disable spice seamless migration. Default is off. |
| 3454 | |
| 3455 | ``gl=[on|off]`` |
| 3456 | Enable/disable OpenGL context. Default is off. |
| 3457 | |
| 3458 | ``rendernode=<file>`` |
| 3459 | DRM render node for OpenGL rendering. If not specified, it will |
| 3460 | pick the first available. (Since 2.9) |
| 3461 | ERST |
Gerd Hoffmann | 29b0040 | 2010-03-11 11:13:27 -0300 | [diff] [blame] | 3462 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3463 | DEF("portrait", 0, QEMU_OPTION_portrait, |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 3464 | "-portrait rotate graphical output 90 deg left (only PXA LCD)\n", |
| 3465 | QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3466 | STEXI |
| 3467 | @item -portrait |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 3468 | @findex -portrait |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3469 | Rotate graphical output 90 deg left (only PXA LCD). |
| 3470 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 3471 | SRST |
| 3472 | ``-portrait`` |
| 3473 | Rotate graphical output 90 deg left (only PXA LCD). |
| 3474 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3475 | |
Vasily Khoruzhick | 9312805 | 2011-06-17 13:04:36 +0300 | [diff] [blame] | 3476 | DEF("rotate", HAS_ARG, QEMU_OPTION_rotate, |
| 3477 | "-rotate <deg> rotate graphical output some deg left (only PXA LCD)\n", |
| 3478 | QEMU_ARCH_ALL) |
| 3479 | STEXI |
Markus Armbruster | 6265c43 | 2013-02-13 19:49:39 +0100 | [diff] [blame] | 3480 | @item -rotate @var{deg} |
Vasily Khoruzhick | 9312805 | 2011-06-17 13:04:36 +0300 | [diff] [blame] | 3481 | @findex -rotate |
| 3482 | Rotate graphical output some deg left (only PXA LCD). |
| 3483 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 3484 | SRST |
| 3485 | ``-rotate deg`` |
| 3486 | Rotate graphical output some deg left (only PXA LCD). |
| 3487 | ERST |
Vasily Khoruzhick | 9312805 | 2011-06-17 13:04:36 +0300 | [diff] [blame] | 3488 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3489 | DEF("vga", HAS_ARG, QEMU_OPTION_vga, |
Gerd Hoffmann | a94f0c5 | 2014-09-10 14:28:48 +0200 | [diff] [blame] | 3490 | "-vga [std|cirrus|vmware|qxl|xenfb|tcx|cg3|virtio|none]\n" |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 3491 | " select video card type\n", QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3492 | STEXI |
malc | e4558dc | 2012-08-27 18:33:21 +0400 | [diff] [blame] | 3493 | @item -vga @var{type} |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 3494 | @findex -vga |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3495 | Select type of VGA card to emulate. Valid values for @var{type} are |
Kevin Wolf | b3f046c | 2009-10-09 10:58:35 +0200 | [diff] [blame] | 3496 | @table @option |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3497 | @item cirrus |
| 3498 | Cirrus Logic GD5446 Video card. All Windows versions starting from |
| 3499 | Windows 95 should recognize and use this graphic card. For optimal |
| 3500 | performances, use 16 bit color depth in the guest and the host OS. |
Alberto Garcia | 41eeb0e | 2017-01-27 11:41:54 +0200 | [diff] [blame] | 3501 | (This card was the default before QEMU 2.2) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3502 | @item std |
| 3503 | Standard VGA card with Bochs VBE extensions. If your guest OS |
| 3504 | supports the VESA 2.0 VBE extensions (e.g. Windows XP) and if you want |
| 3505 | to use high resolution modes (>= 1280x1024x16) then you should use |
Alberto Garcia | 41eeb0e | 2017-01-27 11:41:54 +0200 | [diff] [blame] | 3506 | this option. (This card is the default since QEMU 2.2) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3507 | @item vmware |
| 3508 | VMWare SVGA-II compatible adapter. Use it if you have sufficiently |
| 3509 | recent XFree86/XOrg server or Windows guest with a driver for this |
| 3510 | card. |
Gerd Hoffmann | a19cbfb | 2010-04-27 11:50:11 +0200 | [diff] [blame] | 3511 | @item qxl |
| 3512 | QXL paravirtual graphic card. It is VGA compatible (including VESA |
| 3513 | 2.0 VBE support). Works best with qxl guest drivers installed though. |
| 3514 | Recommended choice when using the spice protocol. |
Mark Cave-Ayland | 3363278 | 2014-03-17 21:46:25 +0000 | [diff] [blame] | 3515 | @item tcx |
| 3516 | (sun4m only) Sun TCX framebuffer. This is the default framebuffer for |
| 3517 | sun4m machines and offers both 8-bit and 24-bit colour depths at a |
| 3518 | fixed resolution of 1024x768. |
| 3519 | @item cg3 |
| 3520 | (sun4m only) Sun cgthree framebuffer. This is a simple 8-bit framebuffer |
| 3521 | for sun4m machines available in both 1024x768 (OpenBIOS) and 1152x900 (OBP) |
| 3522 | resolutions aimed at people wishing to run older Solaris versions. |
Gerd Hoffmann | a94f0c5 | 2014-09-10 14:28:48 +0200 | [diff] [blame] | 3523 | @item virtio |
| 3524 | Virtio VGA card. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3525 | @item none |
| 3526 | Disable VGA card. |
| 3527 | @end table |
| 3528 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 3529 | SRST |
| 3530 | ``-vga type`` |
| 3531 | Select type of VGA card to emulate. Valid values for type are |
| 3532 | |
| 3533 | ``cirrus`` |
| 3534 | Cirrus Logic GD5446 Video card. All Windows versions starting |
| 3535 | from Windows 95 should recognize and use this graphic card. For |
| 3536 | optimal performances, use 16 bit color depth in the guest and |
| 3537 | the host OS. (This card was the default before QEMU 2.2) |
| 3538 | |
| 3539 | ``std`` |
| 3540 | Standard VGA card with Bochs VBE extensions. If your guest OS |
| 3541 | supports the VESA 2.0 VBE extensions (e.g. Windows XP) and if |
| 3542 | you want to use high resolution modes (>= 1280x1024x16) then you |
| 3543 | should use this option. (This card is the default since QEMU |
| 3544 | 2.2) |
| 3545 | |
| 3546 | ``vmware`` |
| 3547 | VMWare SVGA-II compatible adapter. Use it if you have |
| 3548 | sufficiently recent XFree86/XOrg server or Windows guest with a |
| 3549 | driver for this card. |
| 3550 | |
| 3551 | ``qxl`` |
| 3552 | QXL paravirtual graphic card. It is VGA compatible (including |
| 3553 | VESA 2.0 VBE support). Works best with qxl guest drivers |
| 3554 | installed though. Recommended choice when using the spice |
| 3555 | protocol. |
| 3556 | |
| 3557 | ``tcx`` |
| 3558 | (sun4m only) Sun TCX framebuffer. This is the default |
| 3559 | framebuffer for sun4m machines and offers both 8-bit and 24-bit |
| 3560 | colour depths at a fixed resolution of 1024x768. |
| 3561 | |
| 3562 | ``cg3`` |
| 3563 | (sun4m only) Sun cgthree framebuffer. This is a simple 8-bit |
| 3564 | framebuffer for sun4m machines available in both 1024x768 |
| 3565 | (OpenBIOS) and 1152x900 (OBP) resolutions aimed at people |
| 3566 | wishing to run older Solaris versions. |
| 3567 | |
| 3568 | ``virtio`` |
| 3569 | Virtio VGA card. |
| 3570 | |
| 3571 | ``none`` |
| 3572 | Disable VGA card. |
| 3573 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3574 | |
| 3575 | DEF("full-screen", 0, QEMU_OPTION_full_screen, |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 3576 | "-full-screen start in full screen\n", QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3577 | STEXI |
| 3578 | @item -full-screen |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 3579 | @findex -full-screen |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3580 | Start in full screen. |
| 3581 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 3582 | SRST |
| 3583 | ``-full-screen`` |
| 3584 | Start in full screen. |
| 3585 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3586 | |
John Snow | 60f9a4e | 2020-02-04 11:56:38 -0500 | [diff] [blame] | 3587 | DEF("g", HAS_ARG, QEMU_OPTION_g , |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 3588 | "-g WxH[xDEPTH] Set the initial graphical resolution and depth\n", |
Laurent Vivier | 8ac919a | 2019-10-26 18:45:43 +0200 | [diff] [blame] | 3589 | QEMU_ARCH_PPC | QEMU_ARCH_SPARC | QEMU_ARCH_M68K) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3590 | STEXI |
Stefan Weil | 95d5f08 | 2010-01-20 22:25:27 +0100 | [diff] [blame] | 3591 | @item -g @var{width}x@var{height}[x@var{depth}] |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 3592 | @findex -g |
Stefan Weil | 95d5f08 | 2010-01-20 22:25:27 +0100 | [diff] [blame] | 3593 | Set the initial graphical resolution and depth (PPC, SPARC only). |
Peter Maydell | 196afbb | 2020-02-28 15:36:10 +0000 | [diff] [blame] | 3594 | |
| 3595 | For PPC the default is 800x600x32. |
| 3596 | |
| 3597 | For SPARC with the TCX graphics device, the default is 1024x768x8 with the |
| 3598 | option of 1024x768x24. For cgthree, the default is 1024x768x8 with the option |
| 3599 | of 1152x900x8 for people who wish to use OBP. |
| 3600 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3601 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 3602 | SRST |
Peter Maydell | 09ce5f2 | 2020-02-28 15:36:13 +0000 | [diff] [blame^] | 3603 | ``-g`` *width*\ ``x``\ *height*\ ``[x``\ *depth*\ ``]`` |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 3604 | Set the initial graphical resolution and depth (PPC, SPARC only). |
| 3605 | |
| 3606 | For PPC the default is 800x600x32. |
| 3607 | |
| 3608 | For SPARC with the TCX graphics device, the default is 1024x768x8 |
| 3609 | with the option of 1024x768x24. For cgthree, the default is |
| 3610 | 1024x768x8 with the option of 1152x900x8 for people who wish to use |
| 3611 | OBP. |
| 3612 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3613 | |
| 3614 | DEF("vnc", HAS_ARG, QEMU_OPTION_vnc , |
Robert Ho | f04ec5a | 2016-07-26 18:17:11 +0800 | [diff] [blame] | 3615 | "-vnc <display> shorthand for -display vnc=<display>\n", QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3616 | STEXI |
| 3617 | @item -vnc @var{display}[,@var{option}[,@var{option}[,...]]] |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 3618 | @findex -vnc |
Colin Lord | dc0a3e4 | 2016-08-12 15:30:48 -0400 | [diff] [blame] | 3619 | Normally, if QEMU is compiled with graphical window support, it displays |
| 3620 | output such as guest graphics, guest console, and the QEMU monitor in a |
| 3621 | window. With this option, you can have QEMU listen on VNC display |
| 3622 | @var{display} and redirect the VGA display over the VNC session. It is |
| 3623 | very useful to enable the usb tablet device when using this option |
Thomas Huth | a358a3a | 2017-05-19 08:35:16 +0200 | [diff] [blame] | 3624 | (option @option{-device usb-tablet}). When using the VNC display, you |
Colin Lord | dc0a3e4 | 2016-08-12 15:30:48 -0400 | [diff] [blame] | 3625 | must use the @option{-k} parameter to set the keyboard layout if you are |
| 3626 | not using en-us. Valid syntax for the @var{display} is |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3627 | |
Kevin Wolf | b3f046c | 2009-10-09 10:58:35 +0200 | [diff] [blame] | 3628 | @table @option |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3629 | |
Robert Ho | 99a9a52 | 2016-05-31 15:03:09 +0800 | [diff] [blame] | 3630 | @item to=@var{L} |
| 3631 | |
| 3632 | With this option, QEMU will try next available VNC @var{display}s, until the |
| 3633 | number @var{L}, if the origianlly defined "-vnc @var{display}" is not |
| 3634 | available, e.g. port 5900+@var{display} is already used by another |
| 3635 | application. By default, to=0. |
| 3636 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3637 | @item @var{host}:@var{d} |
| 3638 | |
| 3639 | TCP connections will only be allowed from @var{host} on display @var{d}. |
| 3640 | By convention the TCP port is 5900+@var{d}. Optionally, @var{host} can |
| 3641 | be omitted in which case the server will accept connections from any host. |
| 3642 | |
Kevin Wolf | 4e257e5 | 2009-10-09 10:58:36 +0200 | [diff] [blame] | 3643 | @item unix:@var{path} |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3644 | |
| 3645 | Connections will be allowed over UNIX domain sockets where @var{path} is the |
| 3646 | location of a unix socket to listen for connections on. |
| 3647 | |
| 3648 | @item none |
| 3649 | |
| 3650 | VNC is initialized but not started. The monitor @code{change} command |
| 3651 | can be used to later start the VNC server. |
| 3652 | |
| 3653 | @end table |
| 3654 | |
| 3655 | Following the @var{display} value there may be one or more @var{option} flags |
| 3656 | separated by commas. Valid options are |
| 3657 | |
Kevin Wolf | b3f046c | 2009-10-09 10:58:35 +0200 | [diff] [blame] | 3658 | @table @option |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3659 | |
| 3660 | @item reverse |
| 3661 | |
| 3662 | Connect to a listening VNC client via a ``reverse'' connection. The |
| 3663 | client is specified by the @var{display}. For reverse network |
| 3664 | connections (@var{host}:@var{d},@code{reverse}), the @var{d} argument |
| 3665 | is a TCP port number, not a display number. |
| 3666 | |
Tim Hardeck | 7536ee4 | 2013-01-21 11:04:44 +0100 | [diff] [blame] | 3667 | @item websocket |
| 3668 | |
| 3669 | Opens an additional TCP listening port dedicated to VNC Websocket connections. |
Daniel P. Berrange | 275e0d6 | 2017-02-03 12:06:45 +0000 | [diff] [blame] | 3670 | If a bare @var{websocket} option is given, the Websocket port is |
| 3671 | 5700+@var{display}. An alternative port can be specified with the |
| 3672 | syntax @code{websocket}=@var{port}. |
| 3673 | |
| 3674 | If @var{host} is specified connections will only be allowed from this host. |
| 3675 | It is possible to control the websocket listen address independently, using |
| 3676 | the syntax @code{websocket}=@var{host}:@var{port}. |
| 3677 | |
Daniel P. Berrange | 3e305e4 | 2015-08-06 14:39:32 +0100 | [diff] [blame] | 3678 | If no TLS credentials are provided, the websocket connection runs in |
| 3679 | unencrypted mode. If TLS credentials are provided, the websocket connection |
| 3680 | requires encrypted client connections. |
Tim Hardeck | 7536ee4 | 2013-01-21 11:04:44 +0100 | [diff] [blame] | 3681 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3682 | @item password |
| 3683 | |
| 3684 | Require that password based authentication is used for client connections. |
Michal Novotny | 86ee5bc | 2012-07-16 15:54:38 +0200 | [diff] [blame] | 3685 | |
| 3686 | The password must be set separately using the @code{set_password} command in |
| 3687 | the @ref{pcsys_monitor}. The syntax to change your password is: |
| 3688 | @code{set_password <protocol> <password>} where <protocol> could be either |
| 3689 | "vnc" or "spice". |
| 3690 | |
| 3691 | If you would like to change <protocol> password expiration, you should use |
| 3692 | @code{expire_password <protocol> <expiration-time>} where expiration time could |
| 3693 | be one of the following options: now, never, +seconds or UNIX time of |
| 3694 | expiration, e.g. +60 to make password expire in 60 seconds, or 1335196800 |
| 3695 | to make password expire on "Mon Apr 23 12:00:00 EDT 2012" (UNIX time for this |
| 3696 | date and time). |
| 3697 | |
| 3698 | You can also use keywords "now" or "never" for the expiration time to |
| 3699 | allow <protocol> password to expire immediately or never expire. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3700 | |
Daniel P. Berrange | 3e305e4 | 2015-08-06 14:39:32 +0100 | [diff] [blame] | 3701 | @item tls-creds=@var{ID} |
| 3702 | |
| 3703 | Provides the ID of a set of TLS credentials to use to secure the |
| 3704 | VNC server. They will apply to both the normal VNC server socket |
| 3705 | and the websocket socket (if enabled). Setting TLS credentials |
| 3706 | will cause the VNC server socket to enable the VeNCrypt auth |
| 3707 | mechanism. The credentials should have been previously created |
| 3708 | using the @option{-object tls-creds} argument. |
| 3709 | |
Daniel P. Berrange | 55cf09a | 2019-02-27 14:57:54 +0000 | [diff] [blame] | 3710 | @item tls-authz=@var{ID} |
| 3711 | |
| 3712 | Provides the ID of the QAuthZ authorization object against which |
| 3713 | the client's x509 distinguished name will validated. This object is |
| 3714 | only resolved at time of use, so can be deleted and recreated on the |
| 3715 | fly while the VNC server is active. If missing, it will default |
| 3716 | to denying access. |
| 3717 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3718 | @item sasl |
| 3719 | |
| 3720 | Require that the client use SASL to authenticate with the VNC server. |
| 3721 | The exact choice of authentication method used is controlled from the |
| 3722 | system / user's SASL configuration file for the 'qemu' service. This |
| 3723 | is typically found in /etc/sasl2/qemu.conf. If running QEMU as an |
| 3724 | unprivileged user, an environment variable SASL_CONF_PATH can be used |
| 3725 | to make it search alternate locations for the service config. |
| 3726 | While some SASL auth methods can also provide data encryption (eg GSSAPI), |
| 3727 | it is recommended that SASL always be combined with the 'tls' and |
| 3728 | 'x509' settings to enable use of SSL and server certificates. This |
| 3729 | ensures a data encryption preventing compromise of authentication |
| 3730 | credentials. See the @ref{vnc_security} section for details on using |
| 3731 | SASL authentication. |
| 3732 | |
Daniel P. Berrange | 55cf09a | 2019-02-27 14:57:54 +0000 | [diff] [blame] | 3733 | @item sasl-authz=@var{ID} |
| 3734 | |
| 3735 | Provides the ID of the QAuthZ authorization object against which |
| 3736 | the client's SASL username will validated. This object is |
| 3737 | only resolved at time of use, so can be deleted and recreated on the |
| 3738 | fly while the VNC server is active. If missing, it will default |
| 3739 | to denying access. |
| 3740 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3741 | @item acl |
| 3742 | |
Daniel P. Berrange | 55cf09a | 2019-02-27 14:57:54 +0000 | [diff] [blame] | 3743 | Legacy method for enabling authorization of clients against the |
| 3744 | x509 distinguished name and SASL username. It results in the creation |
| 3745 | of two @code{authz-list} objects with IDs of @code{vnc.username} and |
| 3746 | @code{vnc.x509dname}. The rules for these objects must be configured |
| 3747 | with the HMP ACL commands. |
| 3748 | |
| 3749 | This option is deprecated and should no longer be used. The new |
| 3750 | @option{sasl-authz} and @option{tls-authz} options are a |
| 3751 | replacement. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3752 | |
Corentin Chary | 6f9c78c | 2010-07-07 20:57:51 +0200 | [diff] [blame] | 3753 | @item lossy |
| 3754 | |
| 3755 | Enable lossy compression methods (gradient, JPEG, ...). If this |
| 3756 | option is set, VNC client may receive lossy framebuffer updates |
| 3757 | depending on its encoding settings. Enabling this option can save |
| 3758 | a lot of bandwidth at the expense of quality. |
| 3759 | |
Corentin Chary | 80e0c8c | 2011-02-04 09:06:08 +0100 | [diff] [blame] | 3760 | @item non-adaptive |
| 3761 | |
| 3762 | Disable adaptive encodings. Adaptive encodings are enabled by default. |
| 3763 | An adaptive encoding will try to detect frequently updated screen regions, |
| 3764 | and send updates in these regions using a lossy encoding (like JPEG). |
Stefan Weil | 61cc870 | 2011-04-13 22:45:22 +0200 | [diff] [blame] | 3765 | This can be really helpful to save bandwidth when playing videos. Disabling |
Michael Tokarev | 9d85d55 | 2014-04-07 13:34:58 +0400 | [diff] [blame] | 3766 | adaptive encodings restores the original static behavior of encodings |
Corentin Chary | 80e0c8c | 2011-02-04 09:06:08 +0100 | [diff] [blame] | 3767 | like Tight. |
| 3768 | |
Gerd Hoffmann | 8cf3648 | 2011-11-24 18:10:49 +0100 | [diff] [blame] | 3769 | @item share=[allow-exclusive|force-shared|ignore] |
| 3770 | |
| 3771 | Set display sharing policy. 'allow-exclusive' allows clients to ask |
| 3772 | for exclusive access. As suggested by the rfb spec this is |
| 3773 | implemented by dropping other connections. Connecting multiple |
| 3774 | clients in parallel requires all clients asking for a shared session |
| 3775 | (vncviewer: -shared switch). This is the default. 'force-shared' |
| 3776 | disables exclusive client access. Useful for shared desktop sessions, |
| 3777 | where you don't want someone forgetting specify -shared disconnect |
| 3778 | everybody else. 'ignore' completely ignores the shared flag and |
| 3779 | allows everybody connect unconditionally. Doesn't conform to the rfb |
Stefan Weil | b65ee4f | 2012-05-11 22:25:50 +0200 | [diff] [blame] | 3780 | spec but is traditional QEMU behavior. |
Gerd Hoffmann | 8cf3648 | 2011-11-24 18:10:49 +0100 | [diff] [blame] | 3781 | |
Gerd Hoffmann | c5ce833 | 2016-06-01 08:22:30 +0200 | [diff] [blame] | 3782 | @item key-delay-ms |
| 3783 | |
| 3784 | Set keyboard delay, for key down and key up events, in milliseconds. |
Alexander Graf | d3b0db6 | 2017-07-12 14:43:45 +0200 | [diff] [blame] | 3785 | Default is 10. Keyboards are low-bandwidth devices, so this slowdown |
Gerd Hoffmann | c5ce833 | 2016-06-01 08:22:30 +0200 | [diff] [blame] | 3786 | can help the device and guest to keep up and not lose events in case |
| 3787 | events are arriving in bulk. Possible causes for the latter are flaky |
| 3788 | network connections, or scripts for automated testing. |
| 3789 | |
Kővágó, Zoltán | f0b9f36 | 2019-08-19 01:06:48 +0200 | [diff] [blame] | 3790 | @item audiodev=@var{audiodev} |
| 3791 | |
| 3792 | Use the specified @var{audiodev} when the VNC client requests audio |
| 3793 | transmission. When not using an -audiodev argument, this option must |
| 3794 | be omitted, otherwise is must be present and specify a valid audiodev. |
| 3795 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3796 | @end table |
| 3797 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 3798 | SRST |
| 3799 | ``-vnc display[,option[,option[,...]]]`` |
| 3800 | Normally, if QEMU is compiled with graphical window support, it |
| 3801 | displays output such as guest graphics, guest console, and the QEMU |
| 3802 | monitor in a window. With this option, you can have QEMU listen on |
| 3803 | VNC display display and redirect the VGA display over the VNC |
| 3804 | session. It is very useful to enable the usb tablet device when |
| 3805 | using this option (option ``-device usb-tablet``). When using the |
| 3806 | VNC display, you must use the ``-k`` parameter to set the keyboard |
| 3807 | layout if you are not using en-us. Valid syntax for the display is |
| 3808 | |
| 3809 | ``to=L`` |
| 3810 | With this option, QEMU will try next available VNC displays, |
| 3811 | until the number L, if the origianlly defined "-vnc display" is |
| 3812 | not available, e.g. port 5900+display is already used by another |
| 3813 | application. By default, to=0. |
| 3814 | |
| 3815 | ``host:d`` |
| 3816 | TCP connections will only be allowed from host on display d. By |
| 3817 | convention the TCP port is 5900+d. Optionally, host can be |
| 3818 | omitted in which case the server will accept connections from |
| 3819 | any host. |
| 3820 | |
| 3821 | ``unix:path`` |
| 3822 | Connections will be allowed over UNIX domain sockets where path |
| 3823 | is the location of a unix socket to listen for connections on. |
| 3824 | |
| 3825 | ``none`` |
| 3826 | VNC is initialized but not started. The monitor ``change`` |
| 3827 | command can be used to later start the VNC server. |
| 3828 | |
| 3829 | Following the display value there may be one or more option flags |
| 3830 | separated by commas. Valid options are |
| 3831 | |
| 3832 | ``reverse`` |
| 3833 | Connect to a listening VNC client via a "reverse" connection. |
| 3834 | The client is specified by the display. For reverse network |
| 3835 | connections (host:d,``reverse``), the d argument is a TCP port |
| 3836 | number, not a display number. |
| 3837 | |
| 3838 | ``websocket`` |
| 3839 | Opens an additional TCP listening port dedicated to VNC |
| 3840 | Websocket connections. If a bare websocket option is given, the |
| 3841 | Websocket port is 5700+display. An alternative port can be |
| 3842 | specified with the syntax ``websocket``\ =port. |
| 3843 | |
| 3844 | If host is specified connections will only be allowed from this |
| 3845 | host. It is possible to control the websocket listen address |
| 3846 | independently, using the syntax ``websocket``\ =host:port. |
| 3847 | |
| 3848 | If no TLS credentials are provided, the websocket connection |
| 3849 | runs in unencrypted mode. If TLS credentials are provided, the |
| 3850 | websocket connection requires encrypted client connections. |
| 3851 | |
| 3852 | ``password`` |
| 3853 | Require that password based authentication is used for client |
| 3854 | connections. |
| 3855 | |
| 3856 | The password must be set separately using the ``set_password`` |
| 3857 | command in the :ref:`pcsys_005fmonitor`. The |
| 3858 | syntax to change your password is: |
| 3859 | ``set_password <protocol> <password>`` where <protocol> could be |
| 3860 | either "vnc" or "spice". |
| 3861 | |
| 3862 | If you would like to change <protocol> password expiration, you |
| 3863 | should use ``expire_password <protocol> <expiration-time>`` |
| 3864 | where expiration time could be one of the following options: |
| 3865 | now, never, +seconds or UNIX time of expiration, e.g. +60 to |
| 3866 | make password expire in 60 seconds, or 1335196800 to make |
| 3867 | password expire on "Mon Apr 23 12:00:00 EDT 2012" (UNIX time for |
| 3868 | this date and time). |
| 3869 | |
| 3870 | You can also use keywords "now" or "never" for the expiration |
| 3871 | time to allow <protocol> password to expire immediately or never |
| 3872 | expire. |
| 3873 | |
| 3874 | ``tls-creds=ID`` |
| 3875 | Provides the ID of a set of TLS credentials to use to secure the |
| 3876 | VNC server. They will apply to both the normal VNC server socket |
| 3877 | and the websocket socket (if enabled). Setting TLS credentials |
| 3878 | will cause the VNC server socket to enable the VeNCrypt auth |
| 3879 | mechanism. The credentials should have been previously created |
| 3880 | using the ``-object tls-creds`` argument. |
| 3881 | |
| 3882 | ``tls-authz=ID`` |
| 3883 | Provides the ID of the QAuthZ authorization object against which |
| 3884 | the client's x509 distinguished name will validated. This object |
| 3885 | is only resolved at time of use, so can be deleted and recreated |
| 3886 | on the fly while the VNC server is active. If missing, it will |
| 3887 | default to denying access. |
| 3888 | |
| 3889 | ``sasl`` |
| 3890 | Require that the client use SASL to authenticate with the VNC |
| 3891 | server. The exact choice of authentication method used is |
| 3892 | controlled from the system / user's SASL configuration file for |
| 3893 | the 'qemu' service. This is typically found in |
| 3894 | /etc/sasl2/qemu.conf. If running QEMU as an unprivileged user, |
| 3895 | an environment variable SASL\_CONF\_PATH can be used to make it |
| 3896 | search alternate locations for the service config. While some |
| 3897 | SASL auth methods can also provide data encryption (eg GSSAPI), |
| 3898 | it is recommended that SASL always be combined with the 'tls' |
| 3899 | and 'x509' settings to enable use of SSL and server |
| 3900 | certificates. This ensures a data encryption preventing |
| 3901 | compromise of authentication credentials. See the |
| 3902 | :ref:`vnc_005fsecurity` section for details on |
| 3903 | using SASL authentication. |
| 3904 | |
| 3905 | ``sasl-authz=ID`` |
| 3906 | Provides the ID of the QAuthZ authorization object against which |
| 3907 | the client's SASL username will validated. This object is only |
| 3908 | resolved at time of use, so can be deleted and recreated on the |
| 3909 | fly while the VNC server is active. If missing, it will default |
| 3910 | to denying access. |
| 3911 | |
| 3912 | ``acl`` |
| 3913 | Legacy method for enabling authorization of clients against the |
| 3914 | x509 distinguished name and SASL username. It results in the |
| 3915 | creation of two ``authz-list`` objects with IDs of |
| 3916 | ``vnc.username`` and ``vnc.x509dname``. The rules for these |
| 3917 | objects must be configured with the HMP ACL commands. |
| 3918 | |
| 3919 | This option is deprecated and should no longer be used. The new |
| 3920 | ``sasl-authz`` and ``tls-authz`` options are a replacement. |
| 3921 | |
| 3922 | ``lossy`` |
| 3923 | Enable lossy compression methods (gradient, JPEG, ...). If this |
| 3924 | option is set, VNC client may receive lossy framebuffer updates |
| 3925 | depending on its encoding settings. Enabling this option can |
| 3926 | save a lot of bandwidth at the expense of quality. |
| 3927 | |
| 3928 | ``non-adaptive`` |
| 3929 | Disable adaptive encodings. Adaptive encodings are enabled by |
| 3930 | default. An adaptive encoding will try to detect frequently |
| 3931 | updated screen regions, and send updates in these regions using |
| 3932 | a lossy encoding (like JPEG). This can be really helpful to save |
| 3933 | bandwidth when playing videos. Disabling adaptive encodings |
| 3934 | restores the original static behavior of encodings like Tight. |
| 3935 | |
| 3936 | ``share=[allow-exclusive|force-shared|ignore]`` |
| 3937 | Set display sharing policy. 'allow-exclusive' allows clients to |
| 3938 | ask for exclusive access. As suggested by the rfb spec this is |
| 3939 | implemented by dropping other connections. Connecting multiple |
| 3940 | clients in parallel requires all clients asking for a shared |
| 3941 | session (vncviewer: -shared switch). This is the default. |
| 3942 | 'force-shared' disables exclusive client access. Useful for |
| 3943 | shared desktop sessions, where you don't want someone forgetting |
| 3944 | specify -shared disconnect everybody else. 'ignore' completely |
| 3945 | ignores the shared flag and allows everybody connect |
| 3946 | unconditionally. Doesn't conform to the rfb spec but is |
| 3947 | traditional QEMU behavior. |
| 3948 | |
| 3949 | ``key-delay-ms`` |
| 3950 | Set keyboard delay, for key down and key up events, in |
| 3951 | milliseconds. Default is 10. Keyboards are low-bandwidth |
| 3952 | devices, so this slowdown can help the device and guest to keep |
| 3953 | up and not lose events in case events are arriving in bulk. |
| 3954 | Possible causes for the latter are flaky network connections, or |
| 3955 | scripts for automated testing. |
| 3956 | |
| 3957 | ``audiodev=audiodev`` |
| 3958 | Use the specified audiodev when the VNC client requests audio |
| 3959 | transmission. When not using an -audiodev argument, this option |
| 3960 | must be omitted, otherwise is must be present and specify a |
| 3961 | valid audiodev. |
| 3962 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3963 | |
| 3964 | STEXI |
| 3965 | @end table |
| 3966 | ETEXI |
Michael Ellerman | a3adb7a | 2011-12-19 17:19:31 +1100 | [diff] [blame] | 3967 | ARCHHEADING(, QEMU_ARCH_I386) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3968 | |
Markus Armbruster | de6b4f9 | 2017-10-02 16:03:00 +0200 | [diff] [blame] | 3969 | ARCHHEADING(i386 target only:, QEMU_ARCH_I386) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3970 | STEXI |
| 3971 | @table @option |
| 3972 | ETEXI |
| 3973 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3974 | DEF("win2k-hack", 0, QEMU_OPTION_win2k_hack, |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 3975 | "-win2k-hack use it when installing Windows 2000 to avoid a disk full bug\n", |
| 3976 | QEMU_ARCH_I386) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3977 | STEXI |
| 3978 | @item -win2k-hack |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 3979 | @findex -win2k-hack |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3980 | Use it when installing Windows 2000 to avoid a disk full bug. After |
| 3981 | Windows 2000 is installed, you no longer need this option (this option |
| 3982 | slows down the IDE transfers). |
| 3983 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 3984 | SRST |
| 3985 | ``-win2k-hack`` |
| 3986 | Use it when installing Windows 2000 to avoid a disk full bug. After |
| 3987 | Windows 2000 is installed, you no longer need this option (this |
| 3988 | option slows down the IDE transfers). |
| 3989 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3990 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3991 | DEF("no-fd-bootchk", 0, QEMU_OPTION_no_fd_bootchk, |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 3992 | "-no-fd-bootchk disable boot signature checking for floppy disks\n", |
| 3993 | QEMU_ARCH_I386) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3994 | STEXI |
| 3995 | @item -no-fd-bootchk |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 3996 | @findex -no-fd-bootchk |
Markus Armbruster | 4eda32f | 2013-06-14 13:15:06 +0200 | [diff] [blame] | 3997 | Disable boot signature checking for floppy disks in BIOS. May |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 3998 | be needed to boot from old floppy disks. |
| 3999 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 4000 | SRST |
| 4001 | ``-no-fd-bootchk`` |
| 4002 | Disable boot signature checking for floppy disks in BIOS. May be |
| 4003 | needed to boot from old floppy disks. |
| 4004 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4005 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4006 | DEF("no-acpi", 0, QEMU_OPTION_no_acpi, |
Shannon Zhao | f5d8c8c | 2015-05-29 11:28:54 +0100 | [diff] [blame] | 4007 | "-no-acpi disable ACPI\n", QEMU_ARCH_I386 | QEMU_ARCH_ARM) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4008 | STEXI |
| 4009 | @item -no-acpi |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 4010 | @findex -no-acpi |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4011 | Disable ACPI (Advanced Configuration and Power Interface) support. Use |
| 4012 | it if your guest OS complains about ACPI problems (PC target machine |
| 4013 | only). |
| 4014 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 4015 | SRST |
| 4016 | ``-no-acpi`` |
| 4017 | Disable ACPI (Advanced Configuration and Power Interface) support. |
| 4018 | Use it if your guest OS complains about ACPI problems (PC target |
| 4019 | machine only). |
| 4020 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4021 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4022 | DEF("no-hpet", 0, QEMU_OPTION_no_hpet, |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 4023 | "-no-hpet disable HPET\n", QEMU_ARCH_I386) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4024 | STEXI |
| 4025 | @item -no-hpet |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 4026 | @findex -no-hpet |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4027 | Disable HPET support. |
| 4028 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 4029 | SRST |
| 4030 | ``-no-hpet`` |
| 4031 | Disable HPET support. |
| 4032 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4033 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4034 | DEF("acpitable", HAS_ARG, QEMU_OPTION_acpitable, |
Michael Tokarev | 104bf02 | 2011-05-12 18:44:17 +0400 | [diff] [blame] | 4035 | "-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" |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 4036 | " ACPI table description\n", QEMU_ARCH_I386) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4037 | STEXI |
| 4038 | @item -acpitable [sig=@var{str}][,rev=@var{n}][,oem_id=@var{str}][,oem_table_id=@var{str}][,oem_rev=@var{n}] [,asl_compiler_id=@var{str}][,asl_compiler_rev=@var{n}][,data=@var{file1}[:@var{file2}]...] |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 4039 | @findex -acpitable |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4040 | Add ACPI table with specified header fields and context from specified files. |
Michael Tokarev | 104bf02 | 2011-05-12 18:44:17 +0400 | [diff] [blame] | 4041 | For file=, take whole ACPI table from the specified files, including all |
| 4042 | ACPI headers (possible overridden by other options). |
| 4043 | For data=, only data |
| 4044 | portion of the table is used, all header information is specified in the |
| 4045 | command line. |
Laszlo Ersek | ae12374 | 2016-01-18 15:12:13 +0100 | [diff] [blame] | 4046 | If a SLIC table is supplied to QEMU, then the SLIC's oem_id and oem_table_id |
| 4047 | fields will override the same in the RSDT and the FADT (a.k.a. FACP), in order |
| 4048 | to ensure the field matches required by the Microsoft SLIC spec and the ACPI |
| 4049 | spec. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4050 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 4051 | SRST |
| 4052 | ``-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]...]`` |
| 4053 | Add ACPI table with specified header fields and context from |
| 4054 | specified files. For file=, take whole ACPI table from the specified |
| 4055 | files, including all ACPI headers (possible overridden by other |
| 4056 | options). For data=, only data portion of the table is used, all |
| 4057 | header information is specified in the command line. If a SLIC table |
| 4058 | is supplied to QEMU, then the SLIC's oem\_id and oem\_table\_id |
| 4059 | fields will override the same in the RSDT and the FADT (a.k.a. |
| 4060 | FACP), in order to ensure the field matches required by the |
| 4061 | Microsoft SLIC spec and the ACPI spec. |
| 4062 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4063 | |
aliguori | b6f6e3d | 2009-04-17 18:59:56 +0000 | [diff] [blame] | 4064 | DEF("smbios", HAS_ARG, QEMU_OPTION_smbios, |
| 4065 | "-smbios file=binary\n" |
Bruce Rogers | ca1a8a0 | 2010-01-06 12:33:57 -0700 | [diff] [blame] | 4066 | " load SMBIOS entry from binary file\n" |
Gabriel L. Somlo | b155eb1 | 2015-02-05 11:45:30 -0500 | [diff] [blame] | 4067 | "-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]\n" |
| 4068 | " [,uefi=on|off]\n" |
Bruce Rogers | ca1a8a0 | 2010-01-06 12:33:57 -0700 | [diff] [blame] | 4069 | " specify SMBIOS type 0 fields\n" |
aliguori | b6f6e3d | 2009-04-17 18:59:56 +0000 | [diff] [blame] | 4070 | "-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]\n" |
| 4071 | " [,uuid=uuid][,sku=str][,family=str]\n" |
Gabriel L. Somlo | b155eb1 | 2015-02-05 11:45:30 -0500 | [diff] [blame] | 4072 | " specify SMBIOS type 1 fields\n" |
| 4073 | "-smbios type=2[,manufacturer=str][,product=str][,version=str][,serial=str]\n" |
| 4074 | " [,asset=str][,location=str]\n" |
| 4075 | " specify SMBIOS type 2 fields\n" |
| 4076 | "-smbios type=3[,manufacturer=str][,version=str][,serial=str][,asset=str]\n" |
| 4077 | " [,sku=str]\n" |
| 4078 | " specify SMBIOS type 3 fields\n" |
| 4079 | "-smbios type=4[,sock_pfx=str][,manufacturer=str][,version=str][,serial=str]\n" |
| 4080 | " [,asset=str][,part=str]\n" |
| 4081 | " specify SMBIOS type 4 fields\n" |
| 4082 | "-smbios type=17[,loc_pfx=str][,bank=str][,manufacturer=str][,serial=str]\n" |
Gabriel L. Somlo | 3ebd6cc | 2015-03-11 13:58:01 -0400 | [diff] [blame] | 4083 | " [,asset=str][,part=str][,speed=%d]\n" |
Gabriel L. Somlo | b155eb1 | 2015-02-05 11:45:30 -0500 | [diff] [blame] | 4084 | " specify SMBIOS type 17 fields\n", |
Wei Huang | c30e156 | 2015-09-07 10:39:29 +0100 | [diff] [blame] | 4085 | QEMU_ARCH_I386 | QEMU_ARCH_ARM) |
aliguori | b6f6e3d | 2009-04-17 18:59:56 +0000 | [diff] [blame] | 4086 | STEXI |
| 4087 | @item -smbios file=@var{binary} |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 4088 | @findex -smbios |
aliguori | b6f6e3d | 2009-04-17 18:59:56 +0000 | [diff] [blame] | 4089 | Load SMBIOS entry from binary file. |
| 4090 | |
Gabriel L. Somlo | 8435184 | 2014-05-19 10:09:54 -0400 | [diff] [blame] | 4091 | @item -smbios type=0[,vendor=@var{str}][,version=@var{str}][,date=@var{str}][,release=@var{%d.%d}][,uefi=on|off] |
aliguori | b6f6e3d | 2009-04-17 18:59:56 +0000 | [diff] [blame] | 4092 | Specify SMBIOS type 0 fields |
| 4093 | |
Gabriel L. Somlo | b155eb1 | 2015-02-05 11:45:30 -0500 | [diff] [blame] | 4094 | @item -smbios type=1[,manufacturer=@var{str}][,product=@var{str}][,version=@var{str}][,serial=@var{str}][,uuid=@var{uuid}][,sku=@var{str}][,family=@var{str}] |
aliguori | b6f6e3d | 2009-04-17 18:59:56 +0000 | [diff] [blame] | 4095 | Specify SMBIOS type 1 fields |
Gabriel L. Somlo | b155eb1 | 2015-02-05 11:45:30 -0500 | [diff] [blame] | 4096 | |
Igor Mammedov | 3fdbd1d | 2019-05-21 16:23:31 +0200 | [diff] [blame] | 4097 | @item -smbios type=2[,manufacturer=@var{str}][,product=@var{str}][,version=@var{str}][,serial=@var{str}][,asset=@var{str}][,location=@var{str}] |
Gabriel L. Somlo | b155eb1 | 2015-02-05 11:45:30 -0500 | [diff] [blame] | 4098 | Specify SMBIOS type 2 fields |
| 4099 | |
| 4100 | @item -smbios type=3[,manufacturer=@var{str}][,version=@var{str}][,serial=@var{str}][,asset=@var{str}][,sku=@var{str}] |
| 4101 | Specify SMBIOS type 3 fields |
| 4102 | |
| 4103 | @item -smbios type=4[,sock_pfx=@var{str}][,manufacturer=@var{str}][,version=@var{str}][,serial=@var{str}][,asset=@var{str}][,part=@var{str}] |
| 4104 | Specify SMBIOS type 4 fields |
| 4105 | |
Gabriel L. Somlo | 3ebd6cc | 2015-03-11 13:58:01 -0400 | [diff] [blame] | 4106 | @item -smbios type=17[,loc_pfx=@var{str}][,bank=@var{str}][,manufacturer=@var{str}][,serial=@var{str}][,asset=@var{str}][,part=@var{str}][,speed=@var{%d}] |
Gabriel L. Somlo | b155eb1 | 2015-02-05 11:45:30 -0500 | [diff] [blame] | 4107 | Specify SMBIOS type 17 fields |
aliguori | b6f6e3d | 2009-04-17 18:59:56 +0000 | [diff] [blame] | 4108 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 4109 | SRST |
| 4110 | ``-smbios file=binary`` |
| 4111 | Load SMBIOS entry from binary file. |
| 4112 | |
| 4113 | ``-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d][,uefi=on|off]`` |
| 4114 | Specify SMBIOS type 0 fields |
| 4115 | |
| 4116 | ``-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str][,uuid=uuid][,sku=str][,family=str]`` |
| 4117 | Specify SMBIOS type 1 fields |
| 4118 | |
| 4119 | ``-smbios type=2[,manufacturer=str][,product=str][,version=str][,serial=str][,asset=str][,location=str]`` |
| 4120 | Specify SMBIOS type 2 fields |
| 4121 | |
| 4122 | ``-smbios type=3[,manufacturer=str][,version=str][,serial=str][,asset=str][,sku=str]`` |
| 4123 | Specify SMBIOS type 3 fields |
| 4124 | |
| 4125 | ``-smbios type=4[,sock_pfx=str][,manufacturer=str][,version=str][,serial=str][,asset=str][,part=str]`` |
| 4126 | Specify SMBIOS type 4 fields |
| 4127 | |
| 4128 | ``-smbios type=17[,loc_pfx=str][,bank=str][,manufacturer=str][,serial=str][,asset=str][,part=str][,speed=%d]`` |
| 4129 | Specify SMBIOS type 17 fields |
| 4130 | ERST |
aliguori | b6f6e3d | 2009-04-17 18:59:56 +0000 | [diff] [blame] | 4131 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4132 | STEXI |
| 4133 | @end table |
| 4134 | ETEXI |
Markus Armbruster | c70a01e | 2013-02-13 19:49:40 +0100 | [diff] [blame] | 4135 | DEFHEADING() |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4136 | |
Markus Armbruster | de6b4f9 | 2017-10-02 16:03:00 +0200 | [diff] [blame] | 4137 | DEFHEADING(Network options:) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4138 | STEXI |
| 4139 | @table @option |
| 4140 | ETEXI |
| 4141 | |
Thomas Huth | 6a8b4a5 | 2015-05-15 16:58:24 +0200 | [diff] [blame] | 4142 | DEF("netdev", HAS_ARG, QEMU_OPTION_netdev, |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4143 | #ifdef CONFIG_SLIRP |
Samuel Thibault | 0b11c03 | 2016-03-20 12:29:54 +0100 | [diff] [blame] | 4144 | "-netdev user,id=str[,ipv4[=on|off]][,net=addr[/mask]][,host=addr]\n" |
| 4145 | " [,ipv6[=on|off]][,ipv6-net=addr[/int]][,ipv6-host=addr]\n" |
| 4146 | " [,restrict=on|off][,hostname=host][,dhcpstart=addr]\n" |
Benjamin Drung | f18d137 | 2018-02-27 17:06:01 +0100 | [diff] [blame] | 4147 | " [,dns=addr][,ipv6-dns=addr][,dnssearch=domain][,domainname=domain]\n" |
Fam Zheng | 0fca92b | 2018-09-14 15:26:16 +0800 | [diff] [blame] | 4148 | " [,tftp=dir][,tftp-server-name=name][,bootfile=f][,hostfwd=rule][,guestfwd=rule]" |
Jan Kiszka | ad196a9 | 2009-06-24 14:42:28 +0200 | [diff] [blame] | 4149 | #ifndef _WIN32 |
Jan Kiszka | c92ef6a | 2009-06-24 14:42:28 +0200 | [diff] [blame] | 4150 | "[,smb=dir[,smbserver=addr]]\n" |
Jan Kiszka | ad196a9 | 2009-06-24 14:42:28 +0200 | [diff] [blame] | 4151 | #endif |
Thomas Huth | 6a8b4a5 | 2015-05-15 16:58:24 +0200 | [diff] [blame] | 4152 | " configure a user mode network backend with ID 'str',\n" |
| 4153 | " its DHCP server and optional services\n" |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4154 | #endif |
| 4155 | #ifdef _WIN32 |
Thomas Huth | 6a8b4a5 | 2015-05-15 16:58:24 +0200 | [diff] [blame] | 4156 | "-netdev tap,id=str,ifname=name\n" |
| 4157 | " configure a host TAP network backend with ID 'str'\n" |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4158 | #else |
Thomas Huth | 6a8b4a5 | 2015-05-15 16:58:24 +0200 | [diff] [blame] | 4159 | "-netdev tap,id=str[,fd=h][,fds=x:y:...:z][,ifname=name][,script=file][,downscript=dfile]\n" |
Alexey Kardashevskiy | 584613e | 2016-09-13 17:11:54 +1000 | [diff] [blame] | 4160 | " [,br=bridge][,helper=helper][,sndbuf=nbytes][,vnet_hdr=on|off][,vhost=on|off]\n" |
Thomas Huth | 6a8b4a5 | 2015-05-15 16:58:24 +0200 | [diff] [blame] | 4161 | " [,vhostfd=h][,vhostfds=x:y:...:z][,vhostforce=on|off][,queues=n]\n" |
Jason Wang | 69e87b3 | 2016-07-06 09:57:55 +0800 | [diff] [blame] | 4162 | " [,poll-us=n]\n" |
Thomas Huth | 6a8b4a5 | 2015-05-15 16:58:24 +0200 | [diff] [blame] | 4163 | " configure a host TAP network backend with ID 'str'\n" |
Alexey Kardashevskiy | 584613e | 2016-09-13 17:11:54 +1000 | [diff] [blame] | 4164 | " connected to a bridge (default=" DEFAULT_BRIDGE_INTERFACE ")\n" |
Corey Bryant | a7c36ee | 2012-01-26 09:42:27 -0500 | [diff] [blame] | 4165 | " use network scripts 'file' (default=" DEFAULT_NETWORK_SCRIPT ")\n" |
| 4166 | " to configure it and 'dfile' (default=" DEFAULT_NETWORK_DOWN_SCRIPT ")\n" |
| 4167 | " to deconfigure it\n" |
Bruce Rogers | ca1a8a0 | 2010-01-06 12:33:57 -0700 | [diff] [blame] | 4168 | " use '[down]script=no' to disable script execution\n" |
Corey Bryant | a7c36ee | 2012-01-26 09:42:27 -0500 | [diff] [blame] | 4169 | " use network helper 'helper' (default=" DEFAULT_BRIDGE_HELPER ") to\n" |
| 4170 | " configure it\n" |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4171 | " use 'fd=h' to connect to an already opened TAP interface\n" |
Jason Wang | 2ca81ba | 2013-02-20 18:04:01 +0800 | [diff] [blame] | 4172 | " use 'fds=x:y:...:z' to connect to already opened multiqueue capable TAP interfaces\n" |
Bruce Rogers | ca1a8a0 | 2010-01-06 12:33:57 -0700 | [diff] [blame] | 4173 | " use 'sndbuf=nbytes' to limit the size of the send buffer (the\n" |
Michael S. Tsirkin | f157ed2 | 2011-02-01 14:25:40 +0200 | [diff] [blame] | 4174 | " default is disabled 'sndbuf=0' to enable flow control set 'sndbuf=1048576')\n" |
Bruce Rogers | ca1a8a0 | 2010-01-06 12:33:57 -0700 | [diff] [blame] | 4175 | " use vnet_hdr=off to avoid enabling the IFF_VNET_HDR tap flag\n" |
| 4176 | " use vnet_hdr=on to make the lack of IFF_VNET_HDR support an error condition\n" |
Michael S. Tsirkin | 82b0d80 | 2010-03-17 13:08:24 +0200 | [diff] [blame] | 4177 | " use vhost=on to enable experimental in kernel accelerator\n" |
mst@redhat.com | 5430a28 | 2011-02-01 22:13:42 +0200 | [diff] [blame] | 4178 | " (only has effect for virtio guests which use MSIX)\n" |
| 4179 | " use vhostforce=on to force vhost on for non-MSIX virtio guests\n" |
Michael S. Tsirkin | 82b0d80 | 2010-03-17 13:08:24 +0200 | [diff] [blame] | 4180 | " use 'vhostfd=h' to connect to an already opened vhost net device\n" |
Jason Wang | 2ca81ba | 2013-02-20 18:04:01 +0800 | [diff] [blame] | 4181 | " use 'vhostfds=x:y:...:z to connect to multiple already opened vhost net devices\n" |
Jason Wang | ec39601 | 2013-02-22 22:57:52 +0800 | [diff] [blame] | 4182 | " use 'queues=n' to specify the number of queues to be created for multiqueue TAP\n" |
Jason Wang | 69e87b3 | 2016-07-06 09:57:55 +0800 | [diff] [blame] | 4183 | " use 'poll-us=n' to speciy the maximum number of microseconds that could be\n" |
| 4184 | " spent on busy polling for vhost net\n" |
Thomas Huth | 6a8b4a5 | 2015-05-15 16:58:24 +0200 | [diff] [blame] | 4185 | "-netdev bridge,id=str[,br=bridge][,helper=helper]\n" |
| 4186 | " configure a host TAP network backend with ID 'str' that is\n" |
| 4187 | " connected to a bridge (default=" DEFAULT_BRIDGE_INTERFACE ")\n" |
| 4188 | " using the program 'helper (default=" DEFAULT_BRIDGE_HELPER ")\n" |
Mark McLoughlin | 0df0ff6 | 2009-06-18 18:21:34 +0100 | [diff] [blame] | 4189 | #endif |
Anton Ivanov | 3fb69aa | 2014-06-20 10:34:41 +0100 | [diff] [blame] | 4190 | #ifdef __linux__ |
Thomas Huth | 6a8b4a5 | 2015-05-15 16:58:24 +0200 | [diff] [blame] | 4191 | "-netdev l2tpv3,id=str,src=srcaddr,dst=dstaddr[,srcport=srcport][,dstport=dstport]\n" |
| 4192 | " [,rxsession=rxsession],txsession=txsession[,ipv6=on/off][,udp=on/off]\n" |
| 4193 | " [,cookie64=on/off][,counter][,pincounter][,txcookie=txcookie]\n" |
| 4194 | " [,rxcookie=rxcookie][,offset=offset]\n" |
| 4195 | " configure a network backend with ID 'str' connected to\n" |
| 4196 | " an Ethernet over L2TPv3 pseudowire.\n" |
Anton Ivanov | 3fb69aa | 2014-06-20 10:34:41 +0100 | [diff] [blame] | 4197 | " Linux kernel 3.3+ as well as most routers can talk\n" |
Michael Tokarev | 2f47b40 | 2014-07-24 20:10:17 +0400 | [diff] [blame] | 4198 | " L2TPv3. This transport allows connecting a VM to a VM,\n" |
Anton Ivanov | 3fb69aa | 2014-06-20 10:34:41 +0100 | [diff] [blame] | 4199 | " VM to a router and even VM to Host. It is a nearly-universal\n" |
Stefan Hajnoczi | 21843dc | 2020-02-29 11:17:27 +0000 | [diff] [blame] | 4200 | " standard (RFC3931). Note - this implementation uses static\n" |
Anton Ivanov | 3fb69aa | 2014-06-20 10:34:41 +0100 | [diff] [blame] | 4201 | " pre-configured tunnels (same as the Linux kernel).\n" |
| 4202 | " use 'src=' to specify source address\n" |
| 4203 | " use 'dst=' to specify destination address\n" |
| 4204 | " use 'udp=on' to specify udp encapsulation\n" |
Gonglei | 3952651 | 2014-08-14 14:35:48 +0800 | [diff] [blame] | 4205 | " use 'srcport=' to specify source udp port\n" |
Anton Ivanov | 3fb69aa | 2014-06-20 10:34:41 +0100 | [diff] [blame] | 4206 | " use 'dstport=' to specify destination udp port\n" |
| 4207 | " use 'ipv6=on' to force v6\n" |
| 4208 | " L2TPv3 uses cookies to prevent misconfiguration as\n" |
| 4209 | " well as a weak security measure\n" |
| 4210 | " use 'rxcookie=0x012345678' to specify a rxcookie\n" |
| 4211 | " use 'txcookie=0x012345678' to specify a txcookie\n" |
| 4212 | " use 'cookie64=on' to set cookie size to 64 bit, otherwise 32\n" |
| 4213 | " use 'counter=off' to force a 'cut-down' L2TPv3 with no counter\n" |
| 4214 | " use 'pincounter=on' to work around broken counter handling in peer\n" |
| 4215 | " use 'offset=X' to add an extra offset between header and data\n" |
| 4216 | #endif |
Thomas Huth | 6a8b4a5 | 2015-05-15 16:58:24 +0200 | [diff] [blame] | 4217 | "-netdev socket,id=str[,fd=h][,listen=[host]:port][,connect=host:port]\n" |
| 4218 | " configure a network backend to connect to another network\n" |
| 4219 | " using a socket connection\n" |
| 4220 | "-netdev socket,id=str[,fd=h][,mcast=maddr:port[,localaddr=addr]]\n" |
| 4221 | " configure a network backend to connect to a multicast maddr and port\n" |
Mike Ryan | 3a75e74 | 2010-12-01 11:16:47 -0800 | [diff] [blame] | 4222 | " use 'localaddr=addr' to specify the host address to send packets from\n" |
Thomas Huth | 6a8b4a5 | 2015-05-15 16:58:24 +0200 | [diff] [blame] | 4223 | "-netdev socket,id=str[,fd=h][,udp=host:port][,localaddr=host:port]\n" |
| 4224 | " configure a network backend to connect to another network\n" |
| 4225 | " using an UDP tunnel\n" |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4226 | #ifdef CONFIG_VDE |
Thomas Huth | 6a8b4a5 | 2015-05-15 16:58:24 +0200 | [diff] [blame] | 4227 | "-netdev vde,id=str[,sock=socketpath][,port=n][,group=groupname][,mode=octalmode]\n" |
| 4228 | " configure a network backend to connect to port 'n' of a vde switch\n" |
| 4229 | " running on host and listening for incoming connections on 'socketpath'.\n" |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4230 | " Use group 'groupname' and mode 'octalmode' to change default\n" |
| 4231 | " ownership and permissions for communication port.\n" |
| 4232 | #endif |
Vincenzo Maffione | 5895213 | 2013-11-06 11:44:06 +0100 | [diff] [blame] | 4233 | #ifdef CONFIG_NETMAP |
Thomas Huth | 6a8b4a5 | 2015-05-15 16:58:24 +0200 | [diff] [blame] | 4234 | "-netdev netmap,id=str,ifname=name[,devname=nmname]\n" |
Vincenzo Maffione | 5895213 | 2013-11-06 11:44:06 +0100 | [diff] [blame] | 4235 | " attach to the existing netmap-enabled network interface 'name', or to a\n" |
| 4236 | " VALE port (created on the fly) called 'name' ('nmname' is name of the \n" |
| 4237 | " netmap device, defaults to '/dev/netmap')\n" |
| 4238 | #endif |
Thomas Huth | 253dc14 | 2018-02-21 11:18:32 +0100 | [diff] [blame] | 4239 | #ifdef CONFIG_POSIX |
Thomas Huth | 6a8b4a5 | 2015-05-15 16:58:24 +0200 | [diff] [blame] | 4240 | "-netdev vhost-user,id=str,chardev=dev[,vhostforce=on|off]\n" |
| 4241 | " configure a vhost-user network, backed by a chardev 'dev'\n" |
Thomas Huth | 253dc14 | 2018-02-21 11:18:32 +0100 | [diff] [blame] | 4242 | #endif |
Thomas Huth | 18d65d2 | 2018-01-15 20:50:55 +0100 | [diff] [blame] | 4243 | "-netdev hubport,id=str,hubid=n[,netdev=nd]\n" |
Thomas Huth | af1a5c3 | 2018-04-30 20:02:23 +0200 | [diff] [blame] | 4244 | " configure a hub port on the hub with ID 'n'\n", QEMU_ARCH_ALL) |
Thomas Huth | 78cd6f7 | 2018-02-21 11:18:36 +0100 | [diff] [blame] | 4245 | DEF("nic", HAS_ARG, QEMU_OPTION_nic, |
BALATON Zoltan | dfaa7d5 | 2018-07-16 21:12:08 +0200 | [diff] [blame] | 4246 | "-nic [tap|bridge|" |
Thomas Huth | 78cd6f7 | 2018-02-21 11:18:36 +0100 | [diff] [blame] | 4247 | #ifdef CONFIG_SLIRP |
| 4248 | "user|" |
| 4249 | #endif |
| 4250 | #ifdef __linux__ |
| 4251 | "l2tpv3|" |
| 4252 | #endif |
| 4253 | #ifdef CONFIG_VDE |
| 4254 | "vde|" |
| 4255 | #endif |
| 4256 | #ifdef CONFIG_NETMAP |
| 4257 | "netmap|" |
| 4258 | #endif |
| 4259 | #ifdef CONFIG_POSIX |
| 4260 | "vhost-user|" |
| 4261 | #endif |
| 4262 | "socket][,option][,...][mac=macaddr]\n" |
| 4263 | " initialize an on-board / default host NIC (using MAC address\n" |
| 4264 | " macaddr) and connect it to the given host network backend\n" |
BALATON Zoltan | dfaa7d5 | 2018-07-16 21:12:08 +0200 | [diff] [blame] | 4265 | "-nic none use it alone to have zero network devices (the default is to\n" |
Thomas Huth | 78cd6f7 | 2018-02-21 11:18:36 +0100 | [diff] [blame] | 4266 | " provided a 'user' network connection)\n", |
| 4267 | QEMU_ARCH_ALL) |
Thomas Huth | 6a8b4a5 | 2015-05-15 16:58:24 +0200 | [diff] [blame] | 4268 | DEF("net", HAS_ARG, QEMU_OPTION_net, |
Thomas Huth | af1a5c3 | 2018-04-30 20:02:23 +0200 | [diff] [blame] | 4269 | "-net nic[,macaddr=mac][,model=type][,name=str][,addr=str][,vectors=v]\n" |
Thomas Huth | 0e60a82 | 2017-12-19 16:28:55 +0100 | [diff] [blame] | 4270 | " configure or create an on-board (or machine default) NIC and\n" |
Thomas Huth | af1a5c3 | 2018-04-30 20:02:23 +0200 | [diff] [blame] | 4271 | " connect it to hub 0 (please use -nic unless you need a hub)\n" |
Thomas Huth | 6a8b4a5 | 2015-05-15 16:58:24 +0200 | [diff] [blame] | 4272 | "-net [" |
Mark McLoughlin | a1ea458 | 2009-10-08 19:58:26 +0100 | [diff] [blame] | 4273 | #ifdef CONFIG_SLIRP |
| 4274 | "user|" |
| 4275 | #endif |
| 4276 | "tap|" |
Corey Bryant | a7c36ee | 2012-01-26 09:42:27 -0500 | [diff] [blame] | 4277 | "bridge|" |
Mark McLoughlin | a1ea458 | 2009-10-08 19:58:26 +0100 | [diff] [blame] | 4278 | #ifdef CONFIG_VDE |
| 4279 | "vde|" |
| 4280 | #endif |
Vincenzo Maffione | 5895213 | 2013-11-06 11:44:06 +0100 | [diff] [blame] | 4281 | #ifdef CONFIG_NETMAP |
| 4282 | "netmap|" |
| 4283 | #endif |
Thomas Huth | af1a5c3 | 2018-04-30 20:02:23 +0200 | [diff] [blame] | 4284 | "socket][,option][,option][,...]\n" |
Thomas Huth | 6a8b4a5 | 2015-05-15 16:58:24 +0200 | [diff] [blame] | 4285 | " old way to initialize a host network interface\n" |
| 4286 | " (use the -netdev option if possible instead)\n", QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4287 | STEXI |
Thomas Huth | abbbb03 | 2018-03-12 13:20:50 +0100 | [diff] [blame] | 4288 | @item -nic [tap|bridge|user|l2tpv3|vde|netmap|vhost-user|socket][,...][,mac=macaddr][,model=mn] |
| 4289 | @findex -nic |
| 4290 | This option is a shortcut for configuring both the on-board (default) guest |
| 4291 | NIC hardware and the host network backend in one go. The host backend options |
| 4292 | are the same as with the corresponding @option{-netdev} options below. |
| 4293 | The guest NIC model can be set with @option{model=@var{modelname}}. |
| 4294 | Use @option{model=help} to list the available device types. |
| 4295 | The hardware MAC address can be set with @option{mac=@var{macaddr}}. |
| 4296 | |
| 4297 | The following two example do exactly the same, to show how @option{-nic} can |
Daniel P. Berrangé | 416b719 | 2020-01-09 12:24:05 +0000 | [diff] [blame] | 4298 | be used to shorten the command line length: |
Thomas Huth | abbbb03 | 2018-03-12 13:20:50 +0100 | [diff] [blame] | 4299 | @example |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 4300 | @value{qemu_system} -netdev user,id=n1,ipv6=off -device e1000,netdev=n1,mac=52:54:98:76:54:32 |
| 4301 | @value{qemu_system} -nic user,ipv6=off,model=e1000,mac=52:54:98:76:54:32 |
Thomas Huth | abbbb03 | 2018-03-12 13:20:50 +0100 | [diff] [blame] | 4302 | @end example |
| 4303 | |
| 4304 | @item -nic none |
| 4305 | Indicate that no network devices should be configured. It is used to override |
| 4306 | the default configuration (default NIC with ``user'' host network backend) |
| 4307 | which is activated if no other networking options are provided. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4308 | |
Stefan Hajnoczi | 08d1202 | 2012-08-14 14:14:27 +0100 | [diff] [blame] | 4309 | @item -netdev user,id=@var{id}[,@var{option}][,@var{option}][,...] |
Markus Armbruster | b8f490e | 2013-02-13 19:49:38 +0100 | [diff] [blame] | 4310 | @findex -netdev |
Thomas Huth | abbbb03 | 2018-03-12 13:20:50 +0100 | [diff] [blame] | 4311 | Configure user mode host network backend which requires no administrator |
Jan Kiszka | ad196a9 | 2009-06-24 14:42:28 +0200 | [diff] [blame] | 4312 | privilege to run. Valid options are: |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4313 | |
Kevin Wolf | b3f046c | 2009-10-09 10:58:35 +0200 | [diff] [blame] | 4314 | @table @option |
Stefan Hajnoczi | 08d1202 | 2012-08-14 14:14:27 +0100 | [diff] [blame] | 4315 | @item id=@var{id} |
Jan Kiszka | ad196a9 | 2009-06-24 14:42:28 +0200 | [diff] [blame] | 4316 | Assign symbolic name for use in monitor commands. |
| 4317 | |
Thomas Huth | abbbb03 | 2018-03-12 13:20:50 +0100 | [diff] [blame] | 4318 | @item ipv4=on|off and ipv6=on|off |
| 4319 | Specify that either IPv4 or IPv6 must be enabled. If neither is specified |
| 4320 | both protocols are enabled. |
Samuel Thibault | 0b11c03 | 2016-03-20 12:29:54 +0100 | [diff] [blame] | 4321 | |
Jan Kiszka | c92ef6a | 2009-06-24 14:42:28 +0200 | [diff] [blame] | 4322 | @item net=@var{addr}[/@var{mask}] |
| 4323 | Set IP network address the guest will see. Optionally specify the netmask, |
| 4324 | either in the form a.b.c.d or as number of valid top-most bits. Default is |
Brad Hards | b0b36e5 | 2011-04-24 17:19:56 +1000 | [diff] [blame] | 4325 | 10.0.2.0/24. |
Jan Kiszka | c92ef6a | 2009-06-24 14:42:28 +0200 | [diff] [blame] | 4326 | |
| 4327 | @item host=@var{addr} |
| 4328 | Specify the guest-visible address of the host. Default is the 2nd IP in the |
| 4329 | guest network, i.e. x.x.x.2. |
Jan Kiszka | ad196a9 | 2009-06-24 14:42:28 +0200 | [diff] [blame] | 4330 | |
Samuel Thibault | d8eb386 | 2016-03-25 00:02:58 +0100 | [diff] [blame] | 4331 | @item ipv6-net=@var{addr}[/@var{int}] |
| 4332 | Set IPv6 network address the guest will see (default is fec0::/64). The |
| 4333 | network prefix is given in the usual hexadecimal IPv6 address |
| 4334 | notation. The prefix size is optional, and is given as the number of |
| 4335 | valid top-most bits (default is 64). |
Yann Bordenave | 7aac531 | 2016-03-15 10:31:22 +0100 | [diff] [blame] | 4336 | |
Samuel Thibault | d8eb386 | 2016-03-25 00:02:58 +0100 | [diff] [blame] | 4337 | @item ipv6-host=@var{addr} |
Yann Bordenave | 7aac531 | 2016-03-15 10:31:22 +0100 | [diff] [blame] | 4338 | Specify the guest-visible IPv6 address of the host. Default is the 2nd IPv6 in |
| 4339 | the guest network, i.e. xxxx::2. |
| 4340 | |
Jan Kiszka | c54ed5b | 2011-07-20 12:20:14 +0200 | [diff] [blame] | 4341 | @item restrict=on|off |
Brad Hards | caef55e | 2011-06-09 07:50:43 +1000 | [diff] [blame] | 4342 | If this option is enabled, the guest will be isolated, i.e. it will not be |
Jan Kiszka | ad196a9 | 2009-06-24 14:42:28 +0200 | [diff] [blame] | 4343 | able to contact the host and no guest IP packets will be routed over the host |
Brad Hards | caef55e | 2011-06-09 07:50:43 +1000 | [diff] [blame] | 4344 | to the outside. This option does not affect any explicitly set forwarding rules. |
Jan Kiszka | ad196a9 | 2009-06-24 14:42:28 +0200 | [diff] [blame] | 4345 | |
| 4346 | @item hostname=@var{name} |
Klaus Stengel | 63d2960 | 2012-10-27 19:53:39 +0200 | [diff] [blame] | 4347 | Specifies the client hostname reported by the built-in DHCP server. |
Jan Kiszka | ad196a9 | 2009-06-24 14:42:28 +0200 | [diff] [blame] | 4348 | |
Jan Kiszka | c92ef6a | 2009-06-24 14:42:28 +0200 | [diff] [blame] | 4349 | @item dhcpstart=@var{addr} |
| 4350 | Specify the first of the 16 IPs the built-in DHCP server can assign. Default |
Brad Hards | b0b36e5 | 2011-04-24 17:19:56 +1000 | [diff] [blame] | 4351 | is the 15th to 31st IP in the guest network, i.e. x.x.x.15 to x.x.x.31. |
Jan Kiszka | c92ef6a | 2009-06-24 14:42:28 +0200 | [diff] [blame] | 4352 | |
| 4353 | @item dns=@var{addr} |
| 4354 | Specify the guest-visible address of the virtual nameserver. The address must |
| 4355 | be different from the host address. Default is the 3rd IP in the guest network, |
| 4356 | i.e. x.x.x.3. |
| 4357 | |
Samuel Thibault | d8eb386 | 2016-03-25 00:02:58 +0100 | [diff] [blame] | 4358 | @item ipv6-dns=@var{addr} |
Yann Bordenave | 7aac531 | 2016-03-15 10:31:22 +0100 | [diff] [blame] | 4359 | Specify the guest-visible address of the IPv6 virtual nameserver. The address |
| 4360 | must be different from the host address. Default is the 3rd IP in the guest |
| 4361 | network, i.e. xxxx::3. |
| 4362 | |
Klaus Stengel | 63d2960 | 2012-10-27 19:53:39 +0200 | [diff] [blame] | 4363 | @item dnssearch=@var{domain} |
| 4364 | Provides an entry for the domain-search list sent by the built-in |
| 4365 | DHCP server. More than one domain suffix can be transmitted by specifying |
| 4366 | this option multiple times. If supported, this will cause the guest to |
| 4367 | automatically try to append the given domain suffix(es) in case a domain name |
| 4368 | can not be resolved. |
| 4369 | |
| 4370 | Example: |
| 4371 | @example |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 4372 | @value{qemu_system} -nic user,dnssearch=mgmt.example.org,dnssearch=example.org |
Klaus Stengel | 63d2960 | 2012-10-27 19:53:39 +0200 | [diff] [blame] | 4373 | @end example |
| 4374 | |
Benjamin Drung | f18d137 | 2018-02-27 17:06:01 +0100 | [diff] [blame] | 4375 | @item domainname=@var{domain} |
| 4376 | Specifies the client domain name reported by the built-in DHCP server. |
| 4377 | |
Jan Kiszka | ad196a9 | 2009-06-24 14:42:28 +0200 | [diff] [blame] | 4378 | @item tftp=@var{dir} |
| 4379 | When using the user mode network stack, activate a built-in TFTP |
| 4380 | server. The files in @var{dir} will be exposed as the root of a TFTP server. |
| 4381 | The TFTP client on the guest must be configured in binary mode (use the command |
Jan Kiszka | c92ef6a | 2009-06-24 14:42:28 +0200 | [diff] [blame] | 4382 | @code{bin} of the Unix TFTP client). |
Jan Kiszka | ad196a9 | 2009-06-24 14:42:28 +0200 | [diff] [blame] | 4383 | |
Fam Zheng | 0fca92b | 2018-09-14 15:26:16 +0800 | [diff] [blame] | 4384 | @item tftp-server-name=@var{name} |
| 4385 | In BOOTP reply, broadcast @var{name} as the "TFTP server name" (RFC2132 option |
| 4386 | 66). This can be used to advise the guest to load boot files or configurations |
| 4387 | from a different server than the host address. |
| 4388 | |
Jan Kiszka | ad196a9 | 2009-06-24 14:42:28 +0200 | [diff] [blame] | 4389 | @item bootfile=@var{file} |
| 4390 | When using the user mode network stack, broadcast @var{file} as the BOOTP |
| 4391 | filename. In conjunction with @option{tftp}, this can be used to network boot |
| 4392 | a guest from a local directory. |
| 4393 | |
| 4394 | Example (using pxelinux): |
| 4395 | @example |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 4396 | @value{qemu_system} -hda linux.img -boot n -device e1000,netdev=n1 \ |
Thomas Huth | abbbb03 | 2018-03-12 13:20:50 +0100 | [diff] [blame] | 4397 | -netdev user,id=n1,tftp=/path/to/tftp/files,bootfile=/pxelinux.0 |
Jan Kiszka | ad196a9 | 2009-06-24 14:42:28 +0200 | [diff] [blame] | 4398 | @end example |
| 4399 | |
Jan Kiszka | c92ef6a | 2009-06-24 14:42:28 +0200 | [diff] [blame] | 4400 | @item smb=@var{dir}[,smbserver=@var{addr}] |
Jan Kiszka | ad196a9 | 2009-06-24 14:42:28 +0200 | [diff] [blame] | 4401 | When using the user mode network stack, activate a built-in SMB |
| 4402 | server so that Windows OSes can access to the host files in @file{@var{dir}} |
Jan Kiszka | c92ef6a | 2009-06-24 14:42:28 +0200 | [diff] [blame] | 4403 | transparently. The IP address of the SMB server can be set to @var{addr}. By |
| 4404 | default the 4th IP in the guest network is used, i.e. x.x.x.4. |
Jan Kiszka | ad196a9 | 2009-06-24 14:42:28 +0200 | [diff] [blame] | 4405 | |
| 4406 | In the guest Windows OS, the line: |
| 4407 | @example |
| 4408 | 10.0.2.4 smbserver |
| 4409 | @end example |
| 4410 | must be added in the file @file{C:\WINDOWS\LMHOSTS} (for windows 9x/Me) |
| 4411 | or @file{C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS} (Windows NT/2000). |
| 4412 | |
| 4413 | Then @file{@var{dir}} can be accessed in @file{\\smbserver\qemu}. |
| 4414 | |
Brad | e2d8830 | 2011-09-02 16:53:28 -0400 | [diff] [blame] | 4415 | Note that a SAMBA server must be installed on the host OS. |
Jan Kiszka | ad196a9 | 2009-06-24 14:42:28 +0200 | [diff] [blame] | 4416 | |
Jan Kiszka | 3c6a058 | 2009-06-24 14:42:28 +0200 | [diff] [blame] | 4417 | @item hostfwd=[tcp|udp]:[@var{hostaddr}]:@var{hostport}-[@var{guestaddr}]:@var{guestport} |
Jan Kiszka | c92ef6a | 2009-06-24 14:42:28 +0200 | [diff] [blame] | 4418 | Redirect incoming TCP or UDP connections to the host port @var{hostport} to |
| 4419 | the guest IP address @var{guestaddr} on guest port @var{guestport}. If |
| 4420 | @var{guestaddr} is not specified, its value is x.x.x.15 (default first address |
Jan Kiszka | 3c6a058 | 2009-06-24 14:42:28 +0200 | [diff] [blame] | 4421 | given by the built-in DHCP server). By specifying @var{hostaddr}, the rule can |
| 4422 | be bound to a specific host interface. If no connection type is set, TCP is |
Jan Kiszka | c92ef6a | 2009-06-24 14:42:28 +0200 | [diff] [blame] | 4423 | used. This option can be given multiple times. |
Jan Kiszka | ad196a9 | 2009-06-24 14:42:28 +0200 | [diff] [blame] | 4424 | |
| 4425 | For example, to redirect host X11 connection from screen 1 to guest |
| 4426 | screen 0, use the following: |
| 4427 | |
| 4428 | @example |
| 4429 | # on the host |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 4430 | @value{qemu_system} -nic user,hostfwd=tcp:127.0.0.1:6001-:6000 |
Jan Kiszka | ad196a9 | 2009-06-24 14:42:28 +0200 | [diff] [blame] | 4431 | # this host xterm should open in the guest X11 server |
| 4432 | xterm -display :1 |
| 4433 | @end example |
| 4434 | |
| 4435 | To redirect telnet connections from host port 5555 to telnet port on |
| 4436 | the guest, use the following: |
| 4437 | |
| 4438 | @example |
| 4439 | # on the host |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 4440 | @value{qemu_system} -nic user,hostfwd=tcp::5555-:23 |
Jan Kiszka | ad196a9 | 2009-06-24 14:42:28 +0200 | [diff] [blame] | 4441 | telnet localhost 5555 |
| 4442 | @end example |
| 4443 | |
| 4444 | Then when you use on the host @code{telnet localhost 5555}, you |
| 4445 | connect to the guest telnet server. |
| 4446 | |
Jan Kiszka | c92ef6a | 2009-06-24 14:42:28 +0200 | [diff] [blame] | 4447 | @item guestfwd=[tcp]:@var{server}:@var{port}-@var{dev} |
Markus Armbruster | f9cfd65 | 2015-06-15 14:35:59 +0200 | [diff] [blame] | 4448 | @itemx guestfwd=[tcp]:@var{server}:@var{port}-@var{cmd:command} |
Jan Kiszka | 3c6a058 | 2009-06-24 14:42:28 +0200 | [diff] [blame] | 4449 | Forward guest TCP connections to the IP address @var{server} on port @var{port} |
Alexander Graf | b412eb6 | 2012-06-03 09:45:01 +0200 | [diff] [blame] | 4450 | to the character device @var{dev} or to a program executed by @var{cmd:command} |
| 4451 | which gets spawned for each connection. This option can be given multiple times. |
| 4452 | |
Stefan Weil | 43ffe61 | 2012-07-20 23:26:02 +0200 | [diff] [blame] | 4453 | You can either use a chardev directly and have that one used throughout QEMU's |
Alexander Graf | b412eb6 | 2012-06-03 09:45:01 +0200 | [diff] [blame] | 4454 | lifetime, like in the following example: |
| 4455 | |
| 4456 | @example |
| 4457 | # open 10.10.1.1:4321 on bootup, connect 10.0.2.100:1234 to it whenever |
| 4458 | # the guest accesses it |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 4459 | @value{qemu_system} -nic user,guestfwd=tcp:10.0.2.100:1234-tcp:10.10.1.1:4321 |
Alexander Graf | b412eb6 | 2012-06-03 09:45:01 +0200 | [diff] [blame] | 4460 | @end example |
| 4461 | |
| 4462 | Or you can execute a command on every TCP connection established by the guest, |
Stefan Weil | 43ffe61 | 2012-07-20 23:26:02 +0200 | [diff] [blame] | 4463 | so that QEMU behaves similar to an inetd process for that virtual server: |
Alexander Graf | b412eb6 | 2012-06-03 09:45:01 +0200 | [diff] [blame] | 4464 | |
| 4465 | @example |
| 4466 | # call "netcat 10.10.1.1 4321" on every TCP connection to 10.0.2.100:1234 |
| 4467 | # and connect the TCP stream to its stdin/stdout |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 4468 | @value{qemu_system} -nic 'user,id=n1,guestfwd=tcp:10.0.2.100:1234-cmd:netcat 10.10.1.1 4321' |
Alexander Graf | b412eb6 | 2012-06-03 09:45:01 +0200 | [diff] [blame] | 4469 | @end example |
Jan Kiszka | ad196a9 | 2009-06-24 14:42:28 +0200 | [diff] [blame] | 4470 | |
| 4471 | @end table |
| 4472 | |
Alexey Kardashevskiy | 584613e | 2016-09-13 17:11:54 +1000 | [diff] [blame] | 4473 | @item -netdev tap,id=@var{id}[,fd=@var{h}][,ifname=@var{name}][,script=@var{file}][,downscript=@var{dfile}][,br=@var{bridge}][,helper=@var{helper}] |
Thomas Huth | abbbb03 | 2018-03-12 13:20:50 +0100 | [diff] [blame] | 4474 | Configure a host TAP network backend with ID @var{id}. |
Corey Bryant | a7c36ee | 2012-01-26 09:42:27 -0500 | [diff] [blame] | 4475 | |
| 4476 | Use the network script @var{file} to configure it and the network script |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4477 | @var{dfile} to deconfigure it. If @var{name} is not provided, the OS |
Corey Bryant | a7c36ee | 2012-01-26 09:42:27 -0500 | [diff] [blame] | 4478 | automatically provides one. The default network configure script is |
| 4479 | @file{/etc/qemu-ifup} and the default network deconfigure script is |
| 4480 | @file{/etc/qemu-ifdown}. Use @option{script=no} or @option{downscript=no} |
| 4481 | to disable script execution. |
| 4482 | |
| 4483 | If running QEMU as an unprivileged user, use the network helper |
Alexey Kardashevskiy | 584613e | 2016-09-13 17:11:54 +1000 | [diff] [blame] | 4484 | @var{helper} to configure the TAP interface and attach it to the bridge. |
| 4485 | The default network helper executable is @file{/path/to/qemu-bridge-helper} |
| 4486 | and the default bridge device is @file{br0}. |
Corey Bryant | a7c36ee | 2012-01-26 09:42:27 -0500 | [diff] [blame] | 4487 | |
| 4488 | @option{fd}=@var{h} can be used to specify the handle of an already |
| 4489 | opened host TAP interface. |
| 4490 | |
| 4491 | Examples: |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4492 | |
| 4493 | @example |
Corey Bryant | a7c36ee | 2012-01-26 09:42:27 -0500 | [diff] [blame] | 4494 | #launch a QEMU instance with the default network script |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 4495 | @value{qemu_system} linux.img -nic tap |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4496 | @end example |
| 4497 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4498 | @example |
Corey Bryant | a7c36ee | 2012-01-26 09:42:27 -0500 | [diff] [blame] | 4499 | #launch a QEMU instance with two NICs, each one connected |
| 4500 | #to a TAP device |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 4501 | @value{qemu_system} linux.img \ |
Thomas Huth | 74f78b9 | 2018-01-15 08:40:17 +0100 | [diff] [blame] | 4502 | -netdev tap,id=nd0,ifname=tap0 -device e1000,netdev=nd0 \ |
| 4503 | -netdev tap,id=nd1,ifname=tap1 -device rtl8139,netdev=nd1 |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4504 | @end example |
| 4505 | |
Corey Bryant | a7c36ee | 2012-01-26 09:42:27 -0500 | [diff] [blame] | 4506 | @example |
| 4507 | #launch a QEMU instance with the default network helper to |
| 4508 | #connect a TAP device to bridge br0 |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 4509 | @value{qemu_system} linux.img -device virtio-net-pci,netdev=n1 \ |
Thomas Huth | abbbb03 | 2018-03-12 13:20:50 +0100 | [diff] [blame] | 4510 | -netdev tap,id=n1,"helper=/path/to/qemu-bridge-helper" |
Corey Bryant | a7c36ee | 2012-01-26 09:42:27 -0500 | [diff] [blame] | 4511 | @end example |
| 4512 | |
Stefan Hajnoczi | 08d1202 | 2012-08-14 14:14:27 +0100 | [diff] [blame] | 4513 | @item -netdev bridge,id=@var{id}[,br=@var{bridge}][,helper=@var{helper}] |
Corey Bryant | a7c36ee | 2012-01-26 09:42:27 -0500 | [diff] [blame] | 4514 | Connect a host TAP network interface to a host bridge device. |
| 4515 | |
| 4516 | Use the network helper @var{helper} to configure the TAP interface and |
| 4517 | attach it to the bridge. The default network helper executable is |
Amos Kong | 420508f | 2013-10-23 04:49:28 +0800 | [diff] [blame] | 4518 | @file{/path/to/qemu-bridge-helper} and the default bridge |
Corey Bryant | a7c36ee | 2012-01-26 09:42:27 -0500 | [diff] [blame] | 4519 | device is @file{br0}. |
| 4520 | |
| 4521 | Examples: |
| 4522 | |
| 4523 | @example |
| 4524 | #launch a QEMU instance with the default network helper to |
| 4525 | #connect a TAP device to bridge br0 |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 4526 | @value{qemu_system} linux.img -netdev bridge,id=n1 -device virtio-net,netdev=n1 |
Corey Bryant | a7c36ee | 2012-01-26 09:42:27 -0500 | [diff] [blame] | 4527 | @end example |
| 4528 | |
| 4529 | @example |
| 4530 | #launch a QEMU instance with the default network helper to |
| 4531 | #connect a TAP device to bridge qemubr0 |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 4532 | @value{qemu_system} linux.img -netdev bridge,br=qemubr0,id=n1 -device virtio-net,netdev=n1 |
Corey Bryant | a7c36ee | 2012-01-26 09:42:27 -0500 | [diff] [blame] | 4533 | @end example |
| 4534 | |
Stefan Hajnoczi | 08d1202 | 2012-08-14 14:14:27 +0100 | [diff] [blame] | 4535 | @item -netdev socket,id=@var{id}[,fd=@var{h}][,listen=[@var{host}]:@var{port}][,connect=@var{host}:@var{port}] |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4536 | |
Thomas Huth | abbbb03 | 2018-03-12 13:20:50 +0100 | [diff] [blame] | 4537 | This host network backend can be used to connect the guest's network to |
| 4538 | another QEMU virtual machine using a TCP socket connection. If @option{listen} |
| 4539 | is specified, QEMU waits for incoming connections on @var{port} |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4540 | (@var{host} is optional). @option{connect} is used to connect to |
| 4541 | another QEMU instance using the @option{listen} option. @option{fd}=@var{h} |
| 4542 | specifies an already opened TCP socket. |
| 4543 | |
| 4544 | Example: |
| 4545 | @example |
| 4546 | # launch a first QEMU instance |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 4547 | @value{qemu_system} linux.img \ |
Thomas Huth | abbbb03 | 2018-03-12 13:20:50 +0100 | [diff] [blame] | 4548 | -device e1000,netdev=n1,mac=52:54:00:12:34:56 \ |
| 4549 | -netdev socket,id=n1,listen=:1234 |
| 4550 | # connect the network of this instance to the network of the first instance |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 4551 | @value{qemu_system} linux.img \ |
Thomas Huth | abbbb03 | 2018-03-12 13:20:50 +0100 | [diff] [blame] | 4552 | -device e1000,netdev=n2,mac=52:54:00:12:34:57 \ |
| 4553 | -netdev socket,id=n2,connect=127.0.0.1:1234 |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4554 | @end example |
| 4555 | |
Stefan Hajnoczi | 08d1202 | 2012-08-14 14:14:27 +0100 | [diff] [blame] | 4556 | @item -netdev socket,id=@var{id}[,fd=@var{h}][,mcast=@var{maddr}:@var{port}[,localaddr=@var{addr}]] |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4557 | |
Thomas Huth | abbbb03 | 2018-03-12 13:20:50 +0100 | [diff] [blame] | 4558 | Configure a socket host network backend to share the guest's network traffic |
| 4559 | with another QEMU virtual machines using a UDP multicast socket, effectively |
| 4560 | making a bus for every QEMU with same multicast address @var{maddr} and @var{port}. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4561 | NOTES: |
| 4562 | @enumerate |
| 4563 | @item |
| 4564 | Several QEMU can be running on different hosts and share same bus (assuming |
| 4565 | correct multicast setup for these hosts). |
| 4566 | @item |
| 4567 | mcast support is compatible with User Mode Linux (argument @option{eth@var{N}=mcast}), see |
| 4568 | @url{http://user-mode-linux.sf.net}. |
| 4569 | @item |
| 4570 | Use @option{fd=h} to specify an already opened UDP multicast socket. |
| 4571 | @end enumerate |
| 4572 | |
| 4573 | Example: |
| 4574 | @example |
| 4575 | # launch one QEMU instance |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 4576 | @value{qemu_system} linux.img \ |
Thomas Huth | abbbb03 | 2018-03-12 13:20:50 +0100 | [diff] [blame] | 4577 | -device e1000,netdev=n1,mac=52:54:00:12:34:56 \ |
| 4578 | -netdev socket,id=n1,mcast=230.0.0.1:1234 |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4579 | # launch another QEMU instance on same "bus" |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 4580 | @value{qemu_system} linux.img \ |
Thomas Huth | abbbb03 | 2018-03-12 13:20:50 +0100 | [diff] [blame] | 4581 | -device e1000,netdev=n2,mac=52:54:00:12:34:57 \ |
| 4582 | -netdev socket,id=n2,mcast=230.0.0.1:1234 |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4583 | # launch yet another QEMU instance on same "bus" |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 4584 | @value{qemu_system} linux.img \ |
Thomas Huth | 37a4442 | 2018-08-13 13:51:44 +0200 | [diff] [blame] | 4585 | -device e1000,netdev=n3,mac=52:54:00:12:34:58 \ |
Thomas Huth | abbbb03 | 2018-03-12 13:20:50 +0100 | [diff] [blame] | 4586 | -netdev socket,id=n3,mcast=230.0.0.1:1234 |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4587 | @end example |
| 4588 | |
| 4589 | Example (User Mode Linux compat.): |
| 4590 | @example |
Thomas Huth | abbbb03 | 2018-03-12 13:20:50 +0100 | [diff] [blame] | 4591 | # launch QEMU instance (note mcast address selected is UML's default) |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 4592 | @value{qemu_system} linux.img \ |
Thomas Huth | abbbb03 | 2018-03-12 13:20:50 +0100 | [diff] [blame] | 4593 | -device e1000,netdev=n1,mac=52:54:00:12:34:56 \ |
| 4594 | -netdev socket,id=n1,mcast=239.192.168.1:1102 |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4595 | # launch UML |
| 4596 | /path/to/linux ubd0=/path/to/root_fs eth0=mcast |
| 4597 | @end example |
| 4598 | |
Mike Ryan | 3a75e74 | 2010-12-01 11:16:47 -0800 | [diff] [blame] | 4599 | Example (send packets from host's 1.2.3.4): |
| 4600 | @example |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 4601 | @value{qemu_system} linux.img \ |
Thomas Huth | abbbb03 | 2018-03-12 13:20:50 +0100 | [diff] [blame] | 4602 | -device e1000,netdev=n1,mac=52:54:00:12:34:56 \ |
| 4603 | -netdev socket,id=n1,mcast=239.192.168.1:1102,localaddr=1.2.3.4 |
Mike Ryan | 3a75e74 | 2010-12-01 11:16:47 -0800 | [diff] [blame] | 4604 | @end example |
| 4605 | |
Anton Ivanov | 3fb69aa | 2014-06-20 10:34:41 +0100 | [diff] [blame] | 4606 | @item -netdev l2tpv3,id=@var{id},src=@var{srcaddr},dst=@var{dstaddr}[,srcport=@var{srcport}][,dstport=@var{dstport}],txsession=@var{txsession}[,rxsession=@var{rxsession}][,ipv6][,udp][,cookie64][,counter][,pincounter][,txcookie=@var{txcookie}][,rxcookie=@var{rxcookie}][,offset=@var{offset}] |
Stefan Hajnoczi | 21843dc | 2020-02-29 11:17:27 +0000 | [diff] [blame] | 4607 | Configure a L2TPv3 pseudowire host network backend. L2TPv3 (RFC3931) is a |
Thomas Huth | abbbb03 | 2018-03-12 13:20:50 +0100 | [diff] [blame] | 4608 | popular protocol to transport Ethernet (and other Layer 2) data frames between |
Anton Ivanov | 3fb69aa | 2014-06-20 10:34:41 +0100 | [diff] [blame] | 4609 | two systems. It is present in routers, firewalls and the Linux kernel |
| 4610 | (from version 3.3 onwards). |
| 4611 | |
| 4612 | This transport allows a VM to communicate to another VM, router or firewall directly. |
| 4613 | |
Markus Armbruster | 1e9a737 | 2017-10-02 16:03:01 +0200 | [diff] [blame] | 4614 | @table @option |
Anton Ivanov | 3fb69aa | 2014-06-20 10:34:41 +0100 | [diff] [blame] | 4615 | @item src=@var{srcaddr} |
| 4616 | source address (mandatory) |
| 4617 | @item dst=@var{dstaddr} |
| 4618 | destination address (mandatory) |
| 4619 | @item udp |
| 4620 | select udp encapsulation (default is ip). |
| 4621 | @item srcport=@var{srcport} |
| 4622 | source udp port. |
| 4623 | @item dstport=@var{dstport} |
| 4624 | destination udp port. |
| 4625 | @item ipv6 |
| 4626 | force v6, otherwise defaults to v4. |
| 4627 | @item rxcookie=@var{rxcookie} |
Markus Armbruster | f9cfd65 | 2015-06-15 14:35:59 +0200 | [diff] [blame] | 4628 | @itemx txcookie=@var{txcookie} |
Anton Ivanov | 3fb69aa | 2014-06-20 10:34:41 +0100 | [diff] [blame] | 4629 | Cookies are a weak form of security in the l2tpv3 specification. |
| 4630 | Their function is mostly to prevent misconfiguration. By default they are 32 |
| 4631 | bit. |
| 4632 | @item cookie64 |
| 4633 | Set cookie size to 64 bit instead of the default 32 |
| 4634 | @item counter=off |
| 4635 | Force a 'cut-down' L2TPv3 with no counter as in |
| 4636 | draft-mkonstan-l2tpext-keyed-ipv6-tunnel-00 |
| 4637 | @item pincounter=on |
| 4638 | Work around broken counter handling in peer. This may also help on |
| 4639 | networks which have packet reorder. |
| 4640 | @item offset=@var{offset} |
| 4641 | Add an extra offset between header and data |
Markus Armbruster | 1e9a737 | 2017-10-02 16:03:01 +0200 | [diff] [blame] | 4642 | @end table |
Anton Ivanov | 3fb69aa | 2014-06-20 10:34:41 +0100 | [diff] [blame] | 4643 | |
| 4644 | For example, to attach a VM running on host 4.3.2.1 via L2TPv3 to the bridge br-lan |
| 4645 | on the remote Linux host 1.2.3.4: |
| 4646 | @example |
| 4647 | # Setup tunnel on linux host using raw ip as encapsulation |
| 4648 | # on 1.2.3.4 |
| 4649 | ip l2tp add tunnel remote 4.3.2.1 local 1.2.3.4 tunnel_id 1 peer_tunnel_id 1 \ |
| 4650 | encap udp udp_sport 16384 udp_dport 16384 |
| 4651 | ip l2tp add session tunnel_id 1 name vmtunnel0 session_id \ |
| 4652 | 0xFFFFFFFF peer_session_id 0xFFFFFFFF |
| 4653 | ifconfig vmtunnel0 mtu 1500 |
| 4654 | ifconfig vmtunnel0 up |
| 4655 | brctl addif br-lan vmtunnel0 |
| 4656 | |
| 4657 | |
| 4658 | # on 4.3.2.1 |
| 4659 | # launch QEMU instance - if your network has reorder or is very lossy add ,pincounter |
| 4660 | |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 4661 | @value{qemu_system} linux.img -device e1000,netdev=n1 \ |
Thomas Huth | abbbb03 | 2018-03-12 13:20:50 +0100 | [diff] [blame] | 4662 | -netdev l2tpv3,id=n1,src=4.2.3.1,dst=1.2.3.4,udp,srcport=16384,dstport=16384,rxsession=0xffffffff,txsession=0xffffffff,counter |
Anton Ivanov | 3fb69aa | 2014-06-20 10:34:41 +0100 | [diff] [blame] | 4663 | |
| 4664 | @end example |
| 4665 | |
Stefan Hajnoczi | 08d1202 | 2012-08-14 14:14:27 +0100 | [diff] [blame] | 4666 | @item -netdev vde,id=@var{id}[,sock=@var{socketpath}][,port=@var{n}][,group=@var{groupname}][,mode=@var{octalmode}] |
Thomas Huth | abbbb03 | 2018-03-12 13:20:50 +0100 | [diff] [blame] | 4667 | Configure VDE backend to connect to PORT @var{n} of a vde switch running on host and |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4668 | listening for incoming connections on @var{socketpath}. Use GROUP @var{groupname} |
| 4669 | and MODE @var{octalmode} to change default ownership and permissions for |
Stefan Weil | c1ba4e0 | 2011-09-05 18:13:03 +0200 | [diff] [blame] | 4670 | communication port. This option is only available if QEMU has been compiled |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4671 | with vde support enabled. |
| 4672 | |
| 4673 | Example: |
| 4674 | @example |
| 4675 | # launch vde switch |
| 4676 | vde_switch -F -sock /tmp/myswitch |
| 4677 | # launch QEMU instance |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 4678 | @value{qemu_system} linux.img -nic vde,sock=/tmp/myswitch |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4679 | @end example |
| 4680 | |
Changchun Ouyang | b931bfb | 2015-09-23 12:20:00 +0800 | [diff] [blame] | 4681 | @item -netdev vhost-user,chardev=@var{id}[,vhostforce=on|off][,queues=n] |
Nikolay Nikolaev | 03ce574 | 2014-06-10 13:02:16 +0300 | [diff] [blame] | 4682 | |
| 4683 | Establish a vhost-user netdev, backed by a chardev @var{id}. The chardev should |
| 4684 | be a unix domain socket backed one. The vhost-user uses a specifically defined |
| 4685 | protocol to pass vhost ioctl replacement messages to an application on the other |
| 4686 | end of the socket. On non-MSIX guests, the feature can be forced with |
Changchun Ouyang | b931bfb | 2015-09-23 12:20:00 +0800 | [diff] [blame] | 4687 | @var{vhostforce}. Use 'queues=@var{n}' to specify the number of queues to |
| 4688 | be created for multiqueue vhost-user. |
Nikolay Nikolaev | 03ce574 | 2014-06-10 13:02:16 +0300 | [diff] [blame] | 4689 | |
| 4690 | Example: |
| 4691 | @example |
| 4692 | qemu -m 512 -object memory-backend-file,id=mem,size=512M,mem-path=/hugetlbfs,share=on \ |
| 4693 | -numa node,memdev=mem \ |
Vincenzo Maffione | 79cad2f | 2017-02-20 17:45:09 +0100 | [diff] [blame] | 4694 | -chardev socket,id=chr0,path=/path/to/socket \ |
Nikolay Nikolaev | 03ce574 | 2014-06-10 13:02:16 +0300 | [diff] [blame] | 4695 | -netdev type=vhost-user,id=net0,chardev=chr0 \ |
| 4696 | -device virtio-net-pci,netdev=net0 |
| 4697 | @end example |
| 4698 | |
Thomas Huth | abbbb03 | 2018-03-12 13:20:50 +0100 | [diff] [blame] | 4699 | @item -netdev hubport,id=@var{id},hubid=@var{hubid}[,netdev=@var{nd}] |
Thomas Huth | 78cd6f7 | 2018-02-21 11:18:36 +0100 | [diff] [blame] | 4700 | |
Thomas Huth | abbbb03 | 2018-03-12 13:20:50 +0100 | [diff] [blame] | 4701 | Create a hub port on the emulated hub with ID @var{hubid}. |
Thomas Huth | 78cd6f7 | 2018-02-21 11:18:36 +0100 | [diff] [blame] | 4702 | |
Thomas Huth | abbbb03 | 2018-03-12 13:20:50 +0100 | [diff] [blame] | 4703 | The hubport netdev lets you connect a NIC to a QEMU emulated hub instead of a |
Thomas Huth | af1a5c3 | 2018-04-30 20:02:23 +0200 | [diff] [blame] | 4704 | single netdev. Alternatively, you can also connect the hubport to another |
| 4705 | netdev with ID @var{nd} by using the @option{netdev=@var{nd}} option. |
Thomas Huth | abbbb03 | 2018-03-12 13:20:50 +0100 | [diff] [blame] | 4706 | |
Thomas Huth | af1a5c3 | 2018-04-30 20:02:23 +0200 | [diff] [blame] | 4707 | @item -net nic[,netdev=@var{nd}][,macaddr=@var{mac}][,model=@var{type}] [,name=@var{name}][,addr=@var{addr}][,vectors=@var{v}] |
Thomas Huth | abbbb03 | 2018-03-12 13:20:50 +0100 | [diff] [blame] | 4708 | @findex -net |
| 4709 | Legacy option to configure or create an on-board (or machine default) Network |
Thomas Huth | af1a5c3 | 2018-04-30 20:02:23 +0200 | [diff] [blame] | 4710 | Interface Card(NIC) and connect it either to the emulated hub with ID 0 (i.e. |
| 4711 | the default hub), or to the netdev @var{nd}. |
Daniel P. Berrangé | 416b719 | 2020-01-09 12:24:05 +0000 | [diff] [blame] | 4712 | If @var{model} is omitted, then the default NIC model associated with |
| 4713 | the machine type is used. Note that the default NIC model may change in |
| 4714 | future QEMU releases, so it is highly recommended to always specify a model. |
| 4715 | Optionally, the MAC address can be changed to @var{mac}, the device |
| 4716 | address set to @var{addr} (PCI cards only), and a @var{name} can be |
| 4717 | assigned for use in monitor commands. |
Thomas Huth | abbbb03 | 2018-03-12 13:20:50 +0100 | [diff] [blame] | 4718 | Optionally, for PCI cards, you can specify the number @var{v} of MSI-X vectors |
| 4719 | that the card should have; this option currently only affects virtio cards; set |
| 4720 | @var{v} = 0 to disable MSI-X. If no @option{-net} option is specified, a single |
| 4721 | NIC is created. QEMU can emulate several different models of network card. |
| 4722 | Use @code{-net nic,model=help} for a list of available devices for your target. |
| 4723 | |
Thomas Huth | af1a5c3 | 2018-04-30 20:02:23 +0200 | [diff] [blame] | 4724 | @item -net user|tap|bridge|socket|l2tpv3|vde[,...][,name=@var{name}] |
Thomas Huth | abbbb03 | 2018-03-12 13:20:50 +0100 | [diff] [blame] | 4725 | Configure a host network backend (with the options corresponding to the same |
Thomas Huth | af1a5c3 | 2018-04-30 20:02:23 +0200 | [diff] [blame] | 4726 | @option{-netdev} option) and connect it to the emulated hub 0 (the default |
| 4727 | hub). Use @var{name} to specify the name of the hub port. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 4728 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 4729 | SRST |
| 4730 | ``-nic [tap|bridge|user|l2tpv3|vde|netmap|vhost-user|socket][,...][,mac=macaddr][,model=mn]`` |
| 4731 | This option is a shortcut for configuring both the on-board |
| 4732 | (default) guest NIC hardware and the host network backend in one go. |
| 4733 | The host backend options are the same as with the corresponding |
| 4734 | ``-netdev`` options below. The guest NIC model can be set with |
| 4735 | ``model=modelname``. Use ``model=help`` to list the available device |
| 4736 | types. The hardware MAC address can be set with ``mac=macaddr``. |
| 4737 | |
| 4738 | The following two example do exactly the same, to show how ``-nic`` |
| 4739 | can be used to shorten the command line length: |
| 4740 | |
| 4741 | .. parsed-literal:: |
| 4742 | |
| 4743 | |qemu_system| -netdev user,id=n1,ipv6=off -device e1000,netdev=n1,mac=52:54:98:76:54:32 |
| 4744 | |qemu_system| -nic user,ipv6=off,model=e1000,mac=52:54:98:76:54:32 |
| 4745 | |
| 4746 | ``-nic none`` |
| 4747 | Indicate that no network devices should be configured. It is used to |
| 4748 | override the default configuration (default NIC with "user" host |
| 4749 | network backend) which is activated if no other networking options |
| 4750 | are provided. |
| 4751 | |
| 4752 | ``-netdev user,id=id[,option][,option][,...]`` |
| 4753 | Configure user mode host network backend which requires no |
| 4754 | administrator privilege to run. Valid options are: |
| 4755 | |
| 4756 | ``id=id`` |
| 4757 | Assign symbolic name for use in monitor commands. |
| 4758 | |
| 4759 | ``ipv4=on|off and ipv6=on|off`` |
| 4760 | Specify that either IPv4 or IPv6 must be enabled. If neither is |
| 4761 | specified both protocols are enabled. |
| 4762 | |
| 4763 | ``net=addr[/mask]`` |
| 4764 | Set IP network address the guest will see. Optionally specify |
| 4765 | the netmask, either in the form a.b.c.d or as number of valid |
| 4766 | top-most bits. Default is 10.0.2.0/24. |
| 4767 | |
| 4768 | ``host=addr`` |
| 4769 | Specify the guest-visible address of the host. Default is the |
| 4770 | 2nd IP in the guest network, i.e. x.x.x.2. |
| 4771 | |
| 4772 | ``ipv6-net=addr[/int]`` |
| 4773 | Set IPv6 network address the guest will see (default is |
| 4774 | fec0::/64). The network prefix is given in the usual hexadecimal |
| 4775 | IPv6 address notation. The prefix size is optional, and is given |
| 4776 | as the number of valid top-most bits (default is 64). |
| 4777 | |
| 4778 | ``ipv6-host=addr`` |
| 4779 | Specify the guest-visible IPv6 address of the host. Default is |
| 4780 | the 2nd IPv6 in the guest network, i.e. xxxx::2. |
| 4781 | |
| 4782 | ``restrict=on|off`` |
| 4783 | If this option is enabled, the guest will be isolated, i.e. it |
| 4784 | will not be able to contact the host and no guest IP packets |
| 4785 | will be routed over the host to the outside. This option does |
| 4786 | not affect any explicitly set forwarding rules. |
| 4787 | |
| 4788 | ``hostname=name`` |
| 4789 | Specifies the client hostname reported by the built-in DHCP |
| 4790 | server. |
| 4791 | |
| 4792 | ``dhcpstart=addr`` |
| 4793 | Specify the first of the 16 IPs the built-in DHCP server can |
| 4794 | assign. Default is the 15th to 31st IP in the guest network, |
| 4795 | i.e. x.x.x.15 to x.x.x.31. |
| 4796 | |
| 4797 | ``dns=addr`` |
| 4798 | Specify the guest-visible address of the virtual nameserver. The |
| 4799 | address must be different from the host address. Default is the |
| 4800 | 3rd IP in the guest network, i.e. x.x.x.3. |
| 4801 | |
| 4802 | ``ipv6-dns=addr`` |
| 4803 | Specify the guest-visible address of the IPv6 virtual |
| 4804 | nameserver. The address must be different from the host address. |
| 4805 | Default is the 3rd IP in the guest network, i.e. xxxx::3. |
| 4806 | |
| 4807 | ``dnssearch=domain`` |
| 4808 | Provides an entry for the domain-search list sent by the |
| 4809 | built-in DHCP server. More than one domain suffix can be |
| 4810 | transmitted by specifying this option multiple times. If |
| 4811 | supported, this will cause the guest to automatically try to |
| 4812 | append the given domain suffix(es) in case a domain name can not |
| 4813 | be resolved. |
| 4814 | |
| 4815 | Example: |
| 4816 | |
| 4817 | .. parsed-literal:: |
| 4818 | |
| 4819 | |qemu_system| -nic user,dnssearch=mgmt.example.org,dnssearch=example.org |
| 4820 | |
| 4821 | ``domainname=domain`` |
| 4822 | Specifies the client domain name reported by the built-in DHCP |
| 4823 | server. |
| 4824 | |
| 4825 | ``tftp=dir`` |
| 4826 | When using the user mode network stack, activate a built-in TFTP |
| 4827 | server. The files in dir will be exposed as the root of a TFTP |
| 4828 | server. The TFTP client on the guest must be configured in |
| 4829 | binary mode (use the command ``bin`` of the Unix TFTP client). |
| 4830 | |
| 4831 | ``tftp-server-name=name`` |
| 4832 | In BOOTP reply, broadcast name as the "TFTP server name" |
| 4833 | (RFC2132 option 66). This can be used to advise the guest to |
| 4834 | load boot files or configurations from a different server than |
| 4835 | the host address. |
| 4836 | |
| 4837 | ``bootfile=file`` |
| 4838 | When using the user mode network stack, broadcast file as the |
| 4839 | BOOTP filename. In conjunction with ``tftp``, this can be used |
| 4840 | to network boot a guest from a local directory. |
| 4841 | |
| 4842 | Example (using pxelinux): |
| 4843 | |
| 4844 | .. parsed-literal:: |
| 4845 | |
| 4846 | |qemu_system| -hda linux.img -boot n -device e1000,netdev=n1 \ |
| 4847 | -netdev user,id=n1,tftp=/path/to/tftp/files,bootfile=/pxelinux.0 |
| 4848 | |
| 4849 | ``smb=dir[,smbserver=addr]`` |
| 4850 | When using the user mode network stack, activate a built-in SMB |
| 4851 | server so that Windows OSes can access to the host files in |
| 4852 | ``dir`` transparently. The IP address of the SMB server can be |
| 4853 | set to addr. By default the 4th IP in the guest network is used, |
| 4854 | i.e. x.x.x.4. |
| 4855 | |
| 4856 | In the guest Windows OS, the line: |
| 4857 | |
| 4858 | :: |
| 4859 | |
| 4860 | 10.0.2.4 smbserver |
| 4861 | |
| 4862 | must be added in the file ``C:\WINDOWS\LMHOSTS`` (for windows |
| 4863 | 9x/Me) or ``C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS`` (Windows |
| 4864 | NT/2000). |
| 4865 | |
| 4866 | Then ``dir`` can be accessed in ``\\smbserver\qemu``. |
| 4867 | |
| 4868 | Note that a SAMBA server must be installed on the host OS. |
| 4869 | |
| 4870 | ``hostfwd=[tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport`` |
| 4871 | Redirect incoming TCP or UDP connections to the host port |
| 4872 | hostport to the guest IP address guestaddr on guest port |
| 4873 | guestport. If guestaddr is not specified, its value is x.x.x.15 |
| 4874 | (default first address given by the built-in DHCP server). By |
| 4875 | specifying hostaddr, the rule can be bound to a specific host |
| 4876 | interface. If no connection type is set, TCP is used. This |
| 4877 | option can be given multiple times. |
| 4878 | |
| 4879 | For example, to redirect host X11 connection from screen 1 to |
| 4880 | guest screen 0, use the following: |
| 4881 | |
Peter Maydell | 09ce5f2 | 2020-02-28 15:36:13 +0000 | [diff] [blame^] | 4882 | .. parsed-literal:: |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 4883 | |
| 4884 | # on the host |
| 4885 | |qemu_system| -nic user,hostfwd=tcp:127.0.0.1:6001-:6000 |
| 4886 | # this host xterm should open in the guest X11 server |
| 4887 | xterm -display :1 |
| 4888 | |
| 4889 | To redirect telnet connections from host port 5555 to telnet |
| 4890 | port on the guest, use the following: |
| 4891 | |
Peter Maydell | 09ce5f2 | 2020-02-28 15:36:13 +0000 | [diff] [blame^] | 4892 | .. parsed-literal:: |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 4893 | |
| 4894 | # on the host |
| 4895 | |qemu_system| -nic user,hostfwd=tcp::5555-:23 |
| 4896 | telnet localhost 5555 |
| 4897 | |
| 4898 | Then when you use on the host ``telnet localhost 5555``, you |
| 4899 | connect to the guest telnet server. |
| 4900 | |
| 4901 | ``guestfwd=[tcp]:server:port-dev``; \ ``guestfwd=[tcp]:server:port-cmd:command`` |
| 4902 | Forward guest TCP connections to the IP address server on port |
| 4903 | port to the character device dev or to a program executed by |
| 4904 | cmd:command which gets spawned for each connection. This option |
| 4905 | can be given multiple times. |
| 4906 | |
| 4907 | You can either use a chardev directly and have that one used |
| 4908 | throughout QEMU's lifetime, like in the following example: |
| 4909 | |
Peter Maydell | 09ce5f2 | 2020-02-28 15:36:13 +0000 | [diff] [blame^] | 4910 | .. parsed-literal:: |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 4911 | |
| 4912 | # open 10.10.1.1:4321 on bootup, connect 10.0.2.100:1234 to it whenever |
| 4913 | # the guest accesses it |
| 4914 | |qemu_system| -nic user,guestfwd=tcp:10.0.2.100:1234-tcp:10.10.1.1:4321 |
| 4915 | |
| 4916 | Or you can execute a command on every TCP connection established |
| 4917 | by the guest, so that QEMU behaves similar to an inetd process |
| 4918 | for that virtual server: |
| 4919 | |
Peter Maydell | 09ce5f2 | 2020-02-28 15:36:13 +0000 | [diff] [blame^] | 4920 | .. parsed-literal:: |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 4921 | |
| 4922 | # call "netcat 10.10.1.1 4321" on every TCP connection to 10.0.2.100:1234 |
| 4923 | # and connect the TCP stream to its stdin/stdout |
| 4924 | |qemu_system| -nic 'user,id=n1,guestfwd=tcp:10.0.2.100:1234-cmd:netcat 10.10.1.1 4321' |
| 4925 | |
| 4926 | ``-netdev tap,id=id[,fd=h][,ifname=name][,script=file][,downscript=dfile][,br=bridge][,helper=helper]`` |
| 4927 | Configure a host TAP network backend with ID id. |
| 4928 | |
| 4929 | Use the network script file to configure it and the network script |
| 4930 | dfile to deconfigure it. If name is not provided, the OS |
| 4931 | automatically provides one. The default network configure script is |
| 4932 | ``/etc/qemu-ifup`` and the default network deconfigure script is |
| 4933 | ``/etc/qemu-ifdown``. Use ``script=no`` or ``downscript=no`` to |
| 4934 | disable script execution. |
| 4935 | |
| 4936 | If running QEMU as an unprivileged user, use the network helper |
| 4937 | helper to configure the TAP interface and attach it to the bridge. |
| 4938 | The default network helper executable is |
| 4939 | ``/path/to/qemu-bridge-helper`` and the default bridge device is |
| 4940 | ``br0``. |
| 4941 | |
| 4942 | ``fd``\ =h can be used to specify the handle of an already opened |
| 4943 | host TAP interface. |
| 4944 | |
| 4945 | Examples: |
| 4946 | |
Peter Maydell | 09ce5f2 | 2020-02-28 15:36:13 +0000 | [diff] [blame^] | 4947 | .. parsed-literal:: |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 4948 | |
| 4949 | #launch a QEMU instance with the default network script |
| 4950 | |qemu_system| linux.img -nic tap |
| 4951 | |
Peter Maydell | 09ce5f2 | 2020-02-28 15:36:13 +0000 | [diff] [blame^] | 4952 | .. parsed-literal:: |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 4953 | |
| 4954 | #launch a QEMU instance with two NICs, each one connected |
| 4955 | #to a TAP device |
| 4956 | |qemu_system| linux.img \ |
| 4957 | -netdev tap,id=nd0,ifname=tap0 -device e1000,netdev=nd0 \ |
| 4958 | -netdev tap,id=nd1,ifname=tap1 -device rtl8139,netdev=nd1 |
| 4959 | |
Peter Maydell | 09ce5f2 | 2020-02-28 15:36:13 +0000 | [diff] [blame^] | 4960 | .. parsed-literal:: |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 4961 | |
| 4962 | #launch a QEMU instance with the default network helper to |
| 4963 | #connect a TAP device to bridge br0 |
| 4964 | |qemu_system| linux.img -device virtio-net-pci,netdev=n1 \ |
| 4965 | -netdev tap,id=n1,"helper=/path/to/qemu-bridge-helper" |
| 4966 | |
| 4967 | ``-netdev bridge,id=id[,br=bridge][,helper=helper]`` |
| 4968 | Connect a host TAP network interface to a host bridge device. |
| 4969 | |
| 4970 | Use the network helper helper to configure the TAP interface and |
| 4971 | attach it to the bridge. The default network helper executable is |
| 4972 | ``/path/to/qemu-bridge-helper`` and the default bridge device is |
| 4973 | ``br0``. |
| 4974 | |
| 4975 | Examples: |
| 4976 | |
Peter Maydell | 09ce5f2 | 2020-02-28 15:36:13 +0000 | [diff] [blame^] | 4977 | .. parsed-literal:: |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 4978 | |
| 4979 | #launch a QEMU instance with the default network helper to |
| 4980 | #connect a TAP device to bridge br0 |
| 4981 | |qemu_system| linux.img -netdev bridge,id=n1 -device virtio-net,netdev=n1 |
| 4982 | |
Peter Maydell | 09ce5f2 | 2020-02-28 15:36:13 +0000 | [diff] [blame^] | 4983 | .. parsed-literal:: |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 4984 | |
| 4985 | #launch a QEMU instance with the default network helper to |
| 4986 | #connect a TAP device to bridge qemubr0 |
| 4987 | |qemu_system| linux.img -netdev bridge,br=qemubr0,id=n1 -device virtio-net,netdev=n1 |
| 4988 | |
| 4989 | ``-netdev socket,id=id[,fd=h][,listen=[host]:port][,connect=host:port]`` |
| 4990 | This host network backend can be used to connect the guest's network |
| 4991 | to another QEMU virtual machine using a TCP socket connection. If |
| 4992 | ``listen`` is specified, QEMU waits for incoming connections on port |
| 4993 | (host is optional). ``connect`` is used to connect to another QEMU |
| 4994 | instance using the ``listen`` option. ``fd``\ =h specifies an |
| 4995 | already opened TCP socket. |
| 4996 | |
| 4997 | Example: |
| 4998 | |
Peter Maydell | 09ce5f2 | 2020-02-28 15:36:13 +0000 | [diff] [blame^] | 4999 | .. parsed-literal:: |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 5000 | |
| 5001 | # launch a first QEMU instance |
| 5002 | |qemu_system| linux.img \ |
| 5003 | -device e1000,netdev=n1,mac=52:54:00:12:34:56 \ |
| 5004 | -netdev socket,id=n1,listen=:1234 |
| 5005 | # connect the network of this instance to the network of the first instance |
| 5006 | |qemu_system| linux.img \ |
| 5007 | -device e1000,netdev=n2,mac=52:54:00:12:34:57 \ |
| 5008 | -netdev socket,id=n2,connect=127.0.0.1:1234 |
| 5009 | |
| 5010 | ``-netdev socket,id=id[,fd=h][,mcast=maddr:port[,localaddr=addr]]`` |
| 5011 | Configure a socket host network backend to share the guest's network |
| 5012 | traffic with another QEMU virtual machines using a UDP multicast |
| 5013 | socket, effectively making a bus for every QEMU with same multicast |
| 5014 | address maddr and port. NOTES: |
| 5015 | |
| 5016 | 1. Several QEMU can be running on different hosts and share same bus |
| 5017 | (assuming correct multicast setup for these hosts). |
| 5018 | |
| 5019 | 2. mcast support is compatible with User Mode Linux (argument |
| 5020 | ``ethN=mcast``), see http://user-mode-linux.sf.net. |
| 5021 | |
| 5022 | 3. Use ``fd=h`` to specify an already opened UDP multicast socket. |
| 5023 | |
| 5024 | Example: |
| 5025 | |
Peter Maydell | 09ce5f2 | 2020-02-28 15:36:13 +0000 | [diff] [blame^] | 5026 | .. parsed-literal:: |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 5027 | |
| 5028 | # launch one QEMU instance |
| 5029 | |qemu_system| linux.img \ |
| 5030 | -device e1000,netdev=n1,mac=52:54:00:12:34:56 \ |
| 5031 | -netdev socket,id=n1,mcast=230.0.0.1:1234 |
| 5032 | # launch another QEMU instance on same "bus" |
| 5033 | |qemu_system| linux.img \ |
| 5034 | -device e1000,netdev=n2,mac=52:54:00:12:34:57 \ |
| 5035 | -netdev socket,id=n2,mcast=230.0.0.1:1234 |
| 5036 | # launch yet another QEMU instance on same "bus" |
| 5037 | |qemu_system| linux.img \ |
| 5038 | -device e1000,netdev=n3,mac=52:54:00:12:34:58 \ |
| 5039 | -netdev socket,id=n3,mcast=230.0.0.1:1234 |
| 5040 | |
| 5041 | Example (User Mode Linux compat.): |
| 5042 | |
Peter Maydell | 09ce5f2 | 2020-02-28 15:36:13 +0000 | [diff] [blame^] | 5043 | .. parsed-literal:: |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 5044 | |
| 5045 | # launch QEMU instance (note mcast address selected is UML's default) |
| 5046 | |qemu_system| linux.img \ |
| 5047 | -device e1000,netdev=n1,mac=52:54:00:12:34:56 \ |
| 5048 | -netdev socket,id=n1,mcast=239.192.168.1:1102 |
| 5049 | # launch UML |
| 5050 | /path/to/linux ubd0=/path/to/root_fs eth0=mcast |
| 5051 | |
| 5052 | Example (send packets from host's 1.2.3.4): |
| 5053 | |
| 5054 | .. parsed-literal:: |
| 5055 | |
| 5056 | |qemu_system| linux.img \ |
| 5057 | -device e1000,netdev=n1,mac=52:54:00:12:34:56 \ |
| 5058 | -netdev socket,id=n1,mcast=239.192.168.1:1102,localaddr=1.2.3.4 |
| 5059 | |
| 5060 | ``-netdev l2tpv3,id=id,src=srcaddr,dst=dstaddr[,srcport=srcport][,dstport=dstport],txsession=txsession[,rxsession=rxsession][,ipv6][,udp][,cookie64][,counter][,pincounter][,txcookie=txcookie][,rxcookie=rxcookie][,offset=offset]`` |
| 5061 | Configure a L2TPv3 pseudowire host network backend. L2TPv3 (RFC3931) |
| 5062 | is a popular protocol to transport Ethernet (and other Layer 2) data |
| 5063 | frames between two systems. It is present in routers, firewalls and |
| 5064 | the Linux kernel (from version 3.3 onwards). |
| 5065 | |
| 5066 | This transport allows a VM to communicate to another VM, router or |
| 5067 | firewall directly. |
| 5068 | |
| 5069 | ``src=srcaddr`` |
| 5070 | source address (mandatory) |
| 5071 | |
| 5072 | ``dst=dstaddr`` |
| 5073 | destination address (mandatory) |
| 5074 | |
| 5075 | ``udp`` |
| 5076 | select udp encapsulation (default is ip). |
| 5077 | |
| 5078 | ``srcport=srcport`` |
| 5079 | source udp port. |
| 5080 | |
| 5081 | ``dstport=dstport`` |
| 5082 | destination udp port. |
| 5083 | |
| 5084 | ``ipv6`` |
| 5085 | force v6, otherwise defaults to v4. |
| 5086 | |
| 5087 | ``rxcookie=rxcookie``; \ ``txcookie=txcookie`` |
| 5088 | Cookies are a weak form of security in the l2tpv3 specification. |
| 5089 | Their function is mostly to prevent misconfiguration. By default |
| 5090 | they are 32 bit. |
| 5091 | |
| 5092 | ``cookie64`` |
| 5093 | Set cookie size to 64 bit instead of the default 32 |
| 5094 | |
| 5095 | ``counter=off`` |
| 5096 | Force a 'cut-down' L2TPv3 with no counter as in |
| 5097 | draft-mkonstan-l2tpext-keyed-ipv6-tunnel-00 |
| 5098 | |
| 5099 | ``pincounter=on`` |
| 5100 | Work around broken counter handling in peer. This may also help |
| 5101 | on networks which have packet reorder. |
| 5102 | |
| 5103 | ``offset=offset`` |
| 5104 | Add an extra offset between header and data |
| 5105 | |
| 5106 | For example, to attach a VM running on host 4.3.2.1 via L2TPv3 to |
| 5107 | the bridge br-lan on the remote Linux host 1.2.3.4: |
| 5108 | |
Peter Maydell | 09ce5f2 | 2020-02-28 15:36:13 +0000 | [diff] [blame^] | 5109 | .. parsed-literal:: |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 5110 | |
| 5111 | # Setup tunnel on linux host using raw ip as encapsulation |
| 5112 | # on 1.2.3.4 |
| 5113 | ip l2tp add tunnel remote 4.3.2.1 local 1.2.3.4 tunnel_id 1 peer_tunnel_id 1 \ |
| 5114 | encap udp udp_sport 16384 udp_dport 16384 |
| 5115 | ip l2tp add session tunnel_id 1 name vmtunnel0 session_id \ |
| 5116 | 0xFFFFFFFF peer_session_id 0xFFFFFFFF |
| 5117 | ifconfig vmtunnel0 mtu 1500 |
| 5118 | ifconfig vmtunnel0 up |
| 5119 | brctl addif br-lan vmtunnel0 |
| 5120 | |
| 5121 | |
| 5122 | # on 4.3.2.1 |
| 5123 | # launch QEMU instance - if your network has reorder or is very lossy add ,pincounter |
| 5124 | |
| 5125 | |qemu_system| linux.img -device e1000,netdev=n1 \ |
| 5126 | -netdev l2tpv3,id=n1,src=4.2.3.1,dst=1.2.3.4,udp,srcport=16384,dstport=16384,rxsession=0xffffffff,txsession=0xffffffff,counter |
| 5127 | |
| 5128 | ``-netdev vde,id=id[,sock=socketpath][,port=n][,group=groupname][,mode=octalmode]`` |
| 5129 | Configure VDE backend to connect to PORT n of a vde switch running |
| 5130 | on host and listening for incoming connections on socketpath. Use |
| 5131 | GROUP groupname and MODE octalmode to change default ownership and |
| 5132 | permissions for communication port. This option is only available if |
| 5133 | QEMU has been compiled with vde support enabled. |
| 5134 | |
| 5135 | Example: |
| 5136 | |
Peter Maydell | 09ce5f2 | 2020-02-28 15:36:13 +0000 | [diff] [blame^] | 5137 | .. parsed-literal:: |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 5138 | |
| 5139 | # launch vde switch |
| 5140 | vde_switch -F -sock /tmp/myswitch |
| 5141 | # launch QEMU instance |
| 5142 | |qemu_system| linux.img -nic vde,sock=/tmp/myswitch |
| 5143 | |
| 5144 | ``-netdev vhost-user,chardev=id[,vhostforce=on|off][,queues=n]`` |
| 5145 | Establish a vhost-user netdev, backed by a chardev id. The chardev |
| 5146 | should be a unix domain socket backed one. The vhost-user uses a |
| 5147 | specifically defined protocol to pass vhost ioctl replacement |
| 5148 | messages to an application on the other end of the socket. On |
| 5149 | non-MSIX guests, the feature can be forced with vhostforce. Use |
| 5150 | 'queues=n' to specify the number of queues to be created for |
| 5151 | multiqueue vhost-user. |
| 5152 | |
| 5153 | Example: |
| 5154 | |
| 5155 | :: |
| 5156 | |
| 5157 | qemu -m 512 -object memory-backend-file,id=mem,size=512M,mem-path=/hugetlbfs,share=on \ |
| 5158 | -numa node,memdev=mem \ |
| 5159 | -chardev socket,id=chr0,path=/path/to/socket \ |
| 5160 | -netdev type=vhost-user,id=net0,chardev=chr0 \ |
| 5161 | -device virtio-net-pci,netdev=net0 |
| 5162 | |
| 5163 | ``-netdev hubport,id=id,hubid=hubid[,netdev=nd]`` |
| 5164 | Create a hub port on the emulated hub with ID hubid. |
| 5165 | |
| 5166 | The hubport netdev lets you connect a NIC to a QEMU emulated hub |
| 5167 | instead of a single netdev. Alternatively, you can also connect the |
| 5168 | hubport to another netdev with ID nd by using the ``netdev=nd`` |
| 5169 | option. |
| 5170 | |
| 5171 | ``-net nic[,netdev=nd][,macaddr=mac][,model=type] [,name=name][,addr=addr][,vectors=v]`` |
| 5172 | Legacy option to configure or create an on-board (or machine |
| 5173 | default) Network Interface Card(NIC) and connect it either to the |
| 5174 | emulated hub with ID 0 (i.e. the default hub), or to the netdev nd. |
| 5175 | If model is omitted, then the default NIC model associated with the |
| 5176 | machine type is used. Note that the default NIC model may change in |
| 5177 | future QEMU releases, so it is highly recommended to always specify |
| 5178 | a model. Optionally, the MAC address can be changed to mac, the |
| 5179 | device address set to addr (PCI cards only), and a name can be |
| 5180 | assigned for use in monitor commands. Optionally, for PCI cards, you |
| 5181 | can specify the number v of MSI-X vectors that the card should have; |
| 5182 | this option currently only affects virtio cards; set v = 0 to |
| 5183 | disable MSI-X. If no ``-net`` option is specified, a single NIC is |
| 5184 | created. QEMU can emulate several different models of network card. |
| 5185 | Use ``-net nic,model=help`` for a list of available devices for your |
| 5186 | target. |
| 5187 | |
| 5188 | ``-net user|tap|bridge|socket|l2tpv3|vde[,...][,name=name]`` |
| 5189 | Configure a host network backend (with the options corresponding to |
| 5190 | the same ``-netdev`` option) and connect it to the emulated hub 0 |
| 5191 | (the default hub). Use name to specify the name of the hub port. |
| 5192 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 5193 | |
Markus Armbruster | c70a01e | 2013-02-13 19:49:40 +0100 | [diff] [blame] | 5194 | STEXI |
| 5195 | @end table |
| 5196 | ETEXI |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5197 | DEFHEADING() |
| 5198 | |
Markus Armbruster | de6b4f9 | 2017-10-02 16:03:00 +0200 | [diff] [blame] | 5199 | DEFHEADING(Character device options:) |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5200 | |
| 5201 | DEF("chardev", HAS_ARG, QEMU_OPTION_chardev, |
Lin Ma | 517b3d4 | 2016-08-17 01:13:52 +0800 | [diff] [blame] | 5202 | "-chardev help\n" |
Daniel P. Berrange | d0d7708 | 2016-01-11 12:44:41 +0000 | [diff] [blame] | 5203 | "-chardev null,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" |
Corey Minyard | 5dd1f02 | 2014-10-02 11:17:37 -0500 | [diff] [blame] | 5204 | "-chardev socket,id=id[,host=host],port=port[,to=to][,ipv4][,ipv6][,nodelay][,reconnect=seconds]\n" |
Julia Suvorova | 981b06e | 2018-10-19 01:35:00 +0300 | [diff] [blame] | 5205 | " [,server][,nowait][,telnet][,websocket][,reconnect=seconds][,mux=on|off]\n" |
Daniel P. Berrange | fd4a5fd | 2019-03-08 15:21:50 +0000 | [diff] [blame] | 5206 | " [,logfile=PATH][,logappend=on|off][,tls-creds=ID][,tls-authz=ID] (tcp)\n" |
Julia Suvorova | 981b06e | 2018-10-19 01:35:00 +0300 | [diff] [blame] | 5207 | "-chardev socket,id=id,path=path[,server][,nowait][,telnet][,websocket][,reconnect=seconds]\n" |
Daniel P. Berrange | d0d7708 | 2016-01-11 12:44:41 +0000 | [diff] [blame] | 5208 | " [,mux=on|off][,logfile=PATH][,logappend=on|off] (unix)\n" |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5209 | "-chardev udp,id=id[,host=host],port=port[,localaddr=localaddr]\n" |
Jan Kiszka | 9733128 | 2010-04-06 16:55:54 +0200 | [diff] [blame] | 5210 | " [,localport=localport][,ipv4][,ipv6][,mux=on|off]\n" |
Daniel P. Berrange | d0d7708 | 2016-01-11 12:44:41 +0000 | [diff] [blame] | 5211 | " [,logfile=PATH][,logappend=on|off]\n" |
| 5212 | "-chardev msmouse,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5213 | "-chardev vc,id=id[[,width=width][,height=height]][[,cols=cols][,rows=rows]]\n" |
Daniel P. Berrange | d0d7708 | 2016-01-11 12:44:41 +0000 | [diff] [blame] | 5214 | " [,mux=on|off][,logfile=PATH][,logappend=on|off]\n" |
| 5215 | "-chardev ringbuf,id=id[,size=size][,logfile=PATH][,logappend=on|off]\n" |
| 5216 | "-chardev file,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" |
| 5217 | "-chardev pipe,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5218 | #ifdef _WIN32 |
Daniel P. Berrange | d0d7708 | 2016-01-11 12:44:41 +0000 | [diff] [blame] | 5219 | "-chardev console,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" |
| 5220 | "-chardev serial,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5221 | #else |
Daniel P. Berrange | d0d7708 | 2016-01-11 12:44:41 +0000 | [diff] [blame] | 5222 | "-chardev pty,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" |
| 5223 | "-chardev stdio,id=id[,mux=on|off][,signal=on|off][,logfile=PATH][,logappend=on|off]\n" |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5224 | #endif |
| 5225 | #ifdef CONFIG_BRLAPI |
Daniel P. Berrange | d0d7708 | 2016-01-11 12:44:41 +0000 | [diff] [blame] | 5226 | "-chardev braille,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5227 | #endif |
| 5228 | #if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \ |
| 5229 | || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) |
Daniel P. Berrange | d0d7708 | 2016-01-11 12:44:41 +0000 | [diff] [blame] | 5230 | "-chardev serial,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" |
| 5231 | "-chardev tty,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5232 | #endif |
| 5233 | #if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__) |
Daniel P. Berrange | d0d7708 | 2016-01-11 12:44:41 +0000 | [diff] [blame] | 5234 | "-chardev parallel,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" |
| 5235 | "-chardev parport,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5236 | #endif |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 5237 | #if defined(CONFIG_SPICE) |
Daniel P. Berrange | d0d7708 | 2016-01-11 12:44:41 +0000 | [diff] [blame] | 5238 | "-chardev spicevmc,id=id,name=name[,debug=debug][,logfile=PATH][,logappend=on|off]\n" |
| 5239 | "-chardev spiceport,id=id,name=name[,debug=debug][,logfile=PATH][,logappend=on|off]\n" |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 5240 | #endif |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 5241 | , QEMU_ARCH_ALL |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5242 | ) |
| 5243 | |
| 5244 | STEXI |
Markus Armbruster | dddba06 | 2017-10-02 16:03:06 +0200 | [diff] [blame] | 5245 | |
| 5246 | The general form of a character device option is: |
| 5247 | @table @option |
Thomas Huth | 16fdc56 | 2018-01-30 10:36:21 +0100 | [diff] [blame] | 5248 | @item -chardev @var{backend},id=@var{id}[,mux=on|off][,@var{options}] |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 5249 | @findex -chardev |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5250 | Backend is one of: |
| 5251 | @option{null}, |
| 5252 | @option{socket}, |
| 5253 | @option{udp}, |
| 5254 | @option{msmouse}, |
| 5255 | @option{vc}, |
Markus Armbruster | 4f57378 | 2013-07-26 16:44:32 +0200 | [diff] [blame] | 5256 | @option{ringbuf}, |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5257 | @option{file}, |
| 5258 | @option{pipe}, |
| 5259 | @option{console}, |
| 5260 | @option{serial}, |
| 5261 | @option{pty}, |
| 5262 | @option{stdio}, |
| 5263 | @option{braille}, |
| 5264 | @option{tty}, |
Gerd Hoffmann | 88a946d | 2013-01-10 14:20:58 +0100 | [diff] [blame] | 5265 | @option{parallel}, |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 5266 | @option{parport}, |
Thomas Huth | 16fdc56 | 2018-01-30 10:36:21 +0100 | [diff] [blame] | 5267 | @option{spicevmc}, |
Marc-André Lureau | 5a49d3e | 2012-12-05 16:15:34 +0100 | [diff] [blame] | 5268 | @option{spiceport}. |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5269 | The specific backend will determine the applicable options. |
| 5270 | |
Markus Armbruster | dddba06 | 2017-10-02 16:03:06 +0200 | [diff] [blame] | 5271 | Use @code{-chardev help} to print all available chardev backend types. |
Lin Ma | 517b3d4 | 2016-08-17 01:13:52 +0800 | [diff] [blame] | 5272 | |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5273 | All devices must have an id, which can be any string up to 127 characters long. |
| 5274 | It is used to uniquely identify this device in other command line directives. |
| 5275 | |
Jan Kiszka | 9733128 | 2010-04-06 16:55:54 +0200 | [diff] [blame] | 5276 | A character device may be used in multiplexing mode by multiple front-ends. |
Peter Maydell | a40db1b | 2016-02-16 17:28:58 +0000 | [diff] [blame] | 5277 | Specify @option{mux=on} to enable this mode. |
| 5278 | A multiplexer is a "1:N" device, and here the "1" end is your specified chardev |
| 5279 | backend, and the "N" end is the various parts of QEMU that can talk to a chardev. |
| 5280 | If you create a chardev with @option{id=myid} and @option{mux=on}, QEMU will |
| 5281 | create a multiplexer with your specified ID, and you can then configure multiple |
| 5282 | front ends to use that chardev ID for their input/output. Up to four different |
| 5283 | front ends can be connected to a single multiplexed chardev. (Without |
| 5284 | multiplexing enabled, a chardev can only be used by a single front end.) |
| 5285 | For instance you could use this to allow a single stdio chardev to be used by |
| 5286 | two serial ports and the QEMU monitor: |
| 5287 | |
| 5288 | @example |
| 5289 | -chardev stdio,mux=on,id=char0 \ |
Marc-André Lureau | bdbcb54 | 2016-10-11 21:41:21 +0400 | [diff] [blame] | 5290 | -mon chardev=char0,mode=readline \ |
Peter Maydell | a40db1b | 2016-02-16 17:28:58 +0000 | [diff] [blame] | 5291 | -serial chardev:char0 \ |
| 5292 | -serial chardev:char0 |
| 5293 | @end example |
| 5294 | |
| 5295 | You can have more than one multiplexer in a system configuration; for instance |
| 5296 | you could have a TCP port multiplexed between UART 0 and UART 1, and stdio |
| 5297 | multiplexed between the QEMU monitor and a parallel port: |
| 5298 | |
| 5299 | @example |
| 5300 | -chardev stdio,mux=on,id=char0 \ |
Marc-André Lureau | bdbcb54 | 2016-10-11 21:41:21 +0400 | [diff] [blame] | 5301 | -mon chardev=char0,mode=readline \ |
Peter Maydell | a40db1b | 2016-02-16 17:28:58 +0000 | [diff] [blame] | 5302 | -parallel chardev:char0 \ |
| 5303 | -chardev tcp,...,mux=on,id=char1 \ |
| 5304 | -serial chardev:char1 \ |
| 5305 | -serial chardev:char1 |
| 5306 | @end example |
| 5307 | |
| 5308 | When you're using a multiplexed character device, some escape sequences are |
| 5309 | interpreted in the input. @xref{mux_keys, Keys in the character backend |
| 5310 | multiplexer}. |
| 5311 | |
| 5312 | Note that some other command line options may implicitly create multiplexed |
| 5313 | character backends; for instance @option{-serial mon:stdio} creates a |
| 5314 | multiplexed stdio backend connected to the serial port and the QEMU monitor, |
| 5315 | and @option{-nographic} also multiplexes the console and the monitor to |
| 5316 | stdio. |
| 5317 | |
| 5318 | There is currently no support for multiplexing in the other direction |
| 5319 | (where a single QEMU front end takes input and output from multiple chardevs). |
Jan Kiszka | 9733128 | 2010-04-06 16:55:54 +0200 | [diff] [blame] | 5320 | |
Daniel P. Berrange | d0d7708 | 2016-01-11 12:44:41 +0000 | [diff] [blame] | 5321 | Every backend supports the @option{logfile} option, which supplies the path |
| 5322 | to a file to record all data transmitted via the backend. The @option{logappend} |
| 5323 | option controls whether the log file will be truncated or appended to when |
| 5324 | opened. |
| 5325 | |
Markus Armbruster | dddba06 | 2017-10-02 16:03:06 +0200 | [diff] [blame] | 5326 | @end table |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5327 | |
Markus Armbruster | dddba06 | 2017-10-02 16:03:06 +0200 | [diff] [blame] | 5328 | The available backends are: |
| 5329 | |
| 5330 | @table @option |
Thomas Huth | 16fdc56 | 2018-01-30 10:36:21 +0100 | [diff] [blame] | 5331 | @item -chardev null,id=@var{id} |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5332 | A void device. This device will not emit any data, and will drop any data it |
| 5333 | receives. The null backend does not take any options. |
| 5334 | |
Daniel P. Berrange | fd4a5fd | 2019-03-08 15:21:50 +0000 | [diff] [blame] | 5335 | @item -chardev socket,id=@var{id}[,@var{TCP options} or @var{unix options}][,server][,nowait][,telnet][,websocket][,reconnect=@var{seconds}][,tls-creds=@var{id}][,tls-authz=@var{id}] |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5336 | |
| 5337 | Create a two-way stream socket, which can be either a TCP or a unix socket. A |
| 5338 | unix socket will be created if @option{path} is specified. Behaviour is |
| 5339 | undefined if TCP options are specified for a unix socket. |
| 5340 | |
| 5341 | @option{server} specifies that the socket shall be a listening socket. |
| 5342 | |
| 5343 | @option{nowait} specifies that QEMU should not block waiting for a client to |
| 5344 | connect to a listening socket. |
| 5345 | |
| 5346 | @option{telnet} specifies that traffic on the socket should interpret telnet |
| 5347 | escape sequences. |
| 5348 | |
Julia Suvorova | 981b06e | 2018-10-19 01:35:00 +0300 | [diff] [blame] | 5349 | @option{websocket} specifies that the socket uses WebSocket protocol for |
| 5350 | communication. |
| 5351 | |
Corey Minyard | 5dd1f02 | 2014-10-02 11:17:37 -0500 | [diff] [blame] | 5352 | @option{reconnect} sets the timeout for reconnecting on non-server sockets when |
| 5353 | the remote end goes away. qemu will delay this many seconds and then attempt |
| 5354 | to reconnect. Zero disables reconnecting, and is the default. |
| 5355 | |
Daniel P. Berrange | a8fb542 | 2016-01-19 11:14:31 +0000 | [diff] [blame] | 5356 | @option{tls-creds} requests enablement of the TLS protocol for encryption, |
| 5357 | and specifies the id of the TLS credentials to use for the handshake. The |
| 5358 | credentials must be previously created with the @option{-object tls-creds} |
| 5359 | argument. |
| 5360 | |
Daniel P. Berrange | fd4a5fd | 2019-03-08 15:21:50 +0000 | [diff] [blame] | 5361 | @option{tls-auth} provides the ID of the QAuthZ authorization object against |
| 5362 | which the client's x509 distinguished name will be validated. This object is |
| 5363 | only resolved at time of use, so can be deleted and recreated on the fly |
| 5364 | while the chardev server is active. If missing, it will default to denying |
| 5365 | access. |
| 5366 | |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5367 | TCP and unix socket options are given below: |
| 5368 | |
| 5369 | @table @option |
| 5370 | |
Thomas Huth | 16fdc56 | 2018-01-30 10:36:21 +0100 | [diff] [blame] | 5371 | @item TCP options: port=@var{port}[,host=@var{host}][,to=@var{to}][,ipv4][,ipv6][,nodelay] |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5372 | |
| 5373 | @option{host} for a listening socket specifies the local address to be bound. |
| 5374 | For a connecting socket species the remote host to connect to. @option{host} is |
| 5375 | optional for listening sockets. If not specified it defaults to @code{0.0.0.0}. |
| 5376 | |
| 5377 | @option{port} for a listening socket specifies the local port to be bound. For a |
| 5378 | connecting socket specifies the port on the remote host to connect to. |
| 5379 | @option{port} can be given as either a port number or a service name. |
| 5380 | @option{port} is required. |
| 5381 | |
| 5382 | @option{to} is only relevant to listening sockets. If it is specified, and |
| 5383 | @option{port} cannot be bound, QEMU will attempt to bind to subsequent ports up |
| 5384 | to and including @option{to} until it succeeds. @option{to} must be specified |
| 5385 | as a port number. |
| 5386 | |
| 5387 | @option{ipv4} and @option{ipv6} specify that either IPv4 or IPv6 must be used. |
| 5388 | If neither is specified the socket may use either protocol. |
| 5389 | |
| 5390 | @option{nodelay} disables the Nagle algorithm. |
| 5391 | |
| 5392 | @item unix options: path=@var{path} |
| 5393 | |
| 5394 | @option{path} specifies the local path of the unix socket. @option{path} is |
| 5395 | required. |
| 5396 | |
| 5397 | @end table |
| 5398 | |
Thomas Huth | 16fdc56 | 2018-01-30 10:36:21 +0100 | [diff] [blame] | 5399 | @item -chardev udp,id=@var{id}[,host=@var{host}],port=@var{port}[,localaddr=@var{localaddr}][,localport=@var{localport}][,ipv4][,ipv6] |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5400 | |
| 5401 | Sends all traffic from the guest to a remote host over UDP. |
| 5402 | |
| 5403 | @option{host} specifies the remote host to connect to. If not specified it |
| 5404 | defaults to @code{localhost}. |
| 5405 | |
| 5406 | @option{port} specifies the port on the remote host to connect to. @option{port} |
| 5407 | is required. |
| 5408 | |
| 5409 | @option{localaddr} specifies the local address to bind to. If not specified it |
| 5410 | defaults to @code{0.0.0.0}. |
| 5411 | |
| 5412 | @option{localport} specifies the local port to bind to. If not specified any |
| 5413 | available local port will be used. |
| 5414 | |
| 5415 | @option{ipv4} and @option{ipv6} specify that either IPv4 or IPv6 must be used. |
| 5416 | If neither is specified the device may use either protocol. |
| 5417 | |
Thomas Huth | 16fdc56 | 2018-01-30 10:36:21 +0100 | [diff] [blame] | 5418 | @item -chardev msmouse,id=@var{id} |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5419 | |
| 5420 | Forward QEMU's emulated msmouse events to the guest. @option{msmouse} does not |
| 5421 | take any options. |
| 5422 | |
Thomas Huth | 16fdc56 | 2018-01-30 10:36:21 +0100 | [diff] [blame] | 5423 | @item -chardev vc,id=@var{id}[[,width=@var{width}][,height=@var{height}]][[,cols=@var{cols}][,rows=@var{rows}]] |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5424 | |
| 5425 | Connect to a QEMU text console. @option{vc} may optionally be given a specific |
| 5426 | size. |
| 5427 | |
| 5428 | @option{width} and @option{height} specify the width and height respectively of |
| 5429 | the console, in pixels. |
| 5430 | |
| 5431 | @option{cols} and @option{rows} specify that the console be sized to fit a text |
| 5432 | console with the given dimensions. |
| 5433 | |
Thomas Huth | 16fdc56 | 2018-01-30 10:36:21 +0100 | [diff] [blame] | 5434 | @item -chardev ringbuf,id=@var{id}[,size=@var{size}] |
Lei Li | 51767e7 | 2013-01-25 00:03:19 +0800 | [diff] [blame] | 5435 | |
Markus Armbruster | 3949e59 | 2013-02-06 21:27:24 +0100 | [diff] [blame] | 5436 | Create a ring buffer with fixed size @option{size}. |
Stefan Hajnoczi | e69f7d2 | 2016-09-19 11:56:26 +0100 | [diff] [blame] | 5437 | @var{size} must be a power of two and defaults to @code{64K}. |
Lei Li | 51767e7 | 2013-01-25 00:03:19 +0800 | [diff] [blame] | 5438 | |
Thomas Huth | 16fdc56 | 2018-01-30 10:36:21 +0100 | [diff] [blame] | 5439 | @item -chardev file,id=@var{id},path=@var{path} |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5440 | |
| 5441 | Log all traffic received from the guest to a file. |
| 5442 | |
| 5443 | @option{path} specifies the path of the file to be opened. This file will be |
| 5444 | created if it does not already exist, and overwritten if it does. @option{path} |
| 5445 | is required. |
| 5446 | |
Thomas Huth | 16fdc56 | 2018-01-30 10:36:21 +0100 | [diff] [blame] | 5447 | @item -chardev pipe,id=@var{id},path=@var{path} |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5448 | |
| 5449 | Create a two-way connection to the guest. The behaviour differs slightly between |
| 5450 | Windows hosts and other hosts: |
| 5451 | |
| 5452 | On Windows, a single duplex pipe will be created at |
| 5453 | @file{\\.pipe\@option{path}}. |
| 5454 | |
| 5455 | On other hosts, 2 pipes will be created called @file{@option{path}.in} and |
| 5456 | @file{@option{path}.out}. Data written to @file{@option{path}.in} will be |
| 5457 | received by the guest. Data written by the guest can be read from |
| 5458 | @file{@option{path}.out}. QEMU will not create these fifos, and requires them to |
| 5459 | be present. |
| 5460 | |
| 5461 | @option{path} forms part of the pipe path as described above. @option{path} is |
| 5462 | required. |
| 5463 | |
Thomas Huth | 16fdc56 | 2018-01-30 10:36:21 +0100 | [diff] [blame] | 5464 | @item -chardev console,id=@var{id} |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5465 | |
| 5466 | Send traffic from the guest to QEMU's standard output. @option{console} does not |
| 5467 | take any options. |
| 5468 | |
| 5469 | @option{console} is only available on Windows hosts. |
| 5470 | |
Thomas Huth | 16fdc56 | 2018-01-30 10:36:21 +0100 | [diff] [blame] | 5471 | @item -chardev serial,id=@var{id},path=@option{path} |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5472 | |
| 5473 | Send traffic from the guest to a serial device on the host. |
| 5474 | |
Gerd Hoffmann | d59044e | 2012-12-19 13:50:29 +0100 | [diff] [blame] | 5475 | On Unix hosts serial will actually accept any tty device, |
| 5476 | not only serial lines. |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5477 | |
| 5478 | @option{path} specifies the name of the serial device to open. |
| 5479 | |
Thomas Huth | 16fdc56 | 2018-01-30 10:36:21 +0100 | [diff] [blame] | 5480 | @item -chardev pty,id=@var{id} |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5481 | |
| 5482 | Create a new pseudo-terminal on the host and connect to it. @option{pty} does |
| 5483 | not take any options. |
| 5484 | |
| 5485 | @option{pty} is not available on Windows hosts. |
| 5486 | |
Thomas Huth | 16fdc56 | 2018-01-30 10:36:21 +0100 | [diff] [blame] | 5487 | @item -chardev stdio,id=@var{id}[,signal=on|off] |
Stefan Weil | b65ee4f | 2012-05-11 22:25:50 +0200 | [diff] [blame] | 5488 | Connect to standard input and standard output of the QEMU process. |
Aurelien Jarno | b7fdb3a | 2010-07-13 21:13:12 +0200 | [diff] [blame] | 5489 | |
| 5490 | @option{signal} controls if signals are enabled on the terminal, that includes |
| 5491 | exiting QEMU with the key sequence @key{Control-c}. This option is enabled by |
| 5492 | default, use @option{signal=off} to disable it. |
| 5493 | |
Thomas Huth | 16fdc56 | 2018-01-30 10:36:21 +0100 | [diff] [blame] | 5494 | @item -chardev braille,id=@var{id} |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5495 | |
| 5496 | Connect to a local BrlAPI server. @option{braille} does not take any options. |
| 5497 | |
Thomas Huth | 16fdc56 | 2018-01-30 10:36:21 +0100 | [diff] [blame] | 5498 | @item -chardev tty,id=@var{id},path=@var{path} |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5499 | |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5500 | @option{tty} is only available on Linux, Sun, FreeBSD, NetBSD, OpenBSD and |
Markus Armbruster | d037d6b | 2013-02-13 15:54:15 +0100 | [diff] [blame] | 5501 | DragonFlyBSD hosts. It is an alias for @option{serial}. |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5502 | |
| 5503 | @option{path} specifies the path to the tty. @option{path} is required. |
| 5504 | |
Thomas Huth | 16fdc56 | 2018-01-30 10:36:21 +0100 | [diff] [blame] | 5505 | @item -chardev parallel,id=@var{id},path=@var{path} |
| 5506 | @itemx -chardev parport,id=@var{id},path=@var{path} |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5507 | |
Gerd Hoffmann | 88a946d | 2013-01-10 14:20:58 +0100 | [diff] [blame] | 5508 | @option{parallel} is only available on Linux, FreeBSD and DragonFlyBSD hosts. |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5509 | |
| 5510 | Connect to a local parallel port. |
| 5511 | |
| 5512 | @option{path} specifies the path to the parallel port device. @option{path} is |
| 5513 | required. |
| 5514 | |
Thomas Huth | 16fdc56 | 2018-01-30 10:36:21 +0100 | [diff] [blame] | 5515 | @item -chardev spicevmc,id=@var{id},debug=@var{debug},name=@var{name} |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 5516 | |
Stefan Hajnoczi | 3a84690 | 2011-10-06 11:24:12 +0100 | [diff] [blame] | 5517 | @option{spicevmc} is only available when spice support is built in. |
| 5518 | |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 5519 | @option{debug} debug level for spicevmc |
| 5520 | |
| 5521 | @option{name} name of spice channel to connect to |
| 5522 | |
| 5523 | Connect to a spice virtual machine channel, such as vdiport. |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 5524 | |
Thomas Huth | 16fdc56 | 2018-01-30 10:36:21 +0100 | [diff] [blame] | 5525 | @item -chardev spiceport,id=@var{id},debug=@var{debug},name=@var{name} |
Marc-André Lureau | 5a49d3e | 2012-12-05 16:15:34 +0100 | [diff] [blame] | 5526 | |
| 5527 | @option{spiceport} is only available when spice support is built in. |
| 5528 | |
| 5529 | @option{debug} debug level for spicevmc |
| 5530 | |
| 5531 | @option{name} name of spice port to connect to |
| 5532 | |
| 5533 | Connect to a spice port, allowing a Spice client to handle the traffic |
| 5534 | identified by a name (preferably a fqdn). |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5535 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 5536 | SRST |
| 5537 | The general form of a character device option is: |
| 5538 | |
| 5539 | ``-chardev backend,id=id[,mux=on|off][,options]`` |
| 5540 | Backend is one of: ``null``, ``socket``, ``udp``, ``msmouse``, |
| 5541 | ``vc``, ``ringbuf``, ``file``, ``pipe``, ``console``, ``serial``, |
| 5542 | ``pty``, ``stdio``, ``braille``, ``tty``, ``parallel``, ``parport``, |
| 5543 | ``spicevmc``, ``spiceport``. The specific backend will determine the |
| 5544 | applicable options. |
| 5545 | |
| 5546 | Use ``-chardev help`` to print all available chardev backend types. |
| 5547 | |
| 5548 | All devices must have an id, which can be any string up to 127 |
| 5549 | characters long. It is used to uniquely identify this device in |
| 5550 | other command line directives. |
| 5551 | |
| 5552 | A character device may be used in multiplexing mode by multiple |
| 5553 | front-ends. Specify ``mux=on`` to enable this mode. A multiplexer is |
| 5554 | a "1:N" device, and here the "1" end is your specified chardev |
| 5555 | backend, and the "N" end is the various parts of QEMU that can talk |
| 5556 | to a chardev. If you create a chardev with ``id=myid`` and |
| 5557 | ``mux=on``, QEMU will create a multiplexer with your specified ID, |
| 5558 | and you can then configure multiple front ends to use that chardev |
| 5559 | ID for their input/output. Up to four different front ends can be |
| 5560 | connected to a single multiplexed chardev. (Without multiplexing |
| 5561 | enabled, a chardev can only be used by a single front end.) For |
| 5562 | instance you could use this to allow a single stdio chardev to be |
| 5563 | used by two serial ports and the QEMU monitor: |
| 5564 | |
| 5565 | :: |
| 5566 | |
| 5567 | -chardev stdio,mux=on,id=char0 \ |
| 5568 | -mon chardev=char0,mode=readline \ |
| 5569 | -serial chardev:char0 \ |
| 5570 | -serial chardev:char0 |
| 5571 | |
| 5572 | You can have more than one multiplexer in a system configuration; |
| 5573 | for instance you could have a TCP port multiplexed between UART 0 |
| 5574 | and UART 1, and stdio multiplexed between the QEMU monitor and a |
| 5575 | parallel port: |
| 5576 | |
| 5577 | :: |
| 5578 | |
| 5579 | -chardev stdio,mux=on,id=char0 \ |
| 5580 | -mon chardev=char0,mode=readline \ |
| 5581 | -parallel chardev:char0 \ |
| 5582 | -chardev tcp,...,mux=on,id=char1 \ |
| 5583 | -serial chardev:char1 \ |
| 5584 | -serial chardev:char1 |
| 5585 | |
| 5586 | When you're using a multiplexed character device, some escape |
| 5587 | sequences are interpreted in the input. See :ref:`mux_005fkeys`. |
| 5588 | |
| 5589 | Note that some other command line options may implicitly create |
| 5590 | multiplexed character backends; for instance ``-serial mon:stdio`` |
| 5591 | creates a multiplexed stdio backend connected to the serial port and |
| 5592 | the QEMU monitor, and ``-nographic`` also multiplexes the console |
| 5593 | and the monitor to stdio. |
| 5594 | |
| 5595 | There is currently no support for multiplexing in the other |
| 5596 | direction (where a single QEMU front end takes input and output from |
| 5597 | multiple chardevs). |
| 5598 | |
| 5599 | Every backend supports the ``logfile`` option, which supplies the |
| 5600 | path to a file to record all data transmitted via the backend. The |
| 5601 | ``logappend`` option controls whether the log file will be truncated |
| 5602 | or appended to when opened. |
| 5603 | |
| 5604 | The available backends are: |
| 5605 | |
| 5606 | ``-chardev null,id=id`` |
| 5607 | A void device. This device will not emit any data, and will drop any |
| 5608 | data it receives. The null backend does not take any options. |
| 5609 | |
| 5610 | ``-chardev socket,id=id[,TCP options or unix options][,server][,nowait][,telnet][,websocket][,reconnect=seconds][,tls-creds=id][,tls-authz=id]`` |
| 5611 | Create a two-way stream socket, which can be either a TCP or a unix |
| 5612 | socket. A unix socket will be created if ``path`` is specified. |
| 5613 | Behaviour is undefined if TCP options are specified for a unix |
| 5614 | socket. |
| 5615 | |
| 5616 | ``server`` specifies that the socket shall be a listening socket. |
| 5617 | |
| 5618 | ``nowait`` specifies that QEMU should not block waiting for a client |
| 5619 | to connect to a listening socket. |
| 5620 | |
| 5621 | ``telnet`` specifies that traffic on the socket should interpret |
| 5622 | telnet escape sequences. |
| 5623 | |
| 5624 | ``websocket`` specifies that the socket uses WebSocket protocol for |
| 5625 | communication. |
| 5626 | |
| 5627 | ``reconnect`` sets the timeout for reconnecting on non-server |
| 5628 | sockets when the remote end goes away. qemu will delay this many |
| 5629 | seconds and then attempt to reconnect. Zero disables reconnecting, |
| 5630 | and is the default. |
| 5631 | |
| 5632 | ``tls-creds`` requests enablement of the TLS protocol for |
| 5633 | encryption, and specifies the id of the TLS credentials to use for |
| 5634 | the handshake. The credentials must be previously created with the |
| 5635 | ``-object tls-creds`` argument. |
| 5636 | |
| 5637 | ``tls-auth`` provides the ID of the QAuthZ authorization object |
| 5638 | against which the client's x509 distinguished name will be |
| 5639 | validated. This object is only resolved at time of use, so can be |
| 5640 | deleted and recreated on the fly while the chardev server is active. |
| 5641 | If missing, it will default to denying access. |
| 5642 | |
| 5643 | TCP and unix socket options are given below: |
| 5644 | |
| 5645 | ``TCP options: port=port[,host=host][,to=to][,ipv4][,ipv6][,nodelay]`` |
| 5646 | ``host`` for a listening socket specifies the local address to |
| 5647 | be bound. For a connecting socket species the remote host to |
| 5648 | connect to. ``host`` is optional for listening sockets. If not |
| 5649 | specified it defaults to ``0.0.0.0``. |
| 5650 | |
| 5651 | ``port`` for a listening socket specifies the local port to be |
| 5652 | bound. For a connecting socket specifies the port on the remote |
| 5653 | host to connect to. ``port`` can be given as either a port |
| 5654 | number or a service name. ``port`` is required. |
| 5655 | |
| 5656 | ``to`` is only relevant to listening sockets. If it is |
| 5657 | specified, and ``port`` cannot be bound, QEMU will attempt to |
| 5658 | bind to subsequent ports up to and including ``to`` until it |
| 5659 | succeeds. ``to`` must be specified as a port number. |
| 5660 | |
| 5661 | ``ipv4`` and ``ipv6`` specify that either IPv4 or IPv6 must be |
| 5662 | used. If neither is specified the socket may use either |
| 5663 | protocol. |
| 5664 | |
| 5665 | ``nodelay`` disables the Nagle algorithm. |
| 5666 | |
| 5667 | ``unix options: path=path`` |
| 5668 | ``path`` specifies the local path of the unix socket. ``path`` |
| 5669 | is required. |
| 5670 | |
| 5671 | ``-chardev udp,id=id[,host=host],port=port[,localaddr=localaddr][,localport=localport][,ipv4][,ipv6]`` |
| 5672 | Sends all traffic from the guest to a remote host over UDP. |
| 5673 | |
| 5674 | ``host`` specifies the remote host to connect to. If not specified |
| 5675 | it defaults to ``localhost``. |
| 5676 | |
| 5677 | ``port`` specifies the port on the remote host to connect to. |
| 5678 | ``port`` is required. |
| 5679 | |
| 5680 | ``localaddr`` specifies the local address to bind to. If not |
| 5681 | specified it defaults to ``0.0.0.0``. |
| 5682 | |
| 5683 | ``localport`` specifies the local port to bind to. If not specified |
| 5684 | any available local port will be used. |
| 5685 | |
| 5686 | ``ipv4`` and ``ipv6`` specify that either IPv4 or IPv6 must be used. |
| 5687 | If neither is specified the device may use either protocol. |
| 5688 | |
| 5689 | ``-chardev msmouse,id=id`` |
| 5690 | Forward QEMU's emulated msmouse events to the guest. ``msmouse`` |
| 5691 | does not take any options. |
| 5692 | |
| 5693 | ``-chardev vc,id=id[[,width=width][,height=height]][[,cols=cols][,rows=rows]]`` |
| 5694 | Connect to a QEMU text console. ``vc`` may optionally be given a |
| 5695 | specific size. |
| 5696 | |
| 5697 | ``width`` and ``height`` specify the width and height respectively |
| 5698 | of the console, in pixels. |
| 5699 | |
| 5700 | ``cols`` and ``rows`` specify that the console be sized to fit a |
| 5701 | text console with the given dimensions. |
| 5702 | |
| 5703 | ``-chardev ringbuf,id=id[,size=size]`` |
| 5704 | Create a ring buffer with fixed size ``size``. size must be a power |
| 5705 | of two and defaults to ``64K``. |
| 5706 | |
| 5707 | ``-chardev file,id=id,path=path`` |
| 5708 | Log all traffic received from the guest to a file. |
| 5709 | |
| 5710 | ``path`` specifies the path of the file to be opened. This file will |
| 5711 | be created if it does not already exist, and overwritten if it does. |
| 5712 | ``path`` is required. |
| 5713 | |
| 5714 | ``-chardev pipe,id=id,path=path`` |
| 5715 | Create a two-way connection to the guest. The behaviour differs |
| 5716 | slightly between Windows hosts and other hosts: |
| 5717 | |
| 5718 | On Windows, a single duplex pipe will be created at |
| 5719 | ``\\.pipe\path``. |
| 5720 | |
| 5721 | On other hosts, 2 pipes will be created called ``path.in`` and |
| 5722 | ``path.out``. Data written to ``path.in`` will be received by the |
| 5723 | guest. Data written by the guest can be read from ``path.out``. QEMU |
| 5724 | will not create these fifos, and requires them to be present. |
| 5725 | |
| 5726 | ``path`` forms part of the pipe path as described above. ``path`` is |
| 5727 | required. |
| 5728 | |
| 5729 | ``-chardev console,id=id`` |
| 5730 | Send traffic from the guest to QEMU's standard output. ``console`` |
| 5731 | does not take any options. |
| 5732 | |
| 5733 | ``console`` is only available on Windows hosts. |
| 5734 | |
| 5735 | ``-chardev serial,id=id,path=path`` |
| 5736 | Send traffic from the guest to a serial device on the host. |
| 5737 | |
| 5738 | On Unix hosts serial will actually accept any tty device, not only |
| 5739 | serial lines. |
| 5740 | |
| 5741 | ``path`` specifies the name of the serial device to open. |
| 5742 | |
| 5743 | ``-chardev pty,id=id`` |
| 5744 | Create a new pseudo-terminal on the host and connect to it. ``pty`` |
| 5745 | does not take any options. |
| 5746 | |
| 5747 | ``pty`` is not available on Windows hosts. |
| 5748 | |
| 5749 | ``-chardev stdio,id=id[,signal=on|off]`` |
| 5750 | Connect to standard input and standard output of the QEMU process. |
| 5751 | |
| 5752 | ``signal`` controls if signals are enabled on the terminal, that |
| 5753 | includes exiting QEMU with the key sequence Control-c. This option |
| 5754 | is enabled by default, use ``signal=off`` to disable it. |
| 5755 | |
| 5756 | ``-chardev braille,id=id`` |
| 5757 | Connect to a local BrlAPI server. ``braille`` does not take any |
| 5758 | options. |
| 5759 | |
| 5760 | ``-chardev tty,id=id,path=path`` |
| 5761 | ``tty`` is only available on Linux, Sun, FreeBSD, NetBSD, OpenBSD |
| 5762 | and DragonFlyBSD hosts. It is an alias for ``serial``. |
| 5763 | |
| 5764 | ``path`` specifies the path to the tty. ``path`` is required. |
| 5765 | |
Peter Maydell | 09ce5f2 | 2020-02-28 15:36:13 +0000 | [diff] [blame^] | 5766 | ``-chardev parallel,id=id,path=path`` |
| 5767 | \ |
| 5768 | ``-chardev parport,id=id,path=path`` |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 5769 | ``parallel`` is only available on Linux, FreeBSD and DragonFlyBSD |
| 5770 | hosts. |
| 5771 | |
| 5772 | Connect to a local parallel port. |
| 5773 | |
| 5774 | ``path`` specifies the path to the parallel port device. ``path`` is |
| 5775 | required. |
| 5776 | |
| 5777 | ``-chardev spicevmc,id=id,debug=debug,name=name`` |
| 5778 | ``spicevmc`` is only available when spice support is built in. |
| 5779 | |
| 5780 | ``debug`` debug level for spicevmc |
| 5781 | |
| 5782 | ``name`` name of spice channel to connect to |
| 5783 | |
| 5784 | Connect to a spice virtual machine channel, such as vdiport. |
| 5785 | |
| 5786 | ``-chardev spiceport,id=id,debug=debug,name=name`` |
| 5787 | ``spiceport`` is only available when spice support is built in. |
| 5788 | |
| 5789 | ``debug`` debug level for spicevmc |
| 5790 | |
| 5791 | ``name`` name of spice port to connect to |
| 5792 | |
| 5793 | Connect to a spice port, allowing a Spice client to handle the |
| 5794 | traffic identified by a name (preferably a fqdn). |
| 5795 | ERST |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5796 | |
Markus Armbruster | c70a01e | 2013-02-13 19:49:40 +0100 | [diff] [blame] | 5797 | STEXI |
| 5798 | @end table |
| 5799 | ETEXI |
Matthew Booth | 7273a2d | 2009-10-30 13:41:12 +0000 | [diff] [blame] | 5800 | DEFHEADING() |
| 5801 | |
Stefan Berger | d1a0cf7 | 2013-02-27 12:47:49 -0500 | [diff] [blame] | 5802 | #ifdef CONFIG_TPM |
Markus Armbruster | de6b4f9 | 2017-10-02 16:03:00 +0200 | [diff] [blame] | 5803 | DEFHEADING(TPM device options:) |
Stefan Berger | d1a0cf7 | 2013-02-27 12:47:49 -0500 | [diff] [blame] | 5804 | |
| 5805 | DEF("tpmdev", HAS_ARG, QEMU_OPTION_tpmdev, \ |
Stefan Berger | 92dcc23 | 2013-02-27 12:47:54 -0500 | [diff] [blame] | 5806 | "-tpmdev passthrough,id=id[,path=path][,cancel-path=path]\n" |
| 5807 | " use path to provide path to a character device; default is /dev/tpm0\n" |
| 5808 | " use cancel-path to provide path to TPM's cancel sysfs entry; if\n" |
Amarnath Valluri | f4ede81 | 2017-09-29 14:10:20 +0300 | [diff] [blame] | 5809 | " not provided it will be searched for in /sys/class/misc/tpm?/device\n" |
| 5810 | "-tpmdev emulator,id=id,chardev=dev\n" |
| 5811 | " configure the TPM device using chardev backend\n", |
Stefan Berger | d1a0cf7 | 2013-02-27 12:47:49 -0500 | [diff] [blame] | 5812 | QEMU_ARCH_ALL) |
| 5813 | STEXI |
| 5814 | |
| 5815 | The general form of a TPM device option is: |
| 5816 | @table @option |
| 5817 | |
Thomas Huth | 16fdc56 | 2018-01-30 10:36:21 +0100 | [diff] [blame] | 5818 | @item -tpmdev @var{backend},id=@var{id}[,@var{options}] |
Stefan Berger | d1a0cf7 | 2013-02-27 12:47:49 -0500 | [diff] [blame] | 5819 | @findex -tpmdev |
Stefan Berger | d1a0cf7 | 2013-02-27 12:47:49 -0500 | [diff] [blame] | 5820 | |
| 5821 | The specific backend type will determine the applicable options. |
Corey Bryant | 28c4fa3 | 2013-03-20 12:34:49 -0400 | [diff] [blame] | 5822 | The @code{-tpmdev} option creates the TPM backend and requires a |
| 5823 | @code{-device} option that specifies the TPM frontend interface model. |
Stefan Berger | d1a0cf7 | 2013-02-27 12:47:49 -0500 | [diff] [blame] | 5824 | |
Markus Armbruster | 2252aaf | 2017-10-02 16:03:05 +0200 | [diff] [blame] | 5825 | Use @code{-tpmdev help} to print all available TPM backend types. |
Stefan Berger | d1a0cf7 | 2013-02-27 12:47:49 -0500 | [diff] [blame] | 5826 | |
Markus Armbruster | 2252aaf | 2017-10-02 16:03:05 +0200 | [diff] [blame] | 5827 | @end table |
| 5828 | |
| 5829 | The available backends are: |
| 5830 | |
| 5831 | @table @option |
Stefan Berger | d1a0cf7 | 2013-02-27 12:47:49 -0500 | [diff] [blame] | 5832 | |
Thomas Huth | 16fdc56 | 2018-01-30 10:36:21 +0100 | [diff] [blame] | 5833 | @item -tpmdev passthrough,id=@var{id},path=@var{path},cancel-path=@var{cancel-path} |
Stefan Berger | 4549a8b | 2013-02-27 12:47:53 -0500 | [diff] [blame] | 5834 | |
| 5835 | (Linux-host only) Enable access to the host's TPM using the passthrough |
| 5836 | driver. |
| 5837 | |
| 5838 | @option{path} specifies the path to the host's TPM device, i.e., on |
| 5839 | a Linux host this would be @code{/dev/tpm0}. |
| 5840 | @option{path} is optional and by default @code{/dev/tpm0} is used. |
| 5841 | |
Stefan Berger | 92dcc23 | 2013-02-27 12:47:54 -0500 | [diff] [blame] | 5842 | @option{cancel-path} specifies the path to the host TPM device's sysfs |
| 5843 | entry allowing for cancellation of an ongoing TPM command. |
| 5844 | @option{cancel-path} is optional and by default QEMU will search for the |
| 5845 | sysfs entry to use. |
| 5846 | |
Stefan Berger | 4549a8b | 2013-02-27 12:47:53 -0500 | [diff] [blame] | 5847 | Some notes about using the host's TPM with the passthrough driver: |
| 5848 | |
| 5849 | The TPM device accessed by the passthrough driver must not be |
| 5850 | used by any other application on the host. |
| 5851 | |
| 5852 | Since the host's firmware (BIOS/UEFI) has already initialized the TPM, |
| 5853 | the VM's firmware (BIOS/UEFI) will not be able to initialize the |
| 5854 | TPM again and may therefore not show a TPM-specific menu that would |
| 5855 | otherwise allow the user to configure the TPM, e.g., allow the user to |
| 5856 | enable/disable or activate/deactivate the TPM. |
| 5857 | Further, if TPM ownership is released from within a VM then the host's TPM |
| 5858 | will get disabled and deactivated. To enable and activate the |
| 5859 | TPM again afterwards, the host has to be rebooted and the user is |
| 5860 | required to enter the firmware's menu to enable and activate the TPM. |
| 5861 | If the TPM is left disabled and/or deactivated most TPM commands will fail. |
| 5862 | |
| 5863 | To create a passthrough TPM use the following two options: |
| 5864 | @example |
| 5865 | -tpmdev passthrough,id=tpm0 -device tpm-tis,tpmdev=tpm0 |
| 5866 | @end example |
| 5867 | Note that the @code{-tpmdev} id is @code{tpm0} and is referenced by |
| 5868 | @code{tpmdev=tpm0} in the device option. |
| 5869 | |
Thomas Huth | 16fdc56 | 2018-01-30 10:36:21 +0100 | [diff] [blame] | 5870 | @item -tpmdev emulator,id=@var{id},chardev=@var{dev} |
Amarnath Valluri | f4ede81 | 2017-09-29 14:10:20 +0300 | [diff] [blame] | 5871 | |
| 5872 | (Linux-host only) Enable access to a TPM emulator using Unix domain socket based |
| 5873 | chardev backend. |
| 5874 | |
| 5875 | @option{chardev} specifies the unique ID of a character device backend that provides connection to the software TPM server. |
| 5876 | |
| 5877 | To create a TPM emulator backend device with chardev socket backend: |
| 5878 | @example |
| 5879 | |
| 5880 | -chardev socket,id=chrtpm,path=/tmp/swtpm-sock -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis,tpmdev=tpm0 |
| 5881 | |
| 5882 | @end example |
| 5883 | |
Stefan Berger | d1a0cf7 | 2013-02-27 12:47:49 -0500 | [diff] [blame] | 5884 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 5885 | SRST |
| 5886 | The general form of a TPM device option is: |
| 5887 | |
| 5888 | ``-tpmdev backend,id=id[,options]`` |
| 5889 | The specific backend type will determine the applicable options. The |
| 5890 | ``-tpmdev`` option creates the TPM backend and requires a |
| 5891 | ``-device`` option that specifies the TPM frontend interface model. |
| 5892 | |
| 5893 | Use ``-tpmdev help`` to print all available TPM backend types. |
| 5894 | |
| 5895 | The available backends are: |
| 5896 | |
| 5897 | ``-tpmdev passthrough,id=id,path=path,cancel-path=cancel-path`` |
| 5898 | (Linux-host only) Enable access to the host's TPM using the |
| 5899 | passthrough driver. |
| 5900 | |
| 5901 | ``path`` specifies the path to the host's TPM device, i.e., on a |
| 5902 | Linux host this would be ``/dev/tpm0``. ``path`` is optional and by |
| 5903 | default ``/dev/tpm0`` is used. |
| 5904 | |
| 5905 | ``cancel-path`` specifies the path to the host TPM device's sysfs |
| 5906 | entry allowing for cancellation of an ongoing TPM command. |
| 5907 | ``cancel-path`` is optional and by default QEMU will search for the |
| 5908 | sysfs entry to use. |
| 5909 | |
| 5910 | Some notes about using the host's TPM with the passthrough driver: |
| 5911 | |
| 5912 | The TPM device accessed by the passthrough driver must not be used |
| 5913 | by any other application on the host. |
| 5914 | |
| 5915 | Since the host's firmware (BIOS/UEFI) has already initialized the |
| 5916 | TPM, the VM's firmware (BIOS/UEFI) will not be able to initialize |
| 5917 | the TPM again and may therefore not show a TPM-specific menu that |
| 5918 | would otherwise allow the user to configure the TPM, e.g., allow the |
| 5919 | user to enable/disable or activate/deactivate the TPM. Further, if |
| 5920 | TPM ownership is released from within a VM then the host's TPM will |
| 5921 | get disabled and deactivated. To enable and activate the TPM again |
| 5922 | afterwards, the host has to be rebooted and the user is required to |
| 5923 | enter the firmware's menu to enable and activate the TPM. If the TPM |
| 5924 | is left disabled and/or deactivated most TPM commands will fail. |
| 5925 | |
| 5926 | To create a passthrough TPM use the following two options: |
| 5927 | |
| 5928 | :: |
| 5929 | |
| 5930 | -tpmdev passthrough,id=tpm0 -device tpm-tis,tpmdev=tpm0 |
| 5931 | |
| 5932 | Note that the ``-tpmdev`` id is ``tpm0`` and is referenced by |
| 5933 | ``tpmdev=tpm0`` in the device option. |
| 5934 | |
| 5935 | ``-tpmdev emulator,id=id,chardev=dev`` |
| 5936 | (Linux-host only) Enable access to a TPM emulator using Unix domain |
| 5937 | socket based chardev backend. |
| 5938 | |
| 5939 | ``chardev`` specifies the unique ID of a character device backend |
| 5940 | that provides connection to the software TPM server. |
| 5941 | |
| 5942 | To create a TPM emulator backend device with chardev socket backend: |
| 5943 | |
| 5944 | :: |
| 5945 | |
| 5946 | -chardev socket,id=chrtpm,path=/tmp/swtpm-sock -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis,tpmdev=tpm0 |
| 5947 | ERST |
Stefan Berger | d1a0cf7 | 2013-02-27 12:47:49 -0500 | [diff] [blame] | 5948 | |
Markus Armbruster | 2252aaf | 2017-10-02 16:03:05 +0200 | [diff] [blame] | 5949 | STEXI |
| 5950 | @end table |
| 5951 | ETEXI |
Stefan Berger | d1a0cf7 | 2013-02-27 12:47:49 -0500 | [diff] [blame] | 5952 | DEFHEADING() |
| 5953 | |
| 5954 | #endif |
| 5955 | |
Markus Armbruster | de6b4f9 | 2017-10-02 16:03:00 +0200 | [diff] [blame] | 5956 | DEFHEADING(Linux/Multiboot boot specific:) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 5957 | STEXI |
Alexander Graf | 7677f05 | 2009-06-28 16:55:55 +0200 | [diff] [blame] | 5958 | |
| 5959 | When using these options, you can use a given Linux or Multiboot |
| 5960 | kernel without installing it in the disk image. It can be useful |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 5961 | for easier testing of various kernels. |
| 5962 | |
| 5963 | @table @option |
| 5964 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 5965 | SRST |
| 5966 | When using these options, you can use a given Linux or Multiboot kernel |
| 5967 | without installing it in the disk image. It can be useful for easier |
| 5968 | testing of various kernels. |
| 5969 | |
| 5970 | |
| 5971 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 5972 | |
| 5973 | DEF("kernel", HAS_ARG, QEMU_OPTION_kernel, \ |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 5974 | "-kernel bzImage use 'bzImage' as kernel image\n", QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 5975 | STEXI |
| 5976 | @item -kernel @var{bzImage} |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 5977 | @findex -kernel |
Alexander Graf | 7677f05 | 2009-06-28 16:55:55 +0200 | [diff] [blame] | 5978 | Use @var{bzImage} as kernel image. The kernel can be either a Linux kernel |
| 5979 | or in multiboot format. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 5980 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 5981 | SRST |
| 5982 | ``-kernel bzImage`` |
| 5983 | Use bzImage as kernel image. The kernel can be either a Linux kernel |
| 5984 | or in multiboot format. |
| 5985 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 5986 | |
| 5987 | DEF("append", HAS_ARG, QEMU_OPTION_append, \ |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 5988 | "-append cmdline use 'cmdline' as kernel command line\n", QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 5989 | STEXI |
| 5990 | @item -append @var{cmdline} |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 5991 | @findex -append |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 5992 | Use @var{cmdline} as kernel command line |
| 5993 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 5994 | SRST |
| 5995 | ``-append cmdline`` |
| 5996 | Use cmdline as kernel command line |
| 5997 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 5998 | |
| 5999 | DEF("initrd", HAS_ARG, QEMU_OPTION_initrd, \ |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 6000 | "-initrd file use 'file' as initial ram disk\n", QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6001 | STEXI |
| 6002 | @item -initrd @var{file} |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 6003 | @findex -initrd |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6004 | Use @var{file} as initial ram disk. |
Alexander Graf | 7677f05 | 2009-06-28 16:55:55 +0200 | [diff] [blame] | 6005 | |
| 6006 | @item -initrd "@var{file1} arg=foo,@var{file2}" |
| 6007 | |
| 6008 | This syntax is only available with multiboot. |
| 6009 | |
| 6010 | Use @var{file1} and @var{file2} as modules and pass arg=foo as parameter to the |
| 6011 | first module. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6012 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 6013 | SRST |
| 6014 | ``-initrd file`` |
| 6015 | Use file as initial ram disk. |
| 6016 | |
| 6017 | ``-initrd "file1 arg=foo,file2"`` |
| 6018 | This syntax is only available with multiboot. |
| 6019 | |
| 6020 | Use file1 and file2 as modules and pass arg=foo as parameter to the |
| 6021 | first module. |
| 6022 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6023 | |
Grant Likely | 412beee | 2012-03-02 11:56:38 +0000 | [diff] [blame] | 6024 | DEF("dtb", HAS_ARG, QEMU_OPTION_dtb, \ |
Peter A. G. Crosthwaite | 379b5c7 | 2012-03-04 21:03:54 +1000 | [diff] [blame] | 6025 | "-dtb file use 'file' as device tree image\n", QEMU_ARCH_ALL) |
Grant Likely | 412beee | 2012-03-02 11:56:38 +0000 | [diff] [blame] | 6026 | STEXI |
| 6027 | @item -dtb @var{file} |
| 6028 | @findex -dtb |
| 6029 | Use @var{file} as a device tree binary (dtb) image and pass it to the kernel |
| 6030 | on boot. |
| 6031 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 6032 | SRST |
| 6033 | ``-dtb file`` |
| 6034 | Use file as a device tree binary (dtb) image and pass it to the |
| 6035 | kernel on boot. |
| 6036 | ERST |
Grant Likely | 412beee | 2012-03-02 11:56:38 +0000 | [diff] [blame] | 6037 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6038 | STEXI |
| 6039 | @end table |
| 6040 | ETEXI |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6041 | DEFHEADING() |
| 6042 | |
Markus Armbruster | de6b4f9 | 2017-10-02 16:03:00 +0200 | [diff] [blame] | 6043 | DEFHEADING(Debug/Expert options:) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6044 | STEXI |
| 6045 | @table @option |
| 6046 | ETEXI |
| 6047 | |
Gabriel L. Somlo | 81b2b81 | 2015-04-29 11:21:53 -0400 | [diff] [blame] | 6048 | DEF("fw_cfg", HAS_ARG, QEMU_OPTION_fwcfg, |
| 6049 | "-fw_cfg [name=]<name>,file=<file>\n" |
Markus Armbruster | 63d3145 | 2016-04-18 18:29:50 +0200 | [diff] [blame] | 6050 | " add named fw_cfg entry with contents from file\n" |
Gabriel L. Somlo | 6407d76 | 2015-09-29 12:29:01 -0400 | [diff] [blame] | 6051 | "-fw_cfg [name=]<name>,string=<str>\n" |
Markus Armbruster | 63d3145 | 2016-04-18 18:29:50 +0200 | [diff] [blame] | 6052 | " add named fw_cfg entry with contents from string\n", |
Gabriel L. Somlo | 81b2b81 | 2015-04-29 11:21:53 -0400 | [diff] [blame] | 6053 | QEMU_ARCH_ALL) |
| 6054 | STEXI |
Markus Armbruster | 63d3145 | 2016-04-18 18:29:50 +0200 | [diff] [blame] | 6055 | |
Gabriel L. Somlo | 81b2b81 | 2015-04-29 11:21:53 -0400 | [diff] [blame] | 6056 | @item -fw_cfg [name=]@var{name},file=@var{file} |
| 6057 | @findex -fw_cfg |
Markus Armbruster | 63d3145 | 2016-04-18 18:29:50 +0200 | [diff] [blame] | 6058 | Add named fw_cfg entry with contents from file @var{file}. |
Gabriel L. Somlo | 6407d76 | 2015-09-29 12:29:01 -0400 | [diff] [blame] | 6059 | |
| 6060 | @item -fw_cfg [name=]@var{name},string=@var{str} |
Markus Armbruster | 63d3145 | 2016-04-18 18:29:50 +0200 | [diff] [blame] | 6061 | Add named fw_cfg entry with contents from string @var{str}. |
| 6062 | |
| 6063 | The terminating NUL character of the contents of @var{str} will not be |
| 6064 | included as part of the fw_cfg item data. To insert contents with |
| 6065 | embedded NUL characters, you have to use the @var{file} parameter. |
| 6066 | |
| 6067 | The fw_cfg entries are passed by QEMU through to the guest. |
| 6068 | |
| 6069 | Example: |
| 6070 | @example |
| 6071 | -fw_cfg name=opt/com.mycompany/blob,file=./my_blob.bin |
| 6072 | @end example |
| 6073 | creates an fw_cfg entry named opt/com.mycompany/blob with contents |
| 6074 | from ./my_blob.bin. |
| 6075 | |
Gabriel L. Somlo | 81b2b81 | 2015-04-29 11:21:53 -0400 | [diff] [blame] | 6076 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 6077 | SRST |
| 6078 | ``-fw_cfg [name=]name,file=file`` |
| 6079 | Add named fw\_cfg entry with contents from file file. |
| 6080 | |
| 6081 | ``-fw_cfg [name=]name,string=str`` |
| 6082 | Add named fw\_cfg entry with contents from string str. |
| 6083 | |
| 6084 | The terminating NUL character of the contents of str will not be |
| 6085 | included as part of the fw\_cfg item data. To insert contents with |
| 6086 | embedded NUL characters, you have to use the file parameter. |
| 6087 | |
| 6088 | The fw\_cfg entries are passed by QEMU through to the guest. |
| 6089 | |
| 6090 | Example: |
| 6091 | |
| 6092 | :: |
| 6093 | |
| 6094 | -fw_cfg name=opt/com.mycompany/blob,file=./my_blob.bin |
| 6095 | |
| 6096 | creates an fw\_cfg entry named opt/com.mycompany/blob with contents |
| 6097 | from ./my\_blob.bin. |
| 6098 | ERST |
Gabriel L. Somlo | 81b2b81 | 2015-04-29 11:21:53 -0400 | [diff] [blame] | 6099 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6100 | DEF("serial", HAS_ARG, QEMU_OPTION_serial, \ |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 6101 | "-serial dev redirect the serial port to char device 'dev'\n", |
| 6102 | QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6103 | STEXI |
| 6104 | @item -serial @var{dev} |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 6105 | @findex -serial |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6106 | Redirect the virtual serial port to host character device |
| 6107 | @var{dev}. The default device is @code{vc} in graphical mode and |
| 6108 | @code{stdio} in non graphical mode. |
| 6109 | |
| 6110 | This option can be used several times to simulate up to 4 serial |
| 6111 | ports. |
| 6112 | |
| 6113 | Use @code{-serial none} to disable all serial ports. |
| 6114 | |
| 6115 | Available character devices are: |
Kevin Wolf | b3f046c | 2009-10-09 10:58:35 +0200 | [diff] [blame] | 6116 | @table @option |
Kevin Wolf | 4e257e5 | 2009-10-09 10:58:36 +0200 | [diff] [blame] | 6117 | @item vc[:@var{W}x@var{H}] |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6118 | Virtual console. Optionally, a width and height can be given in pixel with |
| 6119 | @example |
| 6120 | vc:800x600 |
| 6121 | @end example |
| 6122 | It is also possible to specify width or height in characters: |
| 6123 | @example |
| 6124 | vc:80Cx24C |
| 6125 | @end example |
| 6126 | @item pty |
| 6127 | [Linux only] Pseudo TTY (a new PTY is automatically allocated) |
| 6128 | @item none |
| 6129 | No device is allocated. |
| 6130 | @item null |
| 6131 | void device |
Ingo van Lil | 88e020e | 2013-12-20 14:44:53 +0100 | [diff] [blame] | 6132 | @item chardev:@var{id} |
| 6133 | Use a named character device defined with the @code{-chardev} option. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6134 | @item /dev/XXX |
| 6135 | [Linux only] Use host tty, e.g. @file{/dev/ttyS0}. The host serial port |
| 6136 | parameters are set according to the emulated ones. |
| 6137 | @item /dev/parport@var{N} |
| 6138 | [Linux only, parallel port only] Use host parallel port |
| 6139 | @var{N}. Currently SPP and EPP parallel port features can be used. |
| 6140 | @item file:@var{filename} |
| 6141 | Write output to @var{filename}. No character can be read. |
| 6142 | @item stdio |
| 6143 | [Unix only] standard input/output |
| 6144 | @item pipe:@var{filename} |
| 6145 | name pipe @var{filename} |
| 6146 | @item COM@var{n} |
| 6147 | [Windows only] Use host serial port @var{n} |
| 6148 | @item udp:[@var{remote_host}]:@var{remote_port}[@@[@var{src_ip}]:@var{src_port}] |
| 6149 | This implements UDP Net Console. |
| 6150 | When @var{remote_host} or @var{src_ip} are not specified |
| 6151 | they default to @code{0.0.0.0}. |
| 6152 | When not using a specified @var{src_port} a random port is automatically chosen. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6153 | |
| 6154 | If you just want a simple readonly console you can use @code{netcat} or |
Stefan Weil | b65ee4f | 2012-05-11 22:25:50 +0200 | [diff] [blame] | 6155 | @code{nc}, by starting QEMU with: @code{-serial udp::4555} and nc as: |
| 6156 | @code{nc -u -l -p 4555}. Any time QEMU writes something to that port it |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6157 | will appear in the netconsole session. |
| 6158 | |
| 6159 | If you plan to send characters back via netconsole or you want to stop |
Stefan Weil | b65ee4f | 2012-05-11 22:25:50 +0200 | [diff] [blame] | 6160 | and start QEMU a lot of times, you should have QEMU use the same |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6161 | source port each time by using something like @code{-serial |
Stefan Weil | b65ee4f | 2012-05-11 22:25:50 +0200 | [diff] [blame] | 6162 | udp::4555@@:4556} to QEMU. Another approach is to use a patched |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6163 | version of netcat which can listen to a TCP port and send and receive |
| 6164 | characters via udp. If you have a patched version of netcat which |
| 6165 | activates telnet remote echo and single char transfer, then you can |
Marc-André Lureau | bd1caa3 | 2016-12-22 18:56:38 +0400 | [diff] [blame] | 6166 | use the following options to set up a netcat redirector to allow |
Stefan Weil | b65ee4f | 2012-05-11 22:25:50 +0200 | [diff] [blame] | 6167 | telnet on port 5555 to access the QEMU port. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6168 | @table @code |
Stefan Weil | 071c939 | 2012-04-07 09:23:36 +0200 | [diff] [blame] | 6169 | @item QEMU Options: |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6170 | -serial udp::4555@@:4556 |
| 6171 | @item netcat options: |
| 6172 | -u -P 4555 -L 0.0.0.0:4556 -t -p 5555 -I -T |
| 6173 | @item telnet options: |
| 6174 | localhost 5555 |
| 6175 | @end table |
| 6176 | |
Corey Minyard | 5dd1f02 | 2014-10-02 11:17:37 -0500 | [diff] [blame] | 6177 | @item tcp:[@var{host}]:@var{port}[,@var{server}][,nowait][,nodelay][,reconnect=@var{seconds}] |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6178 | The TCP Net Console has two modes of operation. It can send the serial |
| 6179 | I/O to a location or wait for a connection from a location. By default |
| 6180 | the TCP Net Console is sent to @var{host} at the @var{port}. If you use |
| 6181 | the @var{server} option QEMU will wait for a client socket application |
| 6182 | to connect to the port before continuing, unless the @code{nowait} |
| 6183 | option was specified. The @code{nodelay} option disables the Nagle buffering |
Corey Minyard | 5dd1f02 | 2014-10-02 11:17:37 -0500 | [diff] [blame] | 6184 | algorithm. The @code{reconnect} option only applies if @var{noserver} is |
| 6185 | set, if the connection goes down it will attempt to reconnect at the |
| 6186 | given interval. If @var{host} is omitted, 0.0.0.0 is assumed. Only |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6187 | one TCP connection at a time is accepted. You can use @code{telnet} to |
| 6188 | connect to the corresponding character device. |
| 6189 | @table @code |
| 6190 | @item Example to send tcp console to 192.168.0.2 port 4444 |
| 6191 | -serial tcp:192.168.0.2:4444 |
| 6192 | @item Example to listen and wait on port 4444 for connection |
| 6193 | -serial tcp::4444,server |
| 6194 | @item Example to not wait and listen on ip 192.168.0.100 port 4444 |
| 6195 | -serial tcp:192.168.0.100:4444,server,nowait |
| 6196 | @end table |
| 6197 | |
| 6198 | @item telnet:@var{host}:@var{port}[,server][,nowait][,nodelay] |
| 6199 | The telnet protocol is used instead of raw tcp sockets. The options |
| 6200 | work the same as if you had specified @code{-serial tcp}. The |
| 6201 | difference is that the port acts like a telnet server or client using |
| 6202 | telnet option negotiation. This will also allow you to send the |
| 6203 | MAGIC_SYSRQ sequence if you use a telnet that supports sending the break |
| 6204 | sequence. Typically in unix telnet you do it with Control-] and then |
| 6205 | type "send break" followed by pressing the enter key. |
| 6206 | |
Julia Suvorova | 981b06e | 2018-10-19 01:35:00 +0300 | [diff] [blame] | 6207 | @item websocket:@var{host}:@var{port},server[,nowait][,nodelay] |
| 6208 | The WebSocket protocol is used instead of raw tcp socket. The port acts as |
| 6209 | a WebSocket server. Client mode is not supported. |
| 6210 | |
Corey Minyard | 5dd1f02 | 2014-10-02 11:17:37 -0500 | [diff] [blame] | 6211 | @item unix:@var{path}[,server][,nowait][,reconnect=@var{seconds}] |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6212 | A unix domain socket is used instead of a tcp socket. The option works the |
| 6213 | same as if you had specified @code{-serial tcp} except the unix domain socket |
| 6214 | @var{path} is used for connections. |
| 6215 | |
| 6216 | @item mon:@var{dev_string} |
| 6217 | This is a special option to allow the monitor to be multiplexed onto |
| 6218 | another serial port. The monitor is accessed with key sequence of |
Paolo Bonzini | 02c4bdf | 2013-07-03 20:29:45 +0400 | [diff] [blame] | 6219 | @key{Control-a} and then pressing @key{c}. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6220 | @var{dev_string} should be any one of the serial devices specified |
| 6221 | above. An example to multiplex the monitor onto a telnet server |
| 6222 | listening on port 4444 would be: |
| 6223 | @table @code |
| 6224 | @item -serial mon:telnet::4444,server,nowait |
| 6225 | @end table |
Michael Tokarev | be022d6 | 2013-07-11 12:55:50 +0400 | [diff] [blame] | 6226 | When the monitor is multiplexed to stdio in this way, Ctrl+C will not terminate |
| 6227 | QEMU any more but will be passed to the guest instead. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6228 | |
| 6229 | @item braille |
| 6230 | Braille device. This will use BrlAPI to display the braille output on a real |
| 6231 | or fake device. |
| 6232 | |
Kevin Wolf | be8b28a | 2009-10-09 10:58:37 +0200 | [diff] [blame] | 6233 | @item msmouse |
| 6234 | Three button serial mouse. Configure the guest to use Microsoft protocol. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6235 | @end table |
| 6236 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 6237 | SRST |
| 6238 | ``-serial dev`` |
| 6239 | Redirect the virtual serial port to host character device dev. The |
| 6240 | default device is ``vc`` in graphical mode and ``stdio`` in non |
| 6241 | graphical mode. |
| 6242 | |
| 6243 | This option can be used several times to simulate up to 4 serial |
| 6244 | ports. |
| 6245 | |
| 6246 | Use ``-serial none`` to disable all serial ports. |
| 6247 | |
| 6248 | Available character devices are: |
| 6249 | |
| 6250 | ``vc[:WxH]`` |
| 6251 | Virtual console. Optionally, a width and height can be given in |
| 6252 | pixel with |
| 6253 | |
| 6254 | :: |
| 6255 | |
| 6256 | vc:800x600 |
| 6257 | |
| 6258 | It is also possible to specify width or height in characters: |
| 6259 | |
| 6260 | :: |
| 6261 | |
| 6262 | vc:80Cx24C |
| 6263 | |
| 6264 | ``pty`` |
| 6265 | [Linux only] Pseudo TTY (a new PTY is automatically allocated) |
| 6266 | |
| 6267 | ``none`` |
| 6268 | No device is allocated. |
| 6269 | |
| 6270 | ``null`` |
| 6271 | void device |
| 6272 | |
| 6273 | ``chardev:id`` |
| 6274 | Use a named character device defined with the ``-chardev`` |
| 6275 | option. |
| 6276 | |
| 6277 | ``/dev/XXX`` |
| 6278 | [Linux only] Use host tty, e.g. ``/dev/ttyS0``. The host serial |
| 6279 | port parameters are set according to the emulated ones. |
| 6280 | |
| 6281 | ``/dev/parportN`` |
| 6282 | [Linux only, parallel port only] Use host parallel port N. |
| 6283 | Currently SPP and EPP parallel port features can be used. |
| 6284 | |
| 6285 | ``file:filename`` |
| 6286 | Write output to filename. No character can be read. |
| 6287 | |
| 6288 | ``stdio`` |
| 6289 | [Unix only] standard input/output |
| 6290 | |
| 6291 | ``pipe:filename`` |
| 6292 | name pipe filename |
| 6293 | |
| 6294 | ``COMn`` |
| 6295 | [Windows only] Use host serial port n |
| 6296 | |
| 6297 | ``udp:[remote_host]:remote_port[@[src_ip]:src_port]`` |
| 6298 | This implements UDP Net Console. When remote\_host or src\_ip |
| 6299 | are not specified they default to ``0.0.0.0``. When not using a |
| 6300 | specified src\_port a random port is automatically chosen. |
| 6301 | |
| 6302 | If you just want a simple readonly console you can use |
| 6303 | ``netcat`` or ``nc``, by starting QEMU with: |
| 6304 | ``-serial udp::4555`` and nc as: ``nc -u -l -p 4555``. Any time |
| 6305 | QEMU writes something to that port it will appear in the |
| 6306 | netconsole session. |
| 6307 | |
| 6308 | If you plan to send characters back via netconsole or you want |
| 6309 | to stop and start QEMU a lot of times, you should have QEMU use |
| 6310 | the same source port each time by using something like ``-serial |
| 6311 | udp::4555@:4556`` to QEMU. Another approach is to use a patched |
| 6312 | version of netcat which can listen to a TCP port and send and |
| 6313 | receive characters via udp. If you have a patched version of |
| 6314 | netcat which activates telnet remote echo and single char |
| 6315 | transfer, then you can use the following options to set up a |
| 6316 | netcat redirector to allow telnet on port 5555 to access the |
| 6317 | QEMU port. |
| 6318 | |
| 6319 | ``QEMU Options:`` |
| 6320 | -serial udp::4555@:4556 |
| 6321 | |
| 6322 | ``netcat options:`` |
| 6323 | -u -P 4555 -L 0.0.0.0:4556 -t -p 5555 -I -T |
| 6324 | |
| 6325 | ``telnet options:`` |
| 6326 | localhost 5555 |
| 6327 | |
| 6328 | ``tcp:[host]:port[,server][,nowait][,nodelay][,reconnect=seconds]`` |
| 6329 | The TCP Net Console has two modes of operation. It can send the |
| 6330 | serial I/O to a location or wait for a connection from a |
| 6331 | location. By default the TCP Net Console is sent to host at the |
| 6332 | port. If you use the server option QEMU will wait for a client |
| 6333 | socket application to connect to the port before continuing, |
| 6334 | unless the ``nowait`` option was specified. The ``nodelay`` |
| 6335 | option disables the Nagle buffering algorithm. The ``reconnect`` |
| 6336 | option only applies if noserver is set, if the connection goes |
| 6337 | down it will attempt to reconnect at the given interval. If host |
| 6338 | is omitted, 0.0.0.0 is assumed. Only one TCP connection at a |
| 6339 | time is accepted. You can use ``telnet`` to connect to the |
| 6340 | corresponding character device. |
| 6341 | |
| 6342 | ``Example to send tcp console to 192.168.0.2 port 4444`` |
| 6343 | -serial tcp:192.168.0.2:4444 |
| 6344 | |
| 6345 | ``Example to listen and wait on port 4444 for connection`` |
| 6346 | -serial tcp::4444,server |
| 6347 | |
| 6348 | ``Example to not wait and listen on ip 192.168.0.100 port 4444`` |
| 6349 | -serial tcp:192.168.0.100:4444,server,nowait |
| 6350 | |
| 6351 | ``telnet:host:port[,server][,nowait][,nodelay]`` |
| 6352 | The telnet protocol is used instead of raw tcp sockets. The |
| 6353 | options work the same as if you had specified ``-serial tcp``. |
| 6354 | The difference is that the port acts like a telnet server or |
| 6355 | client using telnet option negotiation. This will also allow you |
| 6356 | to send the MAGIC\_SYSRQ sequence if you use a telnet that |
| 6357 | supports sending the break sequence. Typically in unix telnet |
| 6358 | you do it with Control-] and then type "send break" followed by |
| 6359 | pressing the enter key. |
| 6360 | |
| 6361 | ``websocket:host:port,server[,nowait][,nodelay]`` |
| 6362 | The WebSocket protocol is used instead of raw tcp socket. The |
| 6363 | port acts as a WebSocket server. Client mode is not supported. |
| 6364 | |
| 6365 | ``unix:path[,server][,nowait][,reconnect=seconds]`` |
| 6366 | A unix domain socket is used instead of a tcp socket. The option |
| 6367 | works the same as if you had specified ``-serial tcp`` except |
| 6368 | the unix domain socket path is used for connections. |
| 6369 | |
| 6370 | ``mon:dev_string`` |
| 6371 | This is a special option to allow the monitor to be multiplexed |
| 6372 | onto another serial port. The monitor is accessed with key |
| 6373 | sequence of Control-a and then pressing c. dev\_string should be |
| 6374 | any one of the serial devices specified above. An example to |
| 6375 | multiplex the monitor onto a telnet server listening on port |
| 6376 | 4444 would be: |
| 6377 | |
| 6378 | ``-serial mon:telnet::4444,server,nowait`` |
| 6379 | |
| 6380 | When the monitor is multiplexed to stdio in this way, Ctrl+C |
| 6381 | will not terminate QEMU any more but will be passed to the guest |
| 6382 | instead. |
| 6383 | |
| 6384 | ``braille`` |
| 6385 | Braille device. This will use BrlAPI to display the braille |
| 6386 | output on a real or fake device. |
| 6387 | |
| 6388 | ``msmouse`` |
| 6389 | Three button serial mouse. Configure the guest to use Microsoft |
| 6390 | protocol. |
| 6391 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6392 | |
| 6393 | DEF("parallel", HAS_ARG, QEMU_OPTION_parallel, \ |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 6394 | "-parallel dev redirect the parallel port to char device 'dev'\n", |
| 6395 | QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6396 | STEXI |
| 6397 | @item -parallel @var{dev} |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 6398 | @findex -parallel |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6399 | Redirect the virtual parallel port to host device @var{dev} (same |
| 6400 | devices as the serial port). On Linux hosts, @file{/dev/parportN} can |
| 6401 | be used to use hardware devices connected on the corresponding host |
| 6402 | parallel port. |
| 6403 | |
| 6404 | This option can be used several times to simulate up to 3 parallel |
| 6405 | ports. |
| 6406 | |
| 6407 | Use @code{-parallel none} to disable all parallel ports. |
| 6408 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 6409 | SRST |
| 6410 | ``-parallel dev`` |
| 6411 | Redirect the virtual parallel port to host device dev (same devices |
| 6412 | as the serial port). On Linux hosts, ``/dev/parportN`` can be used |
| 6413 | to use hardware devices connected on the corresponding host parallel |
| 6414 | port. |
| 6415 | |
| 6416 | This option can be used several times to simulate up to 3 parallel |
| 6417 | ports. |
| 6418 | |
| 6419 | Use ``-parallel none`` to disable all parallel ports. |
| 6420 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6421 | |
| 6422 | DEF("monitor", HAS_ARG, QEMU_OPTION_monitor, \ |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 6423 | "-monitor dev redirect the monitor to char device 'dev'\n", |
| 6424 | QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6425 | STEXI |
Gerd Hoffmann | 4e307fc | 2009-12-08 13:11:37 +0100 | [diff] [blame] | 6426 | @item -monitor @var{dev} |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 6427 | @findex -monitor |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6428 | Redirect the monitor to host device @var{dev} (same devices as the |
| 6429 | serial port). |
| 6430 | The default device is @code{vc} in graphical mode and @code{stdio} in |
| 6431 | non graphical mode. |
Luiz Capitulino | 70e098a | 2013-05-16 12:02:55 -0400 | [diff] [blame] | 6432 | Use @code{-monitor none} to disable the default monitor. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6433 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 6434 | SRST |
| 6435 | ``-monitor dev`` |
| 6436 | Redirect the monitor to host device dev (same devices as the serial |
| 6437 | port). The default device is ``vc`` in graphical mode and ``stdio`` |
| 6438 | in non graphical mode. Use ``-monitor none`` to disable the default |
| 6439 | monitor. |
| 6440 | ERST |
Gerd Hoffmann | 6ca5582 | 2009-12-08 13:11:52 +0100 | [diff] [blame] | 6441 | DEF("qmp", HAS_ARG, QEMU_OPTION_qmp, \ |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 6442 | "-qmp dev like -monitor but opens in 'control' mode\n", |
| 6443 | QEMU_ARCH_ALL) |
Stefan Weil | 95d5f08 | 2010-01-20 22:25:27 +0100 | [diff] [blame] | 6444 | STEXI |
| 6445 | @item -qmp @var{dev} |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 6446 | @findex -qmp |
Stefan Weil | 95d5f08 | 2010-01-20 22:25:27 +0100 | [diff] [blame] | 6447 | Like -monitor but opens in 'control' mode. |
| 6448 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 6449 | SRST |
| 6450 | ``-qmp dev`` |
| 6451 | Like -monitor but opens in 'control' mode. |
| 6452 | ERST |
Max Reitz | 4821cd4 | 2014-11-17 13:31:04 +0100 | [diff] [blame] | 6453 | DEF("qmp-pretty", HAS_ARG, QEMU_OPTION_qmp_pretty, \ |
| 6454 | "-qmp-pretty dev like -qmp but uses pretty JSON formatting\n", |
| 6455 | QEMU_ARCH_ALL) |
| 6456 | STEXI |
| 6457 | @item -qmp-pretty @var{dev} |
| 6458 | @findex -qmp-pretty |
| 6459 | Like -qmp but uses pretty JSON formatting. |
| 6460 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 6461 | SRST |
| 6462 | ``-qmp-pretty dev`` |
| 6463 | Like -qmp but uses pretty JSON formatting. |
| 6464 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6465 | |
Gerd Hoffmann | 22a0e04 | 2009-12-08 13:11:51 +0100 | [diff] [blame] | 6466 | DEF("mon", HAS_ARG, QEMU_OPTION_mon, \ |
Vicente Jimenez Aguilar | ef67072 | 2017-11-14 09:11:27 +0100 | [diff] [blame] | 6467 | "-mon [chardev=]name[,mode=readline|control][,pretty[=on|off]]\n", QEMU_ARCH_ALL) |
Gerd Hoffmann | 22a0e04 | 2009-12-08 13:11:51 +0100 | [diff] [blame] | 6468 | STEXI |
Vicente Jimenez Aguilar | ef67072 | 2017-11-14 09:11:27 +0100 | [diff] [blame] | 6469 | @item -mon [chardev=]name[,mode=readline|control][,pretty[=on|off]] |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 6470 | @findex -mon |
Vicente Jimenez Aguilar | ef67072 | 2017-11-14 09:11:27 +0100 | [diff] [blame] | 6471 | Setup monitor on chardev @var{name}. @code{pretty} turns on JSON pretty printing |
| 6472 | easing human reading and debugging. |
Gerd Hoffmann | 22a0e04 | 2009-12-08 13:11:51 +0100 | [diff] [blame] | 6473 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 6474 | SRST |
| 6475 | ``-mon [chardev=]name[,mode=readline|control][,pretty[=on|off]]`` |
| 6476 | Setup monitor on chardev name. ``pretty`` turns on JSON pretty |
| 6477 | printing easing human reading and debugging. |
| 6478 | ERST |
Gerd Hoffmann | 22a0e04 | 2009-12-08 13:11:51 +0100 | [diff] [blame] | 6479 | |
H. Peter Anvin | c9f398e | 2009-12-29 13:51:36 -0800 | [diff] [blame] | 6480 | DEF("debugcon", HAS_ARG, QEMU_OPTION_debugcon, \ |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 6481 | "-debugcon dev redirect the debug console to char device 'dev'\n", |
| 6482 | QEMU_ARCH_ALL) |
H. Peter Anvin | c9f398e | 2009-12-29 13:51:36 -0800 | [diff] [blame] | 6483 | STEXI |
| 6484 | @item -debugcon @var{dev} |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 6485 | @findex -debugcon |
H. Peter Anvin | c9f398e | 2009-12-29 13:51:36 -0800 | [diff] [blame] | 6486 | Redirect the debug console to host device @var{dev} (same devices as the |
| 6487 | serial port). The debug console is an I/O port which is typically port |
| 6488 | 0xe9; writing to that I/O port sends output to this device. |
| 6489 | The default device is @code{vc} in graphical mode and @code{stdio} in |
| 6490 | non graphical mode. |
| 6491 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 6492 | SRST |
| 6493 | ``-debugcon dev`` |
| 6494 | Redirect the debug console to host device dev (same devices as the |
| 6495 | serial port). The debug console is an I/O port which is typically |
| 6496 | port 0xe9; writing to that I/O port sends output to this device. The |
| 6497 | default device is ``vc`` in graphical mode and ``stdio`` in non |
| 6498 | graphical mode. |
| 6499 | ERST |
H. Peter Anvin | c9f398e | 2009-12-29 13:51:36 -0800 | [diff] [blame] | 6500 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6501 | DEF("pidfile", HAS_ARG, QEMU_OPTION_pidfile, \ |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 6502 | "-pidfile file write PID to 'file'\n", QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6503 | STEXI |
| 6504 | @item -pidfile @var{file} |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 6505 | @findex -pidfile |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6506 | Store the QEMU process PID in @var{file}. It is useful if you launch QEMU |
| 6507 | from a script. |
| 6508 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 6509 | SRST |
| 6510 | ``-pidfile file`` |
| 6511 | Store the QEMU process PID in file. It is useful if you launch QEMU |
| 6512 | from a script. |
| 6513 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6514 | |
aurel32 | 1b530a6 | 2009-04-05 20:08:59 +0000 | [diff] [blame] | 6515 | DEF("singlestep", 0, QEMU_OPTION_singlestep, \ |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 6516 | "-singlestep always run in singlestep mode\n", QEMU_ARCH_ALL) |
aurel32 | 1b530a6 | 2009-04-05 20:08:59 +0000 | [diff] [blame] | 6517 | STEXI |
| 6518 | @item -singlestep |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 6519 | @findex -singlestep |
aurel32 | 1b530a6 | 2009-04-05 20:08:59 +0000 | [diff] [blame] | 6520 | Run the emulation in single step mode. |
| 6521 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 6522 | SRST |
| 6523 | ``-singlestep`` |
| 6524 | Run the emulation in single step mode. |
| 6525 | ERST |
aurel32 | 1b530a6 | 2009-04-05 20:08:59 +0000 | [diff] [blame] | 6526 | |
Igor Mammedov | 047f703 | 2018-05-11 19:24:43 +0200 | [diff] [blame] | 6527 | DEF("preconfig", 0, QEMU_OPTION_preconfig, \ |
Markus Armbruster | 361ac94 | 2018-07-05 11:14:02 +0200 | [diff] [blame] | 6528 | "--preconfig pause QEMU before machine is initialized (experimental)\n", |
Igor Mammedov | 047f703 | 2018-05-11 19:24:43 +0200 | [diff] [blame] | 6529 | QEMU_ARCH_ALL) |
| 6530 | STEXI |
| 6531 | @item --preconfig |
| 6532 | @findex --preconfig |
| 6533 | Pause QEMU for interactive configuration before the machine is created, |
| 6534 | which allows querying and configuring properties that will affect |
Markus Armbruster | 361ac94 | 2018-07-05 11:14:02 +0200 | [diff] [blame] | 6535 | machine initialization. Use QMP command 'x-exit-preconfig' to exit |
| 6536 | the preconfig state and move to the next state (i.e. run guest if -S |
| 6537 | isn't used or pause the second time if -S is used). This option is |
| 6538 | experimental. |
Igor Mammedov | 047f703 | 2018-05-11 19:24:43 +0200 | [diff] [blame] | 6539 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 6540 | SRST |
| 6541 | ``--preconfig`` |
| 6542 | Pause QEMU for interactive configuration before the machine is |
| 6543 | created, which allows querying and configuring properties that will |
| 6544 | affect machine initialization. Use QMP command 'x-exit-preconfig' to |
| 6545 | exit the preconfig state and move to the next state (i.e. run guest |
| 6546 | if -S isn't used or pause the second time if -S is used). This |
| 6547 | option is experimental. |
| 6548 | ERST |
Igor Mammedov | 047f703 | 2018-05-11 19:24:43 +0200 | [diff] [blame] | 6549 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6550 | DEF("S", 0, QEMU_OPTION_S, \ |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 6551 | "-S freeze CPU at startup (use 'c' to start execution)\n", |
| 6552 | QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6553 | STEXI |
| 6554 | @item -S |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 6555 | @findex -S |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6556 | Do not start CPU at startup (you must type 'c' in the monitor). |
| 6557 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 6558 | SRST |
| 6559 | ``-S`` |
| 6560 | Do not start CPU at startup (you must type 'c' in the monitor). |
| 6561 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6562 | |
Satoru Moriya | 888a6bc | 2013-04-19 16:42:06 +0200 | [diff] [blame] | 6563 | DEF("realtime", HAS_ARG, QEMU_OPTION_realtime, |
| 6564 | "-realtime [mlock=on|off]\n" |
| 6565 | " run qemu with realtime features\n" |
| 6566 | " mlock=on|off controls mlock support (default: on)\n", |
| 6567 | QEMU_ARCH_ALL) |
| 6568 | STEXI |
| 6569 | @item -realtime mlock=on|off |
| 6570 | @findex -realtime |
| 6571 | Run qemu with realtime features. |
| 6572 | mlocking qemu and guest memory can be enabled via @option{mlock=on} |
| 6573 | (enabled by default). |
| 6574 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 6575 | SRST |
| 6576 | ``-realtime mlock=on|off`` |
| 6577 | Run qemu with realtime features. mlocking qemu and guest memory can |
| 6578 | be enabled via ``mlock=on`` (enabled by default). |
| 6579 | ERST |
Satoru Moriya | 888a6bc | 2013-04-19 16:42:06 +0200 | [diff] [blame] | 6580 | |
Michael S. Tsirkin | 6f131f1 | 2018-06-22 22:22:05 +0300 | [diff] [blame] | 6581 | DEF("overcommit", HAS_ARG, QEMU_OPTION_overcommit, |
BALATON Zoltan | dfaa7d5 | 2018-07-16 21:12:08 +0200 | [diff] [blame] | 6582 | "-overcommit [mem-lock=on|off][cpu-pm=on|off]\n" |
Michael S. Tsirkin | 6f131f1 | 2018-06-22 22:22:05 +0300 | [diff] [blame] | 6583 | " run qemu with overcommit hints\n" |
| 6584 | " mem-lock=on|off controls memory lock support (default: off)\n" |
| 6585 | " cpu-pm=on|off controls cpu power management (default: off)\n", |
| 6586 | QEMU_ARCH_ALL) |
| 6587 | STEXI |
| 6588 | @item -overcommit mem-lock=on|off |
| 6589 | @item -overcommit cpu-pm=on|off |
| 6590 | @findex -overcommit |
| 6591 | Run qemu with hints about host resource overcommit. The default is |
| 6592 | to assume that host overcommits all resources. |
| 6593 | |
| 6594 | Locking qemu and guest memory can be enabled via @option{mem-lock=on} (disabled |
| 6595 | by default). This works when host memory is not overcommitted and reduces the |
| 6596 | worst-case latency for guest. This is equivalent to @option{realtime}. |
| 6597 | |
| 6598 | Guest ability to manage power state of host cpus (increasing latency for other |
| 6599 | processes on the same host cpu, but decreasing latency for guest) can be |
| 6600 | enabled via @option{cpu-pm=on} (disabled by default). This works best when |
| 6601 | host CPU is not overcommitted. When used, host estimates of CPU cycle and power |
| 6602 | utilization will be incorrect, not taking into account guest idle time. |
| 6603 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 6604 | SRST |
| 6605 | ``-overcommit mem-lock=on|off`` |
Peter Maydell | 09ce5f2 | 2020-02-28 15:36:13 +0000 | [diff] [blame^] | 6606 | \ |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 6607 | ``-overcommit cpu-pm=on|off`` |
| 6608 | Run qemu with hints about host resource overcommit. The default is |
| 6609 | to assume that host overcommits all resources. |
| 6610 | |
| 6611 | Locking qemu and guest memory can be enabled via ``mem-lock=on`` |
| 6612 | (disabled by default). This works when host memory is not |
| 6613 | overcommitted and reduces the worst-case latency for guest. This is |
| 6614 | equivalent to ``realtime``. |
| 6615 | |
| 6616 | Guest ability to manage power state of host cpus (increasing latency |
| 6617 | for other processes on the same host cpu, but decreasing latency for |
| 6618 | guest) can be enabled via ``cpu-pm=on`` (disabled by default). This |
| 6619 | works best when host CPU is not overcommitted. When used, host |
| 6620 | estimates of CPU cycle and power utilization will be incorrect, not |
| 6621 | taking into account guest idle time. |
| 6622 | ERST |
Michael S. Tsirkin | 6f131f1 | 2018-06-22 22:22:05 +0300 | [diff] [blame] | 6623 | |
aliguori | 59030a8 | 2009-04-05 18:43:41 +0000 | [diff] [blame] | 6624 | DEF("gdb", HAS_ARG, QEMU_OPTION_gdb, \ |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 6625 | "-gdb dev wait for gdb connection on 'dev'\n", QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6626 | STEXI |
aliguori | 59030a8 | 2009-04-05 18:43:41 +0000 | [diff] [blame] | 6627 | @item -gdb @var{dev} |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 6628 | @findex -gdb |
aliguori | 59030a8 | 2009-04-05 18:43:41 +0000 | [diff] [blame] | 6629 | Wait for gdb connection on device @var{dev} (@pxref{gdb_usage}). Typical |
| 6630 | connections will likely be TCP-based, but also UDP, pseudo TTY, or even |
Stefan Weil | b65ee4f | 2012-05-11 22:25:50 +0200 | [diff] [blame] | 6631 | stdio are reasonable use case. The latter is allowing to start QEMU from |
aliguori | 59030a8 | 2009-04-05 18:43:41 +0000 | [diff] [blame] | 6632 | within gdb and establish the connection via a pipe: |
| 6633 | @example |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 6634 | (gdb) target remote | exec @value{qemu_system} -gdb stdio ... |
aliguori | 59030a8 | 2009-04-05 18:43:41 +0000 | [diff] [blame] | 6635 | @end example |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6636 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 6637 | SRST |
| 6638 | ``-gdb dev`` |
| 6639 | Wait for gdb connection on device dev (see |
| 6640 | :ref:`gdb_005fusage`). Typical connections will likely be |
| 6641 | TCP-based, but also UDP, pseudo TTY, or even stdio are reasonable |
| 6642 | use case. The latter is allowing to start QEMU from within gdb and |
| 6643 | establish the connection via a pipe: |
| 6644 | |
Peter Maydell | 09ce5f2 | 2020-02-28 15:36:13 +0000 | [diff] [blame^] | 6645 | .. parsed-literal:: |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 6646 | |
| 6647 | (gdb) target remote | exec |qemu_system| -gdb stdio ... |
| 6648 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6649 | |
aliguori | 59030a8 | 2009-04-05 18:43:41 +0000 | [diff] [blame] | 6650 | DEF("s", 0, QEMU_OPTION_s, \ |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 6651 | "-s shorthand for -gdb tcp::" DEFAULT_GDBSTUB_PORT "\n", |
| 6652 | QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6653 | STEXI |
aliguori | 59030a8 | 2009-04-05 18:43:41 +0000 | [diff] [blame] | 6654 | @item -s |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 6655 | @findex -s |
aliguori | 59030a8 | 2009-04-05 18:43:41 +0000 | [diff] [blame] | 6656 | Shorthand for -gdb tcp::1234, i.e. open a gdbserver on TCP port 1234 |
| 6657 | (@pxref{gdb_usage}). |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6658 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 6659 | SRST |
| 6660 | ``-s`` |
| 6661 | Shorthand for -gdb tcp::1234, i.e. open a gdbserver on TCP port 1234 |
| 6662 | (see :ref:`gdb_005fusage`). |
| 6663 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6664 | |
| 6665 | DEF("d", HAS_ARG, QEMU_OPTION_d, \ |
Peter Maydell | 989b697 | 2013-02-26 17:52:40 +0000 | [diff] [blame] | 6666 | "-d item1,... enable logging of specified items (use '-d help' for a list of log items)\n", |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 6667 | QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6668 | STEXI |
Peter Maydell | 989b697 | 2013-02-26 17:52:40 +0000 | [diff] [blame] | 6669 | @item -d @var{item1}[,...] |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 6670 | @findex -d |
Peter Maydell | 989b697 | 2013-02-26 17:52:40 +0000 | [diff] [blame] | 6671 | Enable logging of specified items. Use '-d help' for a list of log items. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6672 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 6673 | SRST |
| 6674 | ``-d item1[,...]`` |
| 6675 | Enable logging of specified items. Use '-d help' for a list of log |
| 6676 | items. |
| 6677 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6678 | |
Matthew Fernandez | c235d73 | 2011-06-07 16:32:40 +0000 | [diff] [blame] | 6679 | DEF("D", HAS_ARG, QEMU_OPTION_D, \ |
Peter Maydell | 989b697 | 2013-02-26 17:52:40 +0000 | [diff] [blame] | 6680 | "-D logfile output log to logfile (default stderr)\n", |
Matthew Fernandez | c235d73 | 2011-06-07 16:32:40 +0000 | [diff] [blame] | 6681 | QEMU_ARCH_ALL) |
| 6682 | STEXI |
Stefan Weil | 8bd383b | 2012-05-11 22:40:50 +0200 | [diff] [blame] | 6683 | @item -D @var{logfile} |
Matthew Fernandez | c235d73 | 2011-06-07 16:32:40 +0000 | [diff] [blame] | 6684 | @findex -D |
Peter Maydell | 989b697 | 2013-02-26 17:52:40 +0000 | [diff] [blame] | 6685 | Output log in @var{logfile} instead of to stderr |
Matthew Fernandez | c235d73 | 2011-06-07 16:32:40 +0000 | [diff] [blame] | 6686 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 6687 | SRST |
| 6688 | ``-D logfile`` |
| 6689 | Output log in logfile instead of to stderr |
| 6690 | ERST |
Matthew Fernandez | c235d73 | 2011-06-07 16:32:40 +0000 | [diff] [blame] | 6691 | |
Alex Bennée | 3514552 | 2016-03-15 14:30:20 +0000 | [diff] [blame] | 6692 | DEF("dfilter", HAS_ARG, QEMU_OPTION_DFILTER, \ |
| 6693 | "-dfilter range,.. filter debug output to range of addresses (useful for -d cpu,exec,etc..)\n", |
| 6694 | QEMU_ARCH_ALL) |
| 6695 | STEXI |
| 6696 | @item -dfilter @var{range1}[,...] |
| 6697 | @findex -dfilter |
| 6698 | Filter debug output to that relevant to a range of target addresses. The filter |
| 6699 | spec can be either @var{start}+@var{size}, @var{start}-@var{size} or |
| 6700 | @var{start}..@var{end} where @var{start} @var{end} and @var{size} are the |
| 6701 | addresses and sizes required. For example: |
| 6702 | @example |
| 6703 | -dfilter 0x8000..0x8fff,0xffffffc000080000+0x200,0xffffffc000060000-0x1000 |
| 6704 | @end example |
| 6705 | Will dump output for any code in the 0x1000 sized block starting at 0x8000 and |
| 6706 | the 0x200 sized block starting at 0xffffffc000080000 and another 0x1000 sized |
| 6707 | block starting at 0xffffffc00005f000. |
| 6708 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 6709 | SRST |
| 6710 | ``-dfilter range1[,...]`` |
| 6711 | Filter debug output to that relevant to a range of target addresses. |
| 6712 | The filter spec can be either start+size, start-size or start..end |
| 6713 | where start end and size are the addresses and sizes required. For |
| 6714 | example: |
| 6715 | |
| 6716 | :: |
| 6717 | |
| 6718 | -dfilter 0x8000..0x8fff,0xffffffc000080000+0x200,0xffffffc000060000-0x1000 |
| 6719 | |
| 6720 | Will dump output for any code in the 0x1000 sized block starting at |
| 6721 | 0x8000 and the 0x200 sized block starting at 0xffffffc000080000 and |
| 6722 | another 0x1000 sized block starting at 0xffffffc00005f000. |
| 6723 | ERST |
Alex Bennée | 3514552 | 2016-03-15 14:30:20 +0000 | [diff] [blame] | 6724 | |
Richard Henderson | 9c09a25 | 2019-03-14 13:06:29 -0700 | [diff] [blame] | 6725 | DEF("seed", HAS_ARG, QEMU_OPTION_seed, \ |
| 6726 | "-seed number seed the pseudo-random number generator\n", |
| 6727 | QEMU_ARCH_ALL) |
| 6728 | STEXI |
| 6729 | @item -seed @var{number} |
| 6730 | @findex -seed |
| 6731 | Force the guest to use a deterministic pseudo-random number generator, seeded |
| 6732 | with @var{number}. This does not affect crypto routines within the host. |
| 6733 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 6734 | SRST |
| 6735 | ``-seed number`` |
| 6736 | Force the guest to use a deterministic pseudo-random number |
| 6737 | generator, seeded with number. This does not affect crypto routines |
| 6738 | within the host. |
| 6739 | ERST |
Richard Henderson | 9c09a25 | 2019-03-14 13:06:29 -0700 | [diff] [blame] | 6740 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6741 | DEF("L", HAS_ARG, QEMU_OPTION_L, \ |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 6742 | "-L path set the directory for the BIOS, VGA BIOS and keymaps\n", |
| 6743 | QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6744 | STEXI |
| 6745 | @item -L @var{path} |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 6746 | @findex -L |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6747 | Set the directory for the BIOS, VGA BIOS and keymaps. |
Richard W.M. Jones | 37146e7 | 2016-05-16 17:34:35 +0100 | [diff] [blame] | 6748 | |
| 6749 | To list all the data directories, use @code{-L help}. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6750 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 6751 | SRST |
| 6752 | ``-L path`` |
| 6753 | Set the directory for the BIOS, VGA BIOS and keymaps. |
| 6754 | |
| 6755 | To list all the data directories, use ``-L help``. |
| 6756 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6757 | |
| 6758 | DEF("bios", HAS_ARG, QEMU_OPTION_bios, \ |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 6759 | "-bios file set the filename for the BIOS\n", QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6760 | STEXI |
| 6761 | @item -bios @var{file} |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 6762 | @findex -bios |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6763 | Set the filename for the BIOS. |
| 6764 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 6765 | SRST |
| 6766 | ``-bios file`` |
| 6767 | Set the filename for the BIOS. |
| 6768 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6769 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6770 | DEF("enable-kvm", 0, QEMU_OPTION_enable_kvm, \ |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 6771 | "-enable-kvm enable KVM full virtualization support\n", QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6772 | STEXI |
| 6773 | @item -enable-kvm |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 6774 | @findex -enable-kvm |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6775 | Enable KVM full virtualization support. This option is only available |
| 6776 | if KVM support is enabled when compiling. |
| 6777 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 6778 | SRST |
| 6779 | ``-enable-kvm`` |
| 6780 | Enable KVM full virtualization support. This option is only |
| 6781 | available if KVM support is enabled when compiling. |
| 6782 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6783 | |
aliguori | e37630c | 2009-04-22 15:19:10 +0000 | [diff] [blame] | 6784 | DEF("xen-domid", HAS_ARG, QEMU_OPTION_xen_domid, |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 6785 | "-xen-domid id specify xen guest domain id\n", QEMU_ARCH_ALL) |
aliguori | e37630c | 2009-04-22 15:19:10 +0000 | [diff] [blame] | 6786 | DEF("xen-attach", 0, QEMU_OPTION_xen_attach, |
| 6787 | "-xen-attach attach to existing xen domain\n" |
Anthony PERARD | 1077bca | 2018-09-14 12:18:30 +0100 | [diff] [blame] | 6788 | " libxl will use this when starting QEMU\n", |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 6789 | QEMU_ARCH_ALL) |
Paul Durrant | 1c59947 | 2017-03-22 09:39:15 +0000 | [diff] [blame] | 6790 | DEF("xen-domid-restrict", 0, QEMU_OPTION_xen_domid_restrict, |
| 6791 | "-xen-domid-restrict restrict set of available xen operations\n" |
| 6792 | " to specified domain id. (Does not affect\n" |
| 6793 | " xenpv machine type).\n", |
| 6794 | QEMU_ARCH_ALL) |
Stefan Weil | 95d5f08 | 2010-01-20 22:25:27 +0100 | [diff] [blame] | 6795 | STEXI |
| 6796 | @item -xen-domid @var{id} |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 6797 | @findex -xen-domid |
Stefan Weil | 95d5f08 | 2010-01-20 22:25:27 +0100 | [diff] [blame] | 6798 | Specify xen guest domain @var{id} (XEN only). |
Stefan Weil | 95d5f08 | 2010-01-20 22:25:27 +0100 | [diff] [blame] | 6799 | @item -xen-attach |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 6800 | @findex -xen-attach |
Stefan Weil | 95d5f08 | 2010-01-20 22:25:27 +0100 | [diff] [blame] | 6801 | Attach to existing xen domain. |
Anthony PERARD | 1077bca | 2018-09-14 12:18:30 +0100 | [diff] [blame] | 6802 | libxl will use this when starting QEMU (XEN only). |
Paul Durrant | 1c59947 | 2017-03-22 09:39:15 +0000 | [diff] [blame] | 6803 | @findex -xen-domid-restrict |
| 6804 | Restrict set of available xen operations to specified domain id (XEN only). |
Stefan Weil | 95d5f08 | 2010-01-20 22:25:27 +0100 | [diff] [blame] | 6805 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 6806 | SRST |
| 6807 | ``-xen-domid id`` |
| 6808 | Specify xen guest domain id (XEN only). |
| 6809 | |
| 6810 | ``-xen-attach`` |
| 6811 | Attach to existing xen domain. libxl will use this when starting |
| 6812 | QEMU (XEN only). Restrict set of available xen operations to |
| 6813 | specified domain id (XEN only). |
| 6814 | ERST |
aliguori | e37630c | 2009-04-22 15:19:10 +0000 | [diff] [blame] | 6815 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6816 | DEF("no-reboot", 0, QEMU_OPTION_no_reboot, \ |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 6817 | "-no-reboot exit instead of rebooting\n", QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6818 | STEXI |
| 6819 | @item -no-reboot |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 6820 | @findex -no-reboot |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6821 | Exit instead of rebooting. |
| 6822 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 6823 | SRST |
| 6824 | ``-no-reboot`` |
| 6825 | Exit instead of rebooting. |
| 6826 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6827 | |
| 6828 | DEF("no-shutdown", 0, QEMU_OPTION_no_shutdown, \ |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 6829 | "-no-shutdown stop before shutdown\n", QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6830 | STEXI |
| 6831 | @item -no-shutdown |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 6832 | @findex -no-shutdown |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6833 | Don't exit QEMU on guest shutdown, but instead only stop the emulation. |
| 6834 | This allows for instance switching to monitor to commit changes to the |
| 6835 | disk image. |
| 6836 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 6837 | SRST |
| 6838 | ``-no-shutdown`` |
| 6839 | Don't exit QEMU on guest shutdown, but instead only stop the |
| 6840 | emulation. This allows for instance switching to monitor to commit |
| 6841 | changes to the disk image. |
| 6842 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6843 | |
| 6844 | DEF("loadvm", HAS_ARG, QEMU_OPTION_loadvm, \ |
| 6845 | "-loadvm [tag|id]\n" \ |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 6846 | " start right away with a saved state (loadvm in monitor)\n", |
| 6847 | QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6848 | STEXI |
| 6849 | @item -loadvm @var{file} |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 6850 | @findex -loadvm |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6851 | Start right away with a saved state (@code{loadvm} in monitor) |
| 6852 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 6853 | SRST |
| 6854 | ``-loadvm file`` |
| 6855 | Start right away with a saved state (``loadvm`` in monitor) |
| 6856 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6857 | |
| 6858 | #ifndef _WIN32 |
| 6859 | DEF("daemonize", 0, QEMU_OPTION_daemonize, \ |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 6860 | "-daemonize daemonize QEMU after initializing\n", QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6861 | #endif |
| 6862 | STEXI |
| 6863 | @item -daemonize |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 6864 | @findex -daemonize |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6865 | Daemonize the QEMU process after initialization. QEMU will not detach from |
| 6866 | standard IO until it is ready to receive connections on any of its devices. |
| 6867 | This option is a useful way for external programs to launch QEMU without having |
| 6868 | to cope with initialization race conditions. |
| 6869 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 6870 | SRST |
| 6871 | ``-daemonize`` |
| 6872 | Daemonize the QEMU process after initialization. QEMU will not |
| 6873 | detach from standard IO until it is ready to receive connections on |
| 6874 | any of its devices. This option is a useful way for external |
| 6875 | programs to launch QEMU without having to cope with initialization |
| 6876 | race conditions. |
| 6877 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6878 | |
| 6879 | DEF("option-rom", HAS_ARG, QEMU_OPTION_option_rom, \ |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 6880 | "-option-rom rom load a file, rom, into the option ROM space\n", |
| 6881 | QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6882 | STEXI |
| 6883 | @item -option-rom @var{file} |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 6884 | @findex -option-rom |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6885 | Load the contents of @var{file} as an option ROM. |
| 6886 | This option is useful to load things like EtherBoot. |
| 6887 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 6888 | SRST |
| 6889 | ``-option-rom file`` |
| 6890 | Load the contents of file as an option ROM. This option is useful to |
| 6891 | load things like EtherBoot. |
| 6892 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6893 | |
Jan Kiszka | 1ed2fc1 | 2009-09-15 13:36:04 +0200 | [diff] [blame] | 6894 | DEF("rtc", HAS_ARG, QEMU_OPTION_rtc, \ |
Artem Pisarenko | 238d124 | 2018-10-18 13:12:52 +0600 | [diff] [blame] | 6895 | "-rtc [base=utc|localtime|<datetime>][,clock=host|rt|vm][,driftfix=none|slew]\n" \ |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 6896 | " set the RTC base and clock, enable drift fix for clock ticks (x86 only)\n", |
| 6897 | QEMU_ARCH_ALL) |
Jan Kiszka | 1ed2fc1 | 2009-09-15 13:36:04 +0200 | [diff] [blame] | 6898 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6899 | STEXI |
| 6900 | |
Artem Pisarenko | 238d124 | 2018-10-18 13:12:52 +0600 | [diff] [blame] | 6901 | @item -rtc [base=utc|localtime|@var{datetime}][,clock=host|rt|vm][,driftfix=none|slew] |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 6902 | @findex -rtc |
Jan Kiszka | 1ed2fc1 | 2009-09-15 13:36:04 +0200 | [diff] [blame] | 6903 | Specify @option{base} as @code{utc} or @code{localtime} to let the RTC start at the current |
| 6904 | UTC or local time, respectively. @code{localtime} is required for correct date in |
Artem Pisarenko | 238d124 | 2018-10-18 13:12:52 +0600 | [diff] [blame] | 6905 | MS-DOS or Windows. To start at a specific point in time, provide @var{datetime} in the |
Jan Kiszka | 1ed2fc1 | 2009-09-15 13:36:04 +0200 | [diff] [blame] | 6906 | format @code{2006-06-17T16:01:21} or @code{2006-06-17}. The default base is UTC. |
| 6907 | |
Michael Tokarev | 9d85d55 | 2014-04-07 13:34:58 +0400 | [diff] [blame] | 6908 | By default the RTC is driven by the host system time. This allows using of the |
Jan Kiszka | 6875204 | 2009-09-15 13:36:04 +0200 | [diff] [blame] | 6909 | RTC as accurate reference clock inside the guest, specifically if the host |
| 6910 | time is smoothly following an accurate external reference clock, e.g. via NTP. |
Paolo Bonzini | 7880814 | 2012-03-30 10:31:21 +0000 | [diff] [blame] | 6911 | If you want to isolate the guest time from the host, you can set @option{clock} |
Artem Pisarenko | 238d124 | 2018-10-18 13:12:52 +0600 | [diff] [blame] | 6912 | to @code{rt} instead, which provides a host monotonic clock if host support it. |
| 6913 | To even prevent the RTC from progressing during suspension, you can set @option{clock} |
| 6914 | to @code{vm} (virtual clock). @samp{clock=vm} is recommended especially in |
| 6915 | icount mode in order to preserve determinism; however, note that in icount mode |
| 6916 | the speed of the virtual clock is variable and can in general differ from the |
| 6917 | host clock. |
Jan Kiszka | 6875204 | 2009-09-15 13:36:04 +0200 | [diff] [blame] | 6918 | |
Jan Kiszka | 1ed2fc1 | 2009-09-15 13:36:04 +0200 | [diff] [blame] | 6919 | Enable @option{driftfix} (i386 targets only) if you experience time drift problems, |
| 6920 | specifically with Windows' ACPI HAL. This option will try to figure out how |
| 6921 | many timer interrupts were not processed by the Windows guest and will |
| 6922 | re-inject them. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6923 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 6924 | SRST |
| 6925 | ``-rtc [base=utc|localtime|datetime][,clock=host|rt|vm][,driftfix=none|slew]`` |
| 6926 | Specify ``base`` as ``utc`` or ``localtime`` to let the RTC start at |
| 6927 | the current UTC or local time, respectively. ``localtime`` is |
| 6928 | required for correct date in MS-DOS or Windows. To start at a |
| 6929 | specific point in time, provide datetime in the format |
| 6930 | ``2006-06-17T16:01:21`` or ``2006-06-17``. The default base is UTC. |
| 6931 | |
| 6932 | By default the RTC is driven by the host system time. This allows |
| 6933 | using of the RTC as accurate reference clock inside the guest, |
| 6934 | specifically if the host time is smoothly following an accurate |
| 6935 | external reference clock, e.g. via NTP. If you want to isolate the |
| 6936 | guest time from the host, you can set ``clock`` to ``rt`` instead, |
| 6937 | which provides a host monotonic clock if host support it. To even |
| 6938 | prevent the RTC from progressing during suspension, you can set |
| 6939 | ``clock`` to ``vm`` (virtual clock). '\ ``clock=vm``\ ' is |
| 6940 | recommended especially in icount mode in order to preserve |
| 6941 | determinism; however, note that in icount mode the speed of the |
| 6942 | virtual clock is variable and can in general differ from the host |
| 6943 | clock. |
| 6944 | |
| 6945 | Enable ``driftfix`` (i386 targets only) if you experience time drift |
| 6946 | problems, specifically with Windows' ACPI HAL. This option will try |
| 6947 | to figure out how many timer interrupts were not processed by the |
| 6948 | Windows guest and will re-inject them. |
| 6949 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6950 | |
| 6951 | DEF("icount", HAS_ARG, QEMU_OPTION_icount, \ |
Pavel Dovgalyuk | 9c2037d | 2017-01-24 10:17:47 +0300 | [diff] [blame] | 6952 | "-icount [shift=N|auto][,align=on|off][,sleep=on|off,rr=record|replay,rrfile=<filename>,rrsnapshot=<snapshot>]\n" \ |
aliguori | bc14ca2 | 2009-04-05 18:43:37 +0000 | [diff] [blame] | 6953 | " enable virtual instruction counter with 2^N clock ticks per\n" \ |
Victor CLEMENT | f1f4b57 | 2015-05-29 17:14:05 +0200 | [diff] [blame] | 6954 | " instruction, enable aligning the host and virtual clocks\n" \ |
| 6955 | " or disable real time cpu sleeping\n", QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6956 | STEXI |
Pavel Dovgalyuk | 9c2037d | 2017-01-24 10:17:47 +0300 | [diff] [blame] | 6957 | @item -icount [shift=@var{N}|auto][,rr=record|replay,rrfile=@var{filename},rrsnapshot=@var{snapshot}] |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 6958 | @findex -icount |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6959 | Enable virtual instruction counter. The virtual cpu will execute one |
Kevin Wolf | 4e257e5 | 2009-10-09 10:58:36 +0200 | [diff] [blame] | 6960 | instruction every 2^@var{N} ns of virtual time. If @code{auto} is specified |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6961 | then the virtual cpu speed will be automatically adjusted to keep virtual |
| 6962 | time within a few seconds of real time. |
| 6963 | |
Victor CLEMENT | f1f4b57 | 2015-05-29 17:14:05 +0200 | [diff] [blame] | 6964 | When the virtual cpu is sleeping, the virtual time will advance at default |
Pranith Kumar | 778d9f9 | 2016-02-26 10:16:51 -0500 | [diff] [blame] | 6965 | speed unless @option{sleep=on|off} is specified. |
| 6966 | With @option{sleep=on|off}, the virtual time will jump to the next timer deadline |
Victor CLEMENT | f1f4b57 | 2015-05-29 17:14:05 +0200 | [diff] [blame] | 6967 | instantly whenever the virtual cpu goes to sleep mode and will not advance |
| 6968 | if no timer is enabled. This behavior give deterministic execution times from |
| 6969 | the guest point of view. |
| 6970 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6971 | Note that while this option can give deterministic behavior, it does not |
| 6972 | provide cycle accurate emulation. Modern CPUs contain superscalar out of |
| 6973 | order cores with complex cache hierarchies. The number of instructions |
| 6974 | executed often has little or no correlation with actual performance. |
Sebastian Tanase | a8bfac3 | 2014-07-25 11:56:29 +0200 | [diff] [blame] | 6975 | |
Daniel P. Berrange | b6af097 | 2015-08-26 12:17:13 +0100 | [diff] [blame] | 6976 | @option{align=on} will activate the delay algorithm which will try |
Sebastian Tanase | a8bfac3 | 2014-07-25 11:56:29 +0200 | [diff] [blame] | 6977 | to synchronise the host clock and the virtual clock. The goal is to |
| 6978 | have a guest running at the real frequency imposed by the shift option. |
| 6979 | Whenever the guest clock is behind the host clock and if |
Michael Tokarev | 8259761 | 2015-04-27 11:12:49 +0300 | [diff] [blame] | 6980 | @option{align=on} is specified then we print a message to the user |
Sebastian Tanase | a8bfac3 | 2014-07-25 11:56:29 +0200 | [diff] [blame] | 6981 | to inform about the delay. |
| 6982 | Currently this option does not work when @option{shift} is @code{auto}. |
| 6983 | Note: The sync algorithm will work for those shift values for which |
| 6984 | the guest clock runs ahead of the host clock. Typically this happens |
| 6985 | when the shift value is high (how high depends on the host machine). |
Pavel Dovgalyuk | 4c27b85 | 2015-09-17 19:25:18 +0300 | [diff] [blame] | 6986 | |
| 6987 | When @option{rr} option is specified deterministic record/replay is enabled. |
| 6988 | Replay log is written into @var{filename} file in record mode and |
| 6989 | read from this file in replay mode. |
Pavel Dovgalyuk | 9c2037d | 2017-01-24 10:17:47 +0300 | [diff] [blame] | 6990 | |
| 6991 | Option rrsnapshot is used to create new vm snapshot named @var{snapshot} |
| 6992 | at the start of execution recording. In replay mode this option is used |
| 6993 | to load the initial VM state. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 6994 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 6995 | SRST |
| 6996 | ``-icount [shift=N|auto][,rr=record|replay,rrfile=filename,rrsnapshot=snapshot]`` |
| 6997 | Enable virtual instruction counter. The virtual cpu will execute one |
| 6998 | instruction every 2^N ns of virtual time. If ``auto`` is specified |
| 6999 | then the virtual cpu speed will be automatically adjusted to keep |
| 7000 | virtual time within a few seconds of real time. |
| 7001 | |
| 7002 | When the virtual cpu is sleeping, the virtual time will advance at |
| 7003 | default speed unless ``sleep=on|off`` is specified. With |
| 7004 | ``sleep=on|off``, the virtual time will jump to the next timer |
| 7005 | deadline instantly whenever the virtual cpu goes to sleep mode and |
| 7006 | will not advance if no timer is enabled. This behavior give |
| 7007 | deterministic execution times from the guest point of view. |
| 7008 | |
| 7009 | Note that while this option can give deterministic behavior, it does |
| 7010 | not provide cycle accurate emulation. Modern CPUs contain |
| 7011 | superscalar out of order cores with complex cache hierarchies. The |
| 7012 | number of instructions executed often has little or no correlation |
| 7013 | with actual performance. |
| 7014 | |
| 7015 | ``align=on`` will activate the delay algorithm which will try to |
| 7016 | synchronise the host clock and the virtual clock. The goal is to |
| 7017 | have a guest running at the real frequency imposed by the shift |
| 7018 | option. Whenever the guest clock is behind the host clock and if |
| 7019 | ``align=on`` is specified then we print a message to the user to |
| 7020 | inform about the delay. Currently this option does not work when |
| 7021 | ``shift`` is ``auto``. Note: The sync algorithm will work for those |
| 7022 | shift values for which the guest clock runs ahead of the host clock. |
| 7023 | Typically this happens when the shift value is high (how high |
| 7024 | depends on the host machine). |
| 7025 | |
| 7026 | When ``rr`` option is specified deterministic record/replay is |
| 7027 | enabled. Replay log is written into filename file in record mode and |
| 7028 | read from this file in replay mode. |
| 7029 | |
| 7030 | Option rrsnapshot is used to create new vm snapshot named snapshot |
| 7031 | at the start of execution recording. In replay mode this option is |
| 7032 | used to load the initial VM state. |
| 7033 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 7034 | |
Richard W.M. Jones | 9dd986c | 2009-04-25 13:56:19 +0100 | [diff] [blame] | 7035 | DEF("watchdog", HAS_ARG, QEMU_OPTION_watchdog, \ |
Xu Wang | d7933ef | 2015-06-11 17:32:05 +0200 | [diff] [blame] | 7036 | "-watchdog model\n" \ |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 7037 | " enable virtual hardware watchdog [default=none]\n", |
| 7038 | QEMU_ARCH_ALL) |
Richard W.M. Jones | 9dd986c | 2009-04-25 13:56:19 +0100 | [diff] [blame] | 7039 | STEXI |
| 7040 | @item -watchdog @var{model} |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 7041 | @findex -watchdog |
Richard W.M. Jones | 9dd986c | 2009-04-25 13:56:19 +0100 | [diff] [blame] | 7042 | Create a virtual hardware watchdog device. Once enabled (by a guest |
| 7043 | action), the watchdog must be periodically polled by an agent inside |
Xu Wang | d7933ef | 2015-06-11 17:32:05 +0200 | [diff] [blame] | 7044 | the guest or else the guest will be restarted. Choose a model for |
| 7045 | which your guest has drivers. |
Richard W.M. Jones | 9dd986c | 2009-04-25 13:56:19 +0100 | [diff] [blame] | 7046 | |
Xu Wang | d7933ef | 2015-06-11 17:32:05 +0200 | [diff] [blame] | 7047 | The @var{model} is the model of hardware watchdog to emulate. Use |
| 7048 | @code{-watchdog help} to list available hardware models. Only one |
Richard W.M. Jones | 9dd986c | 2009-04-25 13:56:19 +0100 | [diff] [blame] | 7049 | watchdog can be enabled for a guest. |
Xu Wang | d7933ef | 2015-06-11 17:32:05 +0200 | [diff] [blame] | 7050 | |
| 7051 | The following models may be available: |
| 7052 | @table @option |
| 7053 | @item ib700 |
| 7054 | iBASE 700 is a very simple ISA watchdog with a single timer. |
| 7055 | @item i6300esb |
| 7056 | Intel 6300ESB I/O controller hub is a much more featureful PCI-based |
| 7057 | dual-timer watchdog. |
Xu Wang | 188f24c | 2015-02-05 18:28:32 +0800 | [diff] [blame] | 7058 | @item diag288 |
| 7059 | A virtual watchdog for s390x backed by the diagnose 288 hypercall |
| 7060 | (currently KVM only). |
Xu Wang | d7933ef | 2015-06-11 17:32:05 +0200 | [diff] [blame] | 7061 | @end table |
Richard W.M. Jones | 9dd986c | 2009-04-25 13:56:19 +0100 | [diff] [blame] | 7062 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 7063 | SRST |
| 7064 | ``-watchdog model`` |
| 7065 | Create a virtual hardware watchdog device. Once enabled (by a guest |
| 7066 | action), the watchdog must be periodically polled by an agent inside |
| 7067 | the guest or else the guest will be restarted. Choose a model for |
| 7068 | which your guest has drivers. |
| 7069 | |
| 7070 | The model is the model of hardware watchdog to emulate. Use |
| 7071 | ``-watchdog help`` to list available hardware models. Only one |
| 7072 | watchdog can be enabled for a guest. |
| 7073 | |
| 7074 | The following models may be available: |
| 7075 | |
| 7076 | ``ib700`` |
| 7077 | iBASE 700 is a very simple ISA watchdog with a single timer. |
| 7078 | |
| 7079 | ``i6300esb`` |
| 7080 | Intel 6300ESB I/O controller hub is a much more featureful |
| 7081 | PCI-based dual-timer watchdog. |
| 7082 | |
| 7083 | ``diag288`` |
| 7084 | A virtual watchdog for s390x backed by the diagnose 288 |
| 7085 | hypercall (currently KVM only). |
| 7086 | ERST |
Richard W.M. Jones | 9dd986c | 2009-04-25 13:56:19 +0100 | [diff] [blame] | 7087 | |
| 7088 | DEF("watchdog-action", HAS_ARG, QEMU_OPTION_watchdog_action, \ |
Markus Armbruster | 7ad9270 | 2017-10-02 16:03:07 +0200 | [diff] [blame] | 7089 | "-watchdog-action reset|shutdown|poweroff|inject-nmi|pause|debug|none\n" \ |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 7090 | " action when watchdog fires [default=reset]\n", |
| 7091 | QEMU_ARCH_ALL) |
Richard W.M. Jones | 9dd986c | 2009-04-25 13:56:19 +0100 | [diff] [blame] | 7092 | STEXI |
| 7093 | @item -watchdog-action @var{action} |
Markus Armbruster | b8f490e | 2013-02-13 19:49:38 +0100 | [diff] [blame] | 7094 | @findex -watchdog-action |
Richard W.M. Jones | 9dd986c | 2009-04-25 13:56:19 +0100 | [diff] [blame] | 7095 | |
| 7096 | The @var{action} controls what QEMU will do when the watchdog timer |
| 7097 | expires. |
| 7098 | The default is |
| 7099 | @code{reset} (forcefully reset the guest). |
| 7100 | Other possible actions are: |
| 7101 | @code{shutdown} (attempt to gracefully shutdown the guest), |
| 7102 | @code{poweroff} (forcefully poweroff the guest), |
Markus Armbruster | 7ad9270 | 2017-10-02 16:03:07 +0200 | [diff] [blame] | 7103 | @code{inject-nmi} (inject a NMI into the guest), |
Richard W.M. Jones | 9dd986c | 2009-04-25 13:56:19 +0100 | [diff] [blame] | 7104 | @code{pause} (pause the guest), |
| 7105 | @code{debug} (print a debug message and continue), or |
| 7106 | @code{none} (do nothing). |
| 7107 | |
| 7108 | Note that the @code{shutdown} action requires that the guest responds |
| 7109 | to ACPI signals, which it may not be able to do in the sort of |
| 7110 | situations where the watchdog would have expired, and thus |
| 7111 | @code{-watchdog-action shutdown} is not recommended for production use. |
| 7112 | |
| 7113 | Examples: |
| 7114 | |
| 7115 | @table @code |
| 7116 | @item -watchdog i6300esb -watchdog-action pause |
Markus Armbruster | f9cfd65 | 2015-06-15 14:35:59 +0200 | [diff] [blame] | 7117 | @itemx -watchdog ib700 |
Richard W.M. Jones | 9dd986c | 2009-04-25 13:56:19 +0100 | [diff] [blame] | 7118 | @end table |
| 7119 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 7120 | SRST |
| 7121 | ``-watchdog-action action`` |
| 7122 | The action controls what QEMU will do when the watchdog timer |
| 7123 | expires. The default is ``reset`` (forcefully reset the guest). |
| 7124 | Other possible actions are: ``shutdown`` (attempt to gracefully |
| 7125 | shutdown the guest), ``poweroff`` (forcefully poweroff the guest), |
| 7126 | ``inject-nmi`` (inject a NMI into the guest), ``pause`` (pause the |
| 7127 | guest), ``debug`` (print a debug message and continue), or ``none`` |
| 7128 | (do nothing). |
| 7129 | |
| 7130 | Note that the ``shutdown`` action requires that the guest responds |
| 7131 | to ACPI signals, which it may not be able to do in the sort of |
| 7132 | situations where the watchdog would have expired, and thus |
| 7133 | ``-watchdog-action shutdown`` is not recommended for production use. |
| 7134 | |
| 7135 | Examples: |
| 7136 | |
| 7137 | ``-watchdog i6300esb -watchdog-action pause``; \ ``-watchdog ib700`` |
| 7138 | |
| 7139 | ERST |
Richard W.M. Jones | 9dd986c | 2009-04-25 13:56:19 +0100 | [diff] [blame] | 7140 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 7141 | DEF("echr", HAS_ARG, QEMU_OPTION_echr, \ |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 7142 | "-echr chr set terminal escape character instead of ctrl-a\n", |
| 7143 | QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 7144 | STEXI |
| 7145 | |
Kevin Wolf | 4e257e5 | 2009-10-09 10:58:36 +0200 | [diff] [blame] | 7146 | @item -echr @var{numeric_ascii_value} |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 7147 | @findex -echr |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 7148 | Change the escape character used for switching to the monitor when using |
| 7149 | monitor and serial sharing. The default is @code{0x01} when using the |
| 7150 | @code{-nographic} option. @code{0x01} is equal to pressing |
| 7151 | @code{Control-a}. You can select a different character from the ascii |
| 7152 | control keys where 1 through 26 map to Control-a through Control-z. For |
| 7153 | instance you could use the either of the following to change the escape |
| 7154 | character to Control-t. |
| 7155 | @table @code |
| 7156 | @item -echr 0x14 |
Markus Armbruster | f9cfd65 | 2015-06-15 14:35:59 +0200 | [diff] [blame] | 7157 | @itemx -echr 20 |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 7158 | @end table |
| 7159 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 7160 | SRST |
| 7161 | ``-echr numeric_ascii_value`` |
| 7162 | Change the escape character used for switching to the monitor when |
| 7163 | using monitor and serial sharing. The default is ``0x01`` when using |
| 7164 | the ``-nographic`` option. ``0x01`` is equal to pressing |
| 7165 | ``Control-a``. You can select a different character from the ascii |
| 7166 | control keys where 1 through 26 map to Control-a through Control-z. |
| 7167 | For instance you could use the either of the following to change the |
| 7168 | escape character to Control-t. |
| 7169 | |
| 7170 | ``-echr 0x14``; \ ``-echr 20`` |
| 7171 | |
| 7172 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 7173 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 7174 | DEF("show-cursor", 0, QEMU_OPTION_show_cursor, \ |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 7175 | "-show-cursor show cursor\n", QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 7176 | STEXI |
Stefan Weil | 95d5f08 | 2010-01-20 22:25:27 +0100 | [diff] [blame] | 7177 | @item -show-cursor |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 7178 | @findex -show-cursor |
Stefan Weil | 95d5f08 | 2010-01-20 22:25:27 +0100 | [diff] [blame] | 7179 | Show cursor. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 7180 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 7181 | SRST |
| 7182 | ``-show-cursor`` |
| 7183 | Show cursor. |
| 7184 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 7185 | |
| 7186 | DEF("tb-size", HAS_ARG, QEMU_OPTION_tb_size, \ |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 7187 | "-tb-size n set TB size\n", QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 7188 | STEXI |
Stefan Weil | 95d5f08 | 2010-01-20 22:25:27 +0100 | [diff] [blame] | 7189 | @item -tb-size @var{n} |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 7190 | @findex -tb-size |
Paolo Bonzini | fe17413 | 2019-11-13 15:16:44 +0100 | [diff] [blame] | 7191 | Set TCG translation block cache size. Deprecated, use @samp{-accel tcg,tb-size=@var{n}} |
| 7192 | instead. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 7193 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 7194 | SRST |
| 7195 | ``-tb-size n`` |
| 7196 | Set TCG translation block cache size. Deprecated, use |
| 7197 | '\ ``-accel tcg,tb-size=n``\ ' instead. |
| 7198 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 7199 | |
| 7200 | DEF("incoming", HAS_ARG, QEMU_OPTION_incoming, \ |
Michael Tokarev | 7c60180 | 2015-02-10 22:40:47 +0300 | [diff] [blame] | 7201 | "-incoming tcp:[host]:port[,to=maxport][,ipv4][,ipv6]\n" \ |
| 7202 | "-incoming rdma:host:port[,ipv4][,ipv6]\n" \ |
| 7203 | "-incoming unix:socketpath\n" \ |
| 7204 | " prepare for incoming migration, listen on\n" \ |
| 7205 | " specified protocol and socket address\n" \ |
| 7206 | "-incoming fd:fd\n" \ |
| 7207 | "-incoming exec:cmdline\n" \ |
| 7208 | " accept incoming migration on given file descriptor\n" \ |
Dr. David Alan Gilbert | 1597051 | 2015-05-29 19:52:52 +0100 | [diff] [blame] | 7209 | " or from given external command\n" \ |
| 7210 | "-incoming defer\n" \ |
| 7211 | " wait for the URI to be specified via migrate_incoming\n", |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 7212 | QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 7213 | STEXI |
Michael Tokarev | 7c60180 | 2015-02-10 22:40:47 +0300 | [diff] [blame] | 7214 | @item -incoming tcp:[@var{host}]:@var{port}[,to=@var{maxport}][,ipv4][,ipv6] |
Markus Armbruster | f9cfd65 | 2015-06-15 14:35:59 +0200 | [diff] [blame] | 7215 | @itemx -incoming rdma:@var{host}:@var{port}[,ipv4][,ipv6] |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 7216 | @findex -incoming |
Michael Tokarev | 7c60180 | 2015-02-10 22:40:47 +0300 | [diff] [blame] | 7217 | Prepare for incoming migration, listen on a given tcp port. |
| 7218 | |
| 7219 | @item -incoming unix:@var{socketpath} |
| 7220 | Prepare for incoming migration, listen on a given unix socket. |
| 7221 | |
| 7222 | @item -incoming fd:@var{fd} |
| 7223 | Accept incoming migration from a given filedescriptor. |
| 7224 | |
| 7225 | @item -incoming exec:@var{cmdline} |
| 7226 | Accept incoming migration as an output from specified external command. |
Dr. David Alan Gilbert | 1597051 | 2015-05-29 19:52:52 +0100 | [diff] [blame] | 7227 | |
| 7228 | @item -incoming defer |
| 7229 | Wait for the URI to be specified via migrate_incoming. The monitor can |
| 7230 | be used to change settings (such as migration parameters) prior to issuing |
| 7231 | the migrate_incoming to allow the migration to begin. |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 7232 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 7233 | SRST |
Peter Maydell | 09ce5f2 | 2020-02-28 15:36:13 +0000 | [diff] [blame^] | 7234 | ``-incoming tcp:[host]:port[,to=maxport][,ipv4][,ipv6]`` |
| 7235 | \ |
| 7236 | ``-incoming rdma:host:port[,ipv4][,ipv6]`` |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 7237 | Prepare for incoming migration, listen on a given tcp port. |
| 7238 | |
| 7239 | ``-incoming unix:socketpath`` |
| 7240 | Prepare for incoming migration, listen on a given unix socket. |
| 7241 | |
| 7242 | ``-incoming fd:fd`` |
| 7243 | Accept incoming migration from a given filedescriptor. |
| 7244 | |
| 7245 | ``-incoming exec:cmdline`` |
| 7246 | Accept incoming migration as an output from specified external |
| 7247 | command. |
| 7248 | |
| 7249 | ``-incoming defer`` |
| 7250 | Wait for the URI to be specified via migrate\_incoming. The monitor |
| 7251 | can be used to change settings (such as migration parameters) prior |
| 7252 | to issuing the migrate\_incoming to allow the migration to begin. |
| 7253 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 7254 | |
Ashijeet Acharya | d15c05f | 2017-01-16 17:01:51 +0530 | [diff] [blame] | 7255 | DEF("only-migratable", 0, QEMU_OPTION_only_migratable, \ |
| 7256 | "-only-migratable allow only migratable devices\n", QEMU_ARCH_ALL) |
| 7257 | STEXI |
| 7258 | @item -only-migratable |
| 7259 | @findex -only-migratable |
| 7260 | Only allow migratable devices. Devices will not be allowed to enter an |
| 7261 | unmigratable state. |
| 7262 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 7263 | SRST |
| 7264 | ``-only-migratable`` |
| 7265 | Only allow migratable devices. Devices will not be allowed to enter |
| 7266 | an unmigratable state. |
| 7267 | ERST |
Ashijeet Acharya | d15c05f | 2017-01-16 17:01:51 +0530 | [diff] [blame] | 7268 | |
Gerd Hoffmann | d8c208d | 2009-12-08 13:11:46 +0100 | [diff] [blame] | 7269 | DEF("nodefaults", 0, QEMU_OPTION_nodefaults, \ |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 7270 | "-nodefaults don't create default devices\n", QEMU_ARCH_ALL) |
Gerd Hoffmann | d8c208d | 2009-12-08 13:11:46 +0100 | [diff] [blame] | 7271 | STEXI |
Stefan Weil | 3dbf2c7 | 2010-01-16 18:19:44 +0100 | [diff] [blame] | 7272 | @item -nodefaults |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 7273 | @findex -nodefaults |
Michal Novotny | 66c19bf | 2012-07-16 14:35:10 +0200 | [diff] [blame] | 7274 | Don't create default devices. Normally, QEMU sets the default devices like serial |
| 7275 | port, parallel port, virtual console, monitor device, VGA adapter, floppy and |
| 7276 | CD-ROM drive and others. The @code{-nodefaults} option will disable all those |
| 7277 | default devices. |
Gerd Hoffmann | d8c208d | 2009-12-08 13:11:46 +0100 | [diff] [blame] | 7278 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 7279 | SRST |
| 7280 | ``-nodefaults`` |
| 7281 | Don't create default devices. Normally, QEMU sets the default |
| 7282 | devices like serial port, parallel port, virtual console, monitor |
| 7283 | device, VGA adapter, floppy and CD-ROM drive and others. The |
| 7284 | ``-nodefaults`` option will disable all those default devices. |
| 7285 | ERST |
Gerd Hoffmann | d8c208d | 2009-12-08 13:11:46 +0100 | [diff] [blame] | 7286 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 7287 | #ifndef _WIN32 |
| 7288 | DEF("chroot", HAS_ARG, QEMU_OPTION_chroot, \ |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 7289 | "-chroot dir chroot to dir just before starting the VM\n", |
| 7290 | QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 7291 | #endif |
| 7292 | STEXI |
Kevin Wolf | 4e257e5 | 2009-10-09 10:58:36 +0200 | [diff] [blame] | 7293 | @item -chroot @var{dir} |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 7294 | @findex -chroot |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 7295 | Immediately before starting guest execution, chroot to the specified |
| 7296 | directory. Especially useful in combination with -runas. |
| 7297 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 7298 | SRST |
| 7299 | ``-chroot dir`` |
| 7300 | Immediately before starting guest execution, chroot to the specified |
| 7301 | directory. Especially useful in combination with -runas. |
| 7302 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 7303 | |
| 7304 | #ifndef _WIN32 |
| 7305 | DEF("runas", HAS_ARG, QEMU_OPTION_runas, \ |
Ian Jackson | 2c42f1e | 2017-09-15 18:10:44 +0100 | [diff] [blame] | 7306 | "-runas user change to user id user just before starting the VM\n" \ |
| 7307 | " user can be numeric uid:gid instead\n", |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 7308 | QEMU_ARCH_ALL) |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 7309 | #endif |
| 7310 | STEXI |
Kevin Wolf | 4e257e5 | 2009-10-09 10:58:36 +0200 | [diff] [blame] | 7311 | @item -runas @var{user} |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 7312 | @findex -runas |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 7313 | Immediately before starting guest execution, drop root privileges, switching |
| 7314 | to the specified user. |
| 7315 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 7316 | SRST |
| 7317 | ``-runas user`` |
| 7318 | Immediately before starting guest execution, drop root privileges, |
| 7319 | switching to the specified user. |
| 7320 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 7321 | |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 7322 | DEF("prom-env", HAS_ARG, QEMU_OPTION_prom_env, |
| 7323 | "-prom-env variable=value\n" |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 7324 | " set OpenBIOS nvram variables\n", |
| 7325 | QEMU_ARCH_PPC | QEMU_ARCH_SPARC) |
Stefan Weil | 95d5f08 | 2010-01-20 22:25:27 +0100 | [diff] [blame] | 7326 | STEXI |
| 7327 | @item -prom-env @var{variable}=@var{value} |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 7328 | @findex -prom-env |
Stefan Weil | 95d5f08 | 2010-01-20 22:25:27 +0100 | [diff] [blame] | 7329 | Set OpenBIOS nvram @var{variable} to given @var{value} (PPC, SPARC only). |
Peter Maydell | 196afbb | 2020-02-28 15:36:10 +0000 | [diff] [blame] | 7330 | |
| 7331 | @example |
| 7332 | qemu-system-sparc -prom-env 'auto-boot?=false' \ |
| 7333 | -prom-env 'boot-device=sd(0,2,0):d' -prom-env 'boot-args=linux single' |
| 7334 | @end example |
| 7335 | |
| 7336 | @example |
| 7337 | qemu-system-ppc -prom-env 'auto-boot?=false' \ |
| 7338 | -prom-env 'boot-device=hd:2,\yaboot' \ |
| 7339 | -prom-env 'boot-args=conf=hd:2,\yaboot.conf' |
| 7340 | @end example |
| 7341 | |
Stefan Weil | 95d5f08 | 2010-01-20 22:25:27 +0100 | [diff] [blame] | 7342 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 7343 | SRST |
| 7344 | ``-prom-env variable=value`` |
| 7345 | Set OpenBIOS nvram variable to given value (PPC, SPARC only). |
| 7346 | |
| 7347 | :: |
| 7348 | |
| 7349 | qemu-system-sparc -prom-env 'auto-boot?=false' \ |
| 7350 | -prom-env 'boot-device=sd(0,2,0):d' -prom-env 'boot-args=linux single' |
| 7351 | |
| 7352 | :: |
| 7353 | |
| 7354 | qemu-system-ppc -prom-env 'auto-boot?=false' \ |
| 7355 | -prom-env 'boot-device=hd:2,\yaboot' \ |
| 7356 | -prom-env 'boot-args=conf=hd:2,\yaboot.conf' |
| 7357 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 7358 | DEF("semihosting", 0, QEMU_OPTION_semihosting, |
Michael Walle | f7bbcfb | 2014-04-22 20:18:42 +0200 | [diff] [blame] | 7359 | "-semihosting semihosting mode\n", |
Leon Alrae | 3b3c169 | 2015-06-19 11:08:43 +0100 | [diff] [blame] | 7360 | QEMU_ARCH_ARM | QEMU_ARCH_M68K | QEMU_ARCH_XTENSA | QEMU_ARCH_LM32 | |
Sandra Loosemore | 413a99a | 2019-04-03 13:53:05 -0600 | [diff] [blame] | 7361 | QEMU_ARCH_MIPS | QEMU_ARCH_NIOS2) |
Stefan Weil | 95d5f08 | 2010-01-20 22:25:27 +0100 | [diff] [blame] | 7362 | STEXI |
| 7363 | @item -semihosting |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 7364 | @findex -semihosting |
Sandra Loosemore | 413a99a | 2019-04-03 13:53:05 -0600 | [diff] [blame] | 7365 | Enable semihosting mode (ARM, M68K, Xtensa, MIPS, Nios II only). |
Peter Maydell | 44d79a6 | 2020-02-28 15:36:09 +0000 | [diff] [blame] | 7366 | |
| 7367 | Note that this allows guest direct access to the host filesystem, so |
| 7368 | should only be used with a trusted guest OS. |
| 7369 | |
| 7370 | See the -semihosting-config option documentation for further information |
| 7371 | about the facilities this enables. |
Liviu Ionescu | a38bb07 | 2014-12-11 12:07:48 +0000 | [diff] [blame] | 7372 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 7373 | SRST |
| 7374 | ``-semihosting`` |
| 7375 | Enable semihosting mode (ARM, M68K, Xtensa, MIPS, Nios II only). |
| 7376 | |
| 7377 | Note that this allows guest direct access to the host filesystem, so |
| 7378 | should only be used with a trusted guest OS. |
| 7379 | |
| 7380 | See the -semihosting-config option documentation for further |
| 7381 | information about the facilities this enables. |
| 7382 | ERST |
Liviu Ionescu | a38bb07 | 2014-12-11 12:07:48 +0000 | [diff] [blame] | 7383 | DEF("semihosting-config", HAS_ARG, QEMU_OPTION_semihosting_config, |
Alex Bennée | 4e7f903 | 2019-05-14 15:30:14 +0100 | [diff] [blame] | 7384 | "-semihosting-config [enable=on|off][,target=native|gdb|auto][,chardev=id][,arg=str[,...]]\n" \ |
Leon Alrae | a59d31a | 2015-06-19 14:17:45 +0100 | [diff] [blame] | 7385 | " semihosting configuration\n", |
Leon Alrae | 3b3c169 | 2015-06-19 11:08:43 +0100 | [diff] [blame] | 7386 | QEMU_ARCH_ARM | QEMU_ARCH_M68K | QEMU_ARCH_XTENSA | QEMU_ARCH_LM32 | |
Sandra Loosemore | 413a99a | 2019-04-03 13:53:05 -0600 | [diff] [blame] | 7387 | QEMU_ARCH_MIPS | QEMU_ARCH_NIOS2) |
Liviu Ionescu | a38bb07 | 2014-12-11 12:07:48 +0000 | [diff] [blame] | 7388 | STEXI |
Alex Bennée | 4e7f903 | 2019-05-14 15:30:14 +0100 | [diff] [blame] | 7389 | @item -semihosting-config [enable=on|off][,target=native|gdb|auto][,chardev=id][,arg=str[,...]] |
Liviu Ionescu | a38bb07 | 2014-12-11 12:07:48 +0000 | [diff] [blame] | 7390 | @findex -semihosting-config |
Sandra Loosemore | 413a99a | 2019-04-03 13:53:05 -0600 | [diff] [blame] | 7391 | Enable and configure semihosting (ARM, M68K, Xtensa, MIPS, Nios II only). |
Peter Maydell | 44d79a6 | 2020-02-28 15:36:09 +0000 | [diff] [blame] | 7392 | |
| 7393 | Note that this allows guest direct access to the host filesystem, so |
| 7394 | should only be used with a trusted guest OS. |
| 7395 | |
| 7396 | On Arm this implements the standard semihosting API, version 2.0. |
| 7397 | |
| 7398 | On M68K this implements the "ColdFire GDB" interface used by libgloss. |
| 7399 | |
| 7400 | Xtensa semihosting provides basic file IO calls, such as |
| 7401 | open/read/write/seek/select. Tensilica baremetal libc for ISS and |
| 7402 | linux platform "sim" use this interface. |
| 7403 | |
Leon Alrae | a59d31a | 2015-06-19 14:17:45 +0100 | [diff] [blame] | 7404 | @table @option |
| 7405 | @item target=@code{native|gdb|auto} |
| 7406 | Defines where the semihosting calls will be addressed, to QEMU (@code{native}) |
| 7407 | or to GDB (@code{gdb}). The default is @code{auto}, which means @code{gdb} |
| 7408 | during debug sessions and @code{native} otherwise. |
Alex Bennée | 4e7f903 | 2019-05-14 15:30:14 +0100 | [diff] [blame] | 7409 | @item chardev=@var{str1} |
| 7410 | Send the output to a chardev backend output for native or auto output when not in gdb |
Leon Alrae | a59d31a | 2015-06-19 14:17:45 +0100 | [diff] [blame] | 7411 | @item arg=@var{str1},arg=@var{str2},... |
| 7412 | Allows the user to pass input arguments, and can be used multiple times to build |
| 7413 | up a list. The old-style @code{-kernel}/@code{-append} method of passing a |
| 7414 | command line is still supported for backward compatibility. If both the |
| 7415 | @code{--semihosting-config arg} and the @code{-kernel}/@code{-append} are |
| 7416 | specified, the former is passed to semihosting as it always takes precedence. |
| 7417 | @end table |
Stefan Weil | 95d5f08 | 2010-01-20 22:25:27 +0100 | [diff] [blame] | 7418 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 7419 | SRST |
| 7420 | ``-semihosting-config [enable=on|off][,target=native|gdb|auto][,chardev=id][,arg=str[,...]]`` |
| 7421 | Enable and configure semihosting (ARM, M68K, Xtensa, MIPS, Nios II |
| 7422 | only). |
| 7423 | |
| 7424 | Note that this allows guest direct access to the host filesystem, so |
| 7425 | should only be used with a trusted guest OS. |
| 7426 | |
| 7427 | On Arm this implements the standard semihosting API, version 2.0. |
| 7428 | |
| 7429 | On M68K this implements the "ColdFire GDB" interface used by |
| 7430 | libgloss. |
| 7431 | |
| 7432 | Xtensa semihosting provides basic file IO calls, such as |
| 7433 | open/read/write/seek/select. Tensilica baremetal libc for ISS and |
| 7434 | linux platform "sim" use this interface. |
| 7435 | |
| 7436 | ``target=native|gdb|auto`` |
| 7437 | Defines where the semihosting calls will be addressed, to QEMU |
| 7438 | (``native``) or to GDB (``gdb``). The default is ``auto``, which |
| 7439 | means ``gdb`` during debug sessions and ``native`` otherwise. |
| 7440 | |
| 7441 | ``chardev=str1`` |
| 7442 | Send the output to a chardev backend output for native or auto |
| 7443 | output when not in gdb |
| 7444 | |
| 7445 | ``arg=str1,arg=str2,...`` |
| 7446 | Allows the user to pass input arguments, and can be used |
| 7447 | multiple times to build up a list. The old-style |
| 7448 | ``-kernel``/``-append`` method of passing a command line is |
| 7449 | still supported for backward compatibility. If both the |
| 7450 | ``--semihosting-config arg`` and the ``-kernel``/``-append`` are |
| 7451 | specified, the former is passed to semihosting as it always |
| 7452 | takes precedence. |
| 7453 | ERST |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 7454 | DEF("old-param", 0, QEMU_OPTION_old_param, |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 7455 | "-old-param old param mode\n", QEMU_ARCH_ARM) |
Stefan Weil | 95d5f08 | 2010-01-20 22:25:27 +0100 | [diff] [blame] | 7456 | STEXI |
| 7457 | @item -old-param |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 7458 | @findex -old-param (ARM) |
Stefan Weil | 95d5f08 | 2010-01-20 22:25:27 +0100 | [diff] [blame] | 7459 | Old param mode (ARM only). |
| 7460 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 7461 | SRST |
| 7462 | ``-old-param`` |
| 7463 | Old param mode (ARM only). |
| 7464 | ERST |
Stefan Weil | 95d5f08 | 2010-01-20 22:25:27 +0100 | [diff] [blame] | 7465 | |
Eduardo Otubo | 7d76ad4 | 2012-08-14 18:44:08 -0300 | [diff] [blame] | 7466 | DEF("sandbox", HAS_ARG, QEMU_OPTION_sandbox, \ |
Eduardo Otubo | 73a1e64 | 2017-03-13 22:13:27 +0100 | [diff] [blame] | 7467 | "-sandbox on[,obsolete=allow|deny][,elevateprivileges=allow|deny|children]\n" \ |
Eduardo Otubo | 24f8cdc | 2017-03-13 22:18:51 +0100 | [diff] [blame] | 7468 | " [,spawn=allow|deny][,resourcecontrol=allow|deny]\n" \ |
Eduardo Otubo | 2b716fa | 2017-03-01 23:17:29 +0100 | [diff] [blame] | 7469 | " Enable seccomp mode 2 system call filter (default 'off').\n" \ |
| 7470 | " use 'obsolete' to allow obsolete system calls that are provided\n" \ |
| 7471 | " by the kernel, but typically no longer used by modern\n" \ |
Eduardo Otubo | 73a1e64 | 2017-03-13 22:13:27 +0100 | [diff] [blame] | 7472 | " C library implementations.\n" \ |
| 7473 | " use 'elevateprivileges' to allow or deny QEMU process to elevate\n" \ |
| 7474 | " its privileges by blacklisting all set*uid|gid system calls.\n" \ |
| 7475 | " The value 'children' will deny set*uid|gid system calls for\n" \ |
Eduardo Otubo | 995a226 | 2017-03-13 22:16:01 +0100 | [diff] [blame] | 7476 | " main QEMU process but will allow forks and execves to run unprivileged\n" \ |
| 7477 | " use 'spawn' to avoid QEMU to spawn new threads or processes by\n" \ |
Eduardo Otubo | 24f8cdc | 2017-03-13 22:18:51 +0100 | [diff] [blame] | 7478 | " blacklisting *fork and execve\n" \ |
| 7479 | " use 'resourcecontrol' to disable process affinity and schedular priority\n", |
Eduardo Otubo | 7d76ad4 | 2012-08-14 18:44:08 -0300 | [diff] [blame] | 7480 | QEMU_ARCH_ALL) |
| 7481 | STEXI |
Eduardo Otubo | 24f8cdc | 2017-03-13 22:18:51 +0100 | [diff] [blame] | 7482 | @item -sandbox @var{arg}[,obsolete=@var{string}][,elevateprivileges=@var{string}][,spawn=@var{string}][,resourcecontrol=@var{string}] |
Eduardo Otubo | 7d76ad4 | 2012-08-14 18:44:08 -0300 | [diff] [blame] | 7483 | @findex -sandbox |
| 7484 | Enable Seccomp mode 2 system call filter. 'on' will enable syscall filtering and 'off' will |
| 7485 | disable it. The default is 'off'. |
Eduardo Otubo | 2b716fa | 2017-03-01 23:17:29 +0100 | [diff] [blame] | 7486 | @table @option |
| 7487 | @item obsolete=@var{string} |
| 7488 | Enable Obsolete system calls |
Eduardo Otubo | 73a1e64 | 2017-03-13 22:13:27 +0100 | [diff] [blame] | 7489 | @item elevateprivileges=@var{string} |
| 7490 | Disable set*uid|gid system calls |
Eduardo Otubo | 995a226 | 2017-03-13 22:16:01 +0100 | [diff] [blame] | 7491 | @item spawn=@var{string} |
| 7492 | Disable *fork and execve |
Eduardo Otubo | 24f8cdc | 2017-03-13 22:18:51 +0100 | [diff] [blame] | 7493 | @item resourcecontrol=@var{string} |
| 7494 | Disable process affinity and schedular priority |
Eduardo Otubo | 2b716fa | 2017-03-01 23:17:29 +0100 | [diff] [blame] | 7495 | @end table |
Eduardo Otubo | 7d76ad4 | 2012-08-14 18:44:08 -0300 | [diff] [blame] | 7496 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 7497 | SRST |
| 7498 | ``-sandbox arg[,obsolete=string][,elevateprivileges=string][,spawn=string][,resourcecontrol=string]`` |
| 7499 | Enable Seccomp mode 2 system call filter. 'on' will enable syscall |
| 7500 | filtering and 'off' will disable it. The default is 'off'. |
| 7501 | |
| 7502 | ``obsolete=string`` |
| 7503 | Enable Obsolete system calls |
| 7504 | |
| 7505 | ``elevateprivileges=string`` |
| 7506 | Disable set\*uid\|gid system calls |
| 7507 | |
| 7508 | ``spawn=string`` |
| 7509 | Disable \*fork and execve |
| 7510 | |
| 7511 | ``resourcecontrol=string`` |
| 7512 | Disable process affinity and schedular priority |
| 7513 | ERST |
Eduardo Otubo | 7d76ad4 | 2012-08-14 18:44:08 -0300 | [diff] [blame] | 7514 | |
Gerd Hoffmann | 715a664 | 2009-10-14 10:39:28 +0200 | [diff] [blame] | 7515 | DEF("readconfig", HAS_ARG, QEMU_OPTION_readconfig, |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 7516 | "-readconfig <file>\n", QEMU_ARCH_ALL) |
Stefan Weil | 3dbf2c7 | 2010-01-16 18:19:44 +0100 | [diff] [blame] | 7517 | STEXI |
| 7518 | @item -readconfig @var{file} |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 7519 | @findex -readconfig |
Michal Novotny | ed24cfa | 2012-07-16 14:28:32 +0200 | [diff] [blame] | 7520 | Read device configuration from @var{file}. This approach is useful when you want to spawn |
| 7521 | QEMU process with many command line options but you don't want to exceed the command line |
| 7522 | character limit. |
Stefan Weil | 3dbf2c7 | 2010-01-16 18:19:44 +0100 | [diff] [blame] | 7523 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 7524 | SRST |
| 7525 | ``-readconfig file`` |
| 7526 | Read device configuration from file. This approach is useful when |
| 7527 | you want to spawn QEMU process with many command line options but |
| 7528 | you don't want to exceed the command line character limit. |
| 7529 | ERST |
Gerd Hoffmann | 715a664 | 2009-10-14 10:39:28 +0200 | [diff] [blame] | 7530 | DEF("writeconfig", HAS_ARG, QEMU_OPTION_writeconfig, |
| 7531 | "-writeconfig <file>\n" |
Blue Swirl | ad96090 | 2010-03-29 19:23:52 +0000 | [diff] [blame] | 7532 | " read/write config file\n", QEMU_ARCH_ALL) |
Stefan Weil | 3dbf2c7 | 2010-01-16 18:19:44 +0100 | [diff] [blame] | 7533 | STEXI |
| 7534 | @item -writeconfig @var{file} |
Stefan Weil | 6616b2a | 2010-02-05 23:52:05 +0100 | [diff] [blame] | 7535 | @findex -writeconfig |
Michal Novotny | ed24cfa | 2012-07-16 14:28:32 +0200 | [diff] [blame] | 7536 | Write device configuration to @var{file}. The @var{file} can be either filename to save |
| 7537 | command line and device configuration into file or dash @code{-}) character to print the |
| 7538 | output to stdout. This can be later used as input file for @code{-readconfig} option. |
Stefan Weil | 3dbf2c7 | 2010-01-16 18:19:44 +0100 | [diff] [blame] | 7539 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 7540 | SRST |
| 7541 | ``-writeconfig file`` |
| 7542 | Write device configuration to file. The file can be either filename |
| 7543 | to save command line and device configuration into file or dash |
| 7544 | ``-``) character to print the output to stdout. This can be later |
| 7545 | used as input file for ``-readconfig`` option. |
| 7546 | ERST |
Thomas Huth | 2feac45 | 2018-08-21 12:59:56 +0200 | [diff] [blame] | 7547 | |
Eduardo Habkost | f29a561 | 2012-05-02 13:07:29 -0300 | [diff] [blame] | 7548 | DEF("no-user-config", 0, QEMU_OPTION_nouserconfig, |
| 7549 | "-no-user-config\n" |
Eduardo Habkost | 3478eae | 2017-10-04 00:00:25 -0300 | [diff] [blame] | 7550 | " do not load default user-provided config files at startup\n", |
Eduardo Habkost | f29a561 | 2012-05-02 13:07:29 -0300 | [diff] [blame] | 7551 | QEMU_ARCH_ALL) |
| 7552 | STEXI |
| 7553 | @item -no-user-config |
| 7554 | @findex -no-user-config |
| 7555 | The @code{-no-user-config} option makes QEMU not load any of the user-provided |
Eduardo Habkost | 3478eae | 2017-10-04 00:00:25 -0300 | [diff] [blame] | 7556 | config files on @var{sysconfdir}. |
Anthony Liguori | 292444c | 2010-01-21 10:57:58 -0600 | [diff] [blame] | 7557 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 7558 | SRST |
| 7559 | ``-no-user-config`` |
| 7560 | The ``-no-user-config`` option makes QEMU not load any of the |
| 7561 | user-provided config files on sysconfdir. |
| 7562 | ERST |
Thomas Huth | 2feac45 | 2018-08-21 12:59:56 +0200 | [diff] [blame] | 7563 | |
Prerna Saxena | ab6540d | 2010-08-09 11:48:32 +0100 | [diff] [blame] | 7564 | DEF("trace", HAS_ARG, QEMU_OPTION_trace, |
Paolo Bonzini | 10578a2 | 2016-01-07 16:55:26 +0300 | [diff] [blame] | 7565 | "-trace [[enable=]<pattern>][,events=<file>][,file=<file>]\n" |
LluÃs | 23d15e8 | 2011-08-31 20:31:31 +0200 | [diff] [blame] | 7566 | " specify tracing options\n", |
Prerna Saxena | ab6540d | 2010-08-09 11:48:32 +0100 | [diff] [blame] | 7567 | QEMU_ARCH_ALL) |
| 7568 | STEXI |
LluÃs | 23d15e8 | 2011-08-31 20:31:31 +0200 | [diff] [blame] | 7569 | HXCOMM This line is not accurate, as some sub-options are backend-specific but |
| 7570 | HXCOMM HX does not support conditional compilation of text. |
Denis V. Lunev | e370ad9 | 2016-06-17 17:44:08 +0300 | [diff] [blame] | 7571 | @item -trace [[enable=]@var{pattern}][,events=@var{file}][,file=@var{file}] |
Prerna Saxena | ab6540d | 2010-08-09 11:48:32 +0100 | [diff] [blame] | 7572 | @findex -trace |
Paolo Bonzini | abcd92d | 2020-02-28 15:35:57 +0000 | [diff] [blame] | 7573 | @include docs/system/qemu-option-trace.texi |
Prerna Saxena | ab6540d | 2010-08-09 11:48:32 +0100 | [diff] [blame] | 7574 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 7575 | SRST |
| 7576 | ``-trace [[enable=]pattern][,events=file][,file=file]`` |
Peter Maydell | 09ce5f2 | 2020-02-28 15:36:13 +0000 | [diff] [blame^] | 7577 | .. include:: ../qemu-option-trace.rst.inc |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 7578 | |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 7579 | ERST |
LluÃs Vilanova | 42229a7 | 2017-07-24 17:28:22 +0300 | [diff] [blame] | 7580 | DEF("plugin", HAS_ARG, QEMU_OPTION_plugin, |
| 7581 | "-plugin [file=]<file>[,arg=<string>]\n" |
| 7582 | " load a plugin\n", |
| 7583 | QEMU_ARCH_ALL) |
| 7584 | STEXI |
| 7585 | @item -plugin file=@var{file}[,arg=@var{string}] |
| 7586 | @findex -plugin |
| 7587 | |
| 7588 | Load a plugin. |
| 7589 | |
| 7590 | @table @option |
| 7591 | @item file=@var{file} |
| 7592 | Load the given plugin from a shared library file. |
| 7593 | @item arg=@var{string} |
| 7594 | Argument string passed to the plugin. (Can be given multiple times.) |
| 7595 | @end table |
| 7596 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 7597 | SRST |
| 7598 | ``-plugin file=file[,arg=string]`` |
| 7599 | Load a plugin. |
| 7600 | |
| 7601 | ``file=file`` |
| 7602 | Load the given plugin from a shared library file. |
| 7603 | |
| 7604 | ``arg=string`` |
| 7605 | Argument string passed to the plugin. (Can be given multiple |
| 7606 | times.) |
| 7607 | ERST |
Stefan Weil | 3dbf2c7 | 2010-01-16 18:19:44 +0100 | [diff] [blame] | 7608 | |
Markus Armbruster | 31e70d6 | 2013-02-13 19:49:37 +0100 | [diff] [blame] | 7609 | HXCOMM Internal use |
| 7610 | DEF("qtest", HAS_ARG, QEMU_OPTION_qtest, "", QEMU_ARCH_ALL) |
| 7611 | DEF("qtest-log", HAS_ARG, QEMU_OPTION_qtest_log, "", QEMU_ARCH_ALL) |
Anthony Liguori | c7f0f3b | 2012-03-28 15:42:02 +0200 | [diff] [blame] | 7612 | |
Paul Moore | 0f66998 | 2012-08-03 14:39:21 -0400 | [diff] [blame] | 7613 | #ifdef __linux__ |
| 7614 | DEF("enable-fips", 0, QEMU_OPTION_enablefips, |
| 7615 | "-enable-fips enable FIPS 140-2 compliance\n", |
| 7616 | QEMU_ARCH_ALL) |
| 7617 | #endif |
| 7618 | STEXI |
| 7619 | @item -enable-fips |
| 7620 | @findex -enable-fips |
| 7621 | Enable FIPS 140-2 compliance mode. |
| 7622 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 7623 | SRST |
| 7624 | ``-enable-fips`` |
| 7625 | Enable FIPS 140-2 compliance mode. |
| 7626 | ERST |
Paul Moore | 0f66998 | 2012-08-03 14:39:21 -0400 | [diff] [blame] | 7627 | |
Thomas Huth | 976e8c5 | 2019-09-04 07:27:39 +0200 | [diff] [blame] | 7628 | HXCOMM Deprecated by -accel tcg |
Bruce Rogers | c6e88b3 | 2012-11-20 07:11:21 -0700 | [diff] [blame] | 7629 | DEF("no-kvm", 0, QEMU_OPTION_no_kvm, "", QEMU_ARCH_I386) |
Jan Kiszka | a0dac02 | 2012-10-05 14:51:45 -0300 | [diff] [blame] | 7630 | |
Seiji Aguchi | 5e2ac51 | 2013-07-03 23:02:46 -0400 | [diff] [blame] | 7631 | DEF("msg", HAS_ARG, QEMU_OPTION_msg, |
| 7632 | "-msg timestamp[=on|off]\n" |
Markus Armbruster | deda497 | 2019-10-10 10:15:08 +0200 | [diff] [blame] | 7633 | " control error message format\n" |
| 7634 | " timestamp=on enables timestamps (default: off)\n", |
Seiji Aguchi | 5e2ac51 | 2013-07-03 23:02:46 -0400 | [diff] [blame] | 7635 | QEMU_ARCH_ALL) |
| 7636 | STEXI |
| 7637 | @item -msg timestamp[=on|off] |
| 7638 | @findex -msg |
Markus Armbruster | deda497 | 2019-10-10 10:15:08 +0200 | [diff] [blame] | 7639 | Control error message format. |
| 7640 | @table @option |
| 7641 | @item timestamp=on|off |
| 7642 | Prefix messages with a timestamp. Default is off. |
| 7643 | @end table |
Seiji Aguchi | 5e2ac51 | 2013-07-03 23:02:46 -0400 | [diff] [blame] | 7644 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 7645 | SRST |
| 7646 | ``-msg timestamp[=on|off]`` |
| 7647 | Control error message format. |
| 7648 | |
| 7649 | ``timestamp=on|off`` |
| 7650 | Prefix messages with a timestamp. Default is off. |
| 7651 | ERST |
Seiji Aguchi | 5e2ac51 | 2013-07-03 23:02:46 -0400 | [diff] [blame] | 7652 | |
Amit Shah | abfd9ce | 2014-06-20 18:56:08 +0530 | [diff] [blame] | 7653 | DEF("dump-vmstate", HAS_ARG, QEMU_OPTION_dump_vmstate, |
| 7654 | "-dump-vmstate <file>\n" |
| 7655 | " Output vmstate information in JSON format to file.\n" |
| 7656 | " Use the scripts/vmstate-static-checker.py file to\n" |
| 7657 | " check for possible regressions in migration code\n" |
Laurent Vivier | 2382053 | 2015-09-04 21:30:04 +0200 | [diff] [blame] | 7658 | " by comparing two such vmstate dumps.\n", |
Amit Shah | abfd9ce | 2014-06-20 18:56:08 +0530 | [diff] [blame] | 7659 | QEMU_ARCH_ALL) |
| 7660 | STEXI |
| 7661 | @item -dump-vmstate @var{file} |
| 7662 | @findex -dump-vmstate |
| 7663 | Dump json-encoded vmstate information for current machine type to file |
| 7664 | in @var{file} |
| 7665 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 7666 | SRST |
| 7667 | ``-dump-vmstate file`` |
| 7668 | Dump json-encoded vmstate information for current machine type to |
| 7669 | file in file |
| 7670 | ERST |
Amit Shah | abfd9ce | 2014-06-20 18:56:08 +0530 | [diff] [blame] | 7671 | |
Emilio G. Cota | 12df189 | 2018-08-15 11:42:49 -0400 | [diff] [blame] | 7672 | DEF("enable-sync-profile", 0, QEMU_OPTION_enable_sync_profile, |
| 7673 | "-enable-sync-profile\n" |
| 7674 | " enable synchronization profiling\n", |
| 7675 | QEMU_ARCH_ALL) |
| 7676 | STEXI |
| 7677 | @item -enable-sync-profile |
| 7678 | @findex -enable-sync-profile |
| 7679 | Enable synchronization profiling. |
| 7680 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 7681 | SRST |
| 7682 | ``-enable-sync-profile`` |
| 7683 | Enable synchronization profiling. |
| 7684 | ERST |
Emilio G. Cota | 12df189 | 2018-08-15 11:42:49 -0400 | [diff] [blame] | 7685 | |
Paolo Bonzini | 43f187a | 2017-01-04 13:50:37 +0100 | [diff] [blame] | 7686 | STEXI |
| 7687 | @end table |
| 7688 | ETEXI |
| 7689 | DEFHEADING() |
Markus Armbruster | de6b4f9 | 2017-10-02 16:03:00 +0200 | [diff] [blame] | 7690 | |
| 7691 | DEFHEADING(Generic object creation:) |
Paolo Bonzini | 43f187a | 2017-01-04 13:50:37 +0100 | [diff] [blame] | 7692 | STEXI |
| 7693 | @table @option |
| 7694 | ETEXI |
Daniel P. Berrange | b9174d4 | 2015-05-13 17:14:03 +0100 | [diff] [blame] | 7695 | |
| 7696 | DEF("object", HAS_ARG, QEMU_OPTION_object, |
| 7697 | "-object TYPENAME[,PROP1=VALUE1,...]\n" |
| 7698 | " create a new object of type TYPENAME setting properties\n" |
| 7699 | " in the order they are specified. Note that the 'id'\n" |
| 7700 | " property must be set. These objects are placed in the\n" |
| 7701 | " '/objects' path.\n", |
| 7702 | QEMU_ARCH_ALL) |
| 7703 | STEXI |
| 7704 | @item -object @var{typename}[,@var{prop1}=@var{value1},...] |
| 7705 | @findex -object |
| 7706 | Create a new object of type @var{typename} setting properties |
| 7707 | in the order they are specified. Note that the 'id' |
| 7708 | property must be set. These objects are placed in the |
| 7709 | '/objects' path. |
| 7710 | |
| 7711 | @table @option |
| 7712 | |
Haozhong Zhang | 9837684 | 2017-12-11 15:28:04 +0800 | [diff] [blame] | 7713 | @item -object memory-backend-file,id=@var{id},size=@var{size},mem-path=@var{dir},share=@var{on|off},discard-data=@var{on|off},merge=@var{on|off},dump=@var{on|off},prealloc=@var{on|off},host-nodes=@var{host-nodes},policy=@var{default|preferred|bind|interleave},align=@var{align} |
Daniel P. Berrange | b9174d4 | 2015-05-13 17:14:03 +0100 | [diff] [blame] | 7714 | |
| 7715 | Creates a memory file backend object, which can be used to back |
Stefan Hajnoczi | c7cddce | 2017-11-28 16:15:28 +0000 | [diff] [blame] | 7716 | the guest RAM with huge pages. |
| 7717 | |
| 7718 | The @option{id} parameter is a unique ID that will be used to reference this |
| 7719 | memory region when configuring the @option{-numa} argument. |
| 7720 | |
| 7721 | The @option{size} option provides the size of the memory region, and accepts |
| 7722 | common suffixes, eg @option{500M}. |
| 7723 | |
| 7724 | The @option{mem-path} provides the path to either a shared memory or huge page |
| 7725 | filesystem mount. |
| 7726 | |
Daniel P. Berrange | b9174d4 | 2015-05-13 17:14:03 +0100 | [diff] [blame] | 7727 | The @option{share} boolean option determines whether the memory |
| 7728 | region is marked as private to QEMU, or shared. The latter allows |
| 7729 | a co-operating external process to access the QEMU memory region. |
Stefan Hajnoczi | c7cddce | 2017-11-28 16:15:28 +0000 | [diff] [blame] | 7730 | |
Marcel Apfelbaum | 06329cc | 2017-12-13 16:37:37 +0200 | [diff] [blame] | 7731 | The @option{share} is also required for pvrdma devices due to |
| 7732 | limitations in the RDMA API provided by Linux. |
| 7733 | |
| 7734 | Setting share=on might affect the ability to configure NUMA |
| 7735 | bindings for the memory backend under some circumstances, see |
| 7736 | Documentation/vm/numa_memory_policy.txt on the Linux kernel |
| 7737 | source tree for additional details. |
| 7738 | |
Eduardo Habkost | 11ae6ed | 2017-08-24 16:23:15 -0300 | [diff] [blame] | 7739 | Setting the @option{discard-data} boolean option to @var{on} |
| 7740 | indicates that file contents can be destroyed when QEMU exits, |
| 7741 | to avoid unnecessarily flushing data to the backing file. Note |
| 7742 | that @option{discard-data} is only an optimization, and QEMU |
| 7743 | might not discard file contents if it aborts unexpectedly or is |
| 7744 | terminated using SIGKILL. |
Daniel P. Berrange | b9174d4 | 2015-05-13 17:14:03 +0100 | [diff] [blame] | 7745 | |
Stefan Hajnoczi | c7cddce | 2017-11-28 16:15:28 +0000 | [diff] [blame] | 7746 | The @option{merge} boolean option enables memory merge, also known as |
| 7747 | MADV_MERGEABLE, so that Kernel Samepage Merging will consider the pages for |
| 7748 | memory deduplication. |
| 7749 | |
| 7750 | Setting the @option{dump} boolean option to @var{off} excludes the memory from |
| 7751 | core dumps. This feature is also known as MADV_DONTDUMP. |
| 7752 | |
| 7753 | The @option{prealloc} boolean option enables memory preallocation. |
| 7754 | |
| 7755 | The @option{host-nodes} option binds the memory range to a list of NUMA host |
| 7756 | nodes. |
| 7757 | |
| 7758 | The @option{policy} option sets the NUMA policy to one of the following values: |
| 7759 | |
| 7760 | @table @option |
| 7761 | @item @var{default} |
| 7762 | default host policy |
| 7763 | |
| 7764 | @item @var{preferred} |
| 7765 | prefer the given host node list for allocation |
| 7766 | |
| 7767 | @item @var{bind} |
| 7768 | restrict memory allocation to the given host node list |
| 7769 | |
| 7770 | @item @var{interleave} |
| 7771 | interleave memory allocations across the given host node list |
| 7772 | @end table |
| 7773 | |
Haozhong Zhang | 9837684 | 2017-12-11 15:28:04 +0800 | [diff] [blame] | 7774 | The @option{align} option specifies the base address alignment when |
| 7775 | QEMU mmap(2) @option{mem-path}, and accepts common suffixes, eg |
| 7776 | @option{2M}. Some backend store specified by @option{mem-path} |
| 7777 | requires an alignment different than the default one used by QEMU, eg |
| 7778 | the device DAX /dev/dax0.0 requires 2M alignment rather than 4K. In |
| 7779 | such cases, users can specify the required alignment via this option. |
| 7780 | |
Junyan He | a4de855 | 2018-07-18 15:48:00 +0800 | [diff] [blame] | 7781 | The @option{pmem} option specifies whether the backing file specified |
| 7782 | by @option{mem-path} is in host persistent memory that can be accessed |
| 7783 | using the SNIA NVM programming model (e.g. Intel NVDIMM). |
| 7784 | If @option{pmem} is set to 'on', QEMU will take necessary operations to |
| 7785 | guarantee the persistence of its own writes to @option{mem-path} |
| 7786 | (e.g. in vNVDIMM label emulation and live migration). |
Zhang Yi | 119906af | 2019-04-22 08:48:48 +0800 | [diff] [blame] | 7787 | Also, we will map the backend-file with MAP_SYNC flag, which ensures the |
| 7788 | file metadata is in sync for @option{mem-path} in case of host crash |
| 7789 | or a power failure. MAP_SYNC requires support from both the host kernel |
| 7790 | (since Linux kernel 4.15) and the filesystem of @option{mem-path} mounted |
| 7791 | with DAX option. |
Junyan He | a4de855 | 2018-07-18 15:48:00 +0800 | [diff] [blame] | 7792 | |
Marcel Apfelbaum | 06329cc | 2017-12-13 16:37:37 +0200 | [diff] [blame] | 7793 | @item -object memory-backend-ram,id=@var{id},merge=@var{on|off},dump=@var{on|off},share=@var{on|off},prealloc=@var{on|off},size=@var{size},host-nodes=@var{host-nodes},policy=@var{default|preferred|bind|interleave} |
Stefan Hajnoczi | cd19491 | 2017-11-28 16:15:29 +0000 | [diff] [blame] | 7794 | |
| 7795 | Creates a memory backend object, which can be used to back the guest RAM. |
| 7796 | Memory backend objects offer more control than the @option{-m} option that is |
| 7797 | traditionally used to define guest RAM. Please refer to |
| 7798 | @option{memory-backend-file} for a description of the options. |
| 7799 | |
Marc-André Lureau | 36ea397 | 2018-08-28 17:38:40 +0200 | [diff] [blame] | 7800 | @item -object memory-backend-memfd,id=@var{id},merge=@var{on|off},dump=@var{on|off},share=@var{on|off},prealloc=@var{on|off},size=@var{size},host-nodes=@var{host-nodes},policy=@var{default|preferred|bind|interleave},seal=@var{on|off},hugetlb=@var{on|off},hugetlbsize=@var{size} |
Marc-André Lureau | dbb9e0f | 2018-02-01 14:27:54 +0100 | [diff] [blame] | 7801 | |
| 7802 | Creates an anonymous memory file backend object, which allows QEMU to |
| 7803 | share the memory with an external process (e.g. when using |
| 7804 | vhost-user). The memory is allocated with memfd and optional |
| 7805 | sealing. (Linux only) |
| 7806 | |
| 7807 | The @option{seal} option creates a sealed-file, that will block |
| 7808 | further resizing the memory ('on' by default). |
| 7809 | |
| 7810 | The @option{hugetlb} option specify the file to be created resides in |
| 7811 | the hugetlbfs filesystem (since Linux 4.14). Used in conjunction with |
| 7812 | the @option{hugetlb} option, the @option{hugetlbsize} option specify |
| 7813 | the hugetlb page size on systems that support multiple hugetlb page |
| 7814 | sizes (it must be a power of 2 value supported by the system). |
| 7815 | |
| 7816 | In some versions of Linux, the @option{hugetlb} option is incompatible |
| 7817 | with the @option{seal} option (requires at least Linux 4.16). |
| 7818 | |
| 7819 | Please refer to @option{memory-backend-file} for a description of the |
| 7820 | other options. |
| 7821 | |
Marc-André Lureau | 36ea397 | 2018-08-28 17:38:40 +0200 | [diff] [blame] | 7822 | The @option{share} boolean option is @var{on} by default with memfd. |
| 7823 | |
Laurent Vivier | 6c4e9d4 | 2019-08-20 18:06:13 +0200 | [diff] [blame] | 7824 | @item -object rng-builtin,id=@var{id} |
| 7825 | |
| 7826 | Creates a random number generator backend which obtains entropy from |
| 7827 | QEMU builtin functions. The @option{id} parameter is a unique ID that |
| 7828 | will be used to reference this entropy backend from the @option{virtio-rng} |
Laurent Vivier | 0198c26 | 2019-08-20 18:06:15 +0200 | [diff] [blame] | 7829 | device. By default, the @option{virtio-rng} device uses this RNG backend. |
Laurent Vivier | 6c4e9d4 | 2019-08-20 18:06:13 +0200 | [diff] [blame] | 7830 | |
Daniel P. Berrange | b9174d4 | 2015-05-13 17:14:03 +0100 | [diff] [blame] | 7831 | @item -object rng-random,id=@var{id},filename=@var{/dev/random} |
| 7832 | |
| 7833 | Creates a random number generator backend which obtains entropy from |
| 7834 | a device on the host. The @option{id} parameter is a unique ID that |
| 7835 | will be used to reference this entropy backend from the @option{virtio-rng} |
| 7836 | device. The @option{filename} parameter specifies which file to obtain |
Kashyap Chamarthy | a2230bd | 2019-05-29 16:31:03 +0200 | [diff] [blame] | 7837 | entropy from and if omitted defaults to @option{/dev/urandom}. |
Daniel P. Berrange | b9174d4 | 2015-05-13 17:14:03 +0100 | [diff] [blame] | 7838 | |
| 7839 | @item -object rng-egd,id=@var{id},chardev=@var{chardevid} |
| 7840 | |
| 7841 | Creates a random number generator backend which obtains entropy from |
| 7842 | an external daemon running on the host. The @option{id} parameter is |
| 7843 | a unique ID that will be used to reference this entropy backend from |
| 7844 | the @option{virtio-rng} device. The @option{chardev} parameter is |
| 7845 | the unique ID of a character device backend that provides the connection |
| 7846 | to the RNG daemon. |
| 7847 | |
Daniel P. Berrange | e00adf6 | 2015-03-13 17:39:26 +0000 | [diff] [blame] | 7848 | @item -object tls-creds-anon,id=@var{id},endpoint=@var{endpoint},dir=@var{/path/to/cred/dir},verify-peer=@var{on|off} |
| 7849 | |
| 7850 | Creates a TLS anonymous credentials object, which can be used to provide |
| 7851 | TLS support on network backends. The @option{id} parameter is a unique |
| 7852 | ID which network backends will use to access the credentials. The |
| 7853 | @option{endpoint} is either @option{server} or @option{client} depending |
| 7854 | on whether the QEMU network backend that uses the credentials will be |
| 7855 | acting as a client or as a server. If @option{verify-peer} is enabled |
| 7856 | (the default) then once the handshake is completed, the peer credentials |
| 7857 | will be verified, though this is a no-op for anonymous credentials. |
| 7858 | |
| 7859 | The @var{dir} parameter tells QEMU where to find the credential |
| 7860 | files. For server endpoints, this directory may contain a file |
| 7861 | @var{dh-params.pem} providing diffie-hellman parameters to use |
| 7862 | for the TLS server. If the file is missing, QEMU will generate |
| 7863 | a set of DH parameters at startup. This is a computationally |
| 7864 | expensive operation that consumes random pool entropy, so it is |
| 7865 | recommended that a persistent set of parameters be generated |
| 7866 | upfront and saved. |
| 7867 | |
Richard W.M. Jones | e1a6dc9 | 2018-07-03 09:03:03 +0100 | [diff] [blame] | 7868 | @item -object tls-creds-psk,id=@var{id},endpoint=@var{endpoint},dir=@var{/path/to/keys/dir}[,username=@var{username}] |
| 7869 | |
| 7870 | Creates a TLS Pre-Shared Keys (PSK) credentials object, which can be used to provide |
| 7871 | TLS support on network backends. The @option{id} parameter is a unique |
| 7872 | ID which network backends will use to access the credentials. The |
| 7873 | @option{endpoint} is either @option{server} or @option{client} depending |
| 7874 | on whether the QEMU network backend that uses the credentials will be |
| 7875 | acting as a client or as a server. For clients only, @option{username} |
| 7876 | is the username which will be sent to the server. If omitted |
| 7877 | it defaults to ``qemu''. |
| 7878 | |
| 7879 | The @var{dir} parameter tells QEMU where to find the keys file. |
| 7880 | It is called ``@var{dir}/keys.psk'' and contains ``username:key'' |
| 7881 | pairs. This file can most easily be created using the GnuTLS |
| 7882 | @code{psktool} program. |
| 7883 | |
| 7884 | For server endpoints, @var{dir} may also contain a file |
| 7885 | @var{dh-params.pem} providing diffie-hellman parameters to use |
| 7886 | for the TLS server. If the file is missing, QEMU will generate |
| 7887 | a set of DH parameters at startup. This is a computationally |
| 7888 | expensive operation that consumes random pool entropy, so it is |
| 7889 | recommended that a persistent set of parameters be generated |
| 7890 | up front and saved. |
| 7891 | |
Christophe Fergeau | 00e5e9d | 2017-12-08 15:14:30 +0100 | [diff] [blame] | 7892 | @item -object tls-creds-x509,id=@var{id},endpoint=@var{endpoint},dir=@var{/path/to/cred/dir},priority=@var{priority},verify-peer=@var{on|off},passwordid=@var{id} |
Daniel P. Berrange | 85bcbc7 | 2015-03-13 17:39:26 +0000 | [diff] [blame] | 7893 | |
| 7894 | Creates a TLS anonymous credentials object, which can be used to provide |
| 7895 | TLS support on network backends. The @option{id} parameter is a unique |
| 7896 | ID which network backends will use to access the credentials. The |
| 7897 | @option{endpoint} is either @option{server} or @option{client} depending |
| 7898 | on whether the QEMU network backend that uses the credentials will be |
| 7899 | acting as a client or as a server. If @option{verify-peer} is enabled |
| 7900 | (the default) then once the handshake is completed, the peer credentials |
| 7901 | will be verified. With x509 certificates, this implies that the clients |
| 7902 | must be provided with valid client certificates too. |
| 7903 | |
| 7904 | The @var{dir} parameter tells QEMU where to find the credential |
| 7905 | files. For server endpoints, this directory may contain a file |
| 7906 | @var{dh-params.pem} providing diffie-hellman parameters to use |
| 7907 | for the TLS server. If the file is missing, QEMU will generate |
| 7908 | a set of DH parameters at startup. This is a computationally |
| 7909 | expensive operation that consumes random pool entropy, so it is |
| 7910 | recommended that a persistent set of parameters be generated |
| 7911 | upfront and saved. |
| 7912 | |
| 7913 | For x509 certificate credentials the directory will contain further files |
| 7914 | providing the x509 certificates. The certificates must be stored |
| 7915 | in PEM format, in filenames @var{ca-cert.pem}, @var{ca-crl.pem} (optional), |
| 7916 | @var{server-cert.pem} (only servers), @var{server-key.pem} (only servers), |
| 7917 | @var{client-cert.pem} (only clients), and @var{client-key.pem} (only clients). |
| 7918 | |
Daniel P. Berrange | 1d7b5b4 | 2015-10-15 16:14:42 +0100 | [diff] [blame] | 7919 | For the @var{server-key.pem} and @var{client-key.pem} files which |
| 7920 | contain sensitive private keys, it is possible to use an encrypted |
| 7921 | version by providing the @var{passwordid} parameter. This provides |
| 7922 | the ID of a previously created @code{secret} object containing the |
| 7923 | password for decryption. |
| 7924 | |
Christophe Fergeau | 00e5e9d | 2017-12-08 15:14:30 +0100 | [diff] [blame] | 7925 | The @var{priority} parameter allows to override the global default |
| 7926 | priority used by gnutls. This can be useful if the system administrator |
| 7927 | needs to use a weaker set of crypto priorities for QEMU without |
| 7928 | potentially forcing the weakness onto all applications. Or conversely |
| 7929 | if one wants wants a stronger default for QEMU than for all other |
| 7930 | applications, they can do this through this parameter. Its format is |
| 7931 | a gnutls priority string as described at |
| 7932 | @url{https://gnutls.org/manual/html_node/Priority-Strings.html}. |
| 7933 | |
Lukas Straub | 1973136 | 2019-10-24 16:25:48 +0200 | [diff] [blame] | 7934 | @item -object filter-buffer,id=@var{id},netdev=@var{netdevid},interval=@var{t}[,queue=@var{all|rx|tx}][,status=@var{on|off}][,position=@var{head|tail|id=<id>}][,insert=@var{behind|before}] |
Yang Hongyang | 7dbb11c | 2015-10-07 11:52:21 +0800 | [diff] [blame] | 7935 | |
| 7936 | Interval @var{t} can't be 0, this filter batches the packet delivery: all |
| 7937 | packets arriving in a given interval on netdev @var{netdevid} are delayed |
| 7938 | until the end of the interval. Interval is in microseconds. |
zhanghailiang | 338d3f4 | 2016-03-01 13:37:02 +0800 | [diff] [blame] | 7939 | @option{status} is optional that indicate whether the netfilter is |
| 7940 | on (enabled) or off (disabled), the default status for netfilter will be 'on'. |
Yang Hongyang | 7dbb11c | 2015-10-07 11:52:21 +0800 | [diff] [blame] | 7941 | |
| 7942 | queue @var{all|rx|tx} is an option that can be applied to any netfilter. |
| 7943 | |
| 7944 | @option{all}: the filter is attached both to the receive and the transmit |
| 7945 | queue of the netdev (default). |
| 7946 | |
| 7947 | @option{rx}: the filter is attached to the receive queue of the netdev, |
| 7948 | where it will receive packets sent to the netdev. |
| 7949 | |
| 7950 | @option{tx}: the filter is attached to the transmit queue of the netdev, |
| 7951 | where it will receive packets sent by the netdev. |
| 7952 | |
Lukas Straub | 1973136 | 2019-10-24 16:25:48 +0200 | [diff] [blame] | 7953 | position @var{head|tail|id=<id>} is an option to specify where the |
| 7954 | filter should be inserted in the filter list. It can be applied to any |
| 7955 | netfilter. |
| 7956 | |
| 7957 | @option{head}: the filter is inserted at the head of the filter |
| 7958 | list, before any existing filters. |
| 7959 | |
| 7960 | @option{tail}: the filter is inserted at the tail of the filter |
| 7961 | list, behind any existing filters (default). |
| 7962 | |
| 7963 | @option{id=<id>}: the filter is inserted before or behind the filter |
| 7964 | specified by <id>, see the insert option below. |
| 7965 | |
| 7966 | insert @var{behind|before} is an option to specify where to insert the |
| 7967 | new filter relative to the one specified with position=id=<id>. It can |
| 7968 | be applied to any netfilter. |
| 7969 | |
| 7970 | @option{before}: insert before the specified filter. |
| 7971 | |
| 7972 | @option{behind}: insert behind the specified filter (default). |
| 7973 | |
| 7974 | @item -object filter-mirror,id=@var{id},netdev=@var{netdevid},outdev=@var{chardevid},queue=@var{all|rx|tx}[,vnet_hdr_support][,position=@var{head|tail|id=<id>}][,insert=@var{behind|before}] |
Zhang Chen | f6d3afb | 2016-03-15 15:41:33 +0800 | [diff] [blame] | 7975 | |
Zhang Chen | e2521f0 | 2017-07-04 14:53:48 +0800 | [diff] [blame] | 7976 | filter-mirror on netdev @var{netdevid},mirror net packet to chardev@var{chardevid}, if it has the vnet_hdr_support flag, filter-mirror will mirror packet with vnet_hdr_len. |
Zhang Chen | f6d3afb | 2016-03-15 15:41:33 +0800 | [diff] [blame] | 7977 | |
Lukas Straub | 1973136 | 2019-10-24 16:25:48 +0200 | [diff] [blame] | 7978 | @item -object filter-redirector,id=@var{id},netdev=@var{netdevid},indev=@var{chardevid},outdev=@var{chardevid},queue=@var{all|rx|tx}[,vnet_hdr_support][,position=@var{head|tail|id=<id>}][,insert=@var{behind|before}] |
Zhang Chen | d46f75b | 2016-03-17 16:16:26 +0800 | [diff] [blame] | 7979 | |
| 7980 | filter-redirector on netdev @var{netdevid},redirect filter's net packet to chardev |
Zhang Chen | 00d5c24 | 2017-07-04 14:53:49 +0800 | [diff] [blame] | 7981 | @var{chardevid},and redirect indev's packet to filter.if it has the vnet_hdr_support flag, |
| 7982 | filter-redirector will redirect packet with vnet_hdr_len. |
Zhang Chen | d46f75b | 2016-03-17 16:16:26 +0800 | [diff] [blame] | 7983 | Create a filter-redirector we need to differ outdev id from indev id, id can not |
| 7984 | be the same. we can just use indev or outdev, but at least one of indev or outdev |
| 7985 | need to be specified. |
| 7986 | |
Lukas Straub | 1973136 | 2019-10-24 16:25:48 +0200 | [diff] [blame] | 7987 | @item -object filter-rewriter,id=@var{id},netdev=@var{netdevid},queue=@var{all|rx|tx},[vnet_hdr_support][,position=@var{head|tail|id=<id>}][,insert=@var{behind|before}] |
Zhang Chen | e6eee8a | 2016-09-27 10:22:32 +0800 | [diff] [blame] | 7988 | |
| 7989 | Filter-rewriter is a part of COLO project.It will rewrite tcp packet to |
| 7990 | secondary from primary to keep secondary tcp connection,and rewrite |
| 7991 | tcp packet to primary from secondary make tcp packet can be handled by |
Zhang Chen | 4b39bdc | 2017-07-04 14:53:55 +0800 | [diff] [blame] | 7992 | client.if it has the vnet_hdr_support flag, we can parse packet with vnet header. |
Zhang Chen | e6eee8a | 2016-09-27 10:22:32 +0800 | [diff] [blame] | 7993 | |
| 7994 | usage: |
| 7995 | colo secondary: |
| 7996 | -object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0 |
| 7997 | -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1 |
| 7998 | -object filter-rewriter,id=rew0,netdev=hn0,queue=all |
| 7999 | |
Lukas Straub | 1973136 | 2019-10-24 16:25:48 +0200 | [diff] [blame] | 8000 | @item -object filter-dump,id=@var{id},netdev=@var{dev}[,file=@var{filename}][,maxlen=@var{len}][,position=@var{head|tail|id=<id>}][,insert=@var{behind|before}] |
Thomas Huth | d3e0c03 | 2015-10-13 12:40:02 +0200 | [diff] [blame] | 8001 | |
| 8002 | Dump the network traffic on netdev @var{dev} to the file specified by |
| 8003 | @var{filename}. At most @var{len} bytes (64k by default) per packet are stored. |
| 8004 | The file format is libpcap, so it can be analyzed with tools such as tcpdump |
| 8005 | or Wireshark. |
| 8006 | |
Zhang Chen | cf6af76 | 2019-06-10 00:44:29 +0800 | [diff] [blame] | 8007 | @item -object colo-compare,id=@var{id},primary_in=@var{chardevid},secondary_in=@var{chardevid},outdev=@var{chardevid},iothread=@var{id}[,vnet_hdr_support][,notify_dev=@var{id}] |
Zhang Chen | 7dce4e6 | 2016-09-27 10:22:26 +0800 | [diff] [blame] | 8008 | |
| 8009 | Colo-compare gets packet from primary_in@var{chardevid} and secondary_in@var{chardevid}, than compare primary packet with |
| 8010 | secondary packet. If the packets are same, we will output primary |
| 8011 | packet to outdev@var{chardevid}, else we will notify colo-frame |
| 8012 | do checkpoint and send primary packet to outdev@var{chardevid}. |
Zhang Chen | 5aede7f | 2019-04-26 17:07:30 +0800 | [diff] [blame] | 8013 | In order to improve efficiency, we need to put the task of comparison |
| 8014 | in another thread. If it has the vnet_hdr_support flag, colo compare |
| 8015 | will send/recv packet with vnet_hdr_len. |
Zhang Chen | cf6af76 | 2019-06-10 00:44:29 +0800 | [diff] [blame] | 8016 | If you want to use Xen COLO, will need the notify_dev to notify Xen |
| 8017 | colo-frame to do checkpoint. |
Zhang Chen | 7dce4e6 | 2016-09-27 10:22:26 +0800 | [diff] [blame] | 8018 | |
| 8019 | we must use it with the help of filter-mirror and filter-redirector. |
| 8020 | |
| 8021 | @example |
| 8022 | |
Zhang Chen | cf6af76 | 2019-06-10 00:44:29 +0800 | [diff] [blame] | 8023 | KVM COLO |
| 8024 | |
Zhang Chen | 7dce4e6 | 2016-09-27 10:22:26 +0800 | [diff] [blame] | 8025 | primary: |
| 8026 | -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown |
| 8027 | -device e1000,id=e0,netdev=hn0,mac=52:a4:00:12:78:66 |
| 8028 | -chardev socket,id=mirror0,host=3.3.3.3,port=9003,server,nowait |
| 8029 | -chardev socket,id=compare1,host=3.3.3.3,port=9004,server,nowait |
| 8030 | -chardev socket,id=compare0,host=3.3.3.3,port=9001,server,nowait |
| 8031 | -chardev socket,id=compare0-0,host=3.3.3.3,port=9001 |
| 8032 | -chardev socket,id=compare_out,host=3.3.3.3,port=9005,server,nowait |
| 8033 | -chardev socket,id=compare_out0,host=3.3.3.3,port=9005 |
Zhang Chen | 5aede7f | 2019-04-26 17:07:30 +0800 | [diff] [blame] | 8034 | -object iothread,id=iothread1 |
Zhang Chen | 7dce4e6 | 2016-09-27 10:22:26 +0800 | [diff] [blame] | 8035 | -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0 |
| 8036 | -object filter-redirector,netdev=hn0,id=redire0,queue=rx,indev=compare_out |
| 8037 | -object filter-redirector,netdev=hn0,id=redire1,queue=rx,outdev=compare0 |
Zhang Chen | 5aede7f | 2019-04-26 17:07:30 +0800 | [diff] [blame] | 8038 | -object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0,iothread=iothread1 |
Zhang Chen | 7dce4e6 | 2016-09-27 10:22:26 +0800 | [diff] [blame] | 8039 | |
| 8040 | secondary: |
| 8041 | -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,down script=/etc/qemu-ifdown |
| 8042 | -device e1000,netdev=hn0,mac=52:a4:00:12:78:66 |
| 8043 | -chardev socket,id=red0,host=3.3.3.3,port=9003 |
| 8044 | -chardev socket,id=red1,host=3.3.3.3,port=9004 |
| 8045 | -object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0 |
| 8046 | -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1 |
| 8047 | |
Zhang Chen | cf6af76 | 2019-06-10 00:44:29 +0800 | [diff] [blame] | 8048 | |
| 8049 | Xen COLO |
| 8050 | |
| 8051 | primary: |
| 8052 | -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown |
| 8053 | -device e1000,id=e0,netdev=hn0,mac=52:a4:00:12:78:66 |
| 8054 | -chardev socket,id=mirror0,host=3.3.3.3,port=9003,server,nowait |
| 8055 | -chardev socket,id=compare1,host=3.3.3.3,port=9004,server,nowait |
| 8056 | -chardev socket,id=compare0,host=3.3.3.3,port=9001,server,nowait |
| 8057 | -chardev socket,id=compare0-0,host=3.3.3.3,port=9001 |
| 8058 | -chardev socket,id=compare_out,host=3.3.3.3,port=9005,server,nowait |
| 8059 | -chardev socket,id=compare_out0,host=3.3.3.3,port=9005 |
| 8060 | -chardev socket,id=notify_way,host=3.3.3.3,port=9009,server,nowait |
| 8061 | -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0 |
| 8062 | -object filter-redirector,netdev=hn0,id=redire0,queue=rx,indev=compare_out |
| 8063 | -object filter-redirector,netdev=hn0,id=redire1,queue=rx,outdev=compare0 |
| 8064 | -object iothread,id=iothread1 |
| 8065 | -object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0,notify_dev=nofity_way,iothread=iothread1 |
| 8066 | |
| 8067 | secondary: |
| 8068 | -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,down script=/etc/qemu-ifdown |
| 8069 | -device e1000,netdev=hn0,mac=52:a4:00:12:78:66 |
| 8070 | -chardev socket,id=red0,host=3.3.3.3,port=9003 |
| 8071 | -chardev socket,id=red1,host=3.3.3.3,port=9004 |
| 8072 | -object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0 |
| 8073 | -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1 |
| 8074 | |
Zhang Chen | 7dce4e6 | 2016-09-27 10:22:26 +0800 | [diff] [blame] | 8075 | @end example |
| 8076 | |
| 8077 | If you want to know the detail of above command line, you can read |
| 8078 | the colo-compare git log. |
| 8079 | |
Gonglei | 1653a5f | 2016-10-28 16:33:23 +0800 | [diff] [blame] | 8080 | @item -object cryptodev-backend-builtin,id=@var{id}[,queues=@var{queues}] |
| 8081 | |
| 8082 | Creates a cryptodev backend which executes crypto opreation from |
| 8083 | the QEMU cipher APIS. The @var{id} parameter is |
| 8084 | a unique ID that will be used to reference this cryptodev backend from |
| 8085 | the @option{virtio-crypto} device. The @var{queues} parameter is optional, |
| 8086 | which specify the queue number of cryptodev backend, the default of |
| 8087 | @var{queues} is 1. |
| 8088 | |
| 8089 | @example |
| 8090 | |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 8091 | # @value{qemu_system} \ |
Gonglei | 1653a5f | 2016-10-28 16:33:23 +0800 | [diff] [blame] | 8092 | [...] \ |
| 8093 | -object cryptodev-backend-builtin,id=cryptodev0 \ |
| 8094 | -device virtio-crypto-pci,id=crypto0,cryptodev=cryptodev0 \ |
| 8095 | [...] |
| 8096 | @end example |
| 8097 | |
Gonglei | 042cea2 | 2018-03-01 21:46:28 +0800 | [diff] [blame] | 8098 | @item -object cryptodev-vhost-user,id=@var{id},chardev=@var{chardevid}[,queues=@var{queues}] |
| 8099 | |
| 8100 | Creates a vhost-user cryptodev backend, backed by a chardev @var{chardevid}. |
| 8101 | The @var{id} parameter is a unique ID that will be used to reference this |
| 8102 | cryptodev backend from the @option{virtio-crypto} device. |
| 8103 | The chardev should be a unix domain socket backed one. The vhost-user uses |
| 8104 | a specifically defined protocol to pass vhost ioctl replacement messages |
| 8105 | to an application on the other end of the socket. |
| 8106 | The @var{queues} parameter is optional, which specify the queue number |
| 8107 | of cryptodev backend for multiqueue vhost-user, the default of @var{queues} is 1. |
| 8108 | |
| 8109 | @example |
| 8110 | |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 8111 | # @value{qemu_system} \ |
Gonglei | 042cea2 | 2018-03-01 21:46:28 +0800 | [diff] [blame] | 8112 | [...] \ |
| 8113 | -chardev socket,id=chardev0,path=/path/to/socket \ |
| 8114 | -object cryptodev-vhost-user,id=cryptodev0,chardev=chardev0 \ |
| 8115 | -device virtio-crypto-pci,id=crypto0,cryptodev=cryptodev0 \ |
| 8116 | [...] |
| 8117 | @end example |
| 8118 | |
Daniel P. Berrange | ac1d887 | 2015-10-14 09:58:38 +0100 | [diff] [blame] | 8119 | @item -object secret,id=@var{id},data=@var{string},format=@var{raw|base64}[,keyid=@var{secretid},iv=@var{string}] |
| 8120 | @item -object secret,id=@var{id},file=@var{filename},format=@var{raw|base64}[,keyid=@var{secretid},iv=@var{string}] |
| 8121 | |
| 8122 | Defines a secret to store a password, encryption key, or some other sensitive |
| 8123 | data. The sensitive data can either be passed directly via the @var{data} |
| 8124 | parameter, or indirectly via the @var{file} parameter. Using the @var{data} |
| 8125 | parameter is insecure unless the sensitive data is encrypted. |
| 8126 | |
| 8127 | The sensitive data can be provided in raw format (the default), or base64. |
| 8128 | When encoded as JSON, the raw format only supports valid UTF-8 characters, |
| 8129 | so base64 is recommended for sending binary data. QEMU will convert from |
| 8130 | which ever format is provided to the format it needs internally. eg, an |
| 8131 | RBD password can be provided in raw format, even though it will be base64 |
| 8132 | encoded when passed onto the RBD sever. |
| 8133 | |
| 8134 | For added protection, it is possible to encrypt the data associated with |
| 8135 | a secret using the AES-256-CBC cipher. Use of encryption is indicated |
| 8136 | by providing the @var{keyid} and @var{iv} parameters. The @var{keyid} |
| 8137 | parameter provides the ID of a previously defined secret that contains |
| 8138 | the AES-256 decryption key. This key should be 32-bytes long and be |
| 8139 | base64 encoded. The @var{iv} parameter provides the random initialization |
| 8140 | vector used for encryption of this particular secret and should be a |
Daniel P. Berrange | 69c0b27 | 2016-04-04 10:33:55 +0100 | [diff] [blame] | 8141 | base64 encrypted string of the 16-byte IV. |
Daniel P. Berrange | ac1d887 | 2015-10-14 09:58:38 +0100 | [diff] [blame] | 8142 | |
| 8143 | The simplest (insecure) usage is to provide the secret inline |
| 8144 | |
| 8145 | @example |
| 8146 | |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 8147 | # @value{qemu_system} -object secret,id=sec0,data=letmein,format=raw |
Daniel P. Berrange | ac1d887 | 2015-10-14 09:58:38 +0100 | [diff] [blame] | 8148 | |
| 8149 | @end example |
| 8150 | |
| 8151 | The simplest secure usage is to provide the secret via a file |
| 8152 | |
Eric Blake | b43671f | 2017-07-03 13:09:50 -0500 | [diff] [blame] | 8153 | # printf "letmein" > mypasswd.txt |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 8154 | # @value{qemu_system} -object secret,id=sec0,file=mypasswd.txt,format=raw |
Daniel P. Berrange | ac1d887 | 2015-10-14 09:58:38 +0100 | [diff] [blame] | 8155 | |
| 8156 | For greater security, AES-256-CBC should be used. To illustrate usage, |
| 8157 | consider the openssl command line tool which can encrypt the data. Note |
| 8158 | that when encrypting, the plaintext must be padded to the cipher block |
| 8159 | size (32 bytes) using the standard PKCS#5/6 compatible padding algorithm. |
| 8160 | |
| 8161 | First a master key needs to be created in base64 encoding: |
| 8162 | |
| 8163 | @example |
| 8164 | # openssl rand -base64 32 > key.b64 |
| 8165 | # KEY=$(base64 -d key.b64 | hexdump -v -e '/1 "%02X"') |
| 8166 | @end example |
| 8167 | |
| 8168 | Each secret to be encrypted needs to have a random initialization vector |
| 8169 | generated. These do not need to be kept secret |
| 8170 | |
| 8171 | @example |
| 8172 | # openssl rand -base64 16 > iv.b64 |
| 8173 | # IV=$(base64 -d iv.b64 | hexdump -v -e '/1 "%02X"') |
| 8174 | @end example |
| 8175 | |
| 8176 | The secret to be defined can now be encrypted, in this case we're |
| 8177 | telling openssl to base64 encode the result, but it could be left |
| 8178 | as raw bytes if desired. |
| 8179 | |
| 8180 | @example |
Eric Blake | b43671f | 2017-07-03 13:09:50 -0500 | [diff] [blame] | 8181 | # SECRET=$(printf "letmein" | |
Daniel P. Berrange | ac1d887 | 2015-10-14 09:58:38 +0100 | [diff] [blame] | 8182 | openssl enc -aes-256-cbc -a -K $KEY -iv $IV) |
| 8183 | @end example |
| 8184 | |
| 8185 | When launching QEMU, create a master secret pointing to @code{key.b64} |
| 8186 | and specify that to be used to decrypt the user password. Pass the |
| 8187 | contents of @code{iv.b64} to the second secret |
| 8188 | |
| 8189 | @example |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 8190 | # @value{qemu_system} \ |
Daniel P. Berrange | ac1d887 | 2015-10-14 09:58:38 +0100 | [diff] [blame] | 8191 | -object secret,id=secmaster0,format=base64,file=key.b64 \ |
| 8192 | -object secret,id=sec0,keyid=secmaster0,format=base64,\ |
| 8193 | data=$SECRET,iv=$(<iv.b64) |
| 8194 | @end example |
| 8195 | |
Brijesh Singh | a9b4942 | 2018-03-08 06:48:41 -0600 | [diff] [blame] | 8196 | @item -object sev-guest,id=@var{id},cbitpos=@var{cbitpos},reduced-phys-bits=@var{val},[sev-device=@var{string},policy=@var{policy},handle=@var{handle},dh-cert-file=@var{file},session-file=@var{file}] |
| 8197 | |
| 8198 | Create a Secure Encrypted Virtualization (SEV) guest object, which can be used |
| 8199 | to provide the guest memory encryption support on AMD processors. |
| 8200 | |
| 8201 | When memory encryption is enabled, one of the physical address bit (aka the |
| 8202 | C-bit) is utilized to mark if a memory page is protected. The @option{cbitpos} |
| 8203 | is used to provide the C-bit position. The C-bit position is Host family dependent |
| 8204 | hence user must provide this value. On EPYC, the value should be 47. |
| 8205 | |
| 8206 | When memory encryption is enabled, we loose certain bits in physical address space. |
| 8207 | The @option{reduced-phys-bits} is used to provide the number of bits we loose in |
| 8208 | physical address space. Similar to C-bit, the value is Host family dependent. |
| 8209 | On EPYC, the value should be 5. |
| 8210 | |
| 8211 | The @option{sev-device} provides the device file to use for communicating with |
| 8212 | the SEV firmware running inside AMD Secure Processor. The default device is |
| 8213 | '/dev/sev'. If hardware supports memory encryption then /dev/sev devices are |
| 8214 | created by CCP driver. |
| 8215 | |
| 8216 | The @option{policy} provides the guest policy to be enforced by the SEV firmware |
| 8217 | and restrict what configuration and operational commands can be performed on this |
| 8218 | guest by the hypervisor. The policy should be provided by the guest owner and is |
| 8219 | bound to the guest and cannot be changed throughout the lifetime of the guest. |
| 8220 | The default is 0. |
| 8221 | |
| 8222 | If guest @option{policy} allows sharing the key with another SEV guest then |
| 8223 | @option{handle} can be use to provide handle of the guest from which to share |
| 8224 | the key. |
| 8225 | |
| 8226 | The @option{dh-cert-file} and @option{session-file} provides the guest owner's |
| 8227 | Public Diffie-Hillman key defined in SEV spec. The PDH and session parameters |
| 8228 | are used for establishing a cryptographic session with the guest owner to |
| 8229 | negotiate keys used for attestation. The file must be encoded in base64. |
| 8230 | |
| 8231 | e.g to launch a SEV guest |
| 8232 | @example |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 8233 | # @value{qemu_system_x86} \ |
Brijesh Singh | a9b4942 | 2018-03-08 06:48:41 -0600 | [diff] [blame] | 8234 | ...... |
| 8235 | -object sev-guest,id=sev0,cbitpos=47,reduced-phys-bits=5 \ |
| 8236 | -machine ...,memory-encryption=sev0 |
| 8237 | ..... |
| 8238 | |
| 8239 | @end example |
Daniel P. Berrangé | fb5c4eb | 2018-05-02 15:40:33 +0100 | [diff] [blame] | 8240 | |
| 8241 | |
| 8242 | @item -object authz-simple,id=@var{id},identity=@var{string} |
| 8243 | |
| 8244 | Create an authorization object that will control access to network services. |
| 8245 | |
| 8246 | The @option{identity} parameter is identifies the user and its format |
| 8247 | depends on the network service that authorization object is associated |
| 8248 | with. For authorizing based on TLS x509 certificates, the identity must |
| 8249 | be the x509 distinguished name. Note that care must be taken to escape |
| 8250 | any commas in the distinguished name. |
| 8251 | |
| 8252 | An example authorization object to validate a x509 distinguished name |
| 8253 | would look like: |
| 8254 | @example |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 8255 | # @value{qemu_system} \ |
Daniel P. Berrangé | fb5c4eb | 2018-05-02 15:40:33 +0100 | [diff] [blame] | 8256 | ... |
| 8257 | -object 'authz-simple,id=auth0,identity=CN=laptop.example.com,,O=Example Org,,L=London,,ST=London,,C=GB' \ |
| 8258 | ... |
| 8259 | @end example |
| 8260 | |
| 8261 | Note the use of quotes due to the x509 distinguished name containing |
| 8262 | whitespace, and escaping of ','. |
| 8263 | |
Daniel P. Berrangé | 55d8698 | 2018-05-11 12:19:59 +0100 | [diff] [blame] | 8264 | @item -object authz-listfile,id=@var{id},filename=@var{path},refresh=@var{yes|no} |
| 8265 | |
| 8266 | Create an authorization object that will control access to network services. |
| 8267 | |
| 8268 | The @option{filename} parameter is the fully qualified path to a file |
| 8269 | containing the access control list rules in JSON format. |
| 8270 | |
| 8271 | An example set of rules that match against SASL usernames might look |
| 8272 | like: |
| 8273 | |
| 8274 | @example |
| 8275 | @{ |
| 8276 | "rules": [ |
| 8277 | @{ "match": "fred", "policy": "allow", "format": "exact" @}, |
| 8278 | @{ "match": "bob", "policy": "allow", "format": "exact" @}, |
| 8279 | @{ "match": "danb", "policy": "deny", "format": "glob" @}, |
| 8280 | @{ "match": "dan*", "policy": "allow", "format": "exact" @}, |
| 8281 | ], |
| 8282 | "policy": "deny" |
| 8283 | @} |
| 8284 | @end example |
| 8285 | |
| 8286 | When checking access the object will iterate over all the rules and |
| 8287 | the first rule to match will have its @option{policy} value returned |
| 8288 | as the result. If no rules match, then the default @option{policy} |
| 8289 | value is returned. |
| 8290 | |
| 8291 | The rules can either be an exact string match, or they can use the |
| 8292 | simple UNIX glob pattern matching to allow wildcards to be used. |
| 8293 | |
| 8294 | If @option{refresh} is set to true the file will be monitored |
| 8295 | and automatically reloaded whenever its content changes. |
| 8296 | |
| 8297 | As with the @code{authz-simple} object, the format of the identity |
| 8298 | strings being matched depends on the network service, but is usually |
| 8299 | a TLS x509 distinguished name, or a SASL username. |
| 8300 | |
| 8301 | An example authorization object to validate a SASL username |
| 8302 | would look like: |
| 8303 | @example |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 8304 | # @value{qemu_system} \ |
Daniel P. Berrangé | 55d8698 | 2018-05-11 12:19:59 +0100 | [diff] [blame] | 8305 | ... |
| 8306 | -object authz-simple,id=auth0,filename=/etc/qemu/vnc-sasl.acl,refresh=yes |
| 8307 | ... |
| 8308 | @end example |
| 8309 | |
Daniel P. Berrange | 8953caf | 2016-07-27 14:13:56 +0100 | [diff] [blame] | 8310 | @item -object authz-pam,id=@var{id},service=@var{string} |
| 8311 | |
| 8312 | Create an authorization object that will control access to network services. |
| 8313 | |
| 8314 | The @option{service} parameter provides the name of a PAM service to use |
| 8315 | for authorization. It requires that a file @code{/etc/pam.d/@var{service}} |
| 8316 | exist to provide the configuration for the @code{account} subsystem. |
| 8317 | |
| 8318 | An example authorization object to validate a TLS x509 distinguished |
| 8319 | name would look like: |
| 8320 | |
| 8321 | @example |
Thomas Huth | 664785a | 2019-07-30 17:08:26 +0200 | [diff] [blame] | 8322 | # @value{qemu_system} \ |
Daniel P. Berrange | 8953caf | 2016-07-27 14:13:56 +0100 | [diff] [blame] | 8323 | ... |
| 8324 | -object authz-pam,id=auth0,service=qemu-vnc |
| 8325 | ... |
| 8326 | @end example |
| 8327 | |
| 8328 | There would then be a corresponding config file for PAM at |
| 8329 | @code{/etc/pam.d/qemu-vnc} that contains: |
| 8330 | |
| 8331 | @example |
| 8332 | account requisite pam_listfile.so item=user sense=allow \ |
| 8333 | file=/etc/qemu/vnc.allow |
| 8334 | @end example |
| 8335 | |
| 8336 | Finally the @code{/etc/qemu/vnc.allow} file would contain |
| 8337 | the list of x509 distingished names that are permitted |
| 8338 | access |
| 8339 | |
| 8340 | @example |
| 8341 | CN=laptop.example.com,O=Example Home,L=London,ST=London,C=GB |
| 8342 | @end example |
| 8343 | |
Stefan Hajnoczi | 86d2a49 | 2019-10-25 14:22:36 +0200 | [diff] [blame] | 8344 | @item -object iothread,id=@var{id},poll-max-ns=@var{poll-max-ns},poll-grow=@var{poll-grow},poll-shrink=@var{poll-shrink} |
| 8345 | |
| 8346 | Creates a dedicated event loop thread that devices can be assigned to. This is |
| 8347 | known as an IOThread. By default device emulation happens in vCPU threads or |
| 8348 | the main event loop thread. This can become a scalability bottleneck. |
| 8349 | IOThreads allow device emulation and I/O to run on other host CPUs. |
| 8350 | |
| 8351 | The @option{id} parameter is a unique ID that will be used to reference this |
| 8352 | IOThread from @option{-device ...,iothread=@var{id}}. Multiple devices can be |
| 8353 | assigned to an IOThread. Note that not all devices support an |
| 8354 | @option{iothread} parameter. |
| 8355 | |
| 8356 | The @code{query-iothreads} QMP command lists IOThreads and reports their thread |
| 8357 | IDs so that the user can configure host CPU pinning/affinity. |
| 8358 | |
| 8359 | IOThreads use an adaptive polling algorithm to reduce event loop latency. |
| 8360 | Instead of entering a blocking system call to monitor file descriptors and then |
| 8361 | pay the cost of being woken up when an event occurs, the polling algorithm |
| 8362 | spins waiting for events for a short time. The algorithm's default parameters |
| 8363 | are suitable for many cases but can be adjusted based on knowledge of the |
| 8364 | workload and/or host device latency. |
| 8365 | |
| 8366 | The @option{poll-max-ns} parameter is the maximum number of nanoseconds to busy |
| 8367 | wait for events. Polling can be disabled by setting this value to 0. |
| 8368 | |
| 8369 | The @option{poll-grow} parameter is the multiplier used to increase the polling |
| 8370 | time when the algorithm detects it is missing events due to not polling long |
| 8371 | enough. |
| 8372 | |
| 8373 | The @option{poll-shrink} parameter is the divisor used to decrease the polling |
| 8374 | time when the algorithm detects it is spending too long polling without |
| 8375 | encountering events. |
| 8376 | |
| 8377 | The polling parameters can be modified at run-time using the @code{qom-set} command (where @code{iothread1} is the IOThread's @code{id}): |
| 8378 | |
| 8379 | @example |
| 8380 | (qemu) qom-set /objects/iothread1 poll-max-ns 100000 |
| 8381 | @end example |
Daniel P. Berrange | 8953caf | 2016-07-27 14:13:56 +0100 | [diff] [blame] | 8382 | |
Daniel P. Berrange | b9174d4 | 2015-05-13 17:14:03 +0100 | [diff] [blame] | 8383 | @end table |
| 8384 | |
| 8385 | ETEXI |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 8386 | SRST |
| 8387 | ``-object typename[,prop1=value1,...]`` |
| 8388 | Create a new object of type typename setting properties in the order |
| 8389 | they are specified. Note that the 'id' property must be set. These |
| 8390 | objects are placed in the '/objects' path. |
| 8391 | |
| 8392 | ``-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`` |
| 8393 | Creates a memory file backend object, which can be used to back |
| 8394 | the guest RAM with huge pages. |
| 8395 | |
| 8396 | The ``id`` parameter is a unique ID that will be used to |
| 8397 | reference this memory region when configuring the ``-numa`` |
| 8398 | argument. |
| 8399 | |
| 8400 | The ``size`` option provides the size of the memory region, and |
| 8401 | accepts common suffixes, eg ``500M``. |
| 8402 | |
| 8403 | The ``mem-path`` provides the path to either a shared memory or |
| 8404 | huge page filesystem mount. |
| 8405 | |
| 8406 | The ``share`` boolean option determines whether the memory |
| 8407 | region is marked as private to QEMU, or shared. The latter |
| 8408 | allows a co-operating external process to access the QEMU memory |
| 8409 | region. |
| 8410 | |
| 8411 | The ``share`` is also required for pvrdma devices due to |
| 8412 | limitations in the RDMA API provided by Linux. |
| 8413 | |
| 8414 | Setting share=on might affect the ability to configure NUMA |
| 8415 | bindings for the memory backend under some circumstances, see |
| 8416 | Documentation/vm/numa\_memory\_policy.txt on the Linux kernel |
| 8417 | source tree for additional details. |
| 8418 | |
| 8419 | Setting the ``discard-data`` boolean option to on indicates that |
| 8420 | file contents can be destroyed when QEMU exits, to avoid |
| 8421 | unnecessarily flushing data to the backing file. Note that |
| 8422 | ``discard-data`` is only an optimization, and QEMU might not |
| 8423 | discard file contents if it aborts unexpectedly or is terminated |
| 8424 | using SIGKILL. |
| 8425 | |
| 8426 | The ``merge`` boolean option enables memory merge, also known as |
| 8427 | MADV\_MERGEABLE, so that Kernel Samepage Merging will consider |
| 8428 | the pages for memory deduplication. |
| 8429 | |
| 8430 | Setting the ``dump`` boolean option to off excludes the memory |
| 8431 | from core dumps. This feature is also known as MADV\_DONTDUMP. |
| 8432 | |
| 8433 | The ``prealloc`` boolean option enables memory preallocation. |
| 8434 | |
| 8435 | The ``host-nodes`` option binds the memory range to a list of |
| 8436 | NUMA host nodes. |
| 8437 | |
| 8438 | The ``policy`` option sets the NUMA policy to one of the |
| 8439 | following values: |
| 8440 | |
| 8441 | ``default`` |
| 8442 | default host policy |
| 8443 | |
| 8444 | ``preferred`` |
| 8445 | prefer the given host node list for allocation |
| 8446 | |
| 8447 | ``bind`` |
| 8448 | restrict memory allocation to the given host node list |
| 8449 | |
| 8450 | ``interleave`` |
| 8451 | interleave memory allocations across the given host node |
| 8452 | list |
| 8453 | |
| 8454 | The ``align`` option specifies the base address alignment when |
| 8455 | QEMU mmap(2) ``mem-path``, and accepts common suffixes, eg |
| 8456 | ``2M``. Some backend store specified by ``mem-path`` requires an |
| 8457 | alignment different than the default one used by QEMU, eg the |
| 8458 | device DAX /dev/dax0.0 requires 2M alignment rather than 4K. In |
| 8459 | such cases, users can specify the required alignment via this |
| 8460 | option. |
| 8461 | |
| 8462 | The ``pmem`` option specifies whether the backing file specified |
| 8463 | by ``mem-path`` is in host persistent memory that can be |
| 8464 | accessed using the SNIA NVM programming model (e.g. Intel |
| 8465 | NVDIMM). If ``pmem`` is set to 'on', QEMU will take necessary |
| 8466 | operations to guarantee the persistence of its own writes to |
| 8467 | ``mem-path`` (e.g. in vNVDIMM label emulation and live |
| 8468 | migration). Also, we will map the backend-file with MAP\_SYNC |
| 8469 | flag, which ensures the file metadata is in sync for |
| 8470 | ``mem-path`` in case of host crash or a power failure. MAP\_SYNC |
| 8471 | requires support from both the host kernel (since Linux kernel |
| 8472 | 4.15) and the filesystem of ``mem-path`` mounted with DAX |
| 8473 | option. |
| 8474 | |
| 8475 | ``-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`` |
| 8476 | Creates a memory backend object, which can be used to back the |
| 8477 | guest RAM. Memory backend objects offer more control than the |
| 8478 | ``-m`` option that is traditionally used to define guest RAM. |
| 8479 | Please refer to ``memory-backend-file`` for a description of the |
| 8480 | options. |
| 8481 | |
| 8482 | ``-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`` |
| 8483 | Creates an anonymous memory file backend object, which allows |
| 8484 | QEMU to share the memory with an external process (e.g. when |
| 8485 | using vhost-user). The memory is allocated with memfd and |
| 8486 | optional sealing. (Linux only) |
| 8487 | |
| 8488 | The ``seal`` option creates a sealed-file, that will block |
| 8489 | further resizing the memory ('on' by default). |
| 8490 | |
| 8491 | The ``hugetlb`` option specify the file to be created resides in |
| 8492 | the hugetlbfs filesystem (since Linux 4.14). Used in conjunction |
| 8493 | with the ``hugetlb`` option, the ``hugetlbsize`` option specify |
| 8494 | the hugetlb page size on systems that support multiple hugetlb |
| 8495 | page sizes (it must be a power of 2 value supported by the |
| 8496 | system). |
| 8497 | |
| 8498 | In some versions of Linux, the ``hugetlb`` option is |
| 8499 | incompatible with the ``seal`` option (requires at least Linux |
| 8500 | 4.16). |
| 8501 | |
| 8502 | Please refer to ``memory-backend-file`` for a description of the |
| 8503 | other options. |
| 8504 | |
| 8505 | The ``share`` boolean option is on by default with memfd. |
| 8506 | |
| 8507 | ``-object rng-builtin,id=id`` |
| 8508 | Creates a random number generator backend which obtains entropy |
| 8509 | from QEMU builtin functions. The ``id`` parameter is a unique ID |
| 8510 | that will be used to reference this entropy backend from the |
| 8511 | ``virtio-rng`` device. By default, the ``virtio-rng`` device |
| 8512 | uses this RNG backend. |
| 8513 | |
| 8514 | ``-object rng-random,id=id,filename=/dev/random`` |
| 8515 | Creates a random number generator backend which obtains entropy |
| 8516 | from a device on the host. The ``id`` parameter is a unique ID |
| 8517 | that will be used to reference this entropy backend from the |
| 8518 | ``virtio-rng`` device. The ``filename`` parameter specifies |
| 8519 | which file to obtain entropy from and if omitted defaults to |
| 8520 | ``/dev/urandom``. |
| 8521 | |
| 8522 | ``-object rng-egd,id=id,chardev=chardevid`` |
| 8523 | Creates a random number generator backend which obtains entropy |
| 8524 | from an external daemon running on the host. The ``id`` |
| 8525 | parameter is a unique ID that will be used to reference this |
| 8526 | entropy backend from the ``virtio-rng`` device. The ``chardev`` |
| 8527 | parameter is the unique ID of a character device backend that |
| 8528 | provides the connection to the RNG daemon. |
| 8529 | |
| 8530 | ``-object tls-creds-anon,id=id,endpoint=endpoint,dir=/path/to/cred/dir,verify-peer=on|off`` |
| 8531 | Creates a TLS anonymous credentials object, which can be used to |
| 8532 | provide TLS support on network backends. The ``id`` parameter is |
| 8533 | a unique ID which network backends will use to access the |
| 8534 | credentials. The ``endpoint`` is either ``server`` or ``client`` |
| 8535 | depending on whether the QEMU network backend that uses the |
| 8536 | credentials will be acting as a client or as a server. If |
| 8537 | ``verify-peer`` is enabled (the default) then once the handshake |
| 8538 | is completed, the peer credentials will be verified, though this |
| 8539 | is a no-op for anonymous credentials. |
| 8540 | |
| 8541 | The dir parameter tells QEMU where to find the credential files. |
| 8542 | For server endpoints, this directory may contain a file |
| 8543 | dh-params.pem providing diffie-hellman parameters to use for the |
| 8544 | TLS server. If the file is missing, QEMU will generate a set of |
| 8545 | DH parameters at startup. This is a computationally expensive |
| 8546 | operation that consumes random pool entropy, so it is |
| 8547 | recommended that a persistent set of parameters be generated |
| 8548 | upfront and saved. |
| 8549 | |
| 8550 | ``-object tls-creds-psk,id=id,endpoint=endpoint,dir=/path/to/keys/dir[,username=username]`` |
| 8551 | Creates a TLS Pre-Shared Keys (PSK) credentials object, which |
| 8552 | can be used to provide TLS support on network backends. The |
| 8553 | ``id`` parameter is a unique ID which network backends will use |
| 8554 | to access the credentials. The ``endpoint`` is either ``server`` |
| 8555 | or ``client`` depending on whether the QEMU network backend that |
| 8556 | uses the credentials will be acting as a client or as a server. |
| 8557 | For clients only, ``username`` is the username which will be |
| 8558 | sent to the server. If omitted it defaults to "qemu". |
| 8559 | |
| 8560 | The dir parameter tells QEMU where to find the keys file. It is |
| 8561 | called "dir/keys.psk" and contains "username:key" pairs. This |
| 8562 | file can most easily be created using the GnuTLS ``psktool`` |
| 8563 | program. |
| 8564 | |
| 8565 | For server endpoints, dir may also contain a file dh-params.pem |
| 8566 | providing diffie-hellman parameters to use for the TLS server. |
| 8567 | If the file is missing, QEMU will generate a set of DH |
| 8568 | parameters at startup. This is a computationally expensive |
| 8569 | operation that consumes random pool entropy, so it is |
| 8570 | recommended that a persistent set of parameters be generated up |
| 8571 | front and saved. |
| 8572 | |
| 8573 | ``-object tls-creds-x509,id=id,endpoint=endpoint,dir=/path/to/cred/dir,priority=priority,verify-peer=on|off,passwordid=id`` |
| 8574 | Creates a TLS anonymous credentials object, which can be used to |
| 8575 | provide TLS support on network backends. The ``id`` parameter is |
| 8576 | a unique ID which network backends will use to access the |
| 8577 | credentials. The ``endpoint`` is either ``server`` or ``client`` |
| 8578 | depending on whether the QEMU network backend that uses the |
| 8579 | credentials will be acting as a client or as a server. If |
| 8580 | ``verify-peer`` is enabled (the default) then once the handshake |
| 8581 | is completed, the peer credentials will be verified. With x509 |
| 8582 | certificates, this implies that the clients must be provided |
| 8583 | with valid client certificates too. |
| 8584 | |
| 8585 | The dir parameter tells QEMU where to find the credential files. |
| 8586 | For server endpoints, this directory may contain a file |
| 8587 | dh-params.pem providing diffie-hellman parameters to use for the |
| 8588 | TLS server. If the file is missing, QEMU will generate a set of |
| 8589 | DH parameters at startup. This is a computationally expensive |
| 8590 | operation that consumes random pool entropy, so it is |
| 8591 | recommended that a persistent set of parameters be generated |
| 8592 | upfront and saved. |
| 8593 | |
| 8594 | For x509 certificate credentials the directory will contain |
| 8595 | further files providing the x509 certificates. The certificates |
| 8596 | must be stored in PEM format, in filenames ca-cert.pem, |
| 8597 | ca-crl.pem (optional), server-cert.pem (only servers), |
| 8598 | server-key.pem (only servers), client-cert.pem (only clients), |
| 8599 | and client-key.pem (only clients). |
| 8600 | |
| 8601 | For the server-key.pem and client-key.pem files which contain |
| 8602 | sensitive private keys, it is possible to use an encrypted |
| 8603 | version by providing the passwordid parameter. This provides the |
| 8604 | ID of a previously created ``secret`` object containing the |
| 8605 | password for decryption. |
| 8606 | |
| 8607 | The priority parameter allows to override the global default |
| 8608 | priority used by gnutls. This can be useful if the system |
| 8609 | administrator needs to use a weaker set of crypto priorities for |
| 8610 | QEMU without potentially forcing the weakness onto all |
| 8611 | applications. Or conversely if one wants wants a stronger |
| 8612 | default for QEMU than for all other applications, they can do |
| 8613 | this through this parameter. Its format is a gnutls priority |
| 8614 | string as described at |
| 8615 | https://gnutls.org/manual/html_node/Priority-Strings.html. |
| 8616 | |
| 8617 | ``-object filter-buffer,id=id,netdev=netdevid,interval=t[,queue=all|rx|tx][,status=on|off][,position=head|tail|id=<id>][,insert=behind|before]`` |
| 8618 | Interval t can't be 0, this filter batches the packet delivery: |
| 8619 | all packets arriving in a given interval on netdev netdevid are |
| 8620 | delayed until the end of the interval. Interval is in |
| 8621 | microseconds. ``status`` is optional that indicate whether the |
| 8622 | netfilter is on (enabled) or off (disabled), the default status |
| 8623 | for netfilter will be 'on'. |
| 8624 | |
| 8625 | queue all\|rx\|tx is an option that can be applied to any |
| 8626 | netfilter. |
| 8627 | |
| 8628 | ``all``: the filter is attached both to the receive and the |
| 8629 | transmit queue of the netdev (default). |
| 8630 | |
| 8631 | ``rx``: the filter is attached to the receive queue of the |
| 8632 | netdev, where it will receive packets sent to the netdev. |
| 8633 | |
| 8634 | ``tx``: the filter is attached to the transmit queue of the |
| 8635 | netdev, where it will receive packets sent by the netdev. |
| 8636 | |
| 8637 | position head\|tail\|id=<id> is an option to specify where the |
| 8638 | filter should be inserted in the filter list. It can be applied |
| 8639 | to any netfilter. |
| 8640 | |
| 8641 | ``head``: the filter is inserted at the head of the filter list, |
| 8642 | before any existing filters. |
| 8643 | |
| 8644 | ``tail``: the filter is inserted at the tail of the filter list, |
| 8645 | behind any existing filters (default). |
| 8646 | |
| 8647 | ``id=<id>``: the filter is inserted before or behind the filter |
| 8648 | specified by <id>, see the insert option below. |
| 8649 | |
| 8650 | insert behind\|before is an option to specify where to insert |
| 8651 | the new filter relative to the one specified with |
| 8652 | position=id=<id>. It can be applied to any netfilter. |
| 8653 | |
| 8654 | ``before``: insert before the specified filter. |
| 8655 | |
| 8656 | ``behind``: insert behind the specified filter (default). |
| 8657 | |
| 8658 | ``-object filter-mirror,id=id,netdev=netdevid,outdev=chardevid,queue=all|rx|tx[,vnet_hdr_support][,position=head|tail|id=<id>][,insert=behind|before]`` |
| 8659 | filter-mirror on netdev netdevid,mirror net packet to |
| 8660 | chardevchardevid, if it has the vnet\_hdr\_support flag, |
| 8661 | filter-mirror will mirror packet with vnet\_hdr\_len. |
| 8662 | |
| 8663 | ``-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]`` |
| 8664 | filter-redirector on netdev netdevid,redirect filter's net |
| 8665 | packet to chardev chardevid,and redirect indev's packet to |
| 8666 | filter.if it has the vnet\_hdr\_support flag, filter-redirector |
| 8667 | will redirect packet with vnet\_hdr\_len. Create a |
| 8668 | filter-redirector we need to differ outdev id from indev id, id |
| 8669 | can not be the same. we can just use indev or outdev, but at |
| 8670 | least one of indev or outdev need to be specified. |
| 8671 | |
| 8672 | ``-object filter-rewriter,id=id,netdev=netdevid,queue=all|rx|tx,[vnet_hdr_support][,position=head|tail|id=<id>][,insert=behind|before]`` |
| 8673 | Filter-rewriter is a part of COLO project.It will rewrite tcp |
| 8674 | packet to secondary from primary to keep secondary tcp |
| 8675 | connection,and rewrite tcp packet to primary from secondary make |
| 8676 | tcp packet can be handled by client.if it has the |
| 8677 | vnet\_hdr\_support flag, we can parse packet with vnet header. |
| 8678 | |
| 8679 | usage: colo secondary: -object |
| 8680 | filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0 -object |
| 8681 | filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1 -object |
| 8682 | filter-rewriter,id=rew0,netdev=hn0,queue=all |
| 8683 | |
| 8684 | ``-object filter-dump,id=id,netdev=dev[,file=filename][,maxlen=len][,position=head|tail|id=<id>][,insert=behind|before]`` |
| 8685 | Dump the network traffic on netdev dev to the file specified by |
| 8686 | filename. At most len bytes (64k by default) per packet are |
| 8687 | stored. The file format is libpcap, so it can be analyzed with |
| 8688 | tools such as tcpdump or Wireshark. |
| 8689 | |
| 8690 | ``-object colo-compare,id=id,primary_in=chardevid,secondary_in=chardevid,outdev=chardevid,iothread=id[,vnet_hdr_support][,notify_dev=id]`` |
| 8691 | Colo-compare gets packet from primary\_inchardevid and |
| 8692 | secondary\_inchardevid, than compare primary packet with |
| 8693 | secondary packet. If the packets are same, we will output |
| 8694 | primary packet to outdevchardevid, else we will notify |
| 8695 | colo-frame do checkpoint and send primary packet to |
| 8696 | outdevchardevid. In order to improve efficiency, we need to put |
| 8697 | the task of comparison in another thread. If it has the |
| 8698 | vnet\_hdr\_support flag, colo compare will send/recv packet with |
| 8699 | vnet\_hdr\_len. If you want to use Xen COLO, will need the |
| 8700 | notify\_dev to notify Xen colo-frame to do checkpoint. |
| 8701 | |
| 8702 | we must use it with the help of filter-mirror and |
| 8703 | filter-redirector. |
| 8704 | |
| 8705 | :: |
| 8706 | |
| 8707 | KVM COLO |
| 8708 | |
| 8709 | primary: |
| 8710 | -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown |
| 8711 | -device e1000,id=e0,netdev=hn0,mac=52:a4:00:12:78:66 |
| 8712 | -chardev socket,id=mirror0,host=3.3.3.3,port=9003,server,nowait |
| 8713 | -chardev socket,id=compare1,host=3.3.3.3,port=9004,server,nowait |
| 8714 | -chardev socket,id=compare0,host=3.3.3.3,port=9001,server,nowait |
| 8715 | -chardev socket,id=compare0-0,host=3.3.3.3,port=9001 |
| 8716 | -chardev socket,id=compare_out,host=3.3.3.3,port=9005,server,nowait |
| 8717 | -chardev socket,id=compare_out0,host=3.3.3.3,port=9005 |
| 8718 | -object iothread,id=iothread1 |
| 8719 | -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0 |
| 8720 | -object filter-redirector,netdev=hn0,id=redire0,queue=rx,indev=compare_out |
| 8721 | -object filter-redirector,netdev=hn0,id=redire1,queue=rx,outdev=compare0 |
| 8722 | -object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0,iothread=iothread1 |
| 8723 | |
| 8724 | secondary: |
| 8725 | -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,down script=/etc/qemu-ifdown |
| 8726 | -device e1000,netdev=hn0,mac=52:a4:00:12:78:66 |
| 8727 | -chardev socket,id=red0,host=3.3.3.3,port=9003 |
| 8728 | -chardev socket,id=red1,host=3.3.3.3,port=9004 |
| 8729 | -object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0 |
| 8730 | -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1 |
| 8731 | |
| 8732 | |
| 8733 | Xen COLO |
| 8734 | |
| 8735 | primary: |
| 8736 | -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown |
| 8737 | -device e1000,id=e0,netdev=hn0,mac=52:a4:00:12:78:66 |
| 8738 | -chardev socket,id=mirror0,host=3.3.3.3,port=9003,server,nowait |
| 8739 | -chardev socket,id=compare1,host=3.3.3.3,port=9004,server,nowait |
| 8740 | -chardev socket,id=compare0,host=3.3.3.3,port=9001,server,nowait |
| 8741 | -chardev socket,id=compare0-0,host=3.3.3.3,port=9001 |
| 8742 | -chardev socket,id=compare_out,host=3.3.3.3,port=9005,server,nowait |
| 8743 | -chardev socket,id=compare_out0,host=3.3.3.3,port=9005 |
| 8744 | -chardev socket,id=notify_way,host=3.3.3.3,port=9009,server,nowait |
| 8745 | -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0 |
| 8746 | -object filter-redirector,netdev=hn0,id=redire0,queue=rx,indev=compare_out |
| 8747 | -object filter-redirector,netdev=hn0,id=redire1,queue=rx,outdev=compare0 |
| 8748 | -object iothread,id=iothread1 |
| 8749 | -object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0,notify_dev=nofity_way,iothread=iothread1 |
| 8750 | |
| 8751 | secondary: |
| 8752 | -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,down script=/etc/qemu-ifdown |
| 8753 | -device e1000,netdev=hn0,mac=52:a4:00:12:78:66 |
| 8754 | -chardev socket,id=red0,host=3.3.3.3,port=9003 |
| 8755 | -chardev socket,id=red1,host=3.3.3.3,port=9004 |
| 8756 | -object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0 |
| 8757 | -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1 |
| 8758 | |
| 8759 | If you want to know the detail of above command line, you can |
| 8760 | read the colo-compare git log. |
| 8761 | |
| 8762 | ``-object cryptodev-backend-builtin,id=id[,queues=queues]`` |
| 8763 | Creates a cryptodev backend which executes crypto opreation from |
| 8764 | the QEMU cipher APIS. The id parameter is a unique ID that will |
| 8765 | be used to reference this cryptodev backend from the |
| 8766 | ``virtio-crypto`` device. The queues parameter is optional, |
| 8767 | which specify the queue number of cryptodev backend, the default |
| 8768 | of queues is 1. |
| 8769 | |
Peter Maydell | 09ce5f2 | 2020-02-28 15:36:13 +0000 | [diff] [blame^] | 8770 | .. parsed-literal:: |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 8771 | |
| 8772 | # |qemu_system| \ |
| 8773 | [...] \ |
| 8774 | -object cryptodev-backend-builtin,id=cryptodev0 \ |
| 8775 | -device virtio-crypto-pci,id=crypto0,cryptodev=cryptodev0 \ |
| 8776 | [...] |
| 8777 | |
| 8778 | ``-object cryptodev-vhost-user,id=id,chardev=chardevid[,queues=queues]`` |
| 8779 | Creates a vhost-user cryptodev backend, backed by a chardev |
| 8780 | chardevid. The id parameter is a unique ID that will be used to |
| 8781 | reference this cryptodev backend from the ``virtio-crypto`` |
| 8782 | device. The chardev should be a unix domain socket backed one. |
| 8783 | The vhost-user uses a specifically defined protocol to pass |
| 8784 | vhost ioctl replacement messages to an application on the other |
| 8785 | end of the socket. The queues parameter is optional, which |
| 8786 | specify the queue number of cryptodev backend for multiqueue |
| 8787 | vhost-user, the default of queues is 1. |
| 8788 | |
Peter Maydell | 09ce5f2 | 2020-02-28 15:36:13 +0000 | [diff] [blame^] | 8789 | .. parsed-literal:: |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 8790 | |
| 8791 | # |qemu_system| \ |
| 8792 | [...] \ |
| 8793 | -chardev socket,id=chardev0,path=/path/to/socket \ |
| 8794 | -object cryptodev-vhost-user,id=cryptodev0,chardev=chardev0 \ |
| 8795 | -device virtio-crypto-pci,id=crypto0,cryptodev=cryptodev0 \ |
| 8796 | [...] |
| 8797 | |
| 8798 | ``-object secret,id=id,data=string,format=raw|base64[,keyid=secretid,iv=string]`` |
Peter Maydell | 09ce5f2 | 2020-02-28 15:36:13 +0000 | [diff] [blame^] | 8799 | \ |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 8800 | ``-object secret,id=id,file=filename,format=raw|base64[,keyid=secretid,iv=string]`` |
| 8801 | Defines a secret to store a password, encryption key, or some |
| 8802 | other sensitive data. The sensitive data can either be passed |
| 8803 | directly via the data parameter, or indirectly via the file |
| 8804 | parameter. Using the data parameter is insecure unless the |
| 8805 | sensitive data is encrypted. |
| 8806 | |
| 8807 | The sensitive data can be provided in raw format (the default), |
| 8808 | or base64. When encoded as JSON, the raw format only supports |
| 8809 | valid UTF-8 characters, so base64 is recommended for sending |
| 8810 | binary data. QEMU will convert from which ever format is |
| 8811 | provided to the format it needs internally. eg, an RBD password |
| 8812 | can be provided in raw format, even though it will be base64 |
| 8813 | encoded when passed onto the RBD sever. |
| 8814 | |
| 8815 | For added protection, it is possible to encrypt the data |
| 8816 | associated with a secret using the AES-256-CBC cipher. Use of |
| 8817 | encryption is indicated by providing the keyid and iv |
| 8818 | parameters. The keyid parameter provides the ID of a previously |
| 8819 | defined secret that contains the AES-256 decryption key. This |
| 8820 | key should be 32-bytes long and be base64 encoded. The iv |
| 8821 | parameter provides the random initialization vector used for |
| 8822 | encryption of this particular secret and should be a base64 |
| 8823 | encrypted string of the 16-byte IV. |
| 8824 | |
| 8825 | The simplest (insecure) usage is to provide the secret inline |
| 8826 | |
Peter Maydell | 09ce5f2 | 2020-02-28 15:36:13 +0000 | [diff] [blame^] | 8827 | .. parsed-literal:: |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 8828 | |
| 8829 | # |qemu_system| -object secret,id=sec0,data=letmein,format=raw |
| 8830 | |
| 8831 | The simplest secure usage is to provide the secret via a file |
| 8832 | |
| 8833 | # printf "letmein" > mypasswd.txt # QEMU\_SYSTEM\_MACRO -object |
| 8834 | secret,id=sec0,file=mypasswd.txt,format=raw |
| 8835 | |
| 8836 | For greater security, AES-256-CBC should be used. To illustrate |
| 8837 | usage, consider the openssl command line tool which can encrypt |
| 8838 | the data. Note that when encrypting, the plaintext must be |
| 8839 | padded to the cipher block size (32 bytes) using the standard |
| 8840 | PKCS#5/6 compatible padding algorithm. |
| 8841 | |
| 8842 | First a master key needs to be created in base64 encoding: |
| 8843 | |
| 8844 | :: |
| 8845 | |
| 8846 | # openssl rand -base64 32 > key.b64 |
| 8847 | # KEY=$(base64 -d key.b64 | hexdump -v -e '/1 "%02X"') |
| 8848 | |
| 8849 | Each secret to be encrypted needs to have a random |
| 8850 | initialization vector generated. These do not need to be kept |
| 8851 | secret |
| 8852 | |
| 8853 | :: |
| 8854 | |
| 8855 | # openssl rand -base64 16 > iv.b64 |
| 8856 | # IV=$(base64 -d iv.b64 | hexdump -v -e '/1 "%02X"') |
| 8857 | |
| 8858 | The secret to be defined can now be encrypted, in this case |
| 8859 | we're telling openssl to base64 encode the result, but it could |
| 8860 | be left as raw bytes if desired. |
| 8861 | |
| 8862 | :: |
| 8863 | |
| 8864 | # SECRET=$(printf "letmein" | |
| 8865 | openssl enc -aes-256-cbc -a -K $KEY -iv $IV) |
| 8866 | |
| 8867 | When launching QEMU, create a master secret pointing to |
| 8868 | ``key.b64`` and specify that to be used to decrypt the user |
| 8869 | password. Pass the contents of ``iv.b64`` to the second secret |
| 8870 | |
Peter Maydell | 09ce5f2 | 2020-02-28 15:36:13 +0000 | [diff] [blame^] | 8871 | .. parsed-literal:: |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 8872 | |
| 8873 | # |qemu_system| \ |
| 8874 | -object secret,id=secmaster0,format=base64,file=key.b64 \ |
| 8875 | -object secret,id=sec0,keyid=secmaster0,format=base64,\ |
| 8876 | data=$SECRET,iv=$(<iv.b64) |
| 8877 | |
| 8878 | ``-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]`` |
| 8879 | Create a Secure Encrypted Virtualization (SEV) guest object, |
| 8880 | which can be used to provide the guest memory encryption support |
| 8881 | on AMD processors. |
| 8882 | |
| 8883 | When memory encryption is enabled, one of the physical address |
| 8884 | bit (aka the C-bit) is utilized to mark if a memory page is |
| 8885 | protected. The ``cbitpos`` is used to provide the C-bit |
| 8886 | position. The C-bit position is Host family dependent hence user |
| 8887 | must provide this value. On EPYC, the value should be 47. |
| 8888 | |
| 8889 | When memory encryption is enabled, we loose certain bits in |
| 8890 | physical address space. The ``reduced-phys-bits`` is used to |
| 8891 | provide the number of bits we loose in physical address space. |
| 8892 | Similar to C-bit, the value is Host family dependent. On EPYC, |
| 8893 | the value should be 5. |
| 8894 | |
| 8895 | The ``sev-device`` provides the device file to use for |
| 8896 | communicating with the SEV firmware running inside AMD Secure |
| 8897 | Processor. The default device is '/dev/sev'. If hardware |
| 8898 | supports memory encryption then /dev/sev devices are created by |
| 8899 | CCP driver. |
| 8900 | |
| 8901 | The ``policy`` provides the guest policy to be enforced by the |
| 8902 | SEV firmware and restrict what configuration and operational |
| 8903 | commands can be performed on this guest by the hypervisor. The |
| 8904 | policy should be provided by the guest owner and is bound to the |
| 8905 | guest and cannot be changed throughout the lifetime of the |
| 8906 | guest. The default is 0. |
| 8907 | |
| 8908 | If guest ``policy`` allows sharing the key with another SEV |
| 8909 | guest then ``handle`` can be use to provide handle of the guest |
| 8910 | from which to share the key. |
| 8911 | |
| 8912 | The ``dh-cert-file`` and ``session-file`` provides the guest |
| 8913 | owner's Public Diffie-Hillman key defined in SEV spec. The PDH |
| 8914 | and session parameters are used for establishing a cryptographic |
| 8915 | session with the guest owner to negotiate keys used for |
| 8916 | attestation. The file must be encoded in base64. |
| 8917 | |
| 8918 | e.g to launch a SEV guest |
| 8919 | |
Peter Maydell | 09ce5f2 | 2020-02-28 15:36:13 +0000 | [diff] [blame^] | 8920 | .. parsed-literal:: |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 8921 | |
| 8922 | # |qemu_system_x86| \ |
| 8923 | ...... |
| 8924 | -object sev-guest,id=sev0,cbitpos=47,reduced-phys-bits=5 \ |
| 8925 | -machine ...,memory-encryption=sev0 |
| 8926 | ..... |
| 8927 | |
| 8928 | ``-object authz-simple,id=id,identity=string`` |
| 8929 | Create an authorization object that will control access to |
| 8930 | network services. |
| 8931 | |
| 8932 | The ``identity`` parameter is identifies the user and its format |
| 8933 | depends on the network service that authorization object is |
| 8934 | associated with. For authorizing based on TLS x509 certificates, |
| 8935 | the identity must be the x509 distinguished name. Note that care |
| 8936 | must be taken to escape any commas in the distinguished name. |
| 8937 | |
| 8938 | An example authorization object to validate a x509 distinguished |
| 8939 | name would look like: |
| 8940 | |
Peter Maydell | 09ce5f2 | 2020-02-28 15:36:13 +0000 | [diff] [blame^] | 8941 | .. parsed-literal:: |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 8942 | |
| 8943 | # |qemu_system| \ |
| 8944 | ... |
| 8945 | -object 'authz-simple,id=auth0,identity=CN=laptop.example.com,,O=Example Org,,L=London,,ST=London,,C=GB' \ |
| 8946 | ... |
| 8947 | |
| 8948 | Note the use of quotes due to the x509 distinguished name |
| 8949 | containing whitespace, and escaping of ','. |
| 8950 | |
| 8951 | ``-object authz-listfile,id=id,filename=path,refresh=yes|no`` |
| 8952 | Create an authorization object that will control access to |
| 8953 | network services. |
| 8954 | |
| 8955 | The ``filename`` parameter is the fully qualified path to a file |
| 8956 | containing the access control list rules in JSON format. |
| 8957 | |
| 8958 | An example set of rules that match against SASL usernames might |
| 8959 | look like: |
| 8960 | |
| 8961 | :: |
| 8962 | |
| 8963 | { |
| 8964 | "rules": [ |
| 8965 | { "match": "fred", "policy": "allow", "format": "exact" }, |
| 8966 | { "match": "bob", "policy": "allow", "format": "exact" }, |
| 8967 | { "match": "danb", "policy": "deny", "format": "glob" }, |
| 8968 | { "match": "dan*", "policy": "allow", "format": "exact" }, |
| 8969 | ], |
| 8970 | "policy": "deny" |
| 8971 | } |
| 8972 | |
| 8973 | When checking access the object will iterate over all the rules |
| 8974 | and the first rule to match will have its ``policy`` value |
| 8975 | returned as the result. If no rules match, then the default |
| 8976 | ``policy`` value is returned. |
| 8977 | |
| 8978 | The rules can either be an exact string match, or they can use |
| 8979 | the simple UNIX glob pattern matching to allow wildcards to be |
| 8980 | used. |
| 8981 | |
| 8982 | If ``refresh`` is set to true the file will be monitored and |
| 8983 | automatically reloaded whenever its content changes. |
| 8984 | |
| 8985 | As with the ``authz-simple`` object, the format of the identity |
| 8986 | strings being matched depends on the network service, but is |
| 8987 | usually a TLS x509 distinguished name, or a SASL username. |
| 8988 | |
| 8989 | An example authorization object to validate a SASL username |
| 8990 | would look like: |
| 8991 | |
Peter Maydell | 09ce5f2 | 2020-02-28 15:36:13 +0000 | [diff] [blame^] | 8992 | .. parsed-literal:: |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 8993 | |
| 8994 | # |qemu_system| \ |
| 8995 | ... |
| 8996 | -object authz-simple,id=auth0,filename=/etc/qemu/vnc-sasl.acl,refresh=yes |
| 8997 | ... |
| 8998 | |
| 8999 | ``-object authz-pam,id=id,service=string`` |
| 9000 | Create an authorization object that will control access to |
| 9001 | network services. |
| 9002 | |
| 9003 | The ``service`` parameter provides the name of a PAM service to |
| 9004 | use for authorization. It requires that a file |
| 9005 | ``/etc/pam.d/service`` exist to provide the configuration for |
| 9006 | the ``account`` subsystem. |
| 9007 | |
| 9008 | An example authorization object to validate a TLS x509 |
| 9009 | distinguished name would look like: |
| 9010 | |
Peter Maydell | 09ce5f2 | 2020-02-28 15:36:13 +0000 | [diff] [blame^] | 9011 | .. parsed-literal:: |
Peter Maydell | e2fcbf4 | 2020-03-06 10:07:14 +0000 | [diff] [blame] | 9012 | |
| 9013 | # |qemu_system| \ |
| 9014 | ... |
| 9015 | -object authz-pam,id=auth0,service=qemu-vnc |
| 9016 | ... |
| 9017 | |
| 9018 | There would then be a corresponding config file for PAM at |
| 9019 | ``/etc/pam.d/qemu-vnc`` that contains: |
| 9020 | |
| 9021 | :: |
| 9022 | |
| 9023 | account requisite pam_listfile.so item=user sense=allow \ |
| 9024 | file=/etc/qemu/vnc.allow |
| 9025 | |
| 9026 | Finally the ``/etc/qemu/vnc.allow`` file would contain the list |
| 9027 | of x509 distingished names that are permitted access |
| 9028 | |
| 9029 | :: |
| 9030 | |
| 9031 | CN=laptop.example.com,O=Example Home,L=London,ST=London,C=GB |
| 9032 | |
| 9033 | ``-object iothread,id=id,poll-max-ns=poll-max-ns,poll-grow=poll-grow,poll-shrink=poll-shrink`` |
| 9034 | Creates a dedicated event loop thread that devices can be |
| 9035 | assigned to. This is known as an IOThread. By default device |
| 9036 | emulation happens in vCPU threads or the main event loop thread. |
| 9037 | This can become a scalability bottleneck. IOThreads allow device |
| 9038 | emulation and I/O to run on other host CPUs. |
| 9039 | |
| 9040 | The ``id`` parameter is a unique ID that will be used to |
| 9041 | reference this IOThread from ``-device ...,iothread=id``. |
| 9042 | Multiple devices can be assigned to an IOThread. Note that not |
| 9043 | all devices support an ``iothread`` parameter. |
| 9044 | |
| 9045 | The ``query-iothreads`` QMP command lists IOThreads and reports |
| 9046 | their thread IDs so that the user can configure host CPU |
| 9047 | pinning/affinity. |
| 9048 | |
| 9049 | IOThreads use an adaptive polling algorithm to reduce event loop |
| 9050 | latency. Instead of entering a blocking system call to monitor |
| 9051 | file descriptors and then pay the cost of being woken up when an |
| 9052 | event occurs, the polling algorithm spins waiting for events for |
| 9053 | a short time. The algorithm's default parameters are suitable |
| 9054 | for many cases but can be adjusted based on knowledge of the |
| 9055 | workload and/or host device latency. |
| 9056 | |
| 9057 | The ``poll-max-ns`` parameter is the maximum number of |
| 9058 | nanoseconds to busy wait for events. Polling can be disabled by |
| 9059 | setting this value to 0. |
| 9060 | |
| 9061 | The ``poll-grow`` parameter is the multiplier used to increase |
| 9062 | the polling time when the algorithm detects it is missing events |
| 9063 | due to not polling long enough. |
| 9064 | |
| 9065 | The ``poll-shrink`` parameter is the divisor used to decrease |
| 9066 | the polling time when the algorithm detects it is spending too |
| 9067 | long polling without encountering events. |
| 9068 | |
| 9069 | The polling parameters can be modified at run-time using the |
| 9070 | ``qom-set`` command (where ``iothread1`` is the IOThread's |
| 9071 | ``id``): |
| 9072 | |
| 9073 | :: |
| 9074 | |
| 9075 | (qemu) qom-set /objects/iothread1 poll-max-ns 100000 |
| 9076 | ERST |
Daniel P. Berrange | b9174d4 | 2015-05-13 17:14:03 +0100 | [diff] [blame] | 9077 | |
| 9078 | |
Stefan Weil | 3dbf2c7 | 2010-01-16 18:19:44 +0100 | [diff] [blame] | 9079 | HXCOMM This is the last statement. Insert new options before this line! |
| 9080 | STEXI |
| 9081 | @end table |
| 9082 | ETEXI |