net.json 26 KB

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