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