ppc/pnv: enable user created pnv-phb for powernv9
[qemu.git] / qapi / net.json
blob75ba2cb98901011f2080519f9b5e2dc37884dfff
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": [ { "str": "example.org" } ] } }
55 # <- { "return": {} }
58 { 'command': 'netdev_add', 'data': 'Netdev', 'boxed': true,
59   'allow-preconfig': true }
62 # @netdev_del:
64 # Remove a network backend.
66 # @id: the name of the network backend to remove
68 # Returns: Nothing on success
69 #          If @id is not a valid network backend, DeviceNotFound
71 # Since: 0.14
73 # Example:
75 # -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
76 # <- { "return": {} }
79 { 'command': 'netdev_del', 'data': {'id': 'str'},
80   'allow-preconfig': true }
83 # @NetLegacyNicOptions:
85 # Create a new Network Interface Card.
87 # @netdev: id of -netdev to connect to
89 # @macaddr: MAC address
91 # @model: device model (e1000, rtl8139, virtio etc.)
93 # @addr: PCI device address
95 # @vectors: number of MSI-x vectors, 0 to disable MSI-X
97 # Since: 1.2
99 { 'struct': 'NetLegacyNicOptions',
100   'data': {
101     '*netdev':  'str',
102     '*macaddr': 'str',
103     '*model':   'str',
104     '*addr':    'str',
105     '*vectors': 'uint32' } }
108 # @NetdevUserOptions:
110 # Use the user mode network stack which requires no administrator privilege to
111 # run.
113 # @hostname: client hostname reported by the builtin DHCP server
115 # @restrict: isolate the guest from the host
117 # @ipv4: whether to support IPv4, default true for enabled
118 #        (since 2.6)
120 # @ipv6: whether to support IPv6, default true for enabled
121 #        (since 2.6)
123 # @ip: legacy parameter, use net= instead
125 # @net: IP network address that the guest will see, in the
126 #       form addr[/netmask] The netmask is optional, and can be
127 #       either in the form a.b.c.d or as a number of valid top-most
128 #       bits. Default is 10.0.2.0/24.
130 # @host: guest-visible address of the host
132 # @tftp: root directory of the built-in TFTP server
134 # @bootfile: BOOTP filename, for use with tftp=
136 # @dhcpstart: the first of the 16 IPs the built-in DHCP server can
137 #             assign
139 # @dns: guest-visible address of the virtual nameserver
141 # @dnssearch: list of DNS suffixes to search, passed as DHCP option
142 #             to the guest
144 # @domainname: guest-visible domain name of the virtual nameserver
145 #              (since 3.0)
147 # @ipv6-prefix: IPv6 network prefix (default is fec0::) (since
148 #               2.6). The network prefix is given in the usual
149 #               hexadecimal IPv6 address notation.
151 # @ipv6-prefixlen: IPv6 network prefix length (default is 64)
152 #                  (since 2.6)
154 # @ipv6-host: guest-visible IPv6 address of the host (since 2.6)
156 # @ipv6-dns: guest-visible IPv6 address of the virtual
157 #            nameserver (since 2.6)
159 # @smb: root directory of the built-in SMB server
161 # @smbserver: IP address of the built-in SMB server
163 # @hostfwd: redirect incoming TCP or UDP host connections to guest
164 #           endpoints
166 # @guestfwd: forward guest TCP connections
168 # @tftp-server-name: RFC2132 "TFTP server name" string (Since 3.1)
170 # Since: 1.2
172 { 'struct': 'NetdevUserOptions',
173   'data': {
174     '*hostname':  'str',
175     '*restrict':  'bool',
176     '*ipv4':      'bool',
177     '*ipv6':      'bool',
178     '*ip':        'str',
179     '*net':       'str',
180     '*host':      'str',
181     '*tftp':      'str',
182     '*bootfile':  'str',
183     '*dhcpstart': 'str',
184     '*dns':       'str',
185     '*dnssearch': ['String'],
186     '*domainname': 'str',
187     '*ipv6-prefix':      'str',
188     '*ipv6-prefixlen':   'int',
189     '*ipv6-host':        'str',
190     '*ipv6-dns':         'str',
191     '*smb':       'str',
192     '*smbserver': 'str',
193     '*hostfwd':   ['String'],
194     '*guestfwd':  ['String'],
195     '*tftp-server-name': 'str' } }
198 # @NetdevTapOptions:
200 # Used to configure a host TAP network interface backend.
202 # @ifname: interface name
204 # @fd: file descriptor of an already opened tap
206 # @fds: multiple file descriptors of already opened multiqueue capable
207 #       tap
209 # @script: script to initialize the interface
211 # @downscript: script to shut down the interface
213 # @br: bridge name (since 2.8)
215 # @helper: command to execute to configure bridge
217 # @sndbuf: send buffer limit. Understands [TGMKkb] suffixes.
219 # @vnet_hdr: enable the IFF_VNET_HDR flag on the tap interface
221 # @vhost: enable vhost-net network accelerator
223 # @vhostfd: file descriptor of an already opened vhost net device
225 # @vhostfds: file descriptors of multiple already opened vhost net
226 #            devices
228 # @vhostforce: vhost on for non-MSIX virtio guests
230 # @queues: number of queues to be created for multiqueue capable tap
232 # @poll-us: maximum number of microseconds that could
233 #           be spent on busy polling for tap (since 2.7)
235 # Since: 1.2
237 { 'struct': 'NetdevTapOptions',
238   'data': {
239     '*ifname':     'str',
240     '*fd':         'str',
241     '*fds':        'str',
242     '*script':     'str',
243     '*downscript': 'str',
244     '*br':         'str',
245     '*helper':     'str',
246     '*sndbuf':     'size',
247     '*vnet_hdr':   'bool',
248     '*vhost':      'bool',
249     '*vhostfd':    'str',
250     '*vhostfds':   'str',
251     '*vhostforce': 'bool',
252     '*queues':     'uint32',
253     '*poll-us':    'uint32'} }
256 # @NetdevSocketOptions:
258 # Socket netdevs are used to establish a network connection to another
259 # QEMU virtual machine via a TCP socket.
261 # @fd: file descriptor of an already opened socket
263 # @listen: port number, and optional hostname, to listen on
265 # @connect: port number, and optional hostname, to connect to
267 # @mcast: UDP multicast address and port number
269 # @localaddr: source address and port for multicast and udp packets
271 # @udp: UDP unicast address and port number
273 # Since: 1.2
275 { 'struct': 'NetdevSocketOptions',
276   'data': {
277     '*fd':        'str',
278     '*listen':    'str',
279     '*connect':   'str',
280     '*mcast':     'str',
281     '*localaddr': 'str',
282     '*udp':       'str' } }
285 # @NetdevL2TPv3Options:
287 # Configure an Ethernet over L2TPv3 tunnel.
289 # @src: source address
291 # @dst: destination address
293 # @srcport: source port - mandatory for udp, optional for ip
295 # @dstport: destination port - mandatory for udp, optional for ip
297 # @ipv6: force the use of ipv6
299 # @udp: use the udp version of l2tpv3 encapsulation
301 # @cookie64: use 64 bit cookies
303 # @counter: have sequence counter
305 # @pincounter: pin sequence counter to zero -
306 #              workaround for buggy implementations or
307 #              networks with packet reorder
309 # @txcookie: 32 or 64 bit transmit cookie
311 # @rxcookie: 32 or 64 bit receive cookie
313 # @txsession: 32 bit transmit session
315 # @rxsession: 32 bit receive session - if not specified
316 #             set to the same value as transmit
318 # @offset: additional offset - allows the insertion of
319 #          additional application-specific data before the packet payload
321 # Since: 2.1
323 { 'struct': 'NetdevL2TPv3Options',
324   'data': {
325     'src':          'str',
326     'dst':          'str',
327     '*srcport':     'str',
328     '*dstport':     'str',
329     '*ipv6':        'bool',
330     '*udp':         'bool',
331     '*cookie64':    'bool',
332     '*counter':     'bool',
333     '*pincounter':  'bool',
334     '*txcookie':    'uint64',
335     '*rxcookie':    'uint64',
336     'txsession':    'uint32',
337     '*rxsession':   'uint32',
338     '*offset':      'uint32' } }
341 # @NetdevVdeOptions:
343 # Connect to a vde switch running on the host.
345 # @sock: socket path
347 # @port: port number
349 # @group: group owner of socket
351 # @mode: permissions for socket
353 # Since: 1.2
355 { 'struct': 'NetdevVdeOptions',
356   'data': {
357     '*sock':  'str',
358     '*port':  'uint16',
359     '*group': 'str',
360     '*mode':  'uint16' } }
363 # @NetdevBridgeOptions:
365 # Connect a host TAP network interface to a host bridge device.
367 # @br: bridge name
369 # @helper: command to execute to configure bridge
371 # Since: 1.2
373 { 'struct': 'NetdevBridgeOptions',
374   'data': {
375     '*br':     'str',
376     '*helper': 'str' } }
379 # @NetdevHubPortOptions:
381 # Connect two or more net clients through a software hub.
383 # @hubid: hub identifier number
384 # @netdev: used to connect hub to a netdev instead of a device (since 2.12)
386 # Since: 1.2
388 { 'struct': 'NetdevHubPortOptions',
389   'data': {
390     'hubid':     'int32',
391     '*netdev':    'str' } }
394 # @NetdevNetmapOptions:
396 # Connect a client to a netmap-enabled NIC or to a VALE switch port
398 # @ifname: Either the name of an existing network interface supported by
399 #          netmap, or the name of a VALE port (created on the fly).
400 #          A VALE port name is in the form 'valeXXX:YYY', where XXX and
401 #          YYY are non-negative integers. XXX identifies a switch and
402 #          YYY identifies a port of the switch. VALE ports having the
403 #          same XXX are therefore connected to the same switch.
405 # @devname: path of the netmap device (default: '/dev/netmap').
407 # Since: 2.0
409 { 'struct': 'NetdevNetmapOptions',
410   'data': {
411     'ifname':     'str',
412     '*devname':    'str' } }
415 # @NetdevVhostUserOptions:
417 # Vhost-user network backend
419 # @chardev: name of a unix socket chardev
421 # @vhostforce: vhost on for non-MSIX virtio guests (default: false).
423 # @queues: number of queues to be created for multiqueue vhost-user
424 #          (default: 1) (Since 2.5)
426 # Since: 2.1
428 { 'struct': 'NetdevVhostUserOptions',
429   'data': {
430     'chardev':        'str',
431     '*vhostforce':    'bool',
432     '*queues':        'int' } }
435 # @NetdevVhostVDPAOptions:
437 # Vhost-vdpa network backend
439 # vDPA device is a device that uses a datapath which complies with the virtio
440 # specifications with a vendor specific control path.
442 # @vhostdev: path of vhost-vdpa device
443 #            (default:'/dev/vhost-vdpa-0')
445 # @queues: number of queues to be created for multiqueue vhost-vdpa
446 #          (default: 1)
448 # @x-svq: Start device with (experimental) shadow virtqueue. (Since 7.1)
449 #         (default: false)
451 # Features:
452 # @unstable: Member @x-svq is experimental.
454 # Since: 5.1
456 { 'struct': 'NetdevVhostVDPAOptions',
457   'data': {
458     '*vhostdev':     'str',
459     '*queues':       'int',
460     '*x-svq':        {'type': 'bool', 'features' : [ 'unstable'] } } }
463 # @NetdevVmnetHostOptions:
465 # vmnet (host mode) network backend.
467 # Allows the vmnet interface to communicate with other vmnet
468 # interfaces that are in host mode and also with the host.
470 # @start-address: The starting IPv4 address to use for the interface.
471 #                 Must be in the private IP range (RFC 1918). Must be
472 #                 specified along with @end-address and @subnet-mask.
473 #                 This address is used as the gateway address. The
474 #                 subsequent address up to and including end-address are
475 #                 placed in the DHCP pool.
477 # @end-address: The DHCP IPv4 range end address to use for the
478 #               interface. Must be in the private IP range (RFC 1918).
479 #               Must be specified along with @start-address and
480 #               @subnet-mask.
482 # @subnet-mask: The IPv4 subnet mask to use on the interface. Must
483 #               be specified along with @start-address and @subnet-mask.
485 # @isolated: Enable isolation for this interface. Interface isolation
486 #            ensures that vmnet interface is not able to communicate
487 #            with any other vmnet interfaces. Only communication with
488 #            host is allowed. Requires at least macOS Big Sur 11.0.
490 # @net-uuid: The identifier (UUID) to uniquely identify the isolated
491 #            network vmnet interface should be added to. If
492 #            set, no DHCP service is provided for this interface and
493 #            network communication is allowed only with other interfaces
494 #            added to this network identified by the UUID. Requires
495 #            at least macOS Big Sur 11.0.
497 # Since: 7.1
499 { 'struct': 'NetdevVmnetHostOptions',
500   'data': {
501     '*start-address': 'str',
502     '*end-address':   'str',
503     '*subnet-mask':   'str',
504     '*isolated':      'bool',
505     '*net-uuid':      'str' },
506   'if': 'CONFIG_VMNET' }
509 # @NetdevVmnetSharedOptions:
511 # vmnet (shared mode) network backend.
513 # Allows traffic originating from the vmnet interface to reach the
514 # Internet through a network address translator (NAT).
515 # The vmnet interface can communicate with the host and with
516 # other shared mode interfaces on the same subnet. If no DHCP
517 # settings, subnet mask and IPv6 prefix specified, the interface can
518 # communicate with any of other interfaces in shared mode.
520 # @start-address: The starting IPv4 address to use for the interface.
521 #                 Must be in the private IP range (RFC 1918). Must be
522 #                 specified along with @end-address and @subnet-mask.
523 #                 This address is used as the gateway address. The
524 #                 subsequent address up to and including end-address are
525 #                 placed in the DHCP pool.
527 # @end-address: The DHCP IPv4 range end address to use for the
528 #               interface. Must be in the private IP range (RFC 1918).
529 #               Must be specified along with @start-address and @subnet-mask.
531 # @subnet-mask: The IPv4 subnet mask to use on the interface. Must
532 #                be specified along with @start-address and @subnet-mask.
534 # @isolated: Enable isolation for this interface. Interface isolation
535 #            ensures that vmnet interface is not able to communicate
536 #            with any other vmnet interfaces. Only communication with
537 #            host is allowed. Requires at least macOS Big Sur 11.0.
539 # @nat66-prefix: The IPv6 prefix to use into guest network. Must be a
540 #                unique local address i.e. start with fd00::/8 and have
541 #                length of 64.
543 # Since: 7.1
545 { 'struct': 'NetdevVmnetSharedOptions',
546   'data': {
547     '*start-address': 'str',
548     '*end-address':   'str',
549     '*subnet-mask':   'str',
550     '*isolated':      'bool',
551     '*nat66-prefix':  'str' },
552   'if': 'CONFIG_VMNET' }
555 # @NetdevVmnetBridgedOptions:
557 # vmnet (bridged mode) network backend.
559 # Bridges the vmnet interface with a physical network interface.
561 # @ifname: The name of the physical interface to be bridged.
563 # @isolated: Enable isolation for this interface. Interface isolation
564 #            ensures that vmnet interface is not able to communicate
565 #            with any other vmnet interfaces. Only communication with
566 #            host is allowed. Requires at least macOS Big Sur 11.0.
568 # Since: 7.1
570 { 'struct': 'NetdevVmnetBridgedOptions',
571   'data': {
572     'ifname':     'str',
573     '*isolated':  'bool' },
574   'if': 'CONFIG_VMNET' }
577 # @NetClientDriver:
579 # Available netdev drivers.
581 # Since: 2.7
583 #        @vhost-vdpa since 5.1
584 #        @vmnet-host since 7.1
585 #        @vmnet-shared since 7.1
586 #        @vmnet-bridged since 7.1
588 { 'enum': 'NetClientDriver',
589   'data': [ 'none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde',
590             'bridge', 'hubport', 'netmap', 'vhost-user', 'vhost-vdpa',
591             { 'name': 'vmnet-host', 'if': 'CONFIG_VMNET' },
592             { 'name': 'vmnet-shared', 'if': 'CONFIG_VMNET' },
593             { 'name': 'vmnet-bridged', 'if': 'CONFIG_VMNET' }] }
596 # @Netdev:
598 # Captures the configuration of a network device.
600 # @id: identifier for monitor commands.
602 # @type: Specify the driver used for interpreting remaining arguments.
604 # Since: 1.2
606 #        'l2tpv3' - since 2.1
607 #        'vmnet-host' - since 7.1
608 #        'vmnet-shared' - since 7.1
609 #        'vmnet-bridged' - since 7.1
611 { 'union': 'Netdev',
612   'base': { 'id': 'str', 'type': 'NetClientDriver' },
613   'discriminator': 'type',
614   'data': {
615     'nic':      'NetLegacyNicOptions',
616     'user':     'NetdevUserOptions',
617     'tap':      'NetdevTapOptions',
618     'l2tpv3':   'NetdevL2TPv3Options',
619     'socket':   'NetdevSocketOptions',
620     'vde':      'NetdevVdeOptions',
621     'bridge':   'NetdevBridgeOptions',
622     'hubport':  'NetdevHubPortOptions',
623     'netmap':   'NetdevNetmapOptions',
624     'vhost-user': 'NetdevVhostUserOptions',
625     'vhost-vdpa': 'NetdevVhostVDPAOptions',
626     'vmnet-host': { 'type': 'NetdevVmnetHostOptions',
627                     'if': 'CONFIG_VMNET' },
628     'vmnet-shared': { 'type': 'NetdevVmnetSharedOptions',
629                       'if': 'CONFIG_VMNET' },
630     'vmnet-bridged': { 'type': 'NetdevVmnetBridgedOptions',
631                        'if': 'CONFIG_VMNET' } } }
634 # @RxState:
636 # Packets receiving state
638 # @normal: filter assigned packets according to the mac-table
640 # @none: don't receive any assigned packet
642 # @all: receive all assigned packets
644 # Since: 1.6
646 { 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] }
649 # @RxFilterInfo:
651 # Rx-filter information for a NIC.
653 # @name: net client name
655 # @promiscuous: whether promiscuous mode is enabled
657 # @multicast: multicast receive state
659 # @unicast: unicast receive state
661 # @vlan: vlan receive state (Since 2.0)
663 # @broadcast-allowed: whether to receive broadcast
665 # @multicast-overflow: multicast table is overflowed or not
667 # @unicast-overflow: unicast table is overflowed or not
669 # @main-mac: the main macaddr string
671 # @vlan-table: a list of active vlan id
673 # @unicast-table: a list of unicast macaddr string
675 # @multicast-table: a list of multicast macaddr string
677 # Since: 1.6
679 { 'struct': 'RxFilterInfo',
680   'data': {
681     'name':               'str',
682     'promiscuous':        'bool',
683     'multicast':          'RxState',
684     'unicast':            'RxState',
685     'vlan':               'RxState',
686     'broadcast-allowed':  'bool',
687     'multicast-overflow': 'bool',
688     'unicast-overflow':   'bool',
689     'main-mac':           'str',
690     'vlan-table':         ['int'],
691     'unicast-table':      ['str'],
692     'multicast-table':    ['str'] }}
695 # @query-rx-filter:
697 # Return rx-filter information for all NICs (or for the given NIC).
699 # @name: net client name
701 # Returns: list of @RxFilterInfo for all NICs (or for the given NIC).
702 #          Returns an error if the given @name doesn't exist, or given
703 #          NIC doesn't support rx-filter querying, or given net client
704 #          isn't a NIC.
706 # Since: 1.6
708 # Example:
710 # -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
711 # <- { "return": [
712 #         {
713 #             "promiscuous": true,
714 #             "name": "vnet0",
715 #             "main-mac": "52:54:00:12:34:56",
716 #             "unicast": "normal",
717 #             "vlan": "normal",
718 #             "vlan-table": [
719 #                 4,
720 #                 0
721 #             ],
722 #             "unicast-table": [
723 #             ],
724 #             "multicast": "normal",
725 #             "multicast-overflow": false,
726 #             "unicast-overflow": false,
727 #             "multicast-table": [
728 #                 "01:00:5e:00:00:01",
729 #                 "33:33:00:00:00:01",
730 #                 "33:33:ff:12:34:56"
731 #             ],
732 #             "broadcast-allowed": false
733 #         }
734 #       ]
735 #    }
738 { 'command': 'query-rx-filter',
739   'data': { '*name': 'str' },
740   'returns': ['RxFilterInfo'] }
743 # @NIC_RX_FILTER_CHANGED:
745 # Emitted once until the 'query-rx-filter' command is executed, the first event
746 # will always be emitted
748 # @name: net client name
750 # @path: device path
752 # Since: 1.6
754 # Example:
756 # <- { "event": "NIC_RX_FILTER_CHANGED",
757 #      "data": { "name": "vnet0",
758 #                "path": "/machine/peripheral/vnet0/virtio-backend" },
759 #      "timestamp": { "seconds": 1368697518, "microseconds": 326866 } }
760 #    }
763 { 'event': 'NIC_RX_FILTER_CHANGED',
764   'data': { '*name': 'str', 'path': 'str' } }
767 # @AnnounceParameters:
769 # Parameters for self-announce timers
771 # @initial: Initial delay (in ms) before sending the first GARP/RARP
772 #           announcement
774 # @max: Maximum delay (in ms) between GARP/RARP announcement packets
776 # @rounds: Number of self-announcement attempts
778 # @step: Delay increase (in ms) after each self-announcement attempt
780 # @interfaces: An optional list of interface names, which restricts the
781 #              announcement to the listed interfaces. (Since 4.1)
783 # @id: A name to be used to identify an instance of announce-timers
784 #      and to allow it to modified later.  Not for use as
785 #      part of the migration parameters. (Since 4.1)
787 # Since: 4.0
790 { 'struct': 'AnnounceParameters',
791   'data': { 'initial': 'int',
792             'max': 'int',
793             'rounds': 'int',
794             'step': 'int',
795             '*interfaces': ['str'],
796             '*id' : 'str' } }
799 # @announce-self:
801 # Trigger generation of broadcast RARP frames to update network switches.
802 # This can be useful when network bonds fail-over the active slave.
804 # Example:
806 # -> { "execute": "announce-self",
807 #      "arguments": {
808 #          "initial": 50, "max": 550, "rounds": 10, "step": 50,
809 #          "interfaces": ["vn2", "vn3"], "id": "bob" } }
810 # <- { "return": {} }
812 # Since: 4.0
814 { 'command': 'announce-self', 'boxed': true,
815   'data' : 'AnnounceParameters'}
818 # @FAILOVER_NEGOTIATED:
820 # Emitted when VIRTIO_NET_F_STANDBY was enabled during feature negotiation.
821 # Failover primary devices which were hidden (not hotplugged when requested)
822 # before will now be hotplugged by the virtio-net standby device.
824 # @device-id: QEMU device id of the unplugged device
826 # Since: 4.2
828 # Example:
830 # <- { "event": "FAILOVER_NEGOTIATED",
831 #      "data": { "device-id": "net1" },
832 #      "timestamp": { "seconds": 1368697518, "microseconds": 326866 } }
835 { 'event': 'FAILOVER_NEGOTIATED',
836   'data': {'device-id': 'str'} }