9 { 'include': 'common.json' }
10 { 'include': 'sockets.json' }
15 # Sets the link status of a virtual network adapter.
17 # @name: the device name of the virtual network adapter
19 # @up: true to set the link status to be up
22 # - Nothing on success
23 # - If @name is not a valid network device, DeviceNotFound
27 # Notes: Not all network adapters support setting link status. This
28 # command will succeed even if the network adapter does not
29 # support link status notification.
33 # -> { "execute": "set_link",
34 # "arguments": { "name": "e1000.0", "up": false } }
37 { 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
42 # Add a network backend.
44 # Additional arguments depend on the type.
49 # - Nothing on success
50 # - If @type is not a valid network backend, DeviceNotFound
54 # -> { "execute": "netdev_add",
55 # "arguments": { "type": "user", "id": "netdev1",
56 # "dnssearch": [ { "str": "example.org" } ] } }
59 { 'command': 'netdev_add', 'data': 'Netdev', 'boxed': true,
60 'allow-preconfig': true }
65 # Remove a network backend.
67 # @id: the name of the network backend to remove
70 # - Nothing on success
71 # - If @id is not a valid network backend, DeviceNotFound
77 # -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
80 { 'command': 'netdev_del', 'data': {'id': 'str'},
81 'allow-preconfig': true }
84 # @NetLegacyNicOptions:
86 # Create a new Network Interface Card.
88 # @netdev: id of -netdev to connect to
90 # @macaddr: MAC address
92 # @model: device model (e1000, rtl8139, virtio etc.)
94 # @addr: PCI device address
96 # @vectors: number of MSI-x vectors, 0 to disable MSI-X
100 { 'struct': 'NetLegacyNicOptions',
106 '*vectors': 'uint32' } }
109 # @NetdevUserOptions:
111 # Use the user mode network stack which requires no administrator
114 # @hostname: client hostname reported by the builtin DHCP server
116 # @restrict: isolate the guest from the host
118 # @ipv4: whether to support IPv4, default true for enabled (since 2.6)
120 # @ipv6: whether to support IPv6, default true for enabled (since 2.6)
122 # @ip: legacy parameter, use net= instead
124 # @net: IP network address that the guest will see, in the form
125 # addr[/netmask] The netmask is optional, and can be either in the
126 # form a.b.c.d or as a number of valid top-most bits. Default is
129 # @host: guest-visible address of the host
131 # @tftp: root directory of the built-in TFTP server
133 # @bootfile: BOOTP filename, for use with tftp=
135 # @dhcpstart: the first of the 16 IPs the built-in DHCP server can
138 # @dns: guest-visible address of the virtual nameserver
140 # @dnssearch: list of DNS suffixes to search, passed as DHCP option to
143 # @domainname: guest-visible domain name of the virtual nameserver
146 # @ipv6-prefix: IPv6 network prefix (default is fec0::) (since 2.6).
147 # The network prefix is given in the usual hexadecimal IPv6
150 # @ipv6-prefixlen: IPv6 network prefix length (default is 64) (since
153 # @ipv6-host: guest-visible IPv6 address of the host (since 2.6)
155 # @ipv6-dns: guest-visible IPv6 address of the virtual nameserver
158 # @smb: root directory of the built-in SMB server
160 # @smbserver: IP address of the built-in SMB server
162 # @hostfwd: redirect incoming TCP or UDP host connections to guest
165 # @guestfwd: forward guest TCP connections
167 # @tftp-server-name: RFC2132 "TFTP server name" string (Since 3.1)
171 { 'struct': 'NetdevUserOptions',
184 '*dnssearch': ['String'],
185 '*domainname': 'str',
186 '*ipv6-prefix': 'str',
187 '*ipv6-prefixlen': 'int',
192 '*hostfwd': ['String'],
193 '*guestfwd': ['String'],
194 '*tftp-server-name': 'str' } }
199 # Used to configure a host TAP network interface backend.
201 # @ifname: interface name
203 # @fd: file descriptor of an already opened tap
205 # @fds: multiple file descriptors of already opened multiqueue capable
208 # @script: script to initialize the interface
210 # @downscript: script to shut down the interface
212 # @br: bridge name (since 2.8)
214 # @helper: command to execute to configure bridge
216 # @sndbuf: send buffer limit. Understands [TGMKkb] suffixes.
218 # @vnet_hdr: enable the IFF_VNET_HDR flag on the tap interface
220 # @vhost: enable vhost-net network accelerator
222 # @vhostfd: file descriptor of an already opened vhost net device
224 # @vhostfds: file descriptors of multiple already opened vhost net
227 # @vhostforce: vhost on for non-MSIX virtio guests
229 # @queues: number of queues to be created for multiqueue capable tap
231 # @poll-us: maximum number of microseconds that could be spent on busy
232 # polling for tap (since 2.7)
236 { 'struct': 'NetdevTapOptions',
242 '*downscript': 'str',
250 '*vhostforce': 'bool',
252 '*poll-us': 'uint32'} }
255 # @NetdevSocketOptions:
257 # Socket netdevs are used to establish a network connection to another
258 # QEMU virtual machine via a TCP socket.
260 # @fd: file descriptor of an already opened socket
262 # @listen: port number, and optional hostname, to listen on
264 # @connect: port number, and optional hostname, to connect to
266 # @mcast: UDP multicast address and port number
268 # @localaddr: source address and port for multicast and udp packets
270 # @udp: UDP unicast address and port number
274 { 'struct': 'NetdevSocketOptions',
284 # @NetdevL2TPv3Options:
286 # Configure an Ethernet over L2TPv3 tunnel.
288 # @src: source address
290 # @dst: destination address
292 # @srcport: source port - mandatory for udp, optional for ip
294 # @dstport: destination port - mandatory for udp, optional for ip
296 # @ipv6: force the use of ipv6
298 # @udp: use the udp version of l2tpv3 encapsulation
300 # @cookie64: use 64 bit cookies
302 # @counter: have sequence counter
304 # @pincounter: pin sequence counter to zero - workaround for buggy
305 # implementations or 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 set to the
314 # same value as transmit
316 # @offset: additional offset - allows the insertion of additional
317 # application-specific data before the packet payload
321 { 'struct': 'NetdevL2TPv3Options',
331 '*pincounter': 'bool',
332 '*txcookie': 'uint64',
333 '*rxcookie': 'uint64',
334 'txsession': 'uint32',
335 '*rxsession': 'uint32',
336 '*offset': 'uint32' } }
341 # Connect to a vde switch running on the host.
347 # @group: group owner of socket
349 # @mode: permissions for socket
353 { 'struct': 'NetdevVdeOptions',
358 '*mode': 'uint16' } }
361 # @NetdevBridgeOptions:
363 # Connect a host TAP network interface to a host bridge device.
367 # @helper: command to execute to configure bridge
371 { 'struct': 'NetdevBridgeOptions',
377 # @NetdevHubPortOptions:
379 # Connect two or more net clients through a software hub.
381 # @hubid: hub identifier number
383 # @netdev: used to connect hub to a netdev instead of a device (since
388 { 'struct': 'NetdevHubPortOptions',
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
399 # by netmap, or the name of a VALE port (created on the fly). A
400 # VALE port name is in the form 'valeXXX:YYY', where XXX and YYY
401 # are non-negative integers. XXX identifies a switch and YYY
402 # identifies a port of the switch. VALE ports having the same XXX
403 # are therefore connected to the same switch.
405 # @devname: path of the netmap device (default: '/dev/netmap').
409 { 'struct': 'NetdevNetmapOptions',
412 '*devname': 'str' } }
417 # Attach mode for a default XDP program
419 # @skb: generic mode, no driver support necessary
421 # @native: DRV mode, program is attached to a driver, packets are passed to
422 # the socket without allocation of skb.
426 { 'enum': 'AFXDPMode',
427 'data': [ 'native', 'skb' ],
428 'if': 'CONFIG_AF_XDP' }
431 # @NetdevAFXDPOptions:
433 # AF_XDP network backend
435 # @ifname: The name of an existing network interface.
437 # @mode: Attach mode for a default XDP program. If not specified, then
438 # 'native' will be tried first, then 'skb'.
440 # @force-copy: Force XDP copy mode even if device supports zero-copy.
443 # @queues: number of queues to be used for multiqueue interfaces (default: 1).
445 # @start-queue: Use @queues starting from this queue number (default: 0).
447 # @inhibit: Don't load a default XDP program, use one already loaded to
448 # the interface (default: false). Requires @sock-fds.
450 # @sock-fds: A colon (:) separated list of file descriptors for already open
451 # but not bound AF_XDP sockets in the queue order. One fd per queue.
452 # These descriptors should already be added into XDP socket map for
453 # corresponding queues. Requires @inhibit.
457 { 'struct': 'NetdevAFXDPOptions',
460 '*mode': 'AFXDPMode',
461 '*force-copy': 'bool',
463 '*start-queue': 'int',
465 '*sock-fds': 'str' },
466 'if': 'CONFIG_AF_XDP' }
469 # @NetdevVhostUserOptions:
471 # Vhost-user network backend
473 # @chardev: name of a unix socket chardev
475 # @vhostforce: vhost on for non-MSIX virtio guests (default: false).
477 # @queues: number of queues to be created for multiqueue vhost-user
478 # (default: 1) (Since 2.5)
482 { 'struct': 'NetdevVhostUserOptions',
485 '*vhostforce': 'bool',
489 # @NetdevVhostVDPAOptions:
491 # Vhost-vdpa network backend
493 # vDPA device is a device that uses a datapath which complies with the
494 # virtio specifications with a vendor specific control path.
496 # @vhostdev: path of vhost-vdpa device (default:'/dev/vhost-vdpa-0')
498 # @vhostfd: file descriptor of an already opened vhost vdpa device
500 # @queues: number of queues to be created for multiqueue vhost-vdpa
503 # @x-svq: Start device with (experimental) shadow virtqueue. (Since
504 # 7.1) (default: false)
508 # @unstable: Member @x-svq is experimental.
512 { 'struct': 'NetdevVhostVDPAOptions',
517 '*x-svq': {'type': 'bool', 'features' : [ 'unstable'] } } }
520 # @NetdevVmnetHostOptions:
522 # vmnet (host mode) network backend.
524 # Allows the vmnet interface to communicate with other vmnet
525 # interfaces that are in host mode and also with the host.
527 # @start-address: The starting IPv4 address to use for the interface.
528 # Must be in the private IP range (RFC 1918). Must be specified
529 # along with @end-address and @subnet-mask. This address is used
530 # as the gateway address. The subsequent address up to and
531 # including end-address are placed in the DHCP pool.
533 # @end-address: The DHCP IPv4 range end address to use for the
534 # interface. Must be in the private IP range (RFC 1918). Must be
535 # specified along with @start-address and @subnet-mask.
537 # @subnet-mask: The IPv4 subnet mask to use on the interface. Must be
538 # specified along with @start-address and @subnet-mask.
540 # @isolated: Enable isolation for this interface. Interface isolation
541 # ensures that vmnet interface is not able to communicate with any
542 # other vmnet interfaces. Only communication with host is
543 # allowed. Requires at least macOS Big Sur 11.0.
545 # @net-uuid: The identifier (UUID) to uniquely identify the isolated
546 # network vmnet interface should be added to. If set, no DHCP
547 # service is provided for this interface and network communication
548 # is allowed only with other interfaces added to this network
549 # identified by the UUID. Requires at least macOS Big Sur 11.0.
553 { 'struct': 'NetdevVmnetHostOptions',
555 '*start-address': 'str',
556 '*end-address': 'str',
557 '*subnet-mask': 'str',
559 '*net-uuid': 'str' },
560 'if': 'CONFIG_VMNET' }
563 # @NetdevVmnetSharedOptions:
565 # vmnet (shared mode) network backend.
567 # Allows traffic originating from the vmnet interface to reach the
568 # Internet through a network address translator (NAT). The vmnet
569 # interface can communicate with the host and with other shared mode
570 # interfaces on the same subnet. If no DHCP settings, subnet mask and
571 # IPv6 prefix specified, the interface can communicate with any of
572 # other interfaces in shared mode.
574 # @start-address: The starting IPv4 address to use for the interface.
575 # Must be in the private IP range (RFC 1918). Must be specified
576 # along with @end-address and @subnet-mask. This address is used
577 # as the gateway address. The subsequent address up to and
578 # including end-address are placed in the DHCP pool.
580 # @end-address: The DHCP IPv4 range end address to use for the
581 # interface. Must be in the private IP range (RFC 1918). Must be
582 # specified along with @start-address and @subnet-mask.
584 # @subnet-mask: The IPv4 subnet mask to use on the interface. Must be
585 # specified along with @start-address and @subnet-mask.
587 # @isolated: Enable isolation for this interface. Interface isolation
588 # ensures that vmnet interface is not able to communicate with any
589 # other vmnet interfaces. Only communication with host is
590 # allowed. Requires at least macOS Big Sur 11.0.
592 # @nat66-prefix: The IPv6 prefix to use into guest network. Must be a
593 # unique local address i.e. start with fd00::/8 and have length of
598 { 'struct': 'NetdevVmnetSharedOptions',
600 '*start-address': 'str',
601 '*end-address': 'str',
602 '*subnet-mask': 'str',
604 '*nat66-prefix': 'str' },
605 'if': 'CONFIG_VMNET' }
608 # @NetdevVmnetBridgedOptions:
610 # vmnet (bridged mode) network backend.
612 # Bridges the vmnet interface with a physical network interface.
614 # @ifname: The name of the physical interface to be bridged.
616 # @isolated: Enable isolation for this interface. Interface isolation
617 # ensures that vmnet interface is not able to communicate with any
618 # other vmnet interfaces. Only communication with host is
619 # allowed. Requires at least macOS Big Sur 11.0.
623 { 'struct': 'NetdevVmnetBridgedOptions',
626 '*isolated': 'bool' },
627 'if': 'CONFIG_VMNET' }
630 # @NetdevStreamOptions:
632 # Configuration info for stream socket netdev
634 # @addr: socket address to listen on (server=true) or connect to
637 # @server: create server socket (default: false)
639 # @reconnect: For a client socket, if a socket is disconnected, then
640 # attempt a reconnect after the given number of seconds. Setting
641 # this to zero disables this function. (default: 0) (since 8.0)
643 # Only SocketAddress types 'unix', 'inet' and 'fd' are supported.
647 { 'struct': 'NetdevStreamOptions',
649 'addr': 'SocketAddress',
651 '*reconnect': 'uint32' } }
654 # @NetdevDgramOptions:
656 # Configuration info for datagram socket netdev.
658 # @remote: remote address
660 # @local: local address
662 # Only SocketAddress types 'unix', 'inet' and 'fd' are supported.
664 # If remote address is present and it's a multicast address, local
665 # address is optional. Otherwise local address is required and remote
666 # address is optional.
668 # .. table:: Valid parameters combination table
671 # ============= ======== =====
673 # ============= ======== =====
677 # multicast absent yes
678 # multicast present yes
679 # not multicast absent no
680 # not multicast present yes
681 # ============= ======== =====
685 { 'struct': 'NetdevDgramOptions',
687 '*local': 'SocketAddress',
688 '*remote': 'SocketAddress' } }
693 # Available netdev drivers.
696 # @vhost-vdpa: since 5.1
697 # @vmnet-host: since 7.1
698 # @vmnet-shared: since 7.1
699 # @vmnet-bridged: since 7.1
706 { 'enum': 'NetClientDriver',
707 'data': [ 'none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'stream',
708 'dgram', 'vde', 'bridge', 'hubport', 'netmap', 'vhost-user',
710 { 'name': 'af-xdp', 'if': 'CONFIG_AF_XDP' },
711 { 'name': 'vmnet-host', 'if': 'CONFIG_VMNET' },
712 { 'name': 'vmnet-shared', 'if': 'CONFIG_VMNET' },
713 { 'name': 'vmnet-bridged', 'if': 'CONFIG_VMNET' }] }
718 # Captures the configuration of a network device.
720 # @id: identifier for monitor commands.
722 # @type: Specify the driver used for interpreting remaining arguments.
727 'base': { 'id': 'str', 'type': 'NetClientDriver' },
728 'discriminator': 'type',
730 'nic': 'NetLegacyNicOptions',
731 'user': 'NetdevUserOptions',
732 'tap': 'NetdevTapOptions',
733 'l2tpv3': 'NetdevL2TPv3Options',
734 'socket': 'NetdevSocketOptions',
735 'stream': 'NetdevStreamOptions',
736 'dgram': 'NetdevDgramOptions',
737 'vde': 'NetdevVdeOptions',
738 'bridge': 'NetdevBridgeOptions',
739 'hubport': 'NetdevHubPortOptions',
740 'netmap': 'NetdevNetmapOptions',
741 'af-xdp': { 'type': 'NetdevAFXDPOptions',
742 'if': 'CONFIG_AF_XDP' },
743 'vhost-user': 'NetdevVhostUserOptions',
744 'vhost-vdpa': 'NetdevVhostVDPAOptions',
745 'vmnet-host': { 'type': 'NetdevVmnetHostOptions',
746 'if': 'CONFIG_VMNET' },
747 'vmnet-shared': { 'type': 'NetdevVmnetSharedOptions',
748 'if': 'CONFIG_VMNET' },
749 'vmnet-bridged': { 'type': 'NetdevVmnetBridgedOptions',
750 'if': 'CONFIG_VMNET' } } }
755 # Packets receiving state
757 # @normal: filter assigned packets according to the mac-table
759 # @none: don't receive any assigned packet
761 # @all: receive all assigned packets
765 { 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] }
770 # Rx-filter information for a NIC.
772 # @name: net client name
774 # @promiscuous: whether promiscuous mode is enabled
776 # @multicast: multicast receive state
778 # @unicast: unicast receive state
780 # @vlan: vlan receive state (Since 2.0)
782 # @broadcast-allowed: whether to receive broadcast
784 # @multicast-overflow: multicast table is overflowed or not
786 # @unicast-overflow: unicast table is overflowed or not
788 # @main-mac: the main macaddr string
790 # @vlan-table: a list of active vlan id
792 # @unicast-table: a list of unicast macaddr string
794 # @multicast-table: a list of multicast macaddr string
798 { 'struct': 'RxFilterInfo',
801 'promiscuous': 'bool',
802 'multicast': 'RxState',
803 'unicast': 'RxState',
805 'broadcast-allowed': 'bool',
806 'multicast-overflow': 'bool',
807 'unicast-overflow': 'bool',
809 'vlan-table': ['int'],
810 'unicast-table': ['str'],
811 'multicast-table': ['str'] }}
816 # Return rx-filter information for all NICs (or for the given NIC).
818 # @name: net client name
820 # Returns: list of @RxFilterInfo for all NICs (or for the given NIC).
821 # Returns an error if the given @name doesn't exist, or given NIC
822 # doesn't support rx-filter querying, or given net client isn't a
829 # -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
832 # "promiscuous": true,
834 # "main-mac": "52:54:00:12:34:56",
835 # "unicast": "normal",
843 # "multicast": "normal",
844 # "multicast-overflow": false,
845 # "unicast-overflow": false,
846 # "multicast-table": [
847 # "01:00:5e:00:00:01",
848 # "33:33:00:00:00:01",
849 # "33:33:ff:12:34:56"
851 # "broadcast-allowed": false
856 { 'command': 'query-rx-filter',
857 'data': { '*name': 'str' },
858 'returns': ['RxFilterInfo'] }
861 # @NIC_RX_FILTER_CHANGED:
863 # Emitted once until the 'query-rx-filter' command is executed, the
864 # first event will always be emitted
866 # @name: net client name
874 # <- { "event": "NIC_RX_FILTER_CHANGED",
875 # "data": { "name": "vnet0",
876 # "path": "/machine/peripheral/vnet0/virtio-backend" },
877 # "timestamp": { "seconds": 1368697518, "microseconds": 326866 } }
879 { 'event': 'NIC_RX_FILTER_CHANGED',
880 'data': { '*name': 'str', 'path': 'str' } }
883 # @AnnounceParameters:
885 # Parameters for self-announce timers
887 # @initial: Initial delay (in ms) before sending the first GARP/RARP
890 # @max: Maximum delay (in ms) between GARP/RARP announcement packets
892 # @rounds: Number of self-announcement attempts
894 # @step: Delay increase (in ms) after each self-announcement attempt
896 # @interfaces: An optional list of interface names, which restricts
897 # the announcement to the listed interfaces. (Since 4.1)
899 # @id: A name to be used to identify an instance of announce-timers
900 # and to allow it to modified later. Not for use as part of the
901 # migration parameters. (Since 4.1)
906 { 'struct': 'AnnounceParameters',
907 'data': { 'initial': 'int',
911 '*interfaces': ['str'],
917 # Trigger generation of broadcast RARP frames to update network
918 # switches. This can be useful when network bonds fail-over the
923 # -> { "execute": "announce-self",
925 # "initial": 50, "max": 550, "rounds": 10, "step": 50,
926 # "interfaces": ["vn2", "vn3"], "id": "bob" } }
927 # <- { "return": {} }
931 { 'command': 'announce-self', 'boxed': true,
932 'data' : 'AnnounceParameters'}
935 # @FAILOVER_NEGOTIATED:
937 # Emitted when VIRTIO_NET_F_STANDBY was enabled during feature
938 # negotiation. Failover primary devices which were hidden (not
939 # hotplugged when requested) before will now be hotplugged by the
940 # virtio-net standby device.
942 # @device-id: QEMU device id of the unplugged device
948 # <- { "event": "FAILOVER_NEGOTIATED",
949 # "data": { "device-id": "net1" },
950 # "timestamp": { "seconds": 1368697518, "microseconds": 326866 } }
952 { 'event': 'FAILOVER_NEGOTIATED',
953 'data': {'device-id': 'str'} }
956 # @NETDEV_STREAM_CONNECTED:
958 # Emitted when the netdev stream backend is connected
960 # @netdev-id: QEMU netdev id that is connected
962 # @addr: The destination address
968 # <- { "event": "NETDEV_STREAM_CONNECTED",
969 # "data": { "netdev-id": "netdev0",
970 # "addr": { "port": "47666", "ipv6": true,
971 # "host": "::1", "type": "inet" } },
972 # "timestamp": { "seconds": 1666269863, "microseconds": 311222 } }
974 # <- { "event": "NETDEV_STREAM_CONNECTED",
975 # "data": { "netdev-id": "netdev0",
976 # "addr": { "path": "/tmp/qemu0", "type": "unix" } },
977 # "timestamp": { "seconds": 1666269706, "microseconds": 413651 } }
979 { 'event': 'NETDEV_STREAM_CONNECTED',
980 'data': { 'netdev-id': 'str',
981 'addr': 'SocketAddress' } }
984 # @NETDEV_STREAM_DISCONNECTED:
986 # Emitted when the netdev stream backend is disconnected
988 # @netdev-id: QEMU netdev id that is disconnected
994 # <- { 'event': 'NETDEV_STREAM_DISCONNECTED',
995 # 'data': {'netdev-id': 'netdev0'},
996 # 'timestamp': {'seconds': 1663330937, 'microseconds': 526695} }
998 { 'event': 'NETDEV_STREAM_DISCONNECTED',
999 'data': { 'netdev-id': 'str' } }