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": [ { "str": "example.org" } ] } }
58 { 'command': 'netdev_add', 'data': 'Netdev', 'boxed': true,
59 'allow-preconfig': true }
64 # Remove a network backend.
66 # @id: the name of the network backend to remove
68 # Returns: Nothing on success
69 # If @id is not a valid network backend, DeviceNotFound
75 # -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
79 { 'command': 'netdev_del', 'data': {'id': 'str'},
80 'allow-preconfig': true }
83 # @NetLegacyNicOptions:
85 # Create a new Network Interface Card.
87 # @netdev: id of -netdev to connect to
89 # @macaddr: MAC address
91 # @model: device model (e1000, rtl8139, virtio etc.)
93 # @addr: PCI device address
95 # @vectors: number of MSI-x vectors, 0 to disable MSI-X
99 { 'struct': 'NetLegacyNicOptions',
105 '*vectors': 'uint32' } }
108 # @NetdevUserOptions:
110 # Use the user mode network stack which requires no administrator privilege to
113 # @hostname: client hostname reported by the builtin DHCP server
115 # @restrict: isolate the guest from the host
117 # @ipv4: whether to support IPv4, default true for enabled
120 # @ipv6: whether to support IPv6, default true for enabled
123 # @ip: legacy parameter, use net= instead
125 # @net: IP network address that the guest will see, in the
126 # form addr[/netmask] The netmask is optional, and can be
127 # either in the form a.b.c.d or as a number of valid top-most
128 # bits. Default is 10.0.2.0/24.
130 # @host: guest-visible address of the host
132 # @tftp: root directory of the built-in TFTP server
134 # @bootfile: BOOTP filename, for use with tftp=
136 # @dhcpstart: the first of the 16 IPs the built-in DHCP server can
139 # @dns: guest-visible address of the virtual nameserver
141 # @dnssearch: list of DNS suffixes to search, passed as DHCP option
144 # @domainname: guest-visible domain name of the virtual nameserver
147 # @ipv6-prefix: IPv6 network prefix (default is fec0::) (since
148 # 2.6). The network prefix is given in the usual
149 # hexadecimal IPv6 address notation.
151 # @ipv6-prefixlen: IPv6 network prefix length (default is 64)
154 # @ipv6-host: guest-visible IPv6 address of the host (since 2.6)
156 # @ipv6-dns: guest-visible IPv6 address of the virtual
157 # nameserver (since 2.6)
159 # @smb: root directory of the built-in SMB server
161 # @smbserver: IP address of the built-in SMB server
163 # @hostfwd: redirect incoming TCP or UDP host connections to guest
166 # @guestfwd: forward guest TCP connections
168 # @tftp-server-name: RFC2132 "TFTP server name" string (Since 3.1)
172 { 'struct': 'NetdevUserOptions',
185 '*dnssearch': ['String'],
186 '*domainname': 'str',
187 '*ipv6-prefix': 'str',
188 '*ipv6-prefixlen': 'int',
193 '*hostfwd': ['String'],
194 '*guestfwd': ['String'],
195 '*tftp-server-name': 'str' } }
200 # Used to configure a host TAP network interface backend.
202 # @ifname: interface name
204 # @fd: file descriptor of an already opened tap
206 # @fds: multiple file descriptors of already opened multiqueue capable
209 # @script: script to initialize the interface
211 # @downscript: script to shut down the interface
213 # @br: bridge name (since 2.8)
215 # @helper: command to execute to configure bridge
217 # @sndbuf: send buffer limit. Understands [TGMKkb] suffixes.
219 # @vnet_hdr: enable the IFF_VNET_HDR flag on the tap interface
221 # @vhost: enable vhost-net network accelerator
223 # @vhostfd: file descriptor of an already opened vhost net device
225 # @vhostfds: file descriptors of multiple already opened vhost net
228 # @vhostforce: vhost on for non-MSIX virtio guests
230 # @queues: number of queues to be created for multiqueue capable tap
232 # @poll-us: maximum number of microseconds that could
233 # be spent on busy polling for tap (since 2.7)
237 { 'struct': 'NetdevTapOptions',
243 '*downscript': 'str',
251 '*vhostforce': 'bool',
253 '*poll-us': 'uint32'} }
256 # @NetdevSocketOptions:
258 # Socket netdevs are used to establish a network connection to another
259 # QEMU virtual machine via a TCP socket.
261 # @fd: file descriptor of an already opened socket
263 # @listen: port number, and optional hostname, to listen on
265 # @connect: port number, and optional hostname, to connect to
267 # @mcast: UDP multicast address and port number
269 # @localaddr: source address and port for multicast and udp packets
271 # @udp: UDP unicast address and port number
275 { 'struct': 'NetdevSocketOptions',
285 # @NetdevL2TPv3Options:
287 # Configure an Ethernet over L2TPv3 tunnel.
289 # @src: source address
291 # @dst: destination address
293 # @srcport: source port - mandatory for udp, optional for ip
295 # @dstport: destination port - mandatory for udp, optional for ip
297 # @ipv6: force the use of ipv6
299 # @udp: use the udp version of l2tpv3 encapsulation
301 # @cookie64: use 64 bit coookies
303 # @counter: have sequence counter
305 # @pincounter: pin sequence counter to zero -
306 # workaround for buggy implementations or
307 # networks with packet reorder
309 # @txcookie: 32 or 64 bit transmit cookie
311 # @rxcookie: 32 or 64 bit receive cookie
313 # @txsession: 32 bit transmit session
315 # @rxsession: 32 bit receive session - if not specified
316 # set to the same value as transmit
318 # @offset: additional offset - allows the insertion of
319 # additional application-specific data before the packet payload
323 { 'struct': 'NetdevL2TPv3Options',
333 '*pincounter': 'bool',
334 '*txcookie': 'uint64',
335 '*rxcookie': 'uint64',
336 'txsession': 'uint32',
337 '*rxsession': 'uint32',
338 '*offset': 'uint32' } }
343 # Connect to a vde switch running on the host.
349 # @group: group owner of socket
351 # @mode: permissions for socket
355 { 'struct': 'NetdevVdeOptions',
360 '*mode': 'uint16' } }
363 # @NetdevBridgeOptions:
365 # Connect a host TAP network interface to a host bridge device.
369 # @helper: command to execute to configure bridge
373 { 'struct': 'NetdevBridgeOptions',
379 # @NetdevHubPortOptions:
381 # Connect two or more net clients through a software hub.
383 # @hubid: hub identifier number
384 # @netdev: used to connect hub to a netdev instead of a device (since 2.12)
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 by
399 # netmap, or the name of a VALE port (created on the fly).
400 # A VALE port name is in the form 'valeXXX:YYY', where XXX and
401 # YYY are non-negative integers. XXX identifies a switch and
402 # YYY identifies a port of the switch. VALE ports having the
403 # same XXX are therefore connected to the same switch.
405 # @devname: path of the netmap device (default: '/dev/netmap').
409 { 'struct': 'NetdevNetmapOptions',
412 '*devname': 'str' } }
415 # @NetdevVhostUserOptions:
417 # Vhost-user network backend
419 # @chardev: name of a unix socket chardev
421 # @vhostforce: vhost on for non-MSIX virtio guests (default: false).
423 # @queues: number of queues to be created for multiqueue vhost-user
424 # (default: 1) (Since 2.5)
428 { 'struct': 'NetdevVhostUserOptions',
431 '*vhostforce': 'bool',
435 # @NetdevVhostVDPAOptions:
437 # Vhost-vdpa network backend
439 # vDPA device is a device that uses a datapath which complies with the virtio
440 # specifications with a vendor specific control path.
442 # @vhostdev: path of vhost-vdpa device
443 # (default:'/dev/vhost-vdpa-0')
445 # @queues: number of queues to be created for multiqueue vhost-vdpa
450 { 'struct': 'NetdevVhostVDPAOptions',
458 # Available netdev drivers.
462 # @vhost-vdpa since 5.1
464 { 'enum': 'NetClientDriver',
465 'data': [ 'none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde',
466 'bridge', 'hubport', 'netmap', 'vhost-user', 'vhost-vdpa' ] }
471 # Captures the configuration of a network device.
473 # @id: identifier for monitor commands.
475 # @type: Specify the driver used for interpreting remaining arguments.
479 # 'l2tpv3' - since 2.1
482 'base': { 'id': 'str', 'type': 'NetClientDriver' },
483 'discriminator': 'type',
485 'nic': 'NetLegacyNicOptions',
486 'user': 'NetdevUserOptions',
487 'tap': 'NetdevTapOptions',
488 'l2tpv3': 'NetdevL2TPv3Options',
489 'socket': 'NetdevSocketOptions',
490 'vde': 'NetdevVdeOptions',
491 'bridge': 'NetdevBridgeOptions',
492 'hubport': 'NetdevHubPortOptions',
493 'netmap': 'NetdevNetmapOptions',
494 'vhost-user': 'NetdevVhostUserOptions',
495 'vhost-vdpa': 'NetdevVhostVDPAOptions' } }
500 # Packets receiving state
502 # @normal: filter assigned packets according to the mac-table
504 # @none: don't receive any assigned packet
506 # @all: receive all assigned packets
510 { 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] }
515 # Rx-filter information for a NIC.
517 # @name: net client name
519 # @promiscuous: whether promiscuous mode is enabled
521 # @multicast: multicast receive state
523 # @unicast: unicast receive state
525 # @vlan: vlan receive state (Since 2.0)
527 # @broadcast-allowed: whether to receive broadcast
529 # @multicast-overflow: multicast table is overflowed or not
531 # @unicast-overflow: unicast table is overflowed or not
533 # @main-mac: the main macaddr string
535 # @vlan-table: a list of active vlan id
537 # @unicast-table: a list of unicast macaddr string
539 # @multicast-table: a list of multicast macaddr string
543 { 'struct': 'RxFilterInfo',
546 'promiscuous': 'bool',
547 'multicast': 'RxState',
548 'unicast': 'RxState',
550 'broadcast-allowed': 'bool',
551 'multicast-overflow': 'bool',
552 'unicast-overflow': 'bool',
554 'vlan-table': ['int'],
555 'unicast-table': ['str'],
556 'multicast-table': ['str'] }}
561 # Return rx-filter information for all NICs (or for the given NIC).
563 # @name: net client name
565 # Returns: list of @RxFilterInfo for all NICs (or for the given NIC).
566 # Returns an error if the given @name doesn't exist, or given
567 # NIC doesn't support rx-filter querying, or given net client
574 # -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
577 # "promiscuous": true,
579 # "main-mac": "52:54:00:12:34:56",
580 # "unicast": "normal",
588 # "multicast": "normal",
589 # "multicast-overflow": false,
590 # "unicast-overflow": false,
591 # "multicast-table": [
592 # "01:00:5e:00:00:01",
593 # "33:33:00:00:00:01",
594 # "33:33:ff:12:34:56"
596 # "broadcast-allowed": false
602 { 'command': 'query-rx-filter',
603 'data': { '*name': 'str' },
604 'returns': ['RxFilterInfo'] }
607 # @NIC_RX_FILTER_CHANGED:
609 # Emitted once until the 'query-rx-filter' command is executed, the first event
610 # will always be emitted
612 # @name: net client name
620 # <- { "event": "NIC_RX_FILTER_CHANGED",
621 # "data": { "name": "vnet0",
622 # "path": "/machine/peripheral/vnet0/virtio-backend" },
623 # "timestamp": { "seconds": 1368697518, "microseconds": 326866 } }
627 { 'event': 'NIC_RX_FILTER_CHANGED',
628 'data': { '*name': 'str', 'path': 'str' } }
631 # @AnnounceParameters:
633 # Parameters for self-announce timers
635 # @initial: Initial delay (in ms) before sending the first GARP/RARP
638 # @max: Maximum delay (in ms) between GARP/RARP announcement packets
640 # @rounds: Number of self-announcement attempts
642 # @step: Delay increase (in ms) after each self-announcement attempt
644 # @interfaces: An optional list of interface names, which restricts the
645 # announcement to the listed interfaces. (Since 4.1)
647 # @id: A name to be used to identify an instance of announce-timers
648 # and to allow it to modified later. Not for use as
649 # part of the migration parameters. (Since 4.1)
654 { 'struct': 'AnnounceParameters',
655 'data': { 'initial': 'int',
659 '*interfaces': ['str'],
665 # Trigger generation of broadcast RARP frames to update network switches.
666 # This can be useful when network bonds fail-over the active slave.
670 # -> { "execute": "announce-self",
672 # "initial": 50, "max": 550, "rounds": 10, "step": 50,
673 # "interfaces": ["vn2", "vn3"], "id": "bob" } }
674 # <- { "return": {} }
678 { 'command': 'announce-self', 'boxed': true,
679 'data' : 'AnnounceParameters'}
682 # @FAILOVER_NEGOTIATED:
684 # Emitted when VIRTIO_NET_F_STANDBY was enabled during feature negotiation.
685 # Failover primary devices which were hidden (not hotplugged when requested)
686 # before will now be hotplugged by the virtio-net standby device.
688 # @device-id: QEMU device id of the unplugged device
694 # <- { "event": "FAILOVER_NEGOTIATED",
695 # "data": { "device-id": "net1" },
696 # "timestamp": { "seconds": 1368697518, "microseconds": 326866 } }
699 { 'event': 'FAILOVER_NEGOTIATED',
700 'data': {'device-id': 'str'} }