9 { 'include': 'common.json' }
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
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
31 # -> { "execute": "set_link",
32 # "arguments": { "name": "e1000.0", "up": false } }
36 { 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
41 # Add a network backend.
43 # Additional arguments depend on the type.
47 # Returns: Nothing on success
48 # If @type is not a valid network backend, DeviceNotFound
52 # -> { "execute": "netdev_add",
53 # "arguments": { "type": "user", "id": "netdev1",
54 # "dnssearch": "example.org" } }
58 { 'command': 'netdev_add', 'data': 'Netdev', 'boxed': true }
63 # Remove a network backend.
65 # @id: the name of the network backend to remove
67 # Returns: Nothing on success
68 # If @id is not a valid network backend, DeviceNotFound
74 # -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
78 { 'command': 'netdev_del', 'data': {'id': 'str'} }
81 # @NetLegacyNicOptions:
83 # Create a new Network Interface Card.
85 # @netdev: id of -netdev to connect to
87 # @macaddr: MAC address
89 # @model: device model (e1000, rtl8139, virtio etc.)
91 # @addr: PCI device address
93 # @vectors: number of MSI-x vectors, 0 to disable MSI-X
97 { 'struct': 'NetLegacyNicOptions',
103 '*vectors': 'uint32' } }
106 # @NetdevUserOptions:
108 # Use the user mode network stack which requires no administrator privilege to
111 # @hostname: client hostname reported by the builtin DHCP server
113 # @restrict: isolate the guest from the host
115 # @ipv4: whether to support IPv4, default true for enabled
118 # @ipv6: whether to support IPv6, default true for enabled
121 # @ip: legacy parameter, use net= instead
123 # @net: IP network address that the guest will see, in the
124 # form addr[/netmask] The netmask is optional, and can be
125 # either in the form a.b.c.d or as a number of valid top-most
126 # bits. Default is 10.0.2.0/24.
128 # @host: guest-visible address of the host
130 # @tftp: root directory of the built-in TFTP server
132 # @bootfile: BOOTP filename, for use with tftp=
134 # @dhcpstart: the first of the 16 IPs the built-in DHCP server can
137 # @dns: guest-visible address of the virtual nameserver
139 # @dnssearch: list of DNS suffixes to search, passed as DHCP option
142 # @domainname: guest-visible domain name of the virtual nameserver
145 # @ipv6-prefix: IPv6 network prefix (default is fec0::) (since
146 # 2.6). The network prefix is given in the usual
147 # hexadecimal IPv6 address notation.
149 # @ipv6-prefixlen: IPv6 network prefix length (default is 64)
152 # @ipv6-host: guest-visible IPv6 address of the host (since 2.6)
154 # @ipv6-dns: guest-visible IPv6 address of the virtual
155 # nameserver (since 2.6)
157 # @smb: root directory of the built-in SMB server
159 # @smbserver: IP address of the built-in SMB server
161 # @hostfwd: redirect incoming TCP or UDP host connections to guest
164 # @guestfwd: forward guest TCP connections
166 # @tftp-server-name: RFC2132 "TFTP server name" string (Since 3.1)
170 { 'struct': 'NetdevUserOptions',
183 '*dnssearch': ['String'],
184 '*domainname': 'str',
185 '*ipv6-prefix': 'str',
186 '*ipv6-prefixlen': 'int',
191 '*hostfwd': ['String'],
192 '*guestfwd': ['String'],
193 '*tftp-server-name': 'str' } }
198 # Used to configure a host TAP network interface backend.
200 # @ifname: interface name
202 # @fd: file descriptor of an already opened tap
204 # @fds: multiple file descriptors of already opened multiqueue capable
207 # @script: script to initialize the interface
209 # @downscript: script to shut down the interface
211 # @br: bridge name (since 2.8)
213 # @helper: command to execute to configure bridge
215 # @sndbuf: send buffer limit. Understands [TGMKkb] suffixes.
217 # @vnet_hdr: enable the IFF_VNET_HDR flag on the tap interface
219 # @vhost: enable vhost-net network accelerator
221 # @vhostfd: file descriptor of an already opened vhost net device
223 # @vhostfds: file descriptors of multiple already opened vhost net
226 # @vhostforce: vhost on for non-MSIX virtio guests
228 # @queues: number of queues to be created for multiqueue capable tap
230 # @poll-us: maximum number of microseconds that could
231 # be spent on busy polling for tap (since 2.7)
235 { 'struct': 'NetdevTapOptions',
241 '*downscript': 'str',
249 '*vhostforce': 'bool',
251 '*poll-us': 'uint32'} }
254 # @NetdevSocketOptions:
256 # Socket netdevs are used to establish a network connection to another
257 # QEMU virtual machine via a TCP socket.
259 # @fd: file descriptor of an already opened socket
261 # @listen: port number, and optional hostname, to listen on
263 # @connect: port number, and optional hostname, to connect to
265 # @mcast: UDP multicast address and port number
267 # @localaddr: source address and port for multicast and udp packets
269 # @udp: UDP unicast address and port number
273 { 'struct': 'NetdevSocketOptions',
283 # @NetdevL2TPv3Options:
285 # Configure an Ethernet over L2TPv3 tunnel.
287 # @src: source address
289 # @dst: destination address
291 # @srcport: source port - mandatory for udp, optional for ip
293 # @dstport: destination port - mandatory for udp, optional for ip
295 # @ipv6: force the use of ipv6
297 # @udp: use the udp version of l2tpv3 encapsulation
299 # @cookie64: use 64 bit coookies
301 # @counter: have sequence counter
303 # @pincounter: pin sequence counter to zero -
304 # workaround for buggy implementations or
305 # 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
314 # set to the same value as transmit
316 # @offset: additional offset - allows the insertion of
317 # additional 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
382 # @netdev: used to connect hub to a netdev instead of a device (since 2.12)
386 { 'struct': 'NetdevHubPortOptions',
392 # @NetdevNetmapOptions:
394 # Connect a client to a netmap-enabled NIC or to a VALE switch port
396 # @ifname: Either the name of an existing network interface supported by
397 # netmap, or the name of a VALE port (created on the fly).
398 # A VALE port name is in the form 'valeXXX:YYY', where XXX and
399 # YYY are non-negative integers. XXX identifies a switch and
400 # YYY identifies a port of the switch. VALE ports having the
401 # same XXX are therefore connected to the same switch.
403 # @devname: path of the netmap device (default: '/dev/netmap').
407 { 'struct': 'NetdevNetmapOptions',
410 '*devname': 'str' } }
413 # @NetdevVhostUserOptions:
415 # Vhost-user network backend
417 # @chardev: name of a unix socket chardev
419 # @vhostforce: vhost on for non-MSIX virtio guests (default: false).
421 # @queues: number of queues to be created for multiqueue vhost-user
422 # (default: 1) (Since 2.5)
426 { 'struct': 'NetdevVhostUserOptions',
429 '*vhostforce': 'bool',
433 # @NetdevVhostVDPAOptions:
435 # Vhost-vdpa network backend
437 # vDPA device is a device that uses a datapath which complies with the virtio
438 # specifications with a vendor specific control path.
440 # @vhostdev: path of vhost-vdpa device
441 # (default:'/dev/vhost-vdpa-0')
443 # @queues: number of queues to be created for multiqueue vhost-vdpa
448 { 'struct': 'NetdevVhostVDPAOptions',
456 # Available netdev drivers.
460 # @vhost-vdpa since 5.1
462 { 'enum': 'NetClientDriver',
463 'data': [ 'none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde',
464 'bridge', 'hubport', 'netmap', 'vhost-user', 'vhost-vdpa' ] }
469 # Captures the configuration of a network device.
471 # @id: identifier for monitor commands.
473 # @type: Specify the driver used for interpreting remaining arguments.
477 # 'l2tpv3' - since 2.1
480 'base': { 'id': 'str', 'type': 'NetClientDriver' },
481 'discriminator': 'type',
483 'nic': 'NetLegacyNicOptions',
484 'user': 'NetdevUserOptions',
485 'tap': 'NetdevTapOptions',
486 'l2tpv3': 'NetdevL2TPv3Options',
487 'socket': 'NetdevSocketOptions',
488 'vde': 'NetdevVdeOptions',
489 'bridge': 'NetdevBridgeOptions',
490 'hubport': 'NetdevHubPortOptions',
491 'netmap': 'NetdevNetmapOptions',
492 'vhost-user': 'NetdevVhostUserOptions',
493 'vhost-vdpa': 'NetdevVhostVDPAOptions' } }
496 # @NetFilterDirection:
498 # Indicates whether a netfilter is attached to a netdev's transmit queue or
499 # receive queue or both.
501 # @all: the filter is attached both to the receive and the transmit
502 # queue of the netdev (default).
504 # @rx: the filter is attached to the receive queue of the netdev,
505 # where it will receive packets sent to the netdev.
507 # @tx: the filter is attached to the transmit queue of the netdev,
508 # where it will receive packets sent by the netdev.
512 { 'enum': 'NetFilterDirection',
513 'data': [ 'all', 'rx', 'tx' ] }
518 # Packets receiving state
520 # @normal: filter assigned packets according to the mac-table
522 # @none: don't receive any assigned packet
524 # @all: receive all assigned packets
528 { 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] }
533 # Rx-filter information for a NIC.
535 # @name: net client name
537 # @promiscuous: whether promiscuous mode is enabled
539 # @multicast: multicast receive state
541 # @unicast: unicast receive state
543 # @vlan: vlan receive state (Since 2.0)
545 # @broadcast-allowed: whether to receive broadcast
547 # @multicast-overflow: multicast table is overflowed or not
549 # @unicast-overflow: unicast table is overflowed or not
551 # @main-mac: the main macaddr string
553 # @vlan-table: a list of active vlan id
555 # @unicast-table: a list of unicast macaddr string
557 # @multicast-table: a list of multicast macaddr string
561 { 'struct': 'RxFilterInfo',
564 'promiscuous': 'bool',
565 'multicast': 'RxState',
566 'unicast': 'RxState',
568 'broadcast-allowed': 'bool',
569 'multicast-overflow': 'bool',
570 'unicast-overflow': 'bool',
572 'vlan-table': ['int'],
573 'unicast-table': ['str'],
574 'multicast-table': ['str'] }}
579 # Return rx-filter information for all NICs (or for the given NIC).
581 # @name: net client name
583 # Returns: list of @RxFilterInfo for all NICs (or for the given NIC).
584 # Returns an error if the given @name doesn't exist, or given
585 # NIC doesn't support rx-filter querying, or given net client
592 # -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
595 # "promiscuous": true,
597 # "main-mac": "52:54:00:12:34:56",
598 # "unicast": "normal",
606 # "multicast": "normal",
607 # "multicast-overflow": false,
608 # "unicast-overflow": false,
609 # "multicast-table": [
610 # "01:00:5e:00:00:01",
611 # "33:33:00:00:00:01",
612 # "33:33:ff:12:34:56"
614 # "broadcast-allowed": false
620 { 'command': 'query-rx-filter',
621 'data': { '*name': 'str' },
622 'returns': ['RxFilterInfo'] }
625 # @NIC_RX_FILTER_CHANGED:
627 # Emitted once until the 'query-rx-filter' command is executed, the first event
628 # will always be emitted
630 # @name: net client name
638 # <- { "event": "NIC_RX_FILTER_CHANGED",
639 # "data": { "name": "vnet0",
640 # "path": "/machine/peripheral/vnet0/virtio-backend" },
641 # "timestamp": { "seconds": 1368697518, "microseconds": 326866 } }
645 { 'event': 'NIC_RX_FILTER_CHANGED',
646 'data': { '*name': 'str', 'path': 'str' } }
649 # @AnnounceParameters:
651 # Parameters for self-announce timers
653 # @initial: Initial delay (in ms) before sending the first GARP/RARP
656 # @max: Maximum delay (in ms) between GARP/RARP announcement packets
658 # @rounds: Number of self-announcement attempts
660 # @step: Delay increase (in ms) after each self-announcement attempt
662 # @interfaces: An optional list of interface names, which restricts the
663 # announcement to the listed interfaces. (Since 4.1)
665 # @id: A name to be used to identify an instance of announce-timers
666 # and to allow it to modified later. Not for use as
667 # part of the migration parameters. (Since 4.1)
672 { 'struct': 'AnnounceParameters',
673 'data': { 'initial': 'int',
677 '*interfaces': ['str'],
683 # Trigger generation of broadcast RARP frames to update network switches.
684 # This can be useful when network bonds fail-over the active slave.
688 # -> { "execute": "announce-self",
690 # "initial": 50, "max": 550, "rounds": 10, "step": 50,
691 # "interfaces": ["vn2", "vn3"], "id": "bob" } }
692 # <- { "return": {} }
696 { 'command': 'announce-self', 'boxed': true,
697 'data' : 'AnnounceParameters'}
700 # @FAILOVER_NEGOTIATED:
702 # Emitted when VIRTIO_NET_F_STANDBY was enabled during feature negotiation.
703 # Failover primary devices which were hidden (not hotplugged when requested)
704 # before will now be hotplugged by the virtio-net standby device.
706 # device-id: QEMU device id of the unplugged device
711 # <- { "event": "FAILOVER_NEGOTIATED",
715 { 'event': 'FAILOVER_NEGOTIATED',
716 'data': {'device-id': 'str'} }