hw/arm: xlnx-zynqmp: Connect a Xilinx CSU DMA module for QSPI
[qemu/ar7.git] / qapi / net.json
blobc31748c87ff302f92b09fb52bb53e5ec19a389a5
1 # -*- Mode: Python -*-
2 # vim: filetype=python
5 ##
6 # = Net devices
7 ##
9 { 'include': 'common.json' }
12 # @set_link:
14 # Sets the link status of a virtual network adapter.
16 # @name: the device name of the virtual network adapter
18 # @up: true to set the link status to be up
20 # Returns: Nothing on success
21 #          If @name is not a valid network device, DeviceNotFound
23 # Since: 0.14
25 # Notes: Not all network adapters support setting link status.  This command
26 #        will succeed even if the network adapter does not support link status
27 #        notification.
29 # Example:
31 # -> { "execute": "set_link",
32 #      "arguments": { "name": "e1000.0", "up": false } }
33 # <- { "return": {} }
36 { 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
39 # @netdev_add:
41 # Add a network backend.
43 # Additional arguments depend on the type.
45 # Since: 0.14
47 # Returns: Nothing on success
48 #          If @type is not a valid network backend, DeviceNotFound
50 # Example:
52 # -> { "execute": "netdev_add",
53 #      "arguments": { "type": "user", "id": "netdev1",
54 #                     "dnssearch": "example.org" } }
55 # <- { "return": {} }
58 { 'command': 'netdev_add', 'data': 'Netdev', 'boxed': true }
61 # @netdev_del:
63 # Remove a network backend.
65 # @id: the name of the network backend to remove
67 # Returns: Nothing on success
68 #          If @id is not a valid network backend, DeviceNotFound
70 # Since: 0.14
72 # Example:
74 # -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
75 # <- { "return": {} }
78 { 'command': 'netdev_del', 'data': {'id': 'str'} }
81 # @NetLegacyNicOptions:
83 # Create a new Network Interface Card.
85 # @netdev: id of -netdev to connect to
87 # @macaddr: MAC address
89 # @model: device model (e1000, rtl8139, virtio etc.)
91 # @addr: PCI device address
93 # @vectors: number of MSI-x vectors, 0 to disable MSI-X
95 # Since: 1.2
97 { 'struct': 'NetLegacyNicOptions',
98   'data': {
99     '*netdev':  'str',
100     '*macaddr': 'str',
101     '*model':   'str',
102     '*addr':    'str',
103     '*vectors': 'uint32' } }
106 # @NetdevUserOptions:
108 # Use the user mode network stack which requires no administrator privilege to
109 # run.
111 # @hostname: client hostname reported by the builtin DHCP server
113 # @restrict: isolate the guest from the host
115 # @ipv4: whether to support IPv4, default true for enabled
116 #        (since 2.6)
118 # @ipv6: whether to support IPv6, default true for enabled
119 #        (since 2.6)
121 # @ip: legacy parameter, use net= instead
123 # @net: IP network address that the guest will see, in the
124 #       form addr[/netmask] The netmask is optional, and can be
125 #       either in the form a.b.c.d or as a number of valid top-most
126 #       bits. Default is 10.0.2.0/24.
128 # @host: guest-visible address of the host
130 # @tftp: root directory of the built-in TFTP server
132 # @bootfile: BOOTP filename, for use with tftp=
134 # @dhcpstart: the first of the 16 IPs the built-in DHCP server can
135 #             assign
137 # @dns: guest-visible address of the virtual nameserver
139 # @dnssearch: list of DNS suffixes to search, passed as DHCP option
140 #             to the guest
142 # @domainname: guest-visible domain name of the virtual nameserver
143 #              (since 3.0)
145 # @ipv6-prefix: IPv6 network prefix (default is fec0::) (since
146 #               2.6). The network prefix is given in the usual
147 #               hexadecimal IPv6 address notation.
149 # @ipv6-prefixlen: IPv6 network prefix length (default is 64)
150 #                  (since 2.6)
152 # @ipv6-host: guest-visible IPv6 address of the host (since 2.6)
154 # @ipv6-dns: guest-visible IPv6 address of the virtual
155 #            nameserver (since 2.6)
157 # @smb: root directory of the built-in SMB server
159 # @smbserver: IP address of the built-in SMB server
161 # @hostfwd: redirect incoming TCP or UDP host connections to guest
162 #           endpoints
164 # @guestfwd: forward guest TCP connections
166 # @tftp-server-name: RFC2132 "TFTP server name" string (Since 3.1)
168 # Since: 1.2
170 { 'struct': 'NetdevUserOptions',
171   'data': {
172     '*hostname':  'str',
173     '*restrict':  'bool',
174     '*ipv4':      'bool',
175     '*ipv6':      'bool',
176     '*ip':        'str',
177     '*net':       'str',
178     '*host':      'str',
179     '*tftp':      'str',
180     '*bootfile':  'str',
181     '*dhcpstart': 'str',
182     '*dns':       'str',
183     '*dnssearch': ['String'],
184     '*domainname': 'str',
185     '*ipv6-prefix':      'str',
186     '*ipv6-prefixlen':   'int',
187     '*ipv6-host':        'str',
188     '*ipv6-dns':         'str',
189     '*smb':       'str',
190     '*smbserver': 'str',
191     '*hostfwd':   ['String'],
192     '*guestfwd':  ['String'],
193     '*tftp-server-name': 'str' } }
196 # @NetdevTapOptions:
198 # Used to configure a host TAP network interface backend.
200 # @ifname: interface name
202 # @fd: file descriptor of an already opened tap
204 # @fds: multiple file descriptors of already opened multiqueue capable
205 #       tap
207 # @script: script to initialize the interface
209 # @downscript: script to shut down the interface
211 # @br: bridge name (since 2.8)
213 # @helper: command to execute to configure bridge
215 # @sndbuf: send buffer limit. Understands [TGMKkb] suffixes.
217 # @vnet_hdr: enable the IFF_VNET_HDR flag on the tap interface
219 # @vhost: enable vhost-net network accelerator
221 # @vhostfd: file descriptor of an already opened vhost net device
223 # @vhostfds: file descriptors of multiple already opened vhost net
224 #            devices
226 # @vhostforce: vhost on for non-MSIX virtio guests
228 # @queues: number of queues to be created for multiqueue capable tap
230 # @poll-us: maximum number of microseconds that could
231 #           be spent on busy polling for tap (since 2.7)
233 # Since: 1.2
235 { 'struct': 'NetdevTapOptions',
236   'data': {
237     '*ifname':     'str',
238     '*fd':         'str',
239     '*fds':        'str',
240     '*script':     'str',
241     '*downscript': 'str',
242     '*br':         'str',
243     '*helper':     'str',
244     '*sndbuf':     'size',
245     '*vnet_hdr':   'bool',
246     '*vhost':      'bool',
247     '*vhostfd':    'str',
248     '*vhostfds':   'str',
249     '*vhostforce': 'bool',
250     '*queues':     'uint32',
251     '*poll-us':    'uint32'} }
254 # @NetdevSocketOptions:
256 # Socket netdevs are used to establish a network connection to another
257 # QEMU virtual machine via a TCP socket.
259 # @fd: file descriptor of an already opened socket
261 # @listen: port number, and optional hostname, to listen on
263 # @connect: port number, and optional hostname, to connect to
265 # @mcast: UDP multicast address and port number
267 # @localaddr: source address and port for multicast and udp packets
269 # @udp: UDP unicast address and port number
271 # Since: 1.2
273 { 'struct': 'NetdevSocketOptions',
274   'data': {
275     '*fd':        'str',
276     '*listen':    'str',
277     '*connect':   'str',
278     '*mcast':     'str',
279     '*localaddr': 'str',
280     '*udp':       'str' } }
283 # @NetdevL2TPv3Options:
285 # Configure an Ethernet over L2TPv3 tunnel.
287 # @src: source address
289 # @dst: destination address
291 # @srcport: source port - mandatory for udp, optional for ip
293 # @dstport: destination port - mandatory for udp, optional for ip
295 # @ipv6: force the use of ipv6
297 # @udp: use the udp version of l2tpv3 encapsulation
299 # @cookie64: use 64 bit coookies
301 # @counter: have sequence counter
303 # @pincounter: pin sequence counter to zero -
304 #              workaround for buggy implementations or
305 #              networks with packet reorder
307 # @txcookie: 32 or 64 bit transmit cookie
309 # @rxcookie: 32 or 64 bit receive cookie
311 # @txsession: 32 bit transmit session
313 # @rxsession: 32 bit receive session - if not specified
314 #             set to the same value as transmit
316 # @offset: additional offset - allows the insertion of
317 #          additional application-specific data before the packet payload
319 # Since: 2.1
321 { 'struct': 'NetdevL2TPv3Options',
322   'data': {
323     'src':          'str',
324     'dst':          'str',
325     '*srcport':     'str',
326     '*dstport':     'str',
327     '*ipv6':        'bool',
328     '*udp':         'bool',
329     '*cookie64':    'bool',
330     '*counter':     'bool',
331     '*pincounter':  'bool',
332     '*txcookie':    'uint64',
333     '*rxcookie':    'uint64',
334     'txsession':    'uint32',
335     '*rxsession':   'uint32',
336     '*offset':      'uint32' } }
339 # @NetdevVdeOptions:
341 # Connect to a vde switch running on the host.
343 # @sock: socket path
345 # @port: port number
347 # @group: group owner of socket
349 # @mode: permissions for socket
351 # Since: 1.2
353 { 'struct': 'NetdevVdeOptions',
354   'data': {
355     '*sock':  'str',
356     '*port':  'uint16',
357     '*group': 'str',
358     '*mode':  'uint16' } }
361 # @NetdevBridgeOptions:
363 # Connect a host TAP network interface to a host bridge device.
365 # @br: bridge name
367 # @helper: command to execute to configure bridge
369 # Since: 1.2
371 { 'struct': 'NetdevBridgeOptions',
372   'data': {
373     '*br':     'str',
374     '*helper': 'str' } }
377 # @NetdevHubPortOptions:
379 # Connect two or more net clients through a software hub.
381 # @hubid: hub identifier number
382 # @netdev: used to connect hub to a netdev instead of a device (since 2.12)
384 # Since: 1.2
386 { 'struct': 'NetdevHubPortOptions',
387   'data': {
388     'hubid':     'int32',
389     '*netdev':    'str' } }
392 # @NetdevNetmapOptions:
394 # Connect a client to a netmap-enabled NIC or to a VALE switch port
396 # @ifname: Either the name of an existing network interface supported by
397 #          netmap, or the name of a VALE port (created on the fly).
398 #          A VALE port name is in the form 'valeXXX:YYY', where XXX and
399 #          YYY are non-negative integers. XXX identifies a switch and
400 #          YYY identifies a port of the switch. VALE ports having the
401 #          same XXX are therefore connected to the same switch.
403 # @devname: path of the netmap device (default: '/dev/netmap').
405 # Since: 2.0
407 { 'struct': 'NetdevNetmapOptions',
408   'data': {
409     'ifname':     'str',
410     '*devname':    'str' } }
413 # @NetdevVhostUserOptions:
415 # Vhost-user network backend
417 # @chardev: name of a unix socket chardev
419 # @vhostforce: vhost on for non-MSIX virtio guests (default: false).
421 # @queues: number of queues to be created for multiqueue vhost-user
422 #          (default: 1) (Since 2.5)
424 # Since: 2.1
426 { 'struct': 'NetdevVhostUserOptions',
427   'data': {
428     'chardev':        'str',
429     '*vhostforce':    'bool',
430     '*queues':        'int' } }
433 # @NetdevVhostVDPAOptions:
435 # Vhost-vdpa network backend
437 # vDPA device is a device that uses a datapath which complies with the virtio
438 # specifications with a vendor specific control path.
440 # @vhostdev: path of vhost-vdpa device
441 #            (default:'/dev/vhost-vdpa-0')
443 # @queues: number of queues to be created for multiqueue vhost-vdpa
444 #          (default: 1)
446 # Since: 5.1
448 { 'struct': 'NetdevVhostVDPAOptions',
449   'data': {
450     '*vhostdev':     'str',
451     '*queues':       'int' } }
454 # @NetClientDriver:
456 # Available netdev drivers.
458 # Since: 2.7
460 #        @vhost-vdpa since 5.1
462 { 'enum': 'NetClientDriver',
463   'data': [ 'none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde',
464             'bridge', 'hubport', 'netmap', 'vhost-user', 'vhost-vdpa' ] }
467 # @Netdev:
469 # Captures the configuration of a network device.
471 # @id: identifier for monitor commands.
473 # @type: Specify the driver used for interpreting remaining arguments.
475 # Since: 1.2
477 #        'l2tpv3' - since 2.1
479 { 'union': 'Netdev',
480   'base': { 'id': 'str', 'type': 'NetClientDriver' },
481   'discriminator': 'type',
482   'data': {
483     'nic':      'NetLegacyNicOptions',
484     'user':     'NetdevUserOptions',
485     'tap':      'NetdevTapOptions',
486     'l2tpv3':   'NetdevL2TPv3Options',
487     'socket':   'NetdevSocketOptions',
488     'vde':      'NetdevVdeOptions',
489     'bridge':   'NetdevBridgeOptions',
490     'hubport':  'NetdevHubPortOptions',
491     'netmap':   'NetdevNetmapOptions',
492     'vhost-user': 'NetdevVhostUserOptions',
493     'vhost-vdpa': 'NetdevVhostVDPAOptions' } }
496 # @NetFilterDirection:
498 # Indicates whether a netfilter is attached to a netdev's transmit queue or
499 # receive queue or both.
501 # @all: the filter is attached both to the receive and the transmit
502 #       queue of the netdev (default).
504 # @rx: the filter is attached to the receive queue of the netdev,
505 #      where it will receive packets sent to the netdev.
507 # @tx: the filter is attached to the transmit queue of the netdev,
508 #      where it will receive packets sent by the netdev.
510 # Since: 2.5
512 { 'enum': 'NetFilterDirection',
513   'data': [ 'all', 'rx', 'tx' ] }
516 # @RxState:
518 # Packets receiving state
520 # @normal: filter assigned packets according to the mac-table
522 # @none: don't receive any assigned packet
524 # @all: receive all assigned packets
526 # Since: 1.6
528 { 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] }
531 # @RxFilterInfo:
533 # Rx-filter information for a NIC.
535 # @name: net client name
537 # @promiscuous: whether promiscuous mode is enabled
539 # @multicast: multicast receive state
541 # @unicast: unicast receive state
543 # @vlan: vlan receive state (Since 2.0)
545 # @broadcast-allowed: whether to receive broadcast
547 # @multicast-overflow: multicast table is overflowed or not
549 # @unicast-overflow: unicast table is overflowed or not
551 # @main-mac: the main macaddr string
553 # @vlan-table: a list of active vlan id
555 # @unicast-table: a list of unicast macaddr string
557 # @multicast-table: a list of multicast macaddr string
559 # Since: 1.6
561 { 'struct': 'RxFilterInfo',
562   'data': {
563     'name':               'str',
564     'promiscuous':        'bool',
565     'multicast':          'RxState',
566     'unicast':            'RxState',
567     'vlan':               'RxState',
568     'broadcast-allowed':  'bool',
569     'multicast-overflow': 'bool',
570     'unicast-overflow':   'bool',
571     'main-mac':           'str',
572     'vlan-table':         ['int'],
573     'unicast-table':      ['str'],
574     'multicast-table':    ['str'] }}
577 # @query-rx-filter:
579 # Return rx-filter information for all NICs (or for the given NIC).
581 # @name: net client name
583 # Returns: list of @RxFilterInfo for all NICs (or for the given NIC).
584 #          Returns an error if the given @name doesn't exist, or given
585 #          NIC doesn't support rx-filter querying, or given net client
586 #          isn't a NIC.
588 # Since: 1.6
590 # Example:
592 # -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
593 # <- { "return": [
594 #         {
595 #             "promiscuous": true,
596 #             "name": "vnet0",
597 #             "main-mac": "52:54:00:12:34:56",
598 #             "unicast": "normal",
599 #             "vlan": "normal",
600 #             "vlan-table": [
601 #                 4,
602 #                 0
603 #             ],
604 #             "unicast-table": [
605 #             ],
606 #             "multicast": "normal",
607 #             "multicast-overflow": false,
608 #             "unicast-overflow": false,
609 #             "multicast-table": [
610 #                 "01:00:5e:00:00:01",
611 #                 "33:33:00:00:00:01",
612 #                 "33:33:ff:12:34:56"
613 #             ],
614 #             "broadcast-allowed": false
615 #         }
616 #       ]
617 #    }
620 { 'command': 'query-rx-filter',
621   'data': { '*name': 'str' },
622   'returns': ['RxFilterInfo'] }
625 # @NIC_RX_FILTER_CHANGED:
627 # Emitted once until the 'query-rx-filter' command is executed, the first event
628 # will always be emitted
630 # @name: net client name
632 # @path: device path
634 # Since: 1.6
636 # Example:
638 # <- { "event": "NIC_RX_FILTER_CHANGED",
639 #      "data": { "name": "vnet0",
640 #                "path": "/machine/peripheral/vnet0/virtio-backend" },
641 #      "timestamp": { "seconds": 1368697518, "microseconds": 326866 } }
642 #    }
645 { 'event': 'NIC_RX_FILTER_CHANGED',
646   'data': { '*name': 'str', 'path': 'str' } }
649 # @AnnounceParameters:
651 # Parameters for self-announce timers
653 # @initial: Initial delay (in ms) before sending the first GARP/RARP
654 #           announcement
656 # @max: Maximum delay (in ms) between GARP/RARP announcement packets
658 # @rounds: Number of self-announcement attempts
660 # @step: Delay increase (in ms) after each self-announcement attempt
662 # @interfaces: An optional list of interface names, which restricts the
663 #              announcement to the listed interfaces. (Since 4.1)
665 # @id: A name to be used to identify an instance of announce-timers
666 #      and to allow it to modified later.  Not for use as
667 #      part of the migration parameters. (Since 4.1)
669 # Since: 4.0
672 { 'struct': 'AnnounceParameters',
673   'data': { 'initial': 'int',
674             'max': 'int',
675             'rounds': 'int',
676             'step': 'int',
677             '*interfaces': ['str'],
678             '*id' : 'str' } }
681 # @announce-self:
683 # Trigger generation of broadcast RARP frames to update network switches.
684 # This can be useful when network bonds fail-over the active slave.
686 # Example:
688 # -> { "execute": "announce-self",
689 #      "arguments": {
690 #          "initial": 50, "max": 550, "rounds": 10, "step": 50,
691 #          "interfaces": ["vn2", "vn3"], "id": "bob" } }
692 # <- { "return": {} }
694 # Since: 4.0
696 { 'command': 'announce-self', 'boxed': true,
697   'data' : 'AnnounceParameters'}
700 # @FAILOVER_NEGOTIATED:
702 # Emitted when VIRTIO_NET_F_STANDBY was enabled during feature negotiation.
703 # Failover primary devices which were hidden (not hotplugged when requested)
704 # before will now be hotplugged by the virtio-net standby device.
706 # device-id: QEMU device id of the unplugged device
707 # Since: 4.2
709 # Example:
711 # <- { "event": "FAILOVER_NEGOTIATED",
712 #      "data": "net1" }
715 { 'event': 'FAILOVER_NEGOTIATED',
716   'data': {'device-id': 'str'} }