]>
Commit | Line | Data |
---|---|---|
3c0bd37d | 1 | # -*- Mode: Python -*- |
f7160f32 | 2 | # vim: filetype=python |
3c0bd37d MA |
3 | # |
4 | ||
5 | ## | |
6 | # = Net devices | |
7 | ## | |
8 | ||
5166fe0a | 9 | { 'include': 'sockets.json' } |
3c0bd37d MA |
10 | |
11 | ## | |
12 | # @set_link: | |
13 | # | |
14 | # Sets the link status of a virtual network adapter. | |
15 | # | |
16 | # @name: the device name of the virtual network adapter | |
17 | # | |
18 | # @up: true to set the link status to be up | |
19 | # | |
2746f060 | 20 | # Errors: |
ae7ccd50 | 21 | # - If @name is not a valid network device, DeviceNotFound |
3c0bd37d | 22 | # |
9bc6e893 | 23 | # Since: 0.14 |
3c0bd37d | 24 | # |
a937b6aa MA |
25 | # Notes: Not all network adapters support setting link status. This |
26 | # command will succeed even if the network adapter does not | |
27 | # support link status notification. | |
3c0bd37d MA |
28 | # |
29 | # Example: | |
30 | # | |
d23055b8 MA |
31 | # -> { "execute": "set_link", |
32 | # "arguments": { "name": "e1000.0", "up": false } } | |
33 | # <- { "return": {} } | |
3c0bd37d MA |
34 | ## |
35 | { 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} } | |
36 | ||
37 | ## | |
38 | # @netdev_add: | |
39 | # | |
40 | # Add a network backend. | |
41 | # | |
3c0bd37d MA |
42 | # Additional arguments depend on the type. |
43 | # | |
9bc6e893 | 44 | # Since: 0.14 |
3c0bd37d | 45 | # |
2746f060 | 46 | # Errors: |
ae7ccd50 | 47 | # - If @type is not a valid network backend, DeviceNotFound |
3c0bd37d MA |
48 | # |
49 | # Example: | |
50 | # | |
d23055b8 MA |
51 | # -> { "execute": "netdev_add", |
52 | # "arguments": { "type": "user", "id": "netdev1", | |
53 | # "dnssearch": [ { "str": "example.org" } ] } } | |
54 | # <- { "return": {} } | |
3c0bd37d | 55 | ## |
48f596c5 PB |
56 | { 'command': 'netdev_add', 'data': 'Netdev', 'boxed': true, |
57 | 'allow-preconfig': true } | |
3c0bd37d MA |
58 | |
59 | ## | |
60 | # @netdev_del: | |
61 | # | |
62 | # Remove a network backend. | |
63 | # | |
64 | # @id: the name of the network backend to remove | |
65 | # | |
2746f060 | 66 | # Errors: |
ae7ccd50 | 67 | # - If @id is not a valid network backend, DeviceNotFound |
3c0bd37d | 68 | # |
9bc6e893 | 69 | # Since: 0.14 |
3c0bd37d MA |
70 | # |
71 | # Example: | |
72 | # | |
d23055b8 MA |
73 | # -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } } |
74 | # <- { "return": {} } | |
3c0bd37d | 75 | ## |
48f596c5 PB |
76 | { 'command': 'netdev_del', 'data': {'id': 'str'}, |
77 | 'allow-preconfig': true } | |
3c0bd37d | 78 | |
3c0bd37d MA |
79 | ## |
80 | # @NetLegacyNicOptions: | |
81 | # | |
82 | # Create a new Network Interface Card. | |
83 | # | |
84 | # @netdev: id of -netdev to connect to | |
85 | # | |
86 | # @macaddr: MAC address | |
87 | # | |
88 | # @model: device model (e1000, rtl8139, virtio etc.) | |
89 | # | |
90 | # @addr: PCI device address | |
91 | # | |
92 | # @vectors: number of MSI-x vectors, 0 to disable MSI-X | |
93 | # | |
94 | # Since: 1.2 | |
95 | ## | |
96 | { 'struct': 'NetLegacyNicOptions', | |
97 | 'data': { | |
98 | '*netdev': 'str', | |
99 | '*macaddr': 'str', | |
100 | '*model': 'str', | |
101 | '*addr': 'str', | |
102 | '*vectors': 'uint32' } } | |
103 | ||
8bf69544 MA |
104 | ## |
105 | # @String: | |
106 | # | |
107 | # A fat type wrapping 'str', to be embedded in lists. | |
108 | # | |
109 | # Since: 1.2 | |
110 | ## | |
111 | { 'struct': 'String', | |
112 | 'data': { | |
113 | 'str': 'str' } } | |
114 | ||
3c0bd37d MA |
115 | ## |
116 | # @NetdevUserOptions: | |
117 | # | |
a937b6aa MA |
118 | # Use the user mode network stack which requires no administrator |
119 | # privilege to run. | |
3c0bd37d MA |
120 | # |
121 | # @hostname: client hostname reported by the builtin DHCP server | |
122 | # | |
123 | # @restrict: isolate the guest from the host | |
124 | # | |
a937b6aa | 125 | # @ipv4: whether to support IPv4, default true for enabled (since 2.6) |
3c0bd37d | 126 | # |
a937b6aa | 127 | # @ipv6: whether to support IPv6, default true for enabled (since 2.6) |
3c0bd37d MA |
128 | # |
129 | # @ip: legacy parameter, use net= instead | |
130 | # | |
a937b6aa MA |
131 | # @net: IP network address that the guest will see, in the form |
132 | # addr[/netmask] The netmask is optional, and can be either in the | |
133 | # form a.b.c.d or as a number of valid top-most bits. Default is | |
134 | # 10.0.2.0/24. | |
3c0bd37d MA |
135 | # |
136 | # @host: guest-visible address of the host | |
137 | # | |
138 | # @tftp: root directory of the built-in TFTP server | |
139 | # | |
140 | # @bootfile: BOOTP filename, for use with tftp= | |
141 | # | |
142 | # @dhcpstart: the first of the 16 IPs the built-in DHCP server can | |
a937b6aa | 143 | # assign |
3c0bd37d MA |
144 | # |
145 | # @dns: guest-visible address of the virtual nameserver | |
146 | # | |
a937b6aa MA |
147 | # @dnssearch: list of DNS suffixes to search, passed as DHCP option to |
148 | # the guest | |
3c0bd37d | 149 | # |
f18d1375 | 150 | # @domainname: guest-visible domain name of the virtual nameserver |
a937b6aa | 151 | # (since 3.0) |
f18d1375 | 152 | # |
a937b6aa MA |
153 | # @ipv6-prefix: IPv6 network prefix (default is fec0::) (since 2.6). |
154 | # The network prefix is given in the usual hexadecimal IPv6 | |
155 | # address notation. | |
3c0bd37d | 156 | # |
a937b6aa MA |
157 | # @ipv6-prefixlen: IPv6 network prefix length (default is 64) (since |
158 | # 2.6) | |
3c0bd37d MA |
159 | # |
160 | # @ipv6-host: guest-visible IPv6 address of the host (since 2.6) | |
161 | # | |
a937b6aa MA |
162 | # @ipv6-dns: guest-visible IPv6 address of the virtual nameserver |
163 | # (since 2.6) | |
3c0bd37d MA |
164 | # |
165 | # @smb: root directory of the built-in SMB server | |
166 | # | |
167 | # @smbserver: IP address of the built-in SMB server | |
168 | # | |
169 | # @hostfwd: redirect incoming TCP or UDP host connections to guest | |
a937b6aa | 170 | # endpoints |
3c0bd37d MA |
171 | # |
172 | # @guestfwd: forward guest TCP connections | |
173 | # | |
0fca92b9 FZ |
174 | # @tftp-server-name: RFC2132 "TFTP server name" string (Since 3.1) |
175 | # | |
3c0bd37d MA |
176 | # Since: 1.2 |
177 | ## | |
178 | { 'struct': 'NetdevUserOptions', | |
179 | 'data': { | |
180 | '*hostname': 'str', | |
181 | '*restrict': 'bool', | |
182 | '*ipv4': 'bool', | |
183 | '*ipv6': 'bool', | |
184 | '*ip': 'str', | |
185 | '*net': 'str', | |
186 | '*host': 'str', | |
187 | '*tftp': 'str', | |
188 | '*bootfile': 'str', | |
189 | '*dhcpstart': 'str', | |
190 | '*dns': 'str', | |
191 | '*dnssearch': ['String'], | |
f18d1375 | 192 | '*domainname': 'str', |
3c0bd37d MA |
193 | '*ipv6-prefix': 'str', |
194 | '*ipv6-prefixlen': 'int', | |
195 | '*ipv6-host': 'str', | |
196 | '*ipv6-dns': 'str', | |
197 | '*smb': 'str', | |
198 | '*smbserver': 'str', | |
199 | '*hostfwd': ['String'], | |
0fca92b9 FZ |
200 | '*guestfwd': ['String'], |
201 | '*tftp-server-name': 'str' } } | |
3c0bd37d MA |
202 | |
203 | ## | |
204 | # @NetdevTapOptions: | |
205 | # | |
af1a5c3e | 206 | # Used to configure a host TAP network interface backend. |
3c0bd37d MA |
207 | # |
208 | # @ifname: interface name | |
209 | # | |
210 | # @fd: file descriptor of an already opened tap | |
211 | # | |
212 | # @fds: multiple file descriptors of already opened multiqueue capable | |
a937b6aa | 213 | # tap |
3c0bd37d MA |
214 | # |
215 | # @script: script to initialize the interface | |
216 | # | |
217 | # @downscript: script to shut down the interface | |
218 | # | |
219 | # @br: bridge name (since 2.8) | |
220 | # | |
221 | # @helper: command to execute to configure bridge | |
222 | # | |
a937b6aa | 223 | # @sndbuf: send buffer limit. Understands [TGMKkb] suffixes. |
3c0bd37d MA |
224 | # |
225 | # @vnet_hdr: enable the IFF_VNET_HDR flag on the tap interface | |
226 | # | |
227 | # @vhost: enable vhost-net network accelerator | |
228 | # | |
229 | # @vhostfd: file descriptor of an already opened vhost net device | |
230 | # | |
231 | # @vhostfds: file descriptors of multiple already opened vhost net | |
a937b6aa | 232 | # devices |
3c0bd37d MA |
233 | # |
234 | # @vhostforce: vhost on for non-MSIX virtio guests | |
235 | # | |
236 | # @queues: number of queues to be created for multiqueue capable tap | |
237 | # | |
a937b6aa MA |
238 | # @poll-us: maximum number of microseconds that could be spent on busy |
239 | # polling for tap (since 2.7) | |
3c0bd37d MA |
240 | # |
241 | # Since: 1.2 | |
242 | ## | |
243 | { 'struct': 'NetdevTapOptions', | |
244 | 'data': { | |
245 | '*ifname': 'str', | |
246 | '*fd': 'str', | |
247 | '*fds': 'str', | |
248 | '*script': 'str', | |
249 | '*downscript': 'str', | |
250 | '*br': 'str', | |
251 | '*helper': 'str', | |
252 | '*sndbuf': 'size', | |
253 | '*vnet_hdr': 'bool', | |
254 | '*vhost': 'bool', | |
255 | '*vhostfd': 'str', | |
256 | '*vhostfds': 'str', | |
257 | '*vhostforce': 'bool', | |
258 | '*queues': 'uint32', | |
259 | '*poll-us': 'uint32'} } | |
260 | ||
261 | ## | |
262 | # @NetdevSocketOptions: | |
263 | # | |
af1a5c3e TH |
264 | # Socket netdevs are used to establish a network connection to another |
265 | # QEMU virtual machine via a TCP socket. | |
3c0bd37d MA |
266 | # |
267 | # @fd: file descriptor of an already opened socket | |
268 | # | |
269 | # @listen: port number, and optional hostname, to listen on | |
270 | # | |
271 | # @connect: port number, and optional hostname, to connect to | |
272 | # | |
273 | # @mcast: UDP multicast address and port number | |
274 | # | |
275 | # @localaddr: source address and port for multicast and udp packets | |
276 | # | |
277 | # @udp: UDP unicast address and port number | |
278 | # | |
279 | # Since: 1.2 | |
280 | ## | |
281 | { 'struct': 'NetdevSocketOptions', | |
282 | 'data': { | |
283 | '*fd': 'str', | |
284 | '*listen': 'str', | |
285 | '*connect': 'str', | |
286 | '*mcast': 'str', | |
287 | '*localaddr': 'str', | |
288 | '*udp': 'str' } } | |
289 | ||
290 | ## | |
291 | # @NetdevL2TPv3Options: | |
292 | # | |
af1a5c3e | 293 | # Configure an Ethernet over L2TPv3 tunnel. |
3c0bd37d MA |
294 | # |
295 | # @src: source address | |
296 | # | |
297 | # @dst: destination address | |
298 | # | |
299 | # @srcport: source port - mandatory for udp, optional for ip | |
300 | # | |
301 | # @dstport: destination port - mandatory for udp, optional for ip | |
302 | # | |
303 | # @ipv6: force the use of ipv6 | |
304 | # | |
305 | # @udp: use the udp version of l2tpv3 encapsulation | |
306 | # | |
118d4ed0 | 307 | # @cookie64: use 64 bit cookies |
3c0bd37d MA |
308 | # |
309 | # @counter: have sequence counter | |
310 | # | |
a937b6aa MA |
311 | # @pincounter: pin sequence counter to zero - workaround for buggy |
312 | # implementations or networks with packet reorder | |
3c0bd37d MA |
313 | # |
314 | # @txcookie: 32 or 64 bit transmit cookie | |
315 | # | |
316 | # @rxcookie: 32 or 64 bit receive cookie | |
317 | # | |
318 | # @txsession: 32 bit transmit session | |
319 | # | |
a937b6aa MA |
320 | # @rxsession: 32 bit receive session - if not specified set to the |
321 | # same value as transmit | |
3c0bd37d | 322 | # |
a937b6aa MA |
323 | # @offset: additional offset - allows the insertion of additional |
324 | # application-specific data before the packet payload | |
3c0bd37d MA |
325 | # |
326 | # Since: 2.1 | |
327 | ## | |
328 | { 'struct': 'NetdevL2TPv3Options', | |
329 | 'data': { | |
330 | 'src': 'str', | |
331 | 'dst': 'str', | |
332 | '*srcport': 'str', | |
333 | '*dstport': 'str', | |
334 | '*ipv6': 'bool', | |
335 | '*udp': 'bool', | |
336 | '*cookie64': 'bool', | |
337 | '*counter': 'bool', | |
338 | '*pincounter': 'bool', | |
339 | '*txcookie': 'uint64', | |
340 | '*rxcookie': 'uint64', | |
341 | 'txsession': 'uint32', | |
342 | '*rxsession': 'uint32', | |
343 | '*offset': 'uint32' } } | |
344 | ||
345 | ## | |
346 | # @NetdevVdeOptions: | |
347 | # | |
af1a5c3e | 348 | # Connect to a vde switch running on the host. |
3c0bd37d MA |
349 | # |
350 | # @sock: socket path | |
351 | # | |
352 | # @port: port number | |
353 | # | |
354 | # @group: group owner of socket | |
355 | # | |
356 | # @mode: permissions for socket | |
357 | # | |
358 | # Since: 1.2 | |
359 | ## | |
360 | { 'struct': 'NetdevVdeOptions', | |
361 | 'data': { | |
362 | '*sock': 'str', | |
363 | '*port': 'uint16', | |
364 | '*group': 'str', | |
365 | '*mode': 'uint16' } } | |
366 | ||
3c0bd37d MA |
367 | ## |
368 | # @NetdevBridgeOptions: | |
369 | # | |
370 | # Connect a host TAP network interface to a host bridge device. | |
371 | # | |
372 | # @br: bridge name | |
373 | # | |
374 | # @helper: command to execute to configure bridge | |
375 | # | |
376 | # Since: 1.2 | |
377 | ## | |
378 | { 'struct': 'NetdevBridgeOptions', | |
379 | 'data': { | |
380 | '*br': 'str', | |
381 | '*helper': 'str' } } | |
382 | ||
383 | ## | |
384 | # @NetdevHubPortOptions: | |
385 | # | |
386 | # Connect two or more net clients through a software hub. | |
387 | # | |
388 | # @hubid: hub identifier number | |
a937b6aa MA |
389 | # |
390 | # @netdev: used to connect hub to a netdev instead of a device (since | |
391 | # 2.12) | |
3c0bd37d MA |
392 | # |
393 | # Since: 1.2 | |
394 | ## | |
395 | { 'struct': 'NetdevHubPortOptions', | |
396 | 'data': { | |
18d65d22 TH |
397 | 'hubid': 'int32', |
398 | '*netdev': 'str' } } | |
3c0bd37d MA |
399 | |
400 | ## | |
401 | # @NetdevNetmapOptions: | |
402 | # | |
403 | # Connect a client to a netmap-enabled NIC or to a VALE switch port | |
404 | # | |
a937b6aa MA |
405 | # @ifname: Either the name of an existing network interface supported |
406 | # by netmap, or the name of a VALE port (created on the fly). A | |
407 | # VALE port name is in the form 'valeXXX:YYY', where XXX and YYY | |
408 | # are non-negative integers. XXX identifies a switch and YYY | |
409 | # identifies a port of the switch. VALE ports having the same XXX | |
410 | # are therefore connected to the same switch. | |
3c0bd37d MA |
411 | # |
412 | # @devname: path of the netmap device (default: '/dev/netmap'). | |
413 | # | |
414 | # Since: 2.0 | |
415 | ## | |
416 | { 'struct': 'NetdevNetmapOptions', | |
417 | 'data': { | |
418 | 'ifname': 'str', | |
419 | '*devname': 'str' } } | |
420 | ||
cb039ef3 IM |
421 | ## |
422 | # @AFXDPMode: | |
423 | # | |
424 | # Attach mode for a default XDP program | |
425 | # | |
426 | # @skb: generic mode, no driver support necessary | |
427 | # | |
209e64d9 MA |
428 | # @native: DRV mode, program is attached to a driver, packets are |
429 | # passed to the socket without allocation of skb. | |
cb039ef3 IM |
430 | # |
431 | # Since: 8.2 | |
432 | ## | |
433 | { 'enum': 'AFXDPMode', | |
434 | 'data': [ 'native', 'skb' ], | |
435 | 'if': 'CONFIG_AF_XDP' } | |
436 | ||
437 | ## | |
438 | # @NetdevAFXDPOptions: | |
439 | # | |
440 | # AF_XDP network backend | |
441 | # | |
442 | # @ifname: The name of an existing network interface. | |
443 | # | |
209e64d9 MA |
444 | # @mode: Attach mode for a default XDP program. If not specified, |
445 | # then 'native' will be tried first, then 'skb'. | |
cb039ef3 IM |
446 | # |
447 | # @force-copy: Force XDP copy mode even if device supports zero-copy. | |
448 | # (default: false) | |
449 | # | |
209e64d9 MA |
450 | # @queues: number of queues to be used for multiqueue interfaces |
451 | # (default: 1). | |
cb039ef3 | 452 | # |
209e64d9 MA |
453 | # @start-queue: Use @queues starting from this queue number |
454 | # (default: 0). | |
cb039ef3 | 455 | # |
209e64d9 MA |
456 | # @inhibit: Don't load a default XDP program, use one already loaded |
457 | # to the interface (default: false). Requires @sock-fds. | |
cb039ef3 | 458 | # |
209e64d9 MA |
459 | # @sock-fds: A colon (:) separated list of file descriptors for |
460 | # already open but not bound AF_XDP sockets in the queue order. | |
461 | # One fd per queue. These descriptors should already be added | |
462 | # into XDP socket map for corresponding queues. Requires | |
463 | # @inhibit. | |
cb039ef3 IM |
464 | # |
465 | # Since: 8.2 | |
466 | ## | |
467 | { 'struct': 'NetdevAFXDPOptions', | |
468 | 'data': { | |
469 | 'ifname': 'str', | |
470 | '*mode': 'AFXDPMode', | |
471 | '*force-copy': 'bool', | |
472 | '*queues': 'int', | |
473 | '*start-queue': 'int', | |
474 | '*inhibit': 'bool', | |
475 | '*sock-fds': 'str' }, | |
476 | 'if': 'CONFIG_AF_XDP' } | |
477 | ||
3c0bd37d MA |
478 | ## |
479 | # @NetdevVhostUserOptions: | |
480 | # | |
481 | # Vhost-user network backend | |
482 | # | |
483 | # @chardev: name of a unix socket chardev | |
484 | # | |
485 | # @vhostforce: vhost on for non-MSIX virtio guests (default: false). | |
486 | # | |
487 | # @queues: number of queues to be created for multiqueue vhost-user | |
a937b6aa | 488 | # (default: 1) (Since 2.5) |
3c0bd37d MA |
489 | # |
490 | # Since: 2.1 | |
491 | ## | |
492 | { 'struct': 'NetdevVhostUserOptions', | |
493 | 'data': { | |
494 | 'chardev': 'str', | |
495 | '*vhostforce': 'bool', | |
496 | '*queues': 'int' } } | |
497 | ||
1e0a84ea CL |
498 | ## |
499 | # @NetdevVhostVDPAOptions: | |
500 | # | |
501 | # Vhost-vdpa network backend | |
502 | # | |
a937b6aa MA |
503 | # vDPA device is a device that uses a datapath which complies with the |
504 | # virtio specifications with a vendor specific control path. | |
1e0a84ea | 505 | # |
a937b6aa | 506 | # @vhostdev: path of vhost-vdpa device (default:'/dev/vhost-vdpa-0') |
1e0a84ea | 507 | # |
8801ccd0 SWL |
508 | # @vhostfd: file descriptor of an already opened vhost vdpa device |
509 | # | |
1e0a84ea | 510 | # @queues: number of queues to be created for multiqueue vhost-vdpa |
a937b6aa | 511 | # (default: 1) |
1e0a84ea | 512 | # |
a937b6aa MA |
513 | # @x-svq: Start device with (experimental) shadow virtqueue. (Since |
514 | # 7.1) (default: false) | |
1576dbb5 EP |
515 | # |
516 | # Features: | |
a937b6aa | 517 | # |
1576dbb5 EP |
518 | # @unstable: Member @x-svq is experimental. |
519 | # | |
1e0a84ea CL |
520 | # Since: 5.1 |
521 | ## | |
522 | { 'struct': 'NetdevVhostVDPAOptions', | |
523 | 'data': { | |
524 | '*vhostdev': 'str', | |
8801ccd0 | 525 | '*vhostfd': 'str', |
1576dbb5 EP |
526 | '*queues': 'int', |
527 | '*x-svq': {'type': 'bool', 'features' : [ 'unstable'] } } } | |
1e0a84ea | 528 | |
81ad2964 VY |
529 | ## |
530 | # @NetdevVmnetHostOptions: | |
531 | # | |
532 | # vmnet (host mode) network backend. | |
533 | # | |
534 | # Allows the vmnet interface to communicate with other vmnet | |
535 | # interfaces that are in host mode and also with the host. | |
536 | # | |
537 | # @start-address: The starting IPv4 address to use for the interface. | |
a937b6aa MA |
538 | # Must be in the private IP range (RFC 1918). Must be specified |
539 | # along with @end-address and @subnet-mask. This address is used | |
540 | # as the gateway address. The subsequent address up to and | |
541 | # including end-address are placed in the DHCP pool. | |
81ad2964 VY |
542 | # |
543 | # @end-address: The DHCP IPv4 range end address to use for the | |
a937b6aa MA |
544 | # interface. Must be in the private IP range (RFC 1918). Must be |
545 | # specified along with @start-address and @subnet-mask. | |
81ad2964 | 546 | # |
a937b6aa MA |
547 | # @subnet-mask: The IPv4 subnet mask to use on the interface. Must be |
548 | # specified along with @start-address and @subnet-mask. | |
81ad2964 | 549 | # |
a937b6aa MA |
550 | # @isolated: Enable isolation for this interface. Interface isolation |
551 | # ensures that vmnet interface is not able to communicate with any | |
552 | # other vmnet interfaces. Only communication with host is | |
553 | # allowed. Requires at least macOS Big Sur 11.0. | |
81ad2964 VY |
554 | # |
555 | # @net-uuid: The identifier (UUID) to uniquely identify the isolated | |
a937b6aa MA |
556 | # network vmnet interface should be added to. If set, no DHCP |
557 | # service is provided for this interface and network communication | |
558 | # is allowed only with other interfaces added to this network | |
559 | # identified by the UUID. Requires at least macOS Big Sur 11.0. | |
81ad2964 VY |
560 | # |
561 | # Since: 7.1 | |
562 | ## | |
563 | { 'struct': 'NetdevVmnetHostOptions', | |
564 | 'data': { | |
565 | '*start-address': 'str', | |
566 | '*end-address': 'str', | |
567 | '*subnet-mask': 'str', | |
568 | '*isolated': 'bool', | |
569 | '*net-uuid': 'str' }, | |
570 | 'if': 'CONFIG_VMNET' } | |
571 | ||
572 | ## | |
573 | # @NetdevVmnetSharedOptions: | |
574 | # | |
575 | # vmnet (shared mode) network backend. | |
576 | # | |
577 | # Allows traffic originating from the vmnet interface to reach the | |
a937b6aa MA |
578 | # Internet through a network address translator (NAT). The vmnet |
579 | # interface can communicate with the host and with other shared mode | |
580 | # interfaces on the same subnet. If no DHCP settings, subnet mask and | |
581 | # IPv6 prefix specified, the interface can communicate with any of | |
582 | # other interfaces in shared mode. | |
81ad2964 VY |
583 | # |
584 | # @start-address: The starting IPv4 address to use for the interface. | |
a937b6aa MA |
585 | # Must be in the private IP range (RFC 1918). Must be specified |
586 | # along with @end-address and @subnet-mask. This address is used | |
587 | # as the gateway address. The subsequent address up to and | |
588 | # including end-address are placed in the DHCP pool. | |
81ad2964 VY |
589 | # |
590 | # @end-address: The DHCP IPv4 range end address to use for the | |
a937b6aa MA |
591 | # interface. Must be in the private IP range (RFC 1918). Must be |
592 | # specified along with @start-address and @subnet-mask. | |
81ad2964 | 593 | # |
a937b6aa MA |
594 | # @subnet-mask: The IPv4 subnet mask to use on the interface. Must be |
595 | # specified along with @start-address and @subnet-mask. | |
81ad2964 | 596 | # |
a937b6aa MA |
597 | # @isolated: Enable isolation for this interface. Interface isolation |
598 | # ensures that vmnet interface is not able to communicate with any | |
599 | # other vmnet interfaces. Only communication with host is | |
600 | # allowed. Requires at least macOS Big Sur 11.0. | |
81ad2964 | 601 | # |
a937b6aa MA |
602 | # @nat66-prefix: The IPv6 prefix to use into guest network. Must be a |
603 | # unique local address i.e. start with fd00::/8 and have length of | |
604 | # 64. | |
81ad2964 VY |
605 | # |
606 | # Since: 7.1 | |
607 | ## | |
608 | { 'struct': 'NetdevVmnetSharedOptions', | |
609 | 'data': { | |
610 | '*start-address': 'str', | |
611 | '*end-address': 'str', | |
612 | '*subnet-mask': 'str', | |
613 | '*isolated': 'bool', | |
614 | '*nat66-prefix': 'str' }, | |
615 | 'if': 'CONFIG_VMNET' } | |
616 | ||
617 | ## | |
618 | # @NetdevVmnetBridgedOptions: | |
619 | # | |
620 | # vmnet (bridged mode) network backend. | |
621 | # | |
622 | # Bridges the vmnet interface with a physical network interface. | |
623 | # | |
624 | # @ifname: The name of the physical interface to be bridged. | |
625 | # | |
a937b6aa MA |
626 | # @isolated: Enable isolation for this interface. Interface isolation |
627 | # ensures that vmnet interface is not able to communicate with any | |
628 | # other vmnet interfaces. Only communication with host is | |
629 | # allowed. Requires at least macOS Big Sur 11.0. | |
81ad2964 VY |
630 | # |
631 | # Since: 7.1 | |
632 | ## | |
633 | { 'struct': 'NetdevVmnetBridgedOptions', | |
634 | 'data': { | |
635 | 'ifname': 'str', | |
636 | '*isolated': 'bool' }, | |
637 | 'if': 'CONFIG_VMNET' } | |
638 | ||
5166fe0a LV |
639 | ## |
640 | # @NetdevStreamOptions: | |
641 | # | |
642 | # Configuration info for stream socket netdev | |
643 | # | |
a937b6aa MA |
644 | # @addr: socket address to listen on (server=true) or connect to |
645 | # (server=false) | |
646 | # | |
5166fe0a | 647 | # @server: create server socket (default: false) |
a937b6aa MA |
648 | # |
649 | # @reconnect: For a client socket, if a socket is disconnected, then | |
650 | # attempt a reconnect after the given number of seconds. Setting | |
651 | # this to zero disables this function. (default: 0) (since 8.0) | |
5166fe0a | 652 | # |
13c6be96 | 653 | # Only SocketAddress types 'unix', 'inet' and 'fd' are supported. |
5166fe0a LV |
654 | # |
655 | # Since: 7.2 | |
656 | ## | |
657 | { 'struct': 'NetdevStreamOptions', | |
658 | 'data': { | |
659 | 'addr': 'SocketAddress', | |
148fbf0d LV |
660 | '*server': 'bool', |
661 | '*reconnect': 'uint32' } } | |
5166fe0a LV |
662 | |
663 | ## | |
664 | # @NetdevDgramOptions: | |
665 | # | |
666 | # Configuration info for datagram socket netdev. | |
667 | # | |
668 | # @remote: remote address | |
a937b6aa | 669 | # |
5166fe0a LV |
670 | # @local: local address |
671 | # | |
784e7a25 | 672 | # Only SocketAddress types 'unix', 'inet' and 'fd' are supported. |
5166fe0a | 673 | # |
a937b6aa MA |
674 | # If remote address is present and it's a multicast address, local |
675 | # address is optional. Otherwise local address is required and remote | |
676 | # address is optional. | |
5166fe0a LV |
677 | # |
678 | # .. table:: Valid parameters combination table | |
679 | # :widths: auto | |
680 | # | |
681 | # ============= ======== ===== | |
682 | # remote local okay? | |
683 | # ============= ======== ===== | |
684 | # absent absent no | |
685 | # absent not fd no | |
686 | # absent fd yes | |
687 | # multicast absent yes | |
688 | # multicast present yes | |
689 | # not multicast absent no | |
690 | # not multicast present yes | |
691 | # ============= ======== ===== | |
692 | # | |
693 | # Since: 7.2 | |
694 | ## | |
695 | { 'struct': 'NetdevDgramOptions', | |
696 | 'data': { | |
697 | '*local': 'SocketAddress', | |
698 | '*remote': 'SocketAddress' } } | |
699 | ||
3c0bd37d MA |
700 | ## |
701 | # @NetClientDriver: | |
702 | # | |
703 | # Available netdev drivers. | |
704 | # | |
86bf13ae MA |
705 | # @l2tpv3: since 2.1 |
706 | # @vhost-vdpa: since 5.1 | |
707 | # @vmnet-host: since 7.1 | |
708 | # @vmnet-shared: since 7.1 | |
709 | # @vmnet-bridged: since 7.1 | |
710 | # @stream: since 7.2 | |
711 | # @dgram: since 7.2 | |
cb039ef3 | 712 | # @af-xdp: since 8.2 |
1e0a84ea | 713 | # |
86bf13ae | 714 | # Since: 2.7 |
3c0bd37d MA |
715 | ## |
716 | { 'enum': 'NetClientDriver', | |
5166fe0a LV |
717 | 'data': [ 'none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'stream', |
718 | 'dgram', 'vde', 'bridge', 'hubport', 'netmap', 'vhost-user', | |
719 | 'vhost-vdpa', | |
cb039ef3 | 720 | { 'name': 'af-xdp', 'if': 'CONFIG_AF_XDP' }, |
81ad2964 VY |
721 | { 'name': 'vmnet-host', 'if': 'CONFIG_VMNET' }, |
722 | { 'name': 'vmnet-shared', 'if': 'CONFIG_VMNET' }, | |
723 | { 'name': 'vmnet-bridged', 'if': 'CONFIG_VMNET' }] } | |
3c0bd37d MA |
724 | |
725 | ## | |
726 | # @Netdev: | |
727 | # | |
728 | # Captures the configuration of a network device. | |
729 | # | |
730 | # @id: identifier for monitor commands. | |
731 | # | |
732 | # @type: Specify the driver used for interpreting remaining arguments. | |
733 | # | |
734 | # Since: 1.2 | |
3c0bd37d MA |
735 | ## |
736 | { 'union': 'Netdev', | |
737 | 'base': { 'id': 'str', 'type': 'NetClientDriver' }, | |
738 | 'discriminator': 'type', | |
739 | 'data': { | |
3c0bd37d MA |
740 | 'nic': 'NetLegacyNicOptions', |
741 | 'user': 'NetdevUserOptions', | |
742 | 'tap': 'NetdevTapOptions', | |
743 | 'l2tpv3': 'NetdevL2TPv3Options', | |
744 | 'socket': 'NetdevSocketOptions', | |
5166fe0a LV |
745 | 'stream': 'NetdevStreamOptions', |
746 | 'dgram': 'NetdevDgramOptions', | |
3c0bd37d | 747 | 'vde': 'NetdevVdeOptions', |
3c0bd37d MA |
748 | 'bridge': 'NetdevBridgeOptions', |
749 | 'hubport': 'NetdevHubPortOptions', | |
750 | 'netmap': 'NetdevNetmapOptions', | |
cb039ef3 IM |
751 | 'af-xdp': { 'type': 'NetdevAFXDPOptions', |
752 | 'if': 'CONFIG_AF_XDP' }, | |
1e0a84ea | 753 | 'vhost-user': 'NetdevVhostUserOptions', |
81ad2964 VY |
754 | 'vhost-vdpa': 'NetdevVhostVDPAOptions', |
755 | 'vmnet-host': { 'type': 'NetdevVmnetHostOptions', | |
756 | 'if': 'CONFIG_VMNET' }, | |
757 | 'vmnet-shared': { 'type': 'NetdevVmnetSharedOptions', | |
758 | 'if': 'CONFIG_VMNET' }, | |
759 | 'vmnet-bridged': { 'type': 'NetdevVmnetBridgedOptions', | |
760 | 'if': 'CONFIG_VMNET' } } } | |
3c0bd37d | 761 | |
3c0bd37d MA |
762 | ## |
763 | # @RxState: | |
764 | # | |
765 | # Packets receiving state | |
766 | # | |
767 | # @normal: filter assigned packets according to the mac-table | |
768 | # | |
769 | # @none: don't receive any assigned packet | |
770 | # | |
771 | # @all: receive all assigned packets | |
772 | # | |
773 | # Since: 1.6 | |
774 | ## | |
775 | { 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] } | |
776 | ||
777 | ## | |
778 | # @RxFilterInfo: | |
779 | # | |
780 | # Rx-filter information for a NIC. | |
781 | # | |
782 | # @name: net client name | |
783 | # | |
784 | # @promiscuous: whether promiscuous mode is enabled | |
785 | # | |
786 | # @multicast: multicast receive state | |
787 | # | |
788 | # @unicast: unicast receive state | |
789 | # | |
790 | # @vlan: vlan receive state (Since 2.0) | |
791 | # | |
792 | # @broadcast-allowed: whether to receive broadcast | |
793 | # | |
794 | # @multicast-overflow: multicast table is overflowed or not | |
795 | # | |
796 | # @unicast-overflow: unicast table is overflowed or not | |
797 | # | |
798 | # @main-mac: the main macaddr string | |
799 | # | |
800 | # @vlan-table: a list of active vlan id | |
801 | # | |
802 | # @unicast-table: a list of unicast macaddr string | |
803 | # | |
804 | # @multicast-table: a list of multicast macaddr string | |
805 | # | |
806 | # Since: 1.6 | |
807 | ## | |
808 | { 'struct': 'RxFilterInfo', | |
809 | 'data': { | |
810 | 'name': 'str', | |
811 | 'promiscuous': 'bool', | |
812 | 'multicast': 'RxState', | |
813 | 'unicast': 'RxState', | |
814 | 'vlan': 'RxState', | |
815 | 'broadcast-allowed': 'bool', | |
816 | 'multicast-overflow': 'bool', | |
817 | 'unicast-overflow': 'bool', | |
818 | 'main-mac': 'str', | |
819 | 'vlan-table': ['int'], | |
820 | 'unicast-table': ['str'], | |
821 | 'multicast-table': ['str'] }} | |
822 | ||
823 | ## | |
824 | # @query-rx-filter: | |
825 | # | |
826 | # Return rx-filter information for all NICs (or for the given NIC). | |
827 | # | |
828 | # @name: net client name | |
829 | # | |
830 | # Returns: list of @RxFilterInfo for all NICs (or for the given NIC). | |
2746f060 MA |
831 | # |
832 | # Errors: | |
833 | # - if the given @name doesn't exist | |
834 | # - if the given NIC doesn't support rx-filter querying | |
835 | # - if the given net client isn't a NIC | |
3c0bd37d MA |
836 | # |
837 | # Since: 1.6 | |
838 | # | |
839 | # Example: | |
840 | # | |
d23055b8 MA |
841 | # -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } } |
842 | # <- { "return": [ | |
843 | # { | |
844 | # "promiscuous": true, | |
845 | # "name": "vnet0", | |
846 | # "main-mac": "52:54:00:12:34:56", | |
847 | # "unicast": "normal", | |
848 | # "vlan": "normal", | |
849 | # "vlan-table": [ | |
850 | # 4, | |
851 | # 0 | |
852 | # ], | |
853 | # "unicast-table": [ | |
854 | # ], | |
855 | # "multicast": "normal", | |
856 | # "multicast-overflow": false, | |
857 | # "unicast-overflow": false, | |
858 | # "multicast-table": [ | |
859 | # "01:00:5e:00:00:01", | |
860 | # "33:33:00:00:00:01", | |
861 | # "33:33:ff:12:34:56" | |
862 | # ], | |
863 | # "broadcast-allowed": false | |
864 | # } | |
865 | # ] | |
866 | # } | |
3c0bd37d | 867 | ## |
b0ddeba2 MAL |
868 | { 'command': 'query-rx-filter', |
869 | 'data': { '*name': 'str' }, | |
3c0bd37d MA |
870 | 'returns': ['RxFilterInfo'] } |
871 | ||
872 | ## | |
873 | # @NIC_RX_FILTER_CHANGED: | |
874 | # | |
a937b6aa MA |
875 | # Emitted once until the 'query-rx-filter' command is executed, the |
876 | # first event will always be emitted | |
3c0bd37d MA |
877 | # |
878 | # @name: net client name | |
879 | # | |
880 | # @path: device path | |
881 | # | |
882 | # Since: 1.6 | |
883 | # | |
884 | # Example: | |
885 | # | |
d23055b8 MA |
886 | # <- { "event": "NIC_RX_FILTER_CHANGED", |
887 | # "data": { "name": "vnet0", | |
888 | # "path": "/machine/peripheral/vnet0/virtio-backend" }, | |
889 | # "timestamp": { "seconds": 1368697518, "microseconds": 326866 } } | |
3c0bd37d MA |
890 | ## |
891 | { 'event': 'NIC_RX_FILTER_CHANGED', | |
892 | 'data': { '*name': 'str', 'path': 'str' } } | |
50510ea2 DDAG |
893 | |
894 | ## | |
895 | # @AnnounceParameters: | |
896 | # | |
897 | # Parameters for self-announce timers | |
898 | # | |
899 | # @initial: Initial delay (in ms) before sending the first GARP/RARP | |
a937b6aa | 900 | # announcement |
50510ea2 DDAG |
901 | # |
902 | # @max: Maximum delay (in ms) between GARP/RARP announcement packets | |
903 | # | |
904 | # @rounds: Number of self-announcement attempts | |
905 | # | |
906 | # @step: Delay increase (in ms) after each self-announcement attempt | |
907 | # | |
a937b6aa MA |
908 | # @interfaces: An optional list of interface names, which restricts |
909 | # the announcement to the listed interfaces. (Since 4.1) | |
ef2fdbfb | 910 | # |
944458b6 | 911 | # @id: A name to be used to identify an instance of announce-timers |
a937b6aa MA |
912 | # and to allow it to modified later. Not for use as part of the |
913 | # migration parameters. (Since 4.1) | |
944458b6 | 914 | # |
50510ea2 DDAG |
915 | # Since: 4.0 |
916 | ## | |
917 | ||
918 | { 'struct': 'AnnounceParameters', | |
919 | 'data': { 'initial': 'int', | |
920 | 'max': 'int', | |
921 | 'rounds': 'int', | |
ef2fdbfb | 922 | 'step': 'int', |
944458b6 DDAG |
923 | '*interfaces': ['str'], |
924 | '*id' : 'str' } } | |
a06cd488 DDAG |
925 | |
926 | ## | |
927 | # @announce-self: | |
928 | # | |
a937b6aa MA |
929 | # Trigger generation of broadcast RARP frames to update network |
930 | # switches. This can be useful when network bonds fail-over the | |
931 | # active slave. | |
a06cd488 | 932 | # |
a06cd488 DDAG |
933 | # Example: |
934 | # | |
d23055b8 MA |
935 | # -> { "execute": "announce-self", |
936 | # "arguments": { | |
937 | # "initial": 50, "max": 550, "rounds": 10, "step": 50, | |
938 | # "interfaces": ["vn2", "vn3"], "id": "bob" } } | |
939 | # <- { "return": {} } | |
a06cd488 DDAG |
940 | # |
941 | # Since: 4.0 | |
942 | ## | |
943 | { 'command': 'announce-self', 'boxed': true, | |
944 | 'data' : 'AnnounceParameters'} | |
70d04971 JF |
945 | |
946 | ## | |
947 | # @FAILOVER_NEGOTIATED: | |
948 | # | |
a937b6aa MA |
949 | # Emitted when VIRTIO_NET_F_STANDBY was enabled during feature |
950 | # negotiation. Failover primary devices which were hidden (not | |
951 | # hotplugged when requested) before will now be hotplugged by the | |
952 | # virtio-net standby device. | |
70d04971 | 953 | # |
121c25b0 VT |
954 | # @device-id: QEMU device id of the unplugged device |
955 | # | |
70d04971 JF |
956 | # Since: 4.2 |
957 | # | |
958 | # Example: | |
959 | # | |
d23055b8 MA |
960 | # <- { "event": "FAILOVER_NEGOTIATED", |
961 | # "data": { "device-id": "net1" }, | |
962 | # "timestamp": { "seconds": 1368697518, "microseconds": 326866 } } | |
70d04971 JF |
963 | ## |
964 | { 'event': 'FAILOVER_NEGOTIATED', | |
965 | 'data': {'device-id': 'str'} } | |
e506fee8 LV |
966 | |
967 | ## | |
968 | # @NETDEV_STREAM_CONNECTED: | |
969 | # | |
970 | # Emitted when the netdev stream backend is connected | |
971 | # | |
972 | # @netdev-id: QEMU netdev id that is connected | |
a937b6aa | 973 | # |
e506fee8 LV |
974 | # @addr: The destination address |
975 | # | |
976 | # Since: 7.2 | |
977 | # | |
37fa48a4 | 978 | # Examples: |
e506fee8 | 979 | # |
d23055b8 MA |
980 | # <- { "event": "NETDEV_STREAM_CONNECTED", |
981 | # "data": { "netdev-id": "netdev0", | |
982 | # "addr": { "port": "47666", "ipv6": true, | |
983 | # "host": "::1", "type": "inet" } }, | |
984 | # "timestamp": { "seconds": 1666269863, "microseconds": 311222 } } | |
e506fee8 | 985 | # |
d23055b8 MA |
986 | # <- { "event": "NETDEV_STREAM_CONNECTED", |
987 | # "data": { "netdev-id": "netdev0", | |
988 | # "addr": { "path": "/tmp/qemu0", "type": "unix" } }, | |
989 | # "timestamp": { "seconds": 1666269706, "microseconds": 413651 } } | |
e506fee8 LV |
990 | ## |
991 | { 'event': 'NETDEV_STREAM_CONNECTED', | |
992 | 'data': { 'netdev-id': 'str', | |
993 | 'addr': 'SocketAddress' } } | |
994 | ||
995 | ## | |
996 | # @NETDEV_STREAM_DISCONNECTED: | |
997 | # | |
998 | # Emitted when the netdev stream backend is disconnected | |
999 | # | |
1000 | # @netdev-id: QEMU netdev id that is disconnected | |
1001 | # | |
1002 | # Since: 7.2 | |
1003 | # | |
1004 | # Example: | |
1005 | # | |
d23055b8 MA |
1006 | # <- { 'event': 'NETDEV_STREAM_DISCONNECTED', |
1007 | # 'data': {'netdev-id': 'netdev0'}, | |
1008 | # 'timestamp': {'seconds': 1663330937, 'microseconds': 526695} } | |
e506fee8 LV |
1009 | ## |
1010 | { 'event': 'NETDEV_STREAM_DISCONNECTED', | |
1011 | 'data': { 'netdev-id': 'str' } } |