block: trickle down the fallback image creation function use to the block drivers
[qemu/ar7.git] / qapi / net.json
blobcebb1b52e3b1824326ecc0d3cd70a3afa0d632c8
1 # -*- Mode: Python -*-
4 ##
5 # = Net devices
6 ##
8 { 'include': 'common.json' }
11 # @set_link:
13 # Sets the link status of a virtual network adapter.
15 # @name: the device name of the virtual network adapter
17 # @up: true to set the link status to be up
19 # Returns: Nothing on success
20 #          If @name is not a valid network device, DeviceNotFound
22 # Since: 0.14.0
24 # Notes: Not all network adapters support setting link status.  This command
25 #        will succeed even if the network adapter does not support link status
26 #        notification.
28 # Example:
30 # -> { "execute": "set_link",
31 #      "arguments": { "name": "e1000.0", "up": false } }
32 # <- { "return": {} }
35 { 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
38 # @netdev_add:
40 # Add a network backend.
42 # Additional arguments depend on the type.
44 # Since: 0.14.0
46 # Returns: Nothing on success
47 #          If @type is not a valid network backend, DeviceNotFound
49 # Example:
51 # -> { "execute": "netdev_add",
52 #      "arguments": { "type": "user", "id": "netdev1",
53 #                     "dnssearch": "example.org" } }
54 # <- { "return": {} }
57 { 'command': 'netdev_add', 'data': 'Netdev', 'boxed': true }
60 # @netdev_del:
62 # Remove a network backend.
64 # @id: the name of the network backend to remove
66 # Returns: Nothing on success
67 #          If @id is not a valid network backend, DeviceNotFound
69 # Since: 0.14.0
71 # Example:
73 # -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
74 # <- { "return": {} }
77 { 'command': 'netdev_del', 'data': {'id': 'str'} }
80 # @NetLegacyNicOptions:
82 # Create a new Network Interface Card.
84 # @netdev: id of -netdev to connect to
86 # @macaddr: MAC address
88 # @model: device model (e1000, rtl8139, virtio etc.)
90 # @addr: PCI device address
92 # @vectors: number of MSI-x vectors, 0 to disable MSI-X
94 # Since: 1.2
96 { 'struct': 'NetLegacyNicOptions',
97   'data': {
98     '*netdev':  'str',
99     '*macaddr': 'str',
100     '*model':   'str',
101     '*addr':    'str',
102     '*vectors': 'uint32' } }
105 # @NetdevUserOptions:
107 # Use the user mode network stack which requires no administrator privilege to
108 # run.
110 # @hostname: client hostname reported by the builtin DHCP server
112 # @restrict: isolate the guest from the host
114 # @ipv4: whether to support IPv4, default true for enabled
115 #        (since 2.6)
117 # @ipv6: whether to support IPv6, default true for enabled
118 #        (since 2.6)
120 # @ip: legacy parameter, use net= instead
122 # @net: IP network address that the guest will see, in the
123 #       form addr[/netmask] The netmask is optional, and can be
124 #       either in the form a.b.c.d or as a number of valid top-most
125 #       bits. Default is 10.0.2.0/24.
127 # @host: guest-visible address of the host
129 # @tftp: root directory of the built-in TFTP server
131 # @bootfile: BOOTP filename, for use with tftp=
133 # @dhcpstart: the first of the 16 IPs the built-in DHCP server can
134 #             assign
136 # @dns: guest-visible address of the virtual nameserver
138 # @dnssearch: list of DNS suffixes to search, passed as DHCP option
139 #             to the guest
141 # @domainname: guest-visible domain name of the virtual nameserver
142 #              (since 3.0)
144 # @ipv6-prefix: IPv6 network prefix (default is fec0::) (since
145 #               2.6). The network prefix is given in the usual
146 #               hexadecimal IPv6 address notation.
148 # @ipv6-prefixlen: IPv6 network prefix length (default is 64)
149 #                  (since 2.6)
151 # @ipv6-host: guest-visible IPv6 address of the host (since 2.6)
153 # @ipv6-dns: guest-visible IPv6 address of the virtual
154 #            nameserver (since 2.6)
156 # @smb: root directory of the built-in SMB server
158 # @smbserver: IP address of the built-in SMB server
160 # @hostfwd: redirect incoming TCP or UDP host connections to guest
161 #           endpoints
163 # @guestfwd: forward guest TCP connections
165 # @tftp-server-name: RFC2132 "TFTP server name" string (Since 3.1)
167 # Since: 1.2
169 { 'struct': 'NetdevUserOptions',
170   'data': {
171     '*hostname':  'str',
172     '*restrict':  'bool',
173     '*ipv4':      'bool',
174     '*ipv6':      'bool',
175     '*ip':        'str',
176     '*net':       'str',
177     '*host':      'str',
178     '*tftp':      'str',
179     '*bootfile':  'str',
180     '*dhcpstart': 'str',
181     '*dns':       'str',
182     '*dnssearch': ['String'],
183     '*domainname': 'str',
184     '*ipv6-prefix':      'str',
185     '*ipv6-prefixlen':   'int',
186     '*ipv6-host':        'str',
187     '*ipv6-dns':         'str',
188     '*smb':       'str',
189     '*smbserver': 'str',
190     '*hostfwd':   ['String'],
191     '*guestfwd':  ['String'],
192     '*tftp-server-name': 'str' } }
195 # @NetdevTapOptions:
197 # Used to configure a host TAP network interface backend.
199 # @ifname: interface name
201 # @fd: file descriptor of an already opened tap
203 # @fds: multiple file descriptors of already opened multiqueue capable
204 #       tap
206 # @script: script to initialize the interface
208 # @downscript: script to shut down the interface
210 # @br: bridge name (since 2.8)
212 # @helper: command to execute to configure bridge
214 # @sndbuf: send buffer limit. Understands [TGMKkb] suffixes.
216 # @vnet_hdr: enable the IFF_VNET_HDR flag on the tap interface
218 # @vhost: enable vhost-net network accelerator
220 # @vhostfd: file descriptor of an already opened vhost net device
222 # @vhostfds: file descriptors of multiple already opened vhost net
223 #            devices
225 # @vhostforce: vhost on for non-MSIX virtio guests
227 # @queues: number of queues to be created for multiqueue capable tap
229 # @poll-us: maximum number of microseconds that could
230 #           be spent on busy polling for tap (since 2.7)
232 # Since: 1.2
234 { 'struct': 'NetdevTapOptions',
235   'data': {
236     '*ifname':     'str',
237     '*fd':         'str',
238     '*fds':        'str',
239     '*script':     'str',
240     '*downscript': 'str',
241     '*br':         'str',
242     '*helper':     'str',
243     '*sndbuf':     'size',
244     '*vnet_hdr':   'bool',
245     '*vhost':      'bool',
246     '*vhostfd':    'str',
247     '*vhostfds':   'str',
248     '*vhostforce': 'bool',
249     '*queues':     'uint32',
250     '*poll-us':    'uint32'} }
253 # @NetdevSocketOptions:
255 # Socket netdevs are used to establish a network connection to another
256 # QEMU virtual machine via a TCP socket.
258 # @fd: file descriptor of an already opened socket
260 # @listen: port number, and optional hostname, to listen on
262 # @connect: port number, and optional hostname, to connect to
264 # @mcast: UDP multicast address and port number
266 # @localaddr: source address and port for multicast and udp packets
268 # @udp: UDP unicast address and port number
270 # Since: 1.2
272 { 'struct': 'NetdevSocketOptions',
273   'data': {
274     '*fd':        'str',
275     '*listen':    'str',
276     '*connect':   'str',
277     '*mcast':     'str',
278     '*localaddr': 'str',
279     '*udp':       'str' } }
282 # @NetdevL2TPv3Options:
284 # Configure an Ethernet over L2TPv3 tunnel.
286 # @src: source address
288 # @dst: destination address
290 # @srcport: source port - mandatory for udp, optional for ip
292 # @dstport: destination port - mandatory for udp, optional for ip
294 # @ipv6: force the use of ipv6
296 # @udp: use the udp version of l2tpv3 encapsulation
298 # @cookie64: use 64 bit coookies
300 # @counter: have sequence counter
302 # @pincounter: pin sequence counter to zero -
303 #              workaround for buggy implementations or
304 #              networks with packet reorder
306 # @txcookie: 32 or 64 bit transmit cookie
308 # @rxcookie: 32 or 64 bit receive cookie
310 # @txsession: 32 bit transmit session
312 # @rxsession: 32 bit receive session - if not specified
313 #             set to the same value as transmit
315 # @offset: additional offset - allows the insertion of
316 #          additional application-specific data before the packet payload
318 # Since: 2.1
320 { 'struct': 'NetdevL2TPv3Options',
321   'data': {
322     'src':          'str',
323     'dst':          'str',
324     '*srcport':     'str',
325     '*dstport':     'str',
326     '*ipv6':        'bool',
327     '*udp':         'bool',
328     '*cookie64':    'bool',
329     '*counter':     'bool',
330     '*pincounter':  'bool',
331     '*txcookie':    'uint64',
332     '*rxcookie':    'uint64',
333     'txsession':    'uint32',
334     '*rxsession':   'uint32',
335     '*offset':      'uint32' } }
338 # @NetdevVdeOptions:
340 # Connect to a vde switch running on the host.
342 # @sock: socket path
344 # @port: port number
346 # @group: group owner of socket
348 # @mode: permissions for socket
350 # Since: 1.2
352 { 'struct': 'NetdevVdeOptions',
353   'data': {
354     '*sock':  'str',
355     '*port':  'uint16',
356     '*group': 'str',
357     '*mode':  'uint16' } }
360 # @NetdevBridgeOptions:
362 # Connect a host TAP network interface to a host bridge device.
364 # @br: bridge name
366 # @helper: command to execute to configure bridge
368 # Since: 1.2
370 { 'struct': 'NetdevBridgeOptions',
371   'data': {
372     '*br':     'str',
373     '*helper': 'str' } }
376 # @NetdevHubPortOptions:
378 # Connect two or more net clients through a software hub.
380 # @hubid: hub identifier number
381 # @netdev: used to connect hub to a netdev instead of a device (since 2.12)
383 # Since: 1.2
385 { 'struct': 'NetdevHubPortOptions',
386   'data': {
387     'hubid':     'int32',
388     '*netdev':    'str' } }
391 # @NetdevNetmapOptions:
393 # Connect a client to a netmap-enabled NIC or to a VALE switch port
395 # @ifname: Either the name of an existing network interface supported by
396 #          netmap, or the name of a VALE port (created on the fly).
397 #          A VALE port name is in the form 'valeXXX:YYY', where XXX and
398 #          YYY are non-negative integers. XXX identifies a switch and
399 #          YYY identifies a port of the switch. VALE ports having the
400 #          same XXX are therefore connected to the same switch.
402 # @devname: path of the netmap device (default: '/dev/netmap').
404 # Since: 2.0
406 { 'struct': 'NetdevNetmapOptions',
407   'data': {
408     'ifname':     'str',
409     '*devname':    'str' } }
412 # @NetdevVhostUserOptions:
414 # Vhost-user network backend
416 # @chardev: name of a unix socket chardev
418 # @vhostforce: vhost on for non-MSIX virtio guests (default: false).
420 # @queues: number of queues to be created for multiqueue vhost-user
421 #          (default: 1) (Since 2.5)
423 # Since: 2.1
425 { 'struct': 'NetdevVhostUserOptions',
426   'data': {
427     'chardev':        'str',
428     '*vhostforce':    'bool',
429     '*queues':        'int' } }
432 # @NetClientDriver:
434 # Available netdev drivers.
436 # Since: 2.7
438 { 'enum': 'NetClientDriver',
439   'data': [ 'none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde',
440             'bridge', 'hubport', 'netmap', 'vhost-user' ] }
443 # @Netdev:
445 # Captures the configuration of a network device.
447 # @id: identifier for monitor commands.
449 # @type: Specify the driver used for interpreting remaining arguments.
451 # Since: 1.2
453 #        'l2tpv3' - since 2.1
455 { 'union': 'Netdev',
456   'base': { 'id': 'str', 'type': 'NetClientDriver' },
457   'discriminator': 'type',
458   'data': {
459     'nic':      'NetLegacyNicOptions',
460     'user':     'NetdevUserOptions',
461     'tap':      'NetdevTapOptions',
462     'l2tpv3':   'NetdevL2TPv3Options',
463     'socket':   'NetdevSocketOptions',
464     'vde':      'NetdevVdeOptions',
465     'bridge':   'NetdevBridgeOptions',
466     'hubport':  'NetdevHubPortOptions',
467     'netmap':   'NetdevNetmapOptions',
468     'vhost-user': 'NetdevVhostUserOptions' } }
471 # @NetLegacy:
473 # Captures the configuration of a network device; legacy.
475 # @id: identifier for monitor commands
477 # @name: identifier for monitor commands, ignored if @id is present
479 # @opts: device type specific properties (legacy)
481 # Since: 1.2
483 { 'struct': 'NetLegacy',
484   'data': {
485     '*id':   'str',
486     '*name': 'str',
487     'opts':  'NetLegacyOptions' } }
490 # @NetLegacyOptionsType:
492 # Since: 1.2
494 { 'enum': 'NetLegacyOptionsType',
495   'data': ['none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde',
496            'bridge', 'netmap', 'vhost-user'] }
499 # @NetLegacyOptions:
501 # Like Netdev, but for use only by the legacy command line options
503 # Since: 1.2
505 { 'union': 'NetLegacyOptions',
506   'base': { 'type': 'NetLegacyOptionsType' },
507   'discriminator': 'type',
508   'data': {
509     'nic':      'NetLegacyNicOptions',
510     'user':     'NetdevUserOptions',
511     'tap':      'NetdevTapOptions',
512     'l2tpv3':   'NetdevL2TPv3Options',
513     'socket':   'NetdevSocketOptions',
514     'vde':      'NetdevVdeOptions',
515     'bridge':   'NetdevBridgeOptions',
516     'netmap':   'NetdevNetmapOptions',
517     'vhost-user': 'NetdevVhostUserOptions' } }
520 # @NetFilterDirection:
522 # Indicates whether a netfilter is attached to a netdev's transmit queue or
523 # receive queue or both.
525 # @all: the filter is attached both to the receive and the transmit
526 #       queue of the netdev (default).
528 # @rx: the filter is attached to the receive queue of the netdev,
529 #      where it will receive packets sent to the netdev.
531 # @tx: the filter is attached to the transmit queue of the netdev,
532 #      where it will receive packets sent by the netdev.
534 # Since: 2.5
536 { 'enum': 'NetFilterDirection',
537   'data': [ 'all', 'rx', 'tx' ] }
540 # @RxState:
542 # Packets receiving state
544 # @normal: filter assigned packets according to the mac-table
546 # @none: don't receive any assigned packet
548 # @all: receive all assigned packets
550 # Since: 1.6
552 { 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] }
555 # @RxFilterInfo:
557 # Rx-filter information for a NIC.
559 # @name: net client name
561 # @promiscuous: whether promiscuous mode is enabled
563 # @multicast: multicast receive state
565 # @unicast: unicast receive state
567 # @vlan: vlan receive state (Since 2.0)
569 # @broadcast-allowed: whether to receive broadcast
571 # @multicast-overflow: multicast table is overflowed or not
573 # @unicast-overflow: unicast table is overflowed or not
575 # @main-mac: the main macaddr string
577 # @vlan-table: a list of active vlan id
579 # @unicast-table: a list of unicast macaddr string
581 # @multicast-table: a list of multicast macaddr string
583 # Since: 1.6
585 { 'struct': 'RxFilterInfo',
586   'data': {
587     'name':               'str',
588     'promiscuous':        'bool',
589     'multicast':          'RxState',
590     'unicast':            'RxState',
591     'vlan':               'RxState',
592     'broadcast-allowed':  'bool',
593     'multicast-overflow': 'bool',
594     'unicast-overflow':   'bool',
595     'main-mac':           'str',
596     'vlan-table':         ['int'],
597     'unicast-table':      ['str'],
598     'multicast-table':    ['str'] }}
601 # @query-rx-filter:
603 # Return rx-filter information for all NICs (or for the given NIC).
605 # @name: net client name
607 # Returns: list of @RxFilterInfo for all NICs (or for the given NIC).
608 #          Returns an error if the given @name doesn't exist, or given
609 #          NIC doesn't support rx-filter querying, or given net client
610 #          isn't a NIC.
612 # Since: 1.6
614 # Example:
616 # -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
617 # <- { "return": [
618 #         {
619 #             "promiscuous": true,
620 #             "name": "vnet0",
621 #             "main-mac": "52:54:00:12:34:56",
622 #             "unicast": "normal",
623 #             "vlan": "normal",
624 #             "vlan-table": [
625 #                 4,
626 #                 0
627 #             ],
628 #             "unicast-table": [
629 #             ],
630 #             "multicast": "normal",
631 #             "multicast-overflow": false,
632 #             "unicast-overflow": false,
633 #             "multicast-table": [
634 #                 "01:00:5e:00:00:01",
635 #                 "33:33:00:00:00:01",
636 #                 "33:33:ff:12:34:56"
637 #             ],
638 #             "broadcast-allowed": false
639 #         }
640 #       ]
641 #    }
644 { 'command': 'query-rx-filter',
645   'data': { '*name': 'str' },
646   'returns': ['RxFilterInfo'] }
649 # @NIC_RX_FILTER_CHANGED:
651 # Emitted once until the 'query-rx-filter' command is executed, the first event
652 # will always be emitted
654 # @name: net client name
656 # @path: device path
658 # Since: 1.6
660 # Example:
662 # <- { "event": "NIC_RX_FILTER_CHANGED",
663 #      "data": { "name": "vnet0",
664 #                "path": "/machine/peripheral/vnet0/virtio-backend" },
665 #      "timestamp": { "seconds": 1368697518, "microseconds": 326866 } }
666 #    }
669 { 'event': 'NIC_RX_FILTER_CHANGED',
670   'data': { '*name': 'str', 'path': 'str' } }
673 # @AnnounceParameters:
675 # Parameters for self-announce timers
677 # @initial: Initial delay (in ms) before sending the first GARP/RARP
678 #           announcement
680 # @max: Maximum delay (in ms) between GARP/RARP announcement packets
682 # @rounds: Number of self-announcement attempts
684 # @step: Delay increase (in ms) after each self-announcement attempt
686 # @interfaces: An optional list of interface names, which restricts the
687 #              announcement to the listed interfaces. (Since 4.1)
689 # @id: A name to be used to identify an instance of announce-timers
690 #      and to allow it to modified later.  Not for use as
691 #      part of the migration parameters. (Since 4.1)
693 # Since: 4.0
696 { 'struct': 'AnnounceParameters',
697   'data': { 'initial': 'int',
698             'max': 'int',
699             'rounds': 'int',
700             'step': 'int',
701             '*interfaces': ['str'],
702             '*id' : 'str' } }
705 # @announce-self:
707 # Trigger generation of broadcast RARP frames to update network switches.
708 # This can be useful when network bonds fail-over the active slave.
710 # Example:
712 # -> { "execute": "announce-self",
713 #      "arguments": {
714 #          "initial": 50, "max": 550, "rounds": 10, "step": 50,
715 #          "interfaces": ["vn2", "vn3"], "id": "bob" } }
716 # <- { "return": {} }
718 # Since: 4.0
720 { 'command': 'announce-self', 'boxed': true,
721   'data' : 'AnnounceParameters'}
724 # @FAILOVER_NEGOTIATED:
726 # Emitted when VIRTIO_NET_F_STANDBY was enabled during feature negotiation.
727 # Failover primary devices which were hidden (not hotplugged when requested)
728 # before will now be hotplugged by the virtio-net standby device.
730 # device-id: QEMU device id of the unplugged device
731 # Since: 4.2
733 # Example:
735 # <- { "event": "FAILOVER_NEGOTIATED",
736 #      "data": "net1" }
739 { 'event': 'FAILOVER_NEGOTIATED',
740   'data': {'device-id': 'str'} }