net.json 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996
  1. # -*- Mode: Python -*-
  2. # vim: filetype=python
  3. #
  4. ##
  5. # = Net devices
  6. ##
  7. { 'include': 'common.json' }
  8. { 'include': 'sockets.json' }
  9. ##
  10. # @set_link:
  11. #
  12. # Sets the link status of a virtual network adapter.
  13. #
  14. # @name: the device name of the virtual network adapter
  15. #
  16. # @up: true to set the link status to be up
  17. #
  18. # Returns: Nothing on success If @name is not a valid network device,
  19. # DeviceNotFound
  20. #
  21. # Since: 0.14
  22. #
  23. # Notes: Not all network adapters support setting link status. This
  24. # command will succeed even if the network adapter does not
  25. # support link status notification.
  26. #
  27. # Example:
  28. #
  29. # -> { "execute": "set_link",
  30. # "arguments": { "name": "e1000.0", "up": false } }
  31. # <- { "return": {} }
  32. ##
  33. { 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
  34. ##
  35. # @netdev_add:
  36. #
  37. # Add a network backend.
  38. #
  39. # Additional arguments depend on the type.
  40. #
  41. # Since: 0.14
  42. #
  43. # Returns: Nothing on success If @type is not a valid network backend,
  44. # DeviceNotFound
  45. #
  46. # Example:
  47. #
  48. # -> { "execute": "netdev_add",
  49. # "arguments": { "type": "user", "id": "netdev1",
  50. # "dnssearch": [ { "str": "example.org" } ] } }
  51. # <- { "return": {} }
  52. ##
  53. { 'command': 'netdev_add', 'data': 'Netdev', 'boxed': true,
  54. 'allow-preconfig': true }
  55. ##
  56. # @netdev_del:
  57. #
  58. # Remove a network backend.
  59. #
  60. # @id: the name of the network backend to remove
  61. #
  62. # Returns: Nothing on success If @id is not a valid network backend,
  63. # DeviceNotFound
  64. #
  65. # Since: 0.14
  66. #
  67. # Example:
  68. #
  69. # -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
  70. # <- { "return": {} }
  71. ##
  72. { 'command': 'netdev_del', 'data': {'id': 'str'},
  73. 'allow-preconfig': true }
  74. ##
  75. # @NetLegacyNicOptions:
  76. #
  77. # Create a new Network Interface Card.
  78. #
  79. # @netdev: id of -netdev to connect to
  80. #
  81. # @macaddr: MAC address
  82. #
  83. # @model: device model (e1000, rtl8139, virtio etc.)
  84. #
  85. # @addr: PCI device address
  86. #
  87. # @vectors: number of MSI-x vectors, 0 to disable MSI-X
  88. #
  89. # Since: 1.2
  90. ##
  91. { 'struct': 'NetLegacyNicOptions',
  92. 'data': {
  93. '*netdev': 'str',
  94. '*macaddr': 'str',
  95. '*model': 'str',
  96. '*addr': 'str',
  97. '*vectors': 'uint32' } }
  98. ##
  99. # @NetdevUserOptions:
  100. #
  101. # Use the user mode network stack which requires no administrator
  102. # privilege to run.
  103. #
  104. # @hostname: client hostname reported by the builtin DHCP server
  105. #
  106. # @restrict: isolate the guest from the host
  107. #
  108. # @ipv4: whether to support IPv4, default true for enabled (since 2.6)
  109. #
  110. # @ipv6: whether to support IPv6, default true for enabled (since 2.6)
  111. #
  112. # @ip: legacy parameter, use net= instead
  113. #
  114. # @net: IP network address that the guest will see, in the form
  115. # addr[/netmask] The netmask is optional, and can be either in the
  116. # form a.b.c.d or as a number of valid top-most bits. Default is
  117. # 10.0.2.0/24.
  118. #
  119. # @host: guest-visible address of the host
  120. #
  121. # @tftp: root directory of the built-in TFTP server
  122. #
  123. # @bootfile: BOOTP filename, for use with tftp=
  124. #
  125. # @dhcpstart: the first of the 16 IPs the built-in DHCP server can
  126. # assign
  127. #
  128. # @dns: guest-visible address of the virtual nameserver
  129. #
  130. # @dnssearch: list of DNS suffixes to search, passed as DHCP option to
  131. # the guest
  132. #
  133. # @domainname: guest-visible domain name of the virtual nameserver
  134. # (since 3.0)
  135. #
  136. # @ipv6-prefix: IPv6 network prefix (default is fec0::) (since 2.6).
  137. # The network prefix is given in the usual hexadecimal IPv6
  138. # address notation.
  139. #
  140. # @ipv6-prefixlen: IPv6 network prefix length (default is 64) (since
  141. # 2.6)
  142. #
  143. # @ipv6-host: guest-visible IPv6 address of the host (since 2.6)
  144. #
  145. # @ipv6-dns: guest-visible IPv6 address of the virtual nameserver
  146. # (since 2.6)
  147. #
  148. # @smb: root directory of the built-in SMB server
  149. #
  150. # @smbserver: IP address of the built-in SMB server
  151. #
  152. # @hostfwd: redirect incoming TCP or UDP host connections to guest
  153. # endpoints
  154. #
  155. # @guestfwd: forward guest TCP connections
  156. #
  157. # @tftp-server-name: RFC2132 "TFTP server name" string (Since 3.1)
  158. #
  159. # Since: 1.2
  160. ##
  161. { 'struct': 'NetdevUserOptions',
  162. 'data': {
  163. '*hostname': 'str',
  164. '*restrict': 'bool',
  165. '*ipv4': 'bool',
  166. '*ipv6': 'bool',
  167. '*ip': 'str',
  168. '*net': 'str',
  169. '*host': 'str',
  170. '*tftp': 'str',
  171. '*bootfile': 'str',
  172. '*dhcpstart': 'str',
  173. '*dns': 'str',
  174. '*dnssearch': ['String'],
  175. '*domainname': 'str',
  176. '*ipv6-prefix': 'str',
  177. '*ipv6-prefixlen': 'int',
  178. '*ipv6-host': 'str',
  179. '*ipv6-dns': 'str',
  180. '*smb': 'str',
  181. '*smbserver': 'str',
  182. '*hostfwd': ['String'],
  183. '*guestfwd': ['String'],
  184. '*tftp-server-name': 'str' } }
  185. ##
  186. # @NetdevTapOptions:
  187. #
  188. # Used to configure a host TAP network interface backend.
  189. #
  190. # @ifname: interface name
  191. #
  192. # @fd: file descriptor of an already opened tap
  193. #
  194. # @fds: multiple file descriptors of already opened multiqueue capable
  195. # tap
  196. #
  197. # @script: script to initialize the interface
  198. #
  199. # @downscript: script to shut down the interface
  200. #
  201. # @br: bridge name (since 2.8)
  202. #
  203. # @helper: command to execute to configure bridge
  204. #
  205. # @sndbuf: send buffer limit. Understands [TGMKkb] suffixes.
  206. #
  207. # @vnet_hdr: enable the IFF_VNET_HDR flag on the tap interface
  208. #
  209. # @vhost: enable vhost-net network accelerator
  210. #
  211. # @vhostfd: file descriptor of an already opened vhost net device
  212. #
  213. # @vhostfds: file descriptors of multiple already opened vhost net
  214. # devices
  215. #
  216. # @vhostforce: vhost on for non-MSIX virtio guests
  217. #
  218. # @queues: number of queues to be created for multiqueue capable tap
  219. #
  220. # @poll-us: maximum number of microseconds that could be spent on busy
  221. # polling for tap (since 2.7)
  222. #
  223. # Since: 1.2
  224. ##
  225. { 'struct': 'NetdevTapOptions',
  226. 'data': {
  227. '*ifname': 'str',
  228. '*fd': 'str',
  229. '*fds': 'str',
  230. '*script': 'str',
  231. '*downscript': 'str',
  232. '*br': 'str',
  233. '*helper': 'str',
  234. '*sndbuf': 'size',
  235. '*vnet_hdr': 'bool',
  236. '*vhost': 'bool',
  237. '*vhostfd': 'str',
  238. '*vhostfds': 'str',
  239. '*vhostforce': 'bool',
  240. '*queues': 'uint32',
  241. '*poll-us': 'uint32'} }
  242. ##
  243. # @NetdevSocketOptions:
  244. #
  245. # Socket netdevs are used to establish a network connection to another
  246. # QEMU virtual machine via a TCP socket.
  247. #
  248. # @fd: file descriptor of an already opened socket
  249. #
  250. # @listen: port number, and optional hostname, to listen on
  251. #
  252. # @connect: port number, and optional hostname, to connect to
  253. #
  254. # @mcast: UDP multicast address and port number
  255. #
  256. # @localaddr: source address and port for multicast and udp packets
  257. #
  258. # @udp: UDP unicast address and port number
  259. #
  260. # Since: 1.2
  261. ##
  262. { 'struct': 'NetdevSocketOptions',
  263. 'data': {
  264. '*fd': 'str',
  265. '*listen': 'str',
  266. '*connect': 'str',
  267. '*mcast': 'str',
  268. '*localaddr': 'str',
  269. '*udp': 'str' } }
  270. ##
  271. # @NetdevL2TPv3Options:
  272. #
  273. # Configure an Ethernet over L2TPv3 tunnel.
  274. #
  275. # @src: source address
  276. #
  277. # @dst: destination address
  278. #
  279. # @srcport: source port - mandatory for udp, optional for ip
  280. #
  281. # @dstport: destination port - mandatory for udp, optional for ip
  282. #
  283. # @ipv6: force the use of ipv6
  284. #
  285. # @udp: use the udp version of l2tpv3 encapsulation
  286. #
  287. # @cookie64: use 64 bit cookies
  288. #
  289. # @counter: have sequence counter
  290. #
  291. # @pincounter: pin sequence counter to zero - workaround for buggy
  292. # implementations or networks with packet reorder
  293. #
  294. # @txcookie: 32 or 64 bit transmit cookie
  295. #
  296. # @rxcookie: 32 or 64 bit receive cookie
  297. #
  298. # @txsession: 32 bit transmit session
  299. #
  300. # @rxsession: 32 bit receive session - if not specified set to the
  301. # same value as transmit
  302. #
  303. # @offset: additional offset - allows the insertion of additional
  304. # application-specific data before the packet payload
  305. #
  306. # Since: 2.1
  307. ##
  308. { 'struct': 'NetdevL2TPv3Options',
  309. 'data': {
  310. 'src': 'str',
  311. 'dst': 'str',
  312. '*srcport': 'str',
  313. '*dstport': 'str',
  314. '*ipv6': 'bool',
  315. '*udp': 'bool',
  316. '*cookie64': 'bool',
  317. '*counter': 'bool',
  318. '*pincounter': 'bool',
  319. '*txcookie': 'uint64',
  320. '*rxcookie': 'uint64',
  321. 'txsession': 'uint32',
  322. '*rxsession': 'uint32',
  323. '*offset': 'uint32' } }
  324. ##
  325. # @NetdevVdeOptions:
  326. #
  327. # Connect to a vde switch running on the host.
  328. #
  329. # @sock: socket path
  330. #
  331. # @port: port number
  332. #
  333. # @group: group owner of socket
  334. #
  335. # @mode: permissions for socket
  336. #
  337. # Since: 1.2
  338. ##
  339. { 'struct': 'NetdevVdeOptions',
  340. 'data': {
  341. '*sock': 'str',
  342. '*port': 'uint16',
  343. '*group': 'str',
  344. '*mode': 'uint16' } }
  345. ##
  346. # @NetdevBridgeOptions:
  347. #
  348. # Connect a host TAP network interface to a host bridge device.
  349. #
  350. # @br: bridge name
  351. #
  352. # @helper: command to execute to configure bridge
  353. #
  354. # Since: 1.2
  355. ##
  356. { 'struct': 'NetdevBridgeOptions',
  357. 'data': {
  358. '*br': 'str',
  359. '*helper': 'str' } }
  360. ##
  361. # @NetdevHubPortOptions:
  362. #
  363. # Connect two or more net clients through a software hub.
  364. #
  365. # @hubid: hub identifier number
  366. #
  367. # @netdev: used to connect hub to a netdev instead of a device (since
  368. # 2.12)
  369. #
  370. # Since: 1.2
  371. ##
  372. { 'struct': 'NetdevHubPortOptions',
  373. 'data': {
  374. 'hubid': 'int32',
  375. '*netdev': 'str' } }
  376. ##
  377. # @NetdevNetmapOptions:
  378. #
  379. # Connect a client to a netmap-enabled NIC or to a VALE switch port
  380. #
  381. # @ifname: Either the name of an existing network interface supported
  382. # by netmap, or the name of a VALE port (created on the fly). A
  383. # VALE port name is in the form 'valeXXX:YYY', where XXX and YYY
  384. # are non-negative integers. XXX identifies a switch and YYY
  385. # identifies a port of the switch. VALE ports having the same XXX
  386. # are therefore connected to the same switch.
  387. #
  388. # @devname: path of the netmap device (default: '/dev/netmap').
  389. #
  390. # Since: 2.0
  391. ##
  392. { 'struct': 'NetdevNetmapOptions',
  393. 'data': {
  394. 'ifname': 'str',
  395. '*devname': 'str' } }
  396. ##
  397. # @AFXDPMode:
  398. #
  399. # Attach mode for a default XDP program
  400. #
  401. # @skb: generic mode, no driver support necessary
  402. #
  403. # @native: DRV mode, program is attached to a driver, packets are passed to
  404. # the socket without allocation of skb.
  405. #
  406. # Since: 8.2
  407. ##
  408. { 'enum': 'AFXDPMode',
  409. 'data': [ 'native', 'skb' ],
  410. 'if': 'CONFIG_AF_XDP' }
  411. ##
  412. # @NetdevAFXDPOptions:
  413. #
  414. # AF_XDP network backend
  415. #
  416. # @ifname: The name of an existing network interface.
  417. #
  418. # @mode: Attach mode for a default XDP program. If not specified, then
  419. # 'native' will be tried first, then 'skb'.
  420. #
  421. # @force-copy: Force XDP copy mode even if device supports zero-copy.
  422. # (default: false)
  423. #
  424. # @queues: number of queues to be used for multiqueue interfaces (default: 1).
  425. #
  426. # @start-queue: Use @queues starting from this queue number (default: 0).
  427. #
  428. # @inhibit: Don't load a default XDP program, use one already loaded to
  429. # the interface (default: false). Requires @sock-fds.
  430. #
  431. # @sock-fds: A colon (:) separated list of file descriptors for already open
  432. # but not bound AF_XDP sockets in the queue order. One fd per queue.
  433. # These descriptors should already be added into XDP socket map for
  434. # corresponding queues. Requires @inhibit.
  435. #
  436. # Since: 8.2
  437. ##
  438. { 'struct': 'NetdevAFXDPOptions',
  439. 'data': {
  440. 'ifname': 'str',
  441. '*mode': 'AFXDPMode',
  442. '*force-copy': 'bool',
  443. '*queues': 'int',
  444. '*start-queue': 'int',
  445. '*inhibit': 'bool',
  446. '*sock-fds': 'str' },
  447. 'if': 'CONFIG_AF_XDP' }
  448. ##
  449. # @NetdevVhostUserOptions:
  450. #
  451. # Vhost-user network backend
  452. #
  453. # @chardev: name of a unix socket chardev
  454. #
  455. # @vhostforce: vhost on for non-MSIX virtio guests (default: false).
  456. #
  457. # @queues: number of queues to be created for multiqueue vhost-user
  458. # (default: 1) (Since 2.5)
  459. #
  460. # Since: 2.1
  461. ##
  462. { 'struct': 'NetdevVhostUserOptions',
  463. 'data': {
  464. 'chardev': 'str',
  465. '*vhostforce': 'bool',
  466. '*queues': 'int' } }
  467. ##
  468. # @NetdevVhostVDPAOptions:
  469. #
  470. # Vhost-vdpa network backend
  471. #
  472. # vDPA device is a device that uses a datapath which complies with the
  473. # virtio specifications with a vendor specific control path.
  474. #
  475. # @vhostdev: path of vhost-vdpa device (default:'/dev/vhost-vdpa-0')
  476. #
  477. # @vhostfd: file descriptor of an already opened vhost vdpa device
  478. #
  479. # @queues: number of queues to be created for multiqueue vhost-vdpa
  480. # (default: 1)
  481. #
  482. # @x-svq: Start device with (experimental) shadow virtqueue. (Since
  483. # 7.1) (default: false)
  484. #
  485. # Features:
  486. #
  487. # @unstable: Member @x-svq is experimental.
  488. #
  489. # Since: 5.1
  490. ##
  491. { 'struct': 'NetdevVhostVDPAOptions',
  492. 'data': {
  493. '*vhostdev': 'str',
  494. '*vhostfd': 'str',
  495. '*queues': 'int',
  496. '*x-svq': {'type': 'bool', 'features' : [ 'unstable'] } } }
  497. ##
  498. # @NetdevVmnetHostOptions:
  499. #
  500. # vmnet (host mode) network backend.
  501. #
  502. # Allows the vmnet interface to communicate with other vmnet
  503. # interfaces that are in host mode and also with the host.
  504. #
  505. # @start-address: The starting IPv4 address to use for the interface.
  506. # Must be in the private IP range (RFC 1918). Must be specified
  507. # along with @end-address and @subnet-mask. This address is used
  508. # as the gateway address. The subsequent address up to and
  509. # including end-address are placed in the DHCP pool.
  510. #
  511. # @end-address: The DHCP IPv4 range end address to use for the
  512. # interface. Must be in the private IP range (RFC 1918). Must be
  513. # specified along with @start-address and @subnet-mask.
  514. #
  515. # @subnet-mask: The IPv4 subnet mask to use on the interface. Must be
  516. # specified along with @start-address and @subnet-mask.
  517. #
  518. # @isolated: Enable isolation for this interface. Interface isolation
  519. # ensures that vmnet interface is not able to communicate with any
  520. # other vmnet interfaces. Only communication with host is
  521. # allowed. Requires at least macOS Big Sur 11.0.
  522. #
  523. # @net-uuid: The identifier (UUID) to uniquely identify the isolated
  524. # network vmnet interface should be added to. If set, no DHCP
  525. # service is provided for this interface and network communication
  526. # is allowed only with other interfaces added to this network
  527. # identified by the UUID. Requires at least macOS Big Sur 11.0.
  528. #
  529. # Since: 7.1
  530. ##
  531. { 'struct': 'NetdevVmnetHostOptions',
  532. 'data': {
  533. '*start-address': 'str',
  534. '*end-address': 'str',
  535. '*subnet-mask': 'str',
  536. '*isolated': 'bool',
  537. '*net-uuid': 'str' },
  538. 'if': 'CONFIG_VMNET' }
  539. ##
  540. # @NetdevVmnetSharedOptions:
  541. #
  542. # vmnet (shared mode) network backend.
  543. #
  544. # Allows traffic originating from the vmnet interface to reach the
  545. # Internet through a network address translator (NAT). The vmnet
  546. # interface can communicate with the host and with other shared mode
  547. # interfaces on the same subnet. If no DHCP settings, subnet mask and
  548. # IPv6 prefix specified, the interface can communicate with any of
  549. # other interfaces in shared mode.
  550. #
  551. # @start-address: The starting IPv4 address to use for the interface.
  552. # Must be in the private IP range (RFC 1918). Must be specified
  553. # along with @end-address and @subnet-mask. This address is used
  554. # as the gateway address. The subsequent address up to and
  555. # including end-address are placed in the DHCP pool.
  556. #
  557. # @end-address: The DHCP IPv4 range end address to use for the
  558. # interface. Must be in the private IP range (RFC 1918). Must be
  559. # specified along with @start-address and @subnet-mask.
  560. #
  561. # @subnet-mask: The IPv4 subnet mask to use on the interface. Must be
  562. # specified along with @start-address and @subnet-mask.
  563. #
  564. # @isolated: Enable isolation for this interface. Interface isolation
  565. # ensures that vmnet interface is not able to communicate with any
  566. # other vmnet interfaces. Only communication with host is
  567. # allowed. Requires at least macOS Big Sur 11.0.
  568. #
  569. # @nat66-prefix: The IPv6 prefix to use into guest network. Must be a
  570. # unique local address i.e. start with fd00::/8 and have length of
  571. # 64.
  572. #
  573. # Since: 7.1
  574. ##
  575. { 'struct': 'NetdevVmnetSharedOptions',
  576. 'data': {
  577. '*start-address': 'str',
  578. '*end-address': 'str',
  579. '*subnet-mask': 'str',
  580. '*isolated': 'bool',
  581. '*nat66-prefix': 'str' },
  582. 'if': 'CONFIG_VMNET' }
  583. ##
  584. # @NetdevVmnetBridgedOptions:
  585. #
  586. # vmnet (bridged mode) network backend.
  587. #
  588. # Bridges the vmnet interface with a physical network interface.
  589. #
  590. # @ifname: The name of the physical interface to be bridged.
  591. #
  592. # @isolated: Enable isolation for this interface. Interface isolation
  593. # ensures that vmnet interface is not able to communicate with any
  594. # other vmnet interfaces. Only communication with host is
  595. # allowed. Requires at least macOS Big Sur 11.0.
  596. #
  597. # Since: 7.1
  598. ##
  599. { 'struct': 'NetdevVmnetBridgedOptions',
  600. 'data': {
  601. 'ifname': 'str',
  602. '*isolated': 'bool' },
  603. 'if': 'CONFIG_VMNET' }
  604. ##
  605. # @NetdevStreamOptions:
  606. #
  607. # Configuration info for stream socket netdev
  608. #
  609. # @addr: socket address to listen on (server=true) or connect to
  610. # (server=false)
  611. #
  612. # @server: create server socket (default: false)
  613. #
  614. # @reconnect: For a client socket, if a socket is disconnected, then
  615. # attempt a reconnect after the given number of seconds. Setting
  616. # this to zero disables this function. (default: 0) (since 8.0)
  617. #
  618. # Only SocketAddress types 'unix', 'inet' and 'fd' are supported.
  619. #
  620. # Since: 7.2
  621. ##
  622. { 'struct': 'NetdevStreamOptions',
  623. 'data': {
  624. 'addr': 'SocketAddress',
  625. '*server': 'bool',
  626. '*reconnect': 'uint32' } }
  627. ##
  628. # @NetdevDgramOptions:
  629. #
  630. # Configuration info for datagram socket netdev.
  631. #
  632. # @remote: remote address
  633. #
  634. # @local: local address
  635. #
  636. # Only SocketAddress types 'unix', 'inet' and 'fd' are supported.
  637. #
  638. # If remote address is present and it's a multicast address, local
  639. # address is optional. Otherwise local address is required and remote
  640. # address is optional.
  641. #
  642. # .. table:: Valid parameters combination table
  643. # :widths: auto
  644. #
  645. # ============= ======== =====
  646. # remote local okay?
  647. # ============= ======== =====
  648. # absent absent no
  649. # absent not fd no
  650. # absent fd yes
  651. # multicast absent yes
  652. # multicast present yes
  653. # not multicast absent no
  654. # not multicast present yes
  655. # ============= ======== =====
  656. #
  657. # Since: 7.2
  658. ##
  659. { 'struct': 'NetdevDgramOptions',
  660. 'data': {
  661. '*local': 'SocketAddress',
  662. '*remote': 'SocketAddress' } }
  663. ##
  664. # @NetClientDriver:
  665. #
  666. # Available netdev drivers.
  667. #
  668. # @l2tpv3: since 2.1
  669. # @vhost-vdpa: since 5.1
  670. # @vmnet-host: since 7.1
  671. # @vmnet-shared: since 7.1
  672. # @vmnet-bridged: since 7.1
  673. # @stream: since 7.2
  674. # @dgram: since 7.2
  675. # @af-xdp: since 8.2
  676. #
  677. # Since: 2.7
  678. ##
  679. { 'enum': 'NetClientDriver',
  680. 'data': [ 'none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'stream',
  681. 'dgram', 'vde', 'bridge', 'hubport', 'netmap', 'vhost-user',
  682. 'vhost-vdpa',
  683. { 'name': 'af-xdp', 'if': 'CONFIG_AF_XDP' },
  684. { 'name': 'vmnet-host', 'if': 'CONFIG_VMNET' },
  685. { 'name': 'vmnet-shared', 'if': 'CONFIG_VMNET' },
  686. { 'name': 'vmnet-bridged', 'if': 'CONFIG_VMNET' }] }
  687. ##
  688. # @Netdev:
  689. #
  690. # Captures the configuration of a network device.
  691. #
  692. # @id: identifier for monitor commands.
  693. #
  694. # @type: Specify the driver used for interpreting remaining arguments.
  695. #
  696. # Since: 1.2
  697. ##
  698. { 'union': 'Netdev',
  699. 'base': { 'id': 'str', 'type': 'NetClientDriver' },
  700. 'discriminator': 'type',
  701. 'data': {
  702. 'nic': 'NetLegacyNicOptions',
  703. 'user': 'NetdevUserOptions',
  704. 'tap': 'NetdevTapOptions',
  705. 'l2tpv3': 'NetdevL2TPv3Options',
  706. 'socket': 'NetdevSocketOptions',
  707. 'stream': 'NetdevStreamOptions',
  708. 'dgram': 'NetdevDgramOptions',
  709. 'vde': 'NetdevVdeOptions',
  710. 'bridge': 'NetdevBridgeOptions',
  711. 'hubport': 'NetdevHubPortOptions',
  712. 'netmap': 'NetdevNetmapOptions',
  713. 'af-xdp': { 'type': 'NetdevAFXDPOptions',
  714. 'if': 'CONFIG_AF_XDP' },
  715. 'vhost-user': 'NetdevVhostUserOptions',
  716. 'vhost-vdpa': 'NetdevVhostVDPAOptions',
  717. 'vmnet-host': { 'type': 'NetdevVmnetHostOptions',
  718. 'if': 'CONFIG_VMNET' },
  719. 'vmnet-shared': { 'type': 'NetdevVmnetSharedOptions',
  720. 'if': 'CONFIG_VMNET' },
  721. 'vmnet-bridged': { 'type': 'NetdevVmnetBridgedOptions',
  722. 'if': 'CONFIG_VMNET' } } }
  723. ##
  724. # @RxState:
  725. #
  726. # Packets receiving state
  727. #
  728. # @normal: filter assigned packets according to the mac-table
  729. #
  730. # @none: don't receive any assigned packet
  731. #
  732. # @all: receive all assigned packets
  733. #
  734. # Since: 1.6
  735. ##
  736. { 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] }
  737. ##
  738. # @RxFilterInfo:
  739. #
  740. # Rx-filter information for a NIC.
  741. #
  742. # @name: net client name
  743. #
  744. # @promiscuous: whether promiscuous mode is enabled
  745. #
  746. # @multicast: multicast receive state
  747. #
  748. # @unicast: unicast receive state
  749. #
  750. # @vlan: vlan receive state (Since 2.0)
  751. #
  752. # @broadcast-allowed: whether to receive broadcast
  753. #
  754. # @multicast-overflow: multicast table is overflowed or not
  755. #
  756. # @unicast-overflow: unicast table is overflowed or not
  757. #
  758. # @main-mac: the main macaddr string
  759. #
  760. # @vlan-table: a list of active vlan id
  761. #
  762. # @unicast-table: a list of unicast macaddr string
  763. #
  764. # @multicast-table: a list of multicast macaddr string
  765. #
  766. # Since: 1.6
  767. ##
  768. { 'struct': 'RxFilterInfo',
  769. 'data': {
  770. 'name': 'str',
  771. 'promiscuous': 'bool',
  772. 'multicast': 'RxState',
  773. 'unicast': 'RxState',
  774. 'vlan': 'RxState',
  775. 'broadcast-allowed': 'bool',
  776. 'multicast-overflow': 'bool',
  777. 'unicast-overflow': 'bool',
  778. 'main-mac': 'str',
  779. 'vlan-table': ['int'],
  780. 'unicast-table': ['str'],
  781. 'multicast-table': ['str'] }}
  782. ##
  783. # @query-rx-filter:
  784. #
  785. # Return rx-filter information for all NICs (or for the given NIC).
  786. #
  787. # @name: net client name
  788. #
  789. # Returns: list of @RxFilterInfo for all NICs (or for the given NIC).
  790. # Returns an error if the given @name doesn't exist, or given NIC
  791. # doesn't support rx-filter querying, or given net client isn't a
  792. # NIC.
  793. #
  794. # Since: 1.6
  795. #
  796. # Example:
  797. #
  798. # -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
  799. # <- { "return": [
  800. # {
  801. # "promiscuous": true,
  802. # "name": "vnet0",
  803. # "main-mac": "52:54:00:12:34:56",
  804. # "unicast": "normal",
  805. # "vlan": "normal",
  806. # "vlan-table": [
  807. # 4,
  808. # 0
  809. # ],
  810. # "unicast-table": [
  811. # ],
  812. # "multicast": "normal",
  813. # "multicast-overflow": false,
  814. # "unicast-overflow": false,
  815. # "multicast-table": [
  816. # "01:00:5e:00:00:01",
  817. # "33:33:00:00:00:01",
  818. # "33:33:ff:12:34:56"
  819. # ],
  820. # "broadcast-allowed": false
  821. # }
  822. # ]
  823. # }
  824. ##
  825. { 'command': 'query-rx-filter',
  826. 'data': { '*name': 'str' },
  827. 'returns': ['RxFilterInfo'] }
  828. ##
  829. # @NIC_RX_FILTER_CHANGED:
  830. #
  831. # Emitted once until the 'query-rx-filter' command is executed, the
  832. # first event will always be emitted
  833. #
  834. # @name: net client name
  835. #
  836. # @path: device path
  837. #
  838. # Since: 1.6
  839. #
  840. # Example:
  841. #
  842. # <- { "event": "NIC_RX_FILTER_CHANGED",
  843. # "data": { "name": "vnet0",
  844. # "path": "/machine/peripheral/vnet0/virtio-backend" },
  845. # "timestamp": { "seconds": 1368697518, "microseconds": 326866 } }
  846. ##
  847. { 'event': 'NIC_RX_FILTER_CHANGED',
  848. 'data': { '*name': 'str', 'path': 'str' } }
  849. ##
  850. # @AnnounceParameters:
  851. #
  852. # Parameters for self-announce timers
  853. #
  854. # @initial: Initial delay (in ms) before sending the first GARP/RARP
  855. # announcement
  856. #
  857. # @max: Maximum delay (in ms) between GARP/RARP announcement packets
  858. #
  859. # @rounds: Number of self-announcement attempts
  860. #
  861. # @step: Delay increase (in ms) after each self-announcement attempt
  862. #
  863. # @interfaces: An optional list of interface names, which restricts
  864. # the announcement to the listed interfaces. (Since 4.1)
  865. #
  866. # @id: A name to be used to identify an instance of announce-timers
  867. # and to allow it to modified later. Not for use as part of the
  868. # migration parameters. (Since 4.1)
  869. #
  870. # Since: 4.0
  871. ##
  872. { 'struct': 'AnnounceParameters',
  873. 'data': { 'initial': 'int',
  874. 'max': 'int',
  875. 'rounds': 'int',
  876. 'step': 'int',
  877. '*interfaces': ['str'],
  878. '*id' : 'str' } }
  879. ##
  880. # @announce-self:
  881. #
  882. # Trigger generation of broadcast RARP frames to update network
  883. # switches. This can be useful when network bonds fail-over the
  884. # active slave.
  885. #
  886. # Example:
  887. #
  888. # -> { "execute": "announce-self",
  889. # "arguments": {
  890. # "initial": 50, "max": 550, "rounds": 10, "step": 50,
  891. # "interfaces": ["vn2", "vn3"], "id": "bob" } }
  892. # <- { "return": {} }
  893. #
  894. # Since: 4.0
  895. ##
  896. { 'command': 'announce-self', 'boxed': true,
  897. 'data' : 'AnnounceParameters'}
  898. ##
  899. # @FAILOVER_NEGOTIATED:
  900. #
  901. # Emitted when VIRTIO_NET_F_STANDBY was enabled during feature
  902. # negotiation. Failover primary devices which were hidden (not
  903. # hotplugged when requested) before will now be hotplugged by the
  904. # virtio-net standby device.
  905. #
  906. # @device-id: QEMU device id of the unplugged device
  907. #
  908. # Since: 4.2
  909. #
  910. # Example:
  911. #
  912. # <- { "event": "FAILOVER_NEGOTIATED",
  913. # "data": { "device-id": "net1" },
  914. # "timestamp": { "seconds": 1368697518, "microseconds": 326866 } }
  915. ##
  916. { 'event': 'FAILOVER_NEGOTIATED',
  917. 'data': {'device-id': 'str'} }
  918. ##
  919. # @NETDEV_STREAM_CONNECTED:
  920. #
  921. # Emitted when the netdev stream backend is connected
  922. #
  923. # @netdev-id: QEMU netdev id that is connected
  924. #
  925. # @addr: The destination address
  926. #
  927. # Since: 7.2
  928. #
  929. # Examples:
  930. #
  931. # <- { "event": "NETDEV_STREAM_CONNECTED",
  932. # "data": { "netdev-id": "netdev0",
  933. # "addr": { "port": "47666", "ipv6": true,
  934. # "host": "::1", "type": "inet" } },
  935. # "timestamp": { "seconds": 1666269863, "microseconds": 311222 } }
  936. #
  937. # <- { "event": "NETDEV_STREAM_CONNECTED",
  938. # "data": { "netdev-id": "netdev0",
  939. # "addr": { "path": "/tmp/qemu0", "type": "unix" } },
  940. # "timestamp": { "seconds": 1666269706, "microseconds": 413651 } }
  941. ##
  942. { 'event': 'NETDEV_STREAM_CONNECTED',
  943. 'data': { 'netdev-id': 'str',
  944. 'addr': 'SocketAddress' } }
  945. ##
  946. # @NETDEV_STREAM_DISCONNECTED:
  947. #
  948. # Emitted when the netdev stream backend is disconnected
  949. #
  950. # @netdev-id: QEMU netdev id that is disconnected
  951. #
  952. # Since: 7.2
  953. #
  954. # Example:
  955. #
  956. # <- { 'event': 'NETDEV_STREAM_DISCONNECTED',
  957. # 'data': {'netdev-id': 'netdev0'},
  958. # 'timestamp': {'seconds': 1663330937, 'microseconds': 526695} }
  959. ##
  960. { 'event': 'NETDEV_STREAM_DISCONNECTED',
  961. 'data': { 'netdev-id': 'str' } }