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
21 # Returns: Nothing on success
22 # If @name is not a valid network device, DeviceNotFound
26 # Notes: Not all network adapters support setting link status. This command
27 # will succeed even if the network adapter does not support link status
32 # -> { "execute": "set_link",
33 # "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.
48 # Returns: Nothing on success
49 # If @type is not a valid network backend, DeviceNotFound
53 # -> { "execute": "netdev_add",
54 # "arguments": { "type": "user", "id": "netdev1",
55 # "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
69 # Returns: Nothing on success
70 # If @id is not a valid network backend, DeviceNotFound
76 # -> { "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 privilege to
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
121 # @ipv6: whether to support IPv6, default true for enabled
124 # @ip: legacy parameter, use net= instead
126 # @net: IP network address that the guest will see, in the
127 # form addr[/netmask] The netmask is optional, and can be
128 # either in the form a.b.c.d or as a number of valid top-most
129 # bits. Default is 10.0.2.0/24.
131 # @host: guest-visible address of the host
133 # @tftp: root directory of the built-in TFTP server
135 # @bootfile: BOOTP filename, for use with tftp=
137 # @dhcpstart: the first of the 16 IPs the built-in DHCP server can
140 # @dns: guest-visible address of the virtual nameserver
142 # @dnssearch: list of DNS suffixes to search, passed as DHCP option
145 # @domainname: guest-visible domain name of the virtual nameserver
148 # @ipv6-prefix: IPv6 network prefix (default is fec0::) (since
149 # 2.6). The network prefix is given in the usual
150 # hexadecimal IPv6 address notation.
152 # @ipv6-prefixlen: IPv6 network prefix length (default is 64)
155 # @ipv6-host: guest-visible IPv6 address of the host (since 2.6)
157 # @ipv6-dns: guest-visible IPv6 address of the virtual
158 # nameserver (since 2.6)
160 # @smb: root directory of the built-in SMB server
162 # @smbserver: IP address of the built-in SMB server
164 # @hostfwd: redirect incoming TCP or UDP host connections to guest
167 # @guestfwd: forward guest TCP connections
169 # @tftp-server-name: RFC2132 "TFTP server name" string (Since 3.1)
173 { 'struct': 'NetdevUserOptions',
186 '*dnssearch': ['String'],
187 '*domainname': 'str',
188 '*ipv6-prefix': 'str',
189 '*ipv6-prefixlen': 'int',
194 '*hostfwd': ['String'],
195 '*guestfwd': ['String'],
196 '*tftp-server-name': 'str' } }
201 # Used to configure a host TAP network interface backend.
203 # @ifname: interface name
205 # @fd: file descriptor of an already opened tap
207 # @fds: multiple file descriptors of already opened multiqueue capable
210 # @script: script to initialize the interface
212 # @downscript: script to shut down the interface
214 # @br: bridge name (since 2.8)
216 # @helper: command to execute to configure bridge
218 # @sndbuf: send buffer limit. Understands [TGMKkb] suffixes.
220 # @vnet_hdr: enable the IFF_VNET_HDR flag on the tap interface
222 # @vhost: enable vhost-net network accelerator
224 # @vhostfd: file descriptor of an already opened vhost net device
226 # @vhostfds: file descriptors of multiple already opened vhost net
229 # @vhostforce: vhost on for non-MSIX virtio guests
231 # @queues: number of queues to be created for multiqueue capable tap
233 # @poll-us: maximum number of microseconds that could
234 # be spent on busy polling for tap (since 2.7)
238 { 'struct': 'NetdevTapOptions',
244 '*downscript': 'str',
252 '*vhostforce': 'bool',
254 '*poll-us': 'uint32'} }
257 # @NetdevSocketOptions:
259 # Socket netdevs are used to establish a network connection to another
260 # QEMU virtual machine via a TCP socket.
262 # @fd: file descriptor of an already opened socket
264 # @listen: port number, and optional hostname, to listen on
266 # @connect: port number, and optional hostname, to connect to
268 # @mcast: UDP multicast address and port number
270 # @localaddr: source address and port for multicast and udp packets
272 # @udp: UDP unicast address and port number
276 { 'struct': 'NetdevSocketOptions',
286 # @NetdevL2TPv3Options:
288 # Configure an Ethernet over L2TPv3 tunnel.
290 # @src: source address
292 # @dst: destination address
294 # @srcport: source port - mandatory for udp, optional for ip
296 # @dstport: destination port - mandatory for udp, optional for ip
298 # @ipv6: force the use of ipv6
300 # @udp: use the udp version of l2tpv3 encapsulation
302 # @cookie64: use 64 bit cookies
304 # @counter: have sequence counter
306 # @pincounter: pin sequence counter to zero -
307 # workaround for buggy implementations or
308 # networks with packet reorder
310 # @txcookie: 32 or 64 bit transmit cookie
312 # @rxcookie: 32 or 64 bit receive cookie
314 # @txsession: 32 bit transmit session
316 # @rxsession: 32 bit receive session - if not specified
317 # set to the same value as transmit
319 # @offset: additional offset - allows the insertion of
320 # additional application-specific data before the packet payload
324 { 'struct': 'NetdevL2TPv3Options',
334 '*pincounter': 'bool',
335 '*txcookie': 'uint64',
336 '*rxcookie': 'uint64',
337 'txsession': 'uint32',
338 '*rxsession': 'uint32',
339 '*offset': 'uint32' } }
344 # Connect to a vde switch running on the host.
350 # @group: group owner of socket
352 # @mode: permissions for socket
356 { 'struct': 'NetdevVdeOptions',
361 '*mode': 'uint16' } }
364 # @NetdevBridgeOptions:
366 # Connect a host TAP network interface to a host bridge device.
370 # @helper: command to execute to configure bridge
374 { 'struct': 'NetdevBridgeOptions',
380 # @NetdevHubPortOptions:
382 # Connect two or more net clients through a software hub.
384 # @hubid: hub identifier number
385 # @netdev: used to connect hub to a netdev instead of a device (since 2.12)
389 { 'struct': 'NetdevHubPortOptions',
395 # @NetdevNetmapOptions:
397 # Connect a client to a netmap-enabled NIC or to a VALE switch port
399 # @ifname: Either the name of an existing network interface supported by
400 # netmap, or the name of a VALE port (created on the fly).
401 # A VALE port name is in the form 'valeXXX:YYY', where XXX and
402 # YYY are non-negative integers. XXX identifies a switch and
403 # YYY identifies a port of the switch. VALE ports having the
404 # same XXX are therefore connected to the same switch.
406 # @devname: path of the netmap device (default: '/dev/netmap').
410 { 'struct': 'NetdevNetmapOptions',
413 '*devname': 'str' } }
416 # @NetdevVhostUserOptions:
418 # Vhost-user network backend
420 # @chardev: name of a unix socket chardev
422 # @vhostforce: vhost on for non-MSIX virtio guests (default: false).
424 # @queues: number of queues to be created for multiqueue vhost-user
425 # (default: 1) (Since 2.5)
429 { 'struct': 'NetdevVhostUserOptions',
432 '*vhostforce': 'bool',
436 # @NetdevVhostVDPAOptions:
438 # Vhost-vdpa network backend
440 # vDPA device is a device that uses a datapath which complies with the virtio
441 # specifications with a vendor specific control path.
443 # @vhostdev: path of vhost-vdpa device
444 # (default:'/dev/vhost-vdpa-0')
446 # @vhostfd: file descriptor of an already opened vhost vdpa device
448 # @queues: number of queues to be created for multiqueue vhost-vdpa
451 # @x-svq: Start device with (experimental) shadow virtqueue. (Since 7.1)
455 # @unstable: Member @x-svq is experimental.
459 { 'struct': 'NetdevVhostVDPAOptions',
464 '*x-svq': {'type': 'bool', 'features' : [ 'unstable'] } } }
467 # @NetdevVmnetHostOptions:
469 # vmnet (host mode) network backend.
471 # Allows the vmnet interface to communicate with other vmnet
472 # interfaces that are in host mode and also with the host.
474 # @start-address: The starting IPv4 address to use for the interface.
475 # Must be in the private IP range (RFC 1918). Must be
476 # specified along with @end-address and @subnet-mask.
477 # This address is used as the gateway address. The
478 # subsequent address up to and including end-address are
479 # placed in the DHCP pool.
481 # @end-address: The DHCP IPv4 range end address to use for the
482 # interface. Must be in the private IP range (RFC 1918).
483 # Must be specified along with @start-address and
486 # @subnet-mask: The IPv4 subnet mask to use on the interface. Must
487 # be specified along with @start-address and @subnet-mask.
489 # @isolated: Enable isolation for this interface. Interface isolation
490 # ensures that vmnet interface is not able to communicate
491 # with any other vmnet interfaces. Only communication with
492 # host is allowed. Requires at least macOS Big Sur 11.0.
494 # @net-uuid: The identifier (UUID) to uniquely identify the isolated
495 # network vmnet interface should be added to. If
496 # set, no DHCP service is provided for this interface and
497 # network communication is allowed only with other interfaces
498 # added to this network identified by the UUID. Requires
499 # at least macOS Big Sur 11.0.
503 { 'struct': 'NetdevVmnetHostOptions',
505 '*start-address': 'str',
506 '*end-address': 'str',
507 '*subnet-mask': 'str',
509 '*net-uuid': 'str' },
510 'if': 'CONFIG_VMNET' }
513 # @NetdevVmnetSharedOptions:
515 # vmnet (shared mode) network backend.
517 # Allows traffic originating from the vmnet interface to reach the
518 # Internet through a network address translator (NAT).
519 # The vmnet interface can communicate with the host and with
520 # other shared mode interfaces on the same subnet. If no DHCP
521 # settings, subnet mask and IPv6 prefix specified, the interface can
522 # communicate with any of other interfaces in shared mode.
524 # @start-address: The starting IPv4 address to use for the interface.
525 # Must be in the private IP range (RFC 1918). Must be
526 # specified along with @end-address and @subnet-mask.
527 # This address is used as the gateway address. The
528 # subsequent address up to and including end-address are
529 # placed in the DHCP pool.
531 # @end-address: The DHCP IPv4 range end address to use for the
532 # interface. Must be in the private IP range (RFC 1918).
533 # Must be specified along with @start-address and @subnet-mask.
535 # @subnet-mask: The IPv4 subnet mask to use on the interface. Must
536 # be specified along with @start-address and @subnet-mask.
538 # @isolated: Enable isolation for this interface. Interface isolation
539 # ensures that vmnet interface is not able to communicate
540 # with any other vmnet interfaces. Only communication with
541 # host is allowed. Requires at least macOS Big Sur 11.0.
543 # @nat66-prefix: The IPv6 prefix to use into guest network. Must be a
544 # unique local address i.e. start with fd00::/8 and have
549 { 'struct': 'NetdevVmnetSharedOptions',
551 '*start-address': 'str',
552 '*end-address': 'str',
553 '*subnet-mask': 'str',
555 '*nat66-prefix': 'str' },
556 'if': 'CONFIG_VMNET' }
559 # @NetdevVmnetBridgedOptions:
561 # vmnet (bridged mode) network backend.
563 # Bridges the vmnet interface with a physical network interface.
565 # @ifname: The name of the physical interface to be bridged.
567 # @isolated: Enable isolation for this interface. Interface isolation
568 # ensures that vmnet interface is not able to communicate
569 # with any other vmnet interfaces. Only communication with
570 # host is allowed. Requires at least macOS Big Sur 11.0.
574 { 'struct': 'NetdevVmnetBridgedOptions',
577 '*isolated': 'bool' },
578 'if': 'CONFIG_VMNET' }
581 # @NetdevStreamOptions:
583 # Configuration info for stream socket netdev
585 # @addr: socket address to listen on (server=true)
586 # or connect to (server=false)
587 # @server: create server socket (default: false)
589 # Only SocketAddress types 'unix', 'inet' and 'fd' are supported.
593 { 'struct': 'NetdevStreamOptions',
595 'addr': 'SocketAddress',
596 '*server': 'bool' } }
599 # @NetdevDgramOptions:
601 # Configuration info for datagram socket netdev.
603 # @remote: remote address
604 # @local: local address
606 # Only SocketAddress types 'unix', 'inet' and 'fd' are supported.
608 # If remote address is present and it's a multicast address, local address
609 # is optional. Otherwise local address is required and remote address is
612 # .. table:: Valid parameters combination table
615 # ============= ======== =====
617 # ============= ======== =====
621 # multicast absent yes
622 # multicast present yes
623 # not multicast absent no
624 # not multicast present yes
625 # ============= ======== =====
629 { 'struct': 'NetdevDgramOptions',
631 '*local': 'SocketAddress',
632 '*remote': 'SocketAddress' } }
637 # Available netdev drivers.
641 # @vhost-vdpa since 5.1
642 # @vmnet-host since 7.1
643 # @vmnet-shared since 7.1
644 # @vmnet-bridged since 7.1
648 { 'enum': 'NetClientDriver',
649 'data': [ 'none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'stream',
650 'dgram', 'vde', 'bridge', 'hubport', 'netmap', 'vhost-user',
652 { 'name': 'vmnet-host', 'if': 'CONFIG_VMNET' },
653 { 'name': 'vmnet-shared', 'if': 'CONFIG_VMNET' },
654 { 'name': 'vmnet-bridged', 'if': 'CONFIG_VMNET' }] }
659 # Captures the configuration of a network device.
661 # @id: identifier for monitor commands.
663 # @type: Specify the driver used for interpreting remaining arguments.
667 # 'l2tpv3' - since 2.1
668 # 'vmnet-host' - since 7.1
669 # 'vmnet-shared' - since 7.1
670 # 'vmnet-bridged' - since 7.1
675 'base': { 'id': 'str', 'type': 'NetClientDriver' },
676 'discriminator': 'type',
678 'nic': 'NetLegacyNicOptions',
679 'user': 'NetdevUserOptions',
680 'tap': 'NetdevTapOptions',
681 'l2tpv3': 'NetdevL2TPv3Options',
682 'socket': 'NetdevSocketOptions',
683 'stream': 'NetdevStreamOptions',
684 'dgram': 'NetdevDgramOptions',
685 'vde': 'NetdevVdeOptions',
686 'bridge': 'NetdevBridgeOptions',
687 'hubport': 'NetdevHubPortOptions',
688 'netmap': 'NetdevNetmapOptions',
689 'vhost-user': 'NetdevVhostUserOptions',
690 'vhost-vdpa': 'NetdevVhostVDPAOptions',
691 'vmnet-host': { 'type': 'NetdevVmnetHostOptions',
692 'if': 'CONFIG_VMNET' },
693 'vmnet-shared': { 'type': 'NetdevVmnetSharedOptions',
694 'if': 'CONFIG_VMNET' },
695 'vmnet-bridged': { 'type': 'NetdevVmnetBridgedOptions',
696 'if': 'CONFIG_VMNET' } } }
701 # Packets receiving state
703 # @normal: filter assigned packets according to the mac-table
705 # @none: don't receive any assigned packet
707 # @all: receive all assigned packets
711 { 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] }
716 # Rx-filter information for a NIC.
718 # @name: net client name
720 # @promiscuous: whether promiscuous mode is enabled
722 # @multicast: multicast receive state
724 # @unicast: unicast receive state
726 # @vlan: vlan receive state (Since 2.0)
728 # @broadcast-allowed: whether to receive broadcast
730 # @multicast-overflow: multicast table is overflowed or not
732 # @unicast-overflow: unicast table is overflowed or not
734 # @main-mac: the main macaddr string
736 # @vlan-table: a list of active vlan id
738 # @unicast-table: a list of unicast macaddr string
740 # @multicast-table: a list of multicast macaddr string
744 { 'struct': 'RxFilterInfo',
747 'promiscuous': 'bool',
748 'multicast': 'RxState',
749 'unicast': 'RxState',
751 'broadcast-allowed': 'bool',
752 'multicast-overflow': 'bool',
753 'unicast-overflow': 'bool',
755 'vlan-table': ['int'],
756 'unicast-table': ['str'],
757 'multicast-table': ['str'] }}
762 # Return rx-filter information for all NICs (or for the given NIC).
764 # @name: net client name
766 # Returns: list of @RxFilterInfo for all NICs (or for the given NIC).
767 # Returns an error if the given @name doesn't exist, or given
768 # NIC doesn't support rx-filter querying, or given net client
775 # -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
778 # "promiscuous": true,
780 # "main-mac": "52:54:00:12:34:56",
781 # "unicast": "normal",
789 # "multicast": "normal",
790 # "multicast-overflow": false,
791 # "unicast-overflow": false,
792 # "multicast-table": [
793 # "01:00:5e:00:00:01",
794 # "33:33:00:00:00:01",
795 # "33:33:ff:12:34:56"
797 # "broadcast-allowed": false
803 { 'command': 'query-rx-filter',
804 'data': { '*name': 'str' },
805 'returns': ['RxFilterInfo'] }
808 # @NIC_RX_FILTER_CHANGED:
810 # Emitted once until the 'query-rx-filter' command is executed, the first event
811 # will always be emitted
813 # @name: net client name
821 # <- { "event": "NIC_RX_FILTER_CHANGED",
822 # "data": { "name": "vnet0",
823 # "path": "/machine/peripheral/vnet0/virtio-backend" },
824 # "timestamp": { "seconds": 1368697518, "microseconds": 326866 } }
827 { 'event': 'NIC_RX_FILTER_CHANGED',
828 'data': { '*name': 'str', 'path': 'str' } }
831 # @AnnounceParameters:
833 # Parameters for self-announce timers
835 # @initial: Initial delay (in ms) before sending the first GARP/RARP
838 # @max: Maximum delay (in ms) between GARP/RARP announcement packets
840 # @rounds: Number of self-announcement attempts
842 # @step: Delay increase (in ms) after each self-announcement attempt
844 # @interfaces: An optional list of interface names, which restricts the
845 # announcement to the listed interfaces. (Since 4.1)
847 # @id: A name to be used to identify an instance of announce-timers
848 # and to allow it to modified later. Not for use as
849 # part of the migration parameters. (Since 4.1)
854 { 'struct': 'AnnounceParameters',
855 'data': { 'initial': 'int',
859 '*interfaces': ['str'],
865 # Trigger generation of broadcast RARP frames to update network switches.
866 # This can be useful when network bonds fail-over the active slave.
870 # -> { "execute": "announce-self",
872 # "initial": 50, "max": 550, "rounds": 10, "step": 50,
873 # "interfaces": ["vn2", "vn3"], "id": "bob" } }
874 # <- { "return": {} }
878 { 'command': 'announce-self', 'boxed': true,
879 'data' : 'AnnounceParameters'}
882 # @FAILOVER_NEGOTIATED:
884 # Emitted when VIRTIO_NET_F_STANDBY was enabled during feature negotiation.
885 # Failover primary devices which were hidden (not hotplugged when requested)
886 # before will now be hotplugged by the virtio-net standby device.
888 # @device-id: QEMU device id of the unplugged device
894 # <- { "event": "FAILOVER_NEGOTIATED",
895 # "data": { "device-id": "net1" },
896 # "timestamp": { "seconds": 1368697518, "microseconds": 326866 } }
899 { 'event': 'FAILOVER_NEGOTIATED',
900 'data': {'device-id': 'str'} }
903 # @NETDEV_STREAM_CONNECTED:
905 # Emitted when the netdev stream backend is connected
907 # @netdev-id: QEMU netdev id that is connected
908 # @addr: The destination address
914 # <- { "event": "NETDEV_STREAM_CONNECTED",
915 # "data": { "netdev-id": "netdev0",
916 # "addr": { "port": "47666", "ipv6": true,
917 # "host": "::1", "type": "inet" } },
918 # "timestamp": { "seconds": 1666269863, "microseconds": 311222 } }
922 # <- { "event": "NETDEV_STREAM_CONNECTED",
923 # "data": { "netdev-id": "netdev0",
924 # "addr": { "path": "/tmp/qemu0", "type": "unix" } },
925 # "timestamp": { "seconds": 1666269706, "microseconds": 413651 } }
928 { 'event': 'NETDEV_STREAM_CONNECTED',
929 'data': { 'netdev-id': 'str',
930 'addr': 'SocketAddress' } }
933 # @NETDEV_STREAM_DISCONNECTED:
935 # Emitted when the netdev stream backend is disconnected
937 # @netdev-id: QEMU netdev id that is disconnected
943 # <- { 'event': 'NETDEV_STREAM_DISCONNECTED',
944 # 'data': {'netdev-id': 'netdev0'},
945 # 'timestamp': {'seconds': 1663330937, 'microseconds': 526695} }
948 { 'event': 'NETDEV_STREAM_DISCONNECTED',
949 'data': { 'netdev-id': 'str' } }