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' } }
498 # Packets receiving state
500 # @normal: filter assigned packets according to the mac-table
502 # @none: don't receive any assigned packet
504 # @all: receive all assigned packets
508 { 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] }
513 # Rx-filter information for a NIC.
515 # @name: net client name
517 # @promiscuous: whether promiscuous mode is enabled
519 # @multicast: multicast receive state
521 # @unicast: unicast receive state
523 # @vlan: vlan receive state (Since 2.0)
525 # @broadcast-allowed: whether to receive broadcast
527 # @multicast-overflow: multicast table is overflowed or not
529 # @unicast-overflow: unicast table is overflowed or not
531 # @main-mac: the main macaddr string
533 # @vlan-table: a list of active vlan id
535 # @unicast-table: a list of unicast macaddr string
537 # @multicast-table: a list of multicast macaddr string
541 { 'struct': 'RxFilterInfo',
544 'promiscuous': 'bool',
545 'multicast': 'RxState',
546 'unicast': 'RxState',
548 'broadcast-allowed': 'bool',
549 'multicast-overflow': 'bool',
550 'unicast-overflow': 'bool',
552 'vlan-table': ['int'],
553 'unicast-table': ['str'],
554 'multicast-table': ['str'] }}
559 # Return rx-filter information for all NICs (or for the given NIC).
561 # @name: net client name
563 # Returns: list of @RxFilterInfo for all NICs (or for the given NIC).
564 # Returns an error if the given @name doesn't exist, or given
565 # NIC doesn't support rx-filter querying, or given net client
572 # -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
575 # "promiscuous": true,
577 # "main-mac": "52:54:00:12:34:56",
578 # "unicast": "normal",
586 # "multicast": "normal",
587 # "multicast-overflow": false,
588 # "unicast-overflow": false,
589 # "multicast-table": [
590 # "01:00:5e:00:00:01",
591 # "33:33:00:00:00:01",
592 # "33:33:ff:12:34:56"
594 # "broadcast-allowed": false
600 { 'command': 'query-rx-filter',
601 'data': { '*name': 'str' },
602 'returns': ['RxFilterInfo'] }
605 # @NIC_RX_FILTER_CHANGED:
607 # Emitted once until the 'query-rx-filter' command is executed, the first event
608 # will always be emitted
610 # @name: net client name
618 # <- { "event": "NIC_RX_FILTER_CHANGED",
619 # "data": { "name": "vnet0",
620 # "path": "/machine/peripheral/vnet0/virtio-backend" },
621 # "timestamp": { "seconds": 1368697518, "microseconds": 326866 } }
625 { 'event': 'NIC_RX_FILTER_CHANGED',
626 'data': { '*name': 'str', 'path': 'str' } }
629 # @AnnounceParameters:
631 # Parameters for self-announce timers
633 # @initial: Initial delay (in ms) before sending the first GARP/RARP
636 # @max: Maximum delay (in ms) between GARP/RARP announcement packets
638 # @rounds: Number of self-announcement attempts
640 # @step: Delay increase (in ms) after each self-announcement attempt
642 # @interfaces: An optional list of interface names, which restricts the
643 # announcement to the listed interfaces. (Since 4.1)
645 # @id: A name to be used to identify an instance of announce-timers
646 # and to allow it to modified later. Not for use as
647 # part of the migration parameters. (Since 4.1)
652 { 'struct': 'AnnounceParameters',
653 'data': { 'initial': 'int',
657 '*interfaces': ['str'],
663 # Trigger generation of broadcast RARP frames to update network switches.
664 # This can be useful when network bonds fail-over the active slave.
668 # -> { "execute": "announce-self",
670 # "initial": 50, "max": 550, "rounds": 10, "step": 50,
671 # "interfaces": ["vn2", "vn3"], "id": "bob" } }
672 # <- { "return": {} }
676 { 'command': 'announce-self', 'boxed': true,
677 'data' : 'AnnounceParameters'}
680 # @FAILOVER_NEGOTIATED:
682 # Emitted when VIRTIO_NET_F_STANDBY was enabled during feature negotiation.
683 # Failover primary devices which were hidden (not hotplugged when requested)
684 # before will now be hotplugged by the virtio-net standby device.
686 # device-id: QEMU device id of the unplugged device
691 # <- { "event": "FAILOVER_NEGOTIATED",
695 { 'event': 'FAILOVER_NEGOTIATED',
696 'data': {'device-id': 'str'} }