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)
588 # @reconnect: For a client socket, if a socket is disconnected,
589 # then attempt a reconnect after the given number of seconds.
590 # Setting this to zero disables this function. (default: 0)
593 # Only SocketAddress types 'unix', 'inet' and 'fd' are supported.
597 { 'struct': 'NetdevStreamOptions',
599 'addr': 'SocketAddress',
601 '*reconnect': 'uint32' } }
604 # @NetdevDgramOptions:
606 # Configuration info for datagram socket netdev.
608 # @remote: remote address
609 # @local: local address
611 # Only SocketAddress types 'unix', 'inet' and 'fd' are supported.
613 # If remote address is present and it's a multicast address, local address
614 # is optional. Otherwise local address is required and remote address is
617 # .. table:: Valid parameters combination table
620 # ============= ======== =====
622 # ============= ======== =====
626 # multicast absent yes
627 # multicast present yes
628 # not multicast absent no
629 # not multicast present yes
630 # ============= ======== =====
634 { 'struct': 'NetdevDgramOptions',
636 '*local': 'SocketAddress',
637 '*remote': 'SocketAddress' } }
642 # Available netdev drivers.
646 # @vhost-vdpa since 5.1
647 # @vmnet-host since 7.1
648 # @vmnet-shared since 7.1
649 # @vmnet-bridged since 7.1
653 { 'enum': 'NetClientDriver',
654 'data': [ 'none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'stream',
655 'dgram', 'vde', 'bridge', 'hubport', 'netmap', 'vhost-user',
657 { 'name': 'vmnet-host', 'if': 'CONFIG_VMNET' },
658 { 'name': 'vmnet-shared', 'if': 'CONFIG_VMNET' },
659 { 'name': 'vmnet-bridged', 'if': 'CONFIG_VMNET' }] }
664 # Captures the configuration of a network device.
666 # @id: identifier for monitor commands.
668 # @type: Specify the driver used for interpreting remaining arguments.
672 # 'l2tpv3' - since 2.1
673 # 'vmnet-host' - since 7.1
674 # 'vmnet-shared' - since 7.1
675 # 'vmnet-bridged' - since 7.1
680 'base': { 'id': 'str', 'type': 'NetClientDriver' },
681 'discriminator': 'type',
683 'nic': 'NetLegacyNicOptions',
684 'user': 'NetdevUserOptions',
685 'tap': 'NetdevTapOptions',
686 'l2tpv3': 'NetdevL2TPv3Options',
687 'socket': 'NetdevSocketOptions',
688 'stream': 'NetdevStreamOptions',
689 'dgram': 'NetdevDgramOptions',
690 'vde': 'NetdevVdeOptions',
691 'bridge': 'NetdevBridgeOptions',
692 'hubport': 'NetdevHubPortOptions',
693 'netmap': 'NetdevNetmapOptions',
694 'vhost-user': 'NetdevVhostUserOptions',
695 'vhost-vdpa': 'NetdevVhostVDPAOptions',
696 'vmnet-host': { 'type': 'NetdevVmnetHostOptions',
697 'if': 'CONFIG_VMNET' },
698 'vmnet-shared': { 'type': 'NetdevVmnetSharedOptions',
699 'if': 'CONFIG_VMNET' },
700 'vmnet-bridged': { 'type': 'NetdevVmnetBridgedOptions',
701 'if': 'CONFIG_VMNET' } } }
706 # Packets receiving state
708 # @normal: filter assigned packets according to the mac-table
710 # @none: don't receive any assigned packet
712 # @all: receive all assigned packets
716 { 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] }
721 # Rx-filter information for a NIC.
723 # @name: net client name
725 # @promiscuous: whether promiscuous mode is enabled
727 # @multicast: multicast receive state
729 # @unicast: unicast receive state
731 # @vlan: vlan receive state (Since 2.0)
733 # @broadcast-allowed: whether to receive broadcast
735 # @multicast-overflow: multicast table is overflowed or not
737 # @unicast-overflow: unicast table is overflowed or not
739 # @main-mac: the main macaddr string
741 # @vlan-table: a list of active vlan id
743 # @unicast-table: a list of unicast macaddr string
745 # @multicast-table: a list of multicast macaddr string
749 { 'struct': 'RxFilterInfo',
752 'promiscuous': 'bool',
753 'multicast': 'RxState',
754 'unicast': 'RxState',
756 'broadcast-allowed': 'bool',
757 'multicast-overflow': 'bool',
758 'unicast-overflow': 'bool',
760 'vlan-table': ['int'],
761 'unicast-table': ['str'],
762 'multicast-table': ['str'] }}
767 # Return rx-filter information for all NICs (or for the given NIC).
769 # @name: net client name
771 # Returns: list of @RxFilterInfo for all NICs (or for the given NIC).
772 # Returns an error if the given @name doesn't exist, or given
773 # NIC doesn't support rx-filter querying, or given net client
780 # -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
783 # "promiscuous": true,
785 # "main-mac": "52:54:00:12:34:56",
786 # "unicast": "normal",
794 # "multicast": "normal",
795 # "multicast-overflow": false,
796 # "unicast-overflow": false,
797 # "multicast-table": [
798 # "01:00:5e:00:00:01",
799 # "33:33:00:00:00:01",
800 # "33:33:ff:12:34:56"
802 # "broadcast-allowed": false
808 { 'command': 'query-rx-filter',
809 'data': { '*name': 'str' },
810 'returns': ['RxFilterInfo'] }
813 # @NIC_RX_FILTER_CHANGED:
815 # Emitted once until the 'query-rx-filter' command is executed, the first event
816 # will always be emitted
818 # @name: net client name
826 # <- { "event": "NIC_RX_FILTER_CHANGED",
827 # "data": { "name": "vnet0",
828 # "path": "/machine/peripheral/vnet0/virtio-backend" },
829 # "timestamp": { "seconds": 1368697518, "microseconds": 326866 } }
832 { 'event': 'NIC_RX_FILTER_CHANGED',
833 'data': { '*name': 'str', 'path': 'str' } }
836 # @AnnounceParameters:
838 # Parameters for self-announce timers
840 # @initial: Initial delay (in ms) before sending the first GARP/RARP
843 # @max: Maximum delay (in ms) between GARP/RARP announcement packets
845 # @rounds: Number of self-announcement attempts
847 # @step: Delay increase (in ms) after each self-announcement attempt
849 # @interfaces: An optional list of interface names, which restricts the
850 # announcement to the listed interfaces. (Since 4.1)
852 # @id: A name to be used to identify an instance of announce-timers
853 # and to allow it to modified later. Not for use as
854 # part of the migration parameters. (Since 4.1)
859 { 'struct': 'AnnounceParameters',
860 'data': { 'initial': 'int',
864 '*interfaces': ['str'],
870 # Trigger generation of broadcast RARP frames to update network switches.
871 # This can be useful when network bonds fail-over the active slave.
875 # -> { "execute": "announce-self",
877 # "initial": 50, "max": 550, "rounds": 10, "step": 50,
878 # "interfaces": ["vn2", "vn3"], "id": "bob" } }
879 # <- { "return": {} }
883 { 'command': 'announce-self', 'boxed': true,
884 'data' : 'AnnounceParameters'}
887 # @FAILOVER_NEGOTIATED:
889 # Emitted when VIRTIO_NET_F_STANDBY was enabled during feature negotiation.
890 # Failover primary devices which were hidden (not hotplugged when requested)
891 # before will now be hotplugged by the virtio-net standby device.
893 # @device-id: QEMU device id of the unplugged device
899 # <- { "event": "FAILOVER_NEGOTIATED",
900 # "data": { "device-id": "net1" },
901 # "timestamp": { "seconds": 1368697518, "microseconds": 326866 } }
904 { 'event': 'FAILOVER_NEGOTIATED',
905 'data': {'device-id': 'str'} }
908 # @NETDEV_STREAM_CONNECTED:
910 # Emitted when the netdev stream backend is connected
912 # @netdev-id: QEMU netdev id that is connected
913 # @addr: The destination address
919 # <- { "event": "NETDEV_STREAM_CONNECTED",
920 # "data": { "netdev-id": "netdev0",
921 # "addr": { "port": "47666", "ipv6": true,
922 # "host": "::1", "type": "inet" } },
923 # "timestamp": { "seconds": 1666269863, "microseconds": 311222 } }
927 # <- { "event": "NETDEV_STREAM_CONNECTED",
928 # "data": { "netdev-id": "netdev0",
929 # "addr": { "path": "/tmp/qemu0", "type": "unix" } },
930 # "timestamp": { "seconds": 1666269706, "microseconds": 413651 } }
933 { 'event': 'NETDEV_STREAM_CONNECTED',
934 'data': { 'netdev-id': 'str',
935 'addr': 'SocketAddress' } }
938 # @NETDEV_STREAM_DISCONNECTED:
940 # Emitted when the netdev stream backend is disconnected
942 # @netdev-id: QEMU netdev id that is disconnected
948 # <- { 'event': 'NETDEV_STREAM_DISCONNECTED',
949 # 'data': {'netdev-id': 'netdev0'},
950 # 'timestamp': {'seconds': 1663330937, 'microseconds': 526695} }
953 { 'event': 'NETDEV_STREAM_DISCONNECTED',
954 'data': { 'netdev-id': 'str' } }