virtio.json 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008
  1. # -*- Mode: Python -*-
  2. # vim: filetype=python
  3. #
  4. ##
  5. # = Virtio devices
  6. ##
  7. ##
  8. # @VirtioInfo:
  9. #
  10. # Basic information about a given VirtIODevice
  11. #
  12. # @path: The VirtIODevice's canonical QOM path
  13. #
  14. # @name: Name of the VirtIODevice
  15. #
  16. # Since: 7.2
  17. ##
  18. { 'struct': 'VirtioInfo',
  19. 'data': { 'path': 'str',
  20. 'name': 'str' } }
  21. ##
  22. # @x-query-virtio:
  23. #
  24. # Returns a list of all realized VirtIODevices
  25. #
  26. # Features:
  27. #
  28. # @unstable: This command is meant for debugging.
  29. #
  30. # Returns: List of gathered VirtIODevices
  31. #
  32. # Since: 7.2
  33. #
  34. # .. qmp-example::
  35. #
  36. # -> { "execute": "x-query-virtio" }
  37. # <- { "return": [
  38. # {
  39. # "name": "virtio-input",
  40. # "path": "/machine/peripheral-anon/device[4]/virtio-backend"
  41. # },
  42. # {
  43. # "name": "virtio-crypto",
  44. # "path": "/machine/peripheral/crypto0/virtio-backend"
  45. # },
  46. # {
  47. # "name": "virtio-scsi",
  48. # "path": "/machine/peripheral-anon/device[2]/virtio-backend"
  49. # },
  50. # {
  51. # "name": "virtio-net",
  52. # "path": "/machine/peripheral-anon/device[1]/virtio-backend"
  53. # },
  54. # {
  55. # "name": "virtio-serial",
  56. # "path": "/machine/peripheral-anon/device[0]/virtio-backend"
  57. # }
  58. # ]
  59. # }
  60. ##
  61. { 'command': 'x-query-virtio',
  62. 'returns': [ 'VirtioInfo' ],
  63. 'features': [ 'unstable' ] }
  64. ##
  65. # @VhostStatus:
  66. #
  67. # Information about a vhost device. This information will only be
  68. # displayed if the vhost device is active.
  69. #
  70. # @n-mem-sections: vhost_dev n_mem_sections
  71. #
  72. # @n-tmp-sections: vhost_dev n_tmp_sections
  73. #
  74. # @nvqs: vhost_dev nvqs (number of virtqueues being used)
  75. #
  76. # @vq-index: vhost_dev vq_index
  77. #
  78. # @features: vhost_dev features
  79. #
  80. # @acked-features: vhost_dev acked_features
  81. #
  82. # @backend-features: vhost_dev backend_features
  83. #
  84. # @protocol-features: vhost_dev protocol_features
  85. #
  86. # @max-queues: vhost_dev max_queues
  87. #
  88. # @backend-cap: vhost_dev backend_cap
  89. #
  90. # @log-enabled: vhost_dev log_enabled flag
  91. #
  92. # @log-size: vhost_dev log_size
  93. #
  94. # Since: 7.2
  95. ##
  96. { 'struct': 'VhostStatus',
  97. 'data': { 'n-mem-sections': 'int',
  98. 'n-tmp-sections': 'int',
  99. 'nvqs': 'uint32',
  100. 'vq-index': 'int',
  101. 'features': 'VirtioDeviceFeatures',
  102. 'acked-features': 'VirtioDeviceFeatures',
  103. 'backend-features': 'VirtioDeviceFeatures',
  104. 'protocol-features': 'VhostDeviceProtocols',
  105. 'max-queues': 'uint64',
  106. 'backend-cap': 'uint64',
  107. 'log-enabled': 'bool',
  108. 'log-size': 'uint64' } }
  109. ##
  110. # @VirtioStatus:
  111. #
  112. # Full status of the virtio device with most VirtIODevice members.
  113. # Also includes the full status of the corresponding vhost device if
  114. # the vhost device is active.
  115. #
  116. # @name: VirtIODevice name
  117. #
  118. # @device-id: VirtIODevice ID
  119. #
  120. # @vhost-started: VirtIODevice vhost_started flag
  121. #
  122. # @guest-features: VirtIODevice guest_features
  123. #
  124. # @host-features: VirtIODevice host_features
  125. #
  126. # @backend-features: VirtIODevice backend_features
  127. #
  128. # @device-endian: VirtIODevice device_endian
  129. #
  130. # @num-vqs: VirtIODevice virtqueue count. This is the number of
  131. # active virtqueues being used by the VirtIODevice.
  132. #
  133. # @status: VirtIODevice configuration status (VirtioDeviceStatus)
  134. #
  135. # @isr: VirtIODevice ISR
  136. #
  137. # @queue-sel: VirtIODevice queue_sel
  138. #
  139. # @vm-running: VirtIODevice vm_running flag
  140. #
  141. # @broken: VirtIODevice broken flag
  142. #
  143. # @disabled: VirtIODevice disabled flag
  144. #
  145. # @use-started: VirtIODevice use_started flag
  146. #
  147. # @started: VirtIODevice started flag
  148. #
  149. # @start-on-kick: VirtIODevice start_on_kick flag
  150. #
  151. # @disable-legacy-check: VirtIODevice disabled_legacy_check flag
  152. #
  153. # @bus-name: VirtIODevice bus_name
  154. #
  155. # @use-guest-notifier-mask: VirtIODevice use_guest_notifier_mask flag
  156. #
  157. # @vhost-dev: Corresponding vhost device info for a given
  158. # VirtIODevice. Present if the given VirtIODevice has an active
  159. # vhost device.
  160. #
  161. # Since: 7.2
  162. ##
  163. { 'struct': 'VirtioStatus',
  164. 'data': { 'name': 'str',
  165. 'device-id': 'uint16',
  166. 'vhost-started': 'bool',
  167. 'device-endian': 'str',
  168. 'guest-features': 'VirtioDeviceFeatures',
  169. 'host-features': 'VirtioDeviceFeatures',
  170. 'backend-features': 'VirtioDeviceFeatures',
  171. 'num-vqs': 'int',
  172. 'status': 'VirtioDeviceStatus',
  173. 'isr': 'uint8',
  174. 'queue-sel': 'uint16',
  175. 'vm-running': 'bool',
  176. 'broken': 'bool',
  177. 'disabled': 'bool',
  178. 'use-started': 'bool',
  179. 'started': 'bool',
  180. 'start-on-kick': 'bool',
  181. 'disable-legacy-check': 'bool',
  182. 'bus-name': 'str',
  183. 'use-guest-notifier-mask': 'bool',
  184. '*vhost-dev': 'VhostStatus' } }
  185. ##
  186. # @x-query-virtio-status:
  187. #
  188. # Poll for a comprehensive status of a given virtio device
  189. #
  190. # @path: Canonical QOM path of the VirtIODevice
  191. #
  192. # Features:
  193. #
  194. # @unstable: This command is meant for debugging.
  195. #
  196. # Returns: VirtioStatus of the virtio device
  197. #
  198. # Since: 7.2
  199. #
  200. # .. qmp-example::
  201. # :annotated:
  202. #
  203. # Poll for the status of virtio-crypto (no vhost-crypto active)
  204. # ::
  205. #
  206. # -> { "execute": "x-query-virtio-status",
  207. # "arguments": { "path": "/machine/peripheral/crypto0/virtio-backend" }
  208. # }
  209. # <- { "return": {
  210. # "device-endian": "little",
  211. # "bus-name": "",
  212. # "disable-legacy-check": false,
  213. # "name": "virtio-crypto",
  214. # "started": true,
  215. # "device-id": 20,
  216. # "backend-features": {
  217. # "transports": [],
  218. # "dev-features": []
  219. # },
  220. # "start-on-kick": false,
  221. # "isr": 1,
  222. # "broken": false,
  223. # "status": {
  224. # "statuses": [
  225. # "VIRTIO_CONFIG_S_ACKNOWLEDGE: Valid virtio device found",
  226. # "VIRTIO_CONFIG_S_DRIVER: Guest OS compatible with device",
  227. # "VIRTIO_CONFIG_S_FEATURES_OK: Feature negotiation complete",
  228. # "VIRTIO_CONFIG_S_DRIVER_OK: Driver setup and ready"
  229. # ]
  230. # },
  231. # "num-vqs": 2,
  232. # "guest-features": {
  233. # "dev-features": [],
  234. # "transports": [
  235. # "VIRTIO_RING_F_EVENT_IDX: Used & avail. event fields enabled",
  236. # "VIRTIO_RING_F_INDIRECT_DESC: Indirect descriptors supported",
  237. # "VIRTIO_F_VERSION_1: Device compliant for v1 spec (legacy)"
  238. # ]
  239. # },
  240. # "host-features": {
  241. # "unknown-dev-features": 1073741824,
  242. # "dev-features": [],
  243. # "transports": [
  244. # "VIRTIO_RING_F_EVENT_IDX: Used & avail. event fields enabled",
  245. # "VIRTIO_RING_F_INDIRECT_DESC: Indirect descriptors supported",
  246. # "VIRTIO_F_VERSION_1: Device compliant for v1 spec (legacy)",
  247. # "VIRTIO_F_ANY_LAYOUT: Device accepts arbitrary desc. layouts",
  248. # "VIRTIO_F_NOTIFY_ON_EMPTY: Notify when device runs out of avail. descs. on VQ"
  249. # ]
  250. # },
  251. # "use-guest-notifier-mask": true,
  252. # "vm-running": true,
  253. # "queue-sel": 1,
  254. # "disabled": false,
  255. # "vhost-started": false,
  256. # "use-started": true
  257. # }
  258. # }
  259. #
  260. # .. qmp-example::
  261. # :annotated:
  262. #
  263. # Poll for the status of virtio-net (vhost-net is active)
  264. # ::
  265. #
  266. # -> { "execute": "x-query-virtio-status",
  267. # "arguments": { "path": "/machine/peripheral-anon/device[1]/virtio-backend" }
  268. # }
  269. # <- { "return": {
  270. # "device-endian": "little",
  271. # "bus-name": "",
  272. # "disabled-legacy-check": false,
  273. # "name": "virtio-net",
  274. # "started": true,
  275. # "device-id": 1,
  276. # "vhost-dev": {
  277. # "n-tmp-sections": 4,
  278. # "n-mem-sections": 4,
  279. # "max-queues": 1,
  280. # "backend-cap": 2,
  281. # "log-size": 0,
  282. # "backend-features": {
  283. # "dev-features": [],
  284. # "transports": []
  285. # },
  286. # "nvqs": 2,
  287. # "protocol-features": {
  288. # "protocols": []
  289. # },
  290. # "vq-index": 0,
  291. # "log-enabled": false,
  292. # "acked-features": {
  293. # "dev-features": [
  294. # "VIRTIO_NET_F_MRG_RXBUF: Driver can merge receive buffers"
  295. # ],
  296. # "transports": [
  297. # "VIRTIO_RING_F_EVENT_IDX: Used & avail. event fields enabled",
  298. # "VIRTIO_RING_F_INDIRECT_DESC: Indirect descriptors supported",
  299. # "VIRTIO_F_VERSION_1: Device compliant for v1 spec (legacy)"
  300. # ]
  301. # },
  302. # "features": {
  303. # "dev-features": [
  304. # "VHOST_F_LOG_ALL: Logging write descriptors supported",
  305. # "VIRTIO_NET_F_MRG_RXBUF: Driver can merge receive buffers"
  306. # ],
  307. # "transports": [
  308. # "VIRTIO_RING_F_EVENT_IDX: Used & avail. event fields enabled",
  309. # "VIRTIO_RING_F_INDIRECT_DESC: Indirect descriptors supported",
  310. # "VIRTIO_F_IOMMU_PLATFORM: Device can be used on IOMMU platform",
  311. # "VIRTIO_F_VERSION_1: Device compliant for v1 spec (legacy)",
  312. # "VIRTIO_F_ANY_LAYOUT: Device accepts arbitrary desc. layouts",
  313. # "VIRTIO_F_NOTIFY_ON_EMPTY: Notify when device runs out of avail. descs. on VQ"
  314. # ]
  315. # }
  316. # },
  317. # "backend-features": {
  318. # "dev-features": [
  319. # "VHOST_USER_F_PROTOCOL_FEATURES: Vhost-user protocol features negotiation supported",
  320. # "VIRTIO_NET_F_GSO: Handling GSO-type packets supported",
  321. # "VIRTIO_NET_F_CTRL_MAC_ADDR: MAC address set through control channel",
  322. # "VIRTIO_NET_F_GUEST_ANNOUNCE: Driver sending gratuitous packets supported",
  323. # "VIRTIO_NET_F_CTRL_RX_EXTRA: Extra RX mode control supported",
  324. # "VIRTIO_NET_F_CTRL_VLAN: Control channel VLAN filtering supported",
  325. # "VIRTIO_NET_F_CTRL_RX: Control channel RX mode supported",
  326. # "VIRTIO_NET_F_CTRL_VQ: Control channel available",
  327. # "VIRTIO_NET_F_STATUS: Configuration status field available",
  328. # "VIRTIO_NET_F_MRG_RXBUF: Driver can merge receive buffers",
  329. # "VIRTIO_NET_F_HOST_UFO: Device can receive UFO",
  330. # "VIRTIO_NET_F_HOST_ECN: Device can receive TSO with ECN",
  331. # "VIRTIO_NET_F_HOST_TSO6: Device can receive TSOv6",
  332. # "VIRTIO_NET_F_HOST_TSO4: Device can receive TSOv4",
  333. # "VIRTIO_NET_F_GUEST_UFO: Driver can receive UFO",
  334. # "VIRTIO_NET_F_GUEST_ECN: Driver can receive TSO with ECN",
  335. # "VIRTIO_NET_F_GUEST_TSO6: Driver can receive TSOv6",
  336. # "VIRTIO_NET_F_GUEST_TSO4: Driver can receive TSOv4",
  337. # "VIRTIO_NET_F_MAC: Device has given MAC address",
  338. # "VIRTIO_NET_F_CTRL_GUEST_OFFLOADS: Control channel offloading reconfig. supported",
  339. # "VIRTIO_NET_F_GUEST_CSUM: Driver handling packets with partial checksum supported",
  340. # "VIRTIO_NET_F_CSUM: Device handling packets with partial checksum supported"
  341. # ],
  342. # "transports": [
  343. # "VIRTIO_RING_F_EVENT_IDX: Used & avail. event fields enabled",
  344. # "VIRTIO_RING_F_INDIRECT_DESC: Indirect descriptors supported",
  345. # "VIRTIO_F_VERSION_1: Device compliant for v1 spec (legacy)",
  346. # "VIRTIO_F_ANY_LAYOUT: Device accepts arbitrary desc. layouts",
  347. # "VIRTIO_F_NOTIFY_ON_EMPTY: Notify when device runs out of avail. descs. on VQ"
  348. # ]
  349. # },
  350. # "start-on-kick": false,
  351. # "isr": 1,
  352. # "broken": false,
  353. # "status": {
  354. # "statuses": [
  355. # "VIRTIO_CONFIG_S_ACKNOWLEDGE: Valid virtio device found",
  356. # "VIRTIO_CONFIG_S_DRIVER: Guest OS compatible with device",
  357. # "VIRTIO_CONFIG_S_FEATURES_OK: Feature negotiation complete",
  358. # "VIRTIO_CONFIG_S_DRIVER_OK: Driver setup and ready"
  359. # ]
  360. # },
  361. # "num-vqs": 3,
  362. # "guest-features": {
  363. # "dev-features": [
  364. # "VIRTIO_NET_F_CTRL_MAC_ADDR: MAC address set through control channel",
  365. # "VIRTIO_NET_F_GUEST_ANNOUNCE: Driver sending gratuitous packets supported",
  366. # "VIRTIO_NET_F_CTRL_VLAN: Control channel VLAN filtering supported",
  367. # "VIRTIO_NET_F_CTRL_RX: Control channel RX mode supported",
  368. # "VIRTIO_NET_F_CTRL_VQ: Control channel available",
  369. # "VIRTIO_NET_F_STATUS: Configuration status field available",
  370. # "VIRTIO_NET_F_MRG_RXBUF: Driver can merge receive buffers",
  371. # "VIRTIO_NET_F_HOST_UFO: Device can receive UFO",
  372. # "VIRTIO_NET_F_HOST_ECN: Device can receive TSO with ECN",
  373. # "VIRTIO_NET_F_HOST_TSO6: Device can receive TSOv6",
  374. # "VIRTIO_NET_F_HOST_TSO4: Device can receive TSOv4",
  375. # "VIRTIO_NET_F_GUEST_UFO: Driver can receive UFO",
  376. # "VIRTIO_NET_F_GUEST_ECN: Driver can receive TSO with ECN",
  377. # "VIRTIO_NET_F_GUEST_TSO6: Driver can receive TSOv6",
  378. # "VIRTIO_NET_F_GUEST_TSO4: Driver can receive TSOv4",
  379. # "VIRTIO_NET_F_MAC: Device has given MAC address",
  380. # "VIRTIO_NET_F_CTRL_GUEST_OFFLOADS: Control channel offloading reconfig. supported",
  381. # "VIRTIO_NET_F_GUEST_CSUM: Driver handling packets with partial checksum supported",
  382. # "VIRTIO_NET_F_CSUM: Device handling packets with partial checksum supported"
  383. # ],
  384. # "transports": [
  385. # "VIRTIO_RING_F_EVENT_IDX: Used & avail. event fields enabled",
  386. # "VIRTIO_RING_F_INDIRECT_DESC: Indirect descriptors supported",
  387. # "VIRTIO_F_VERSION_1: Device compliant for v1 spec (legacy)"
  388. # ]
  389. # },
  390. # "host-features": {
  391. # "dev-features": [
  392. # "VHOST_USER_F_PROTOCOL_FEATURES: Vhost-user protocol features negotiation supported",
  393. # "VIRTIO_NET_F_GSO: Handling GSO-type packets supported",
  394. # "VIRTIO_NET_F_CTRL_MAC_ADDR: MAC address set through control channel",
  395. # "VIRTIO_NET_F_GUEST_ANNOUNCE: Driver sending gratuitous packets supported",
  396. # "VIRTIO_NET_F_CTRL_RX_EXTRA: Extra RX mode control supported",
  397. # "VIRTIO_NET_F_CTRL_VLAN: Control channel VLAN filtering supported",
  398. # "VIRTIO_NET_F_CTRL_RX: Control channel RX mode supported",
  399. # "VIRTIO_NET_F_CTRL_VQ: Control channel available",
  400. # "VIRTIO_NET_F_STATUS: Configuration status field available",
  401. # "VIRTIO_NET_F_MRG_RXBUF: Driver can merge receive buffers",
  402. # "VIRTIO_NET_F_HOST_UFO: Device can receive UFO",
  403. # "VIRTIO_NET_F_HOST_ECN: Device can receive TSO with ECN",
  404. # "VIRTIO_NET_F_HOST_TSO6: Device can receive TSOv6",
  405. # "VIRTIO_NET_F_HOST_TSO4: Device can receive TSOv4",
  406. # "VIRTIO_NET_F_GUEST_UFO: Driver can receive UFO",
  407. # "VIRTIO_NET_F_GUEST_ECN: Driver can receive TSO with ECN",
  408. # "VIRTIO_NET_F_GUEST_TSO6: Driver can receive TSOv6",
  409. # "VIRTIO_NET_F_GUEST_TSO4: Driver can receive TSOv4",
  410. # "VIRTIO_NET_F_MAC: Device has given MAC address",
  411. # "VIRTIO_NET_F_CTRL_GUEST_OFFLOADS: Control channel offloading reconfig. supported",
  412. # "VIRTIO_NET_F_GUEST_CSUM: Driver handling packets with partial checksum supported",
  413. # "VIRTIO_NET_F_CSUM: Device handling packets with partial checksum supported"
  414. # ],
  415. # "transports": [
  416. # "VIRTIO_RING_F_EVENT_IDX: Used & avail. event fields enabled",
  417. # "VIRTIO_RING_F_INDIRECT_DESC: Indirect descriptors supported",
  418. # "VIRTIO_F_VERSION_1: Device compliant for v1 spec (legacy)",
  419. # "VIRTIO_F_ANY_LAYOUT: Device accepts arbitrary desc. layouts",
  420. # "VIRTIO_F_NOTIFY_ON_EMPTY: Notify when device runs out of avail. descs. on VQ"
  421. # ]
  422. # },
  423. # "use-guest-notifier-mask": true,
  424. # "vm-running": true,
  425. # "queue-sel": 2,
  426. # "disabled": false,
  427. # "vhost-started": true,
  428. # "use-started": true
  429. # }
  430. # }
  431. ##
  432. { 'command': 'x-query-virtio-status',
  433. 'data': { 'path': 'str' },
  434. 'returns': 'VirtioStatus',
  435. 'features': [ 'unstable' ] }
  436. ##
  437. # @VirtioDeviceStatus:
  438. #
  439. # A structure defined to list the configuration statuses of a virtio
  440. # device
  441. #
  442. # @statuses: List of decoded configuration statuses of the virtio
  443. # device
  444. #
  445. # @unknown-statuses: Virtio device statuses bitmap that have not been
  446. # decoded
  447. #
  448. # Since: 7.2
  449. ##
  450. { 'struct': 'VirtioDeviceStatus',
  451. 'data': { 'statuses': [ 'str' ],
  452. '*unknown-statuses': 'uint8' } }
  453. ##
  454. # @VhostDeviceProtocols:
  455. #
  456. # A structure defined to list the vhost user protocol features of a
  457. # Vhost User device
  458. #
  459. # @protocols: List of decoded vhost user protocol features of a vhost
  460. # user device
  461. #
  462. # @unknown-protocols: Vhost user device protocol features bitmap that
  463. # have not been decoded
  464. #
  465. # Since: 7.2
  466. ##
  467. { 'struct': 'VhostDeviceProtocols',
  468. 'data': { 'protocols': [ 'str' ],
  469. '*unknown-protocols': 'uint64' } }
  470. ##
  471. # @VirtioDeviceFeatures:
  472. #
  473. # The common fields that apply to most Virtio devices. Some devices
  474. # may not have their own device-specific features (e.g. virtio-rng).
  475. #
  476. # @transports: List of transport features of the virtio device
  477. #
  478. # @dev-features: List of device-specific features (if the device has
  479. # unique features)
  480. #
  481. # @unknown-dev-features: Virtio device features bitmap that have not
  482. # been decoded
  483. #
  484. # Since: 7.2
  485. ##
  486. { 'struct': 'VirtioDeviceFeatures',
  487. 'data': { 'transports': [ 'str' ],
  488. '*dev-features': [ 'str' ],
  489. '*unknown-dev-features': 'uint64' } }
  490. ##
  491. # @VirtQueueStatus:
  492. #
  493. # Information of a VirtIODevice VirtQueue, including most members of
  494. # the VirtQueue data structure.
  495. #
  496. # @name: Name of the VirtIODevice that uses this VirtQueue
  497. #
  498. # @queue-index: VirtQueue queue_index
  499. #
  500. # @inuse: VirtQueue inuse
  501. #
  502. # @vring-num: VirtQueue vring.num
  503. #
  504. # @vring-num-default: VirtQueue vring.num_default
  505. #
  506. # @vring-align: VirtQueue vring.align
  507. #
  508. # @vring-desc: VirtQueue vring.desc (descriptor area)
  509. #
  510. # @vring-avail: VirtQueue vring.avail (driver area)
  511. #
  512. # @vring-used: VirtQueue vring.used (device area)
  513. #
  514. # @last-avail-idx: VirtQueue last_avail_idx or return of vhost_dev
  515. # vhost_get_vring_base (if vhost active)
  516. #
  517. # @shadow-avail-idx: VirtQueue shadow_avail_idx
  518. #
  519. # @used-idx: VirtQueue used_idx
  520. #
  521. # @signalled-used: VirtQueue signalled_used
  522. #
  523. # @signalled-used-valid: VirtQueue signalled_used_valid flag
  524. #
  525. # Since: 7.2
  526. ##
  527. { 'struct': 'VirtQueueStatus',
  528. 'data': { 'name': 'str',
  529. 'queue-index': 'uint16',
  530. 'inuse': 'uint32',
  531. 'vring-num': 'uint32',
  532. 'vring-num-default': 'uint32',
  533. 'vring-align': 'uint32',
  534. 'vring-desc': 'uint64',
  535. 'vring-avail': 'uint64',
  536. 'vring-used': 'uint64',
  537. '*last-avail-idx': 'uint16',
  538. '*shadow-avail-idx': 'uint16',
  539. 'used-idx': 'uint16',
  540. 'signalled-used': 'uint16',
  541. 'signalled-used-valid': 'bool' } }
  542. ##
  543. # @x-query-virtio-queue-status:
  544. #
  545. # Return the status of a given VirtIODevice's VirtQueue
  546. #
  547. # @path: VirtIODevice canonical QOM path
  548. #
  549. # @queue: VirtQueue index to examine
  550. #
  551. # Features:
  552. #
  553. # @unstable: This command is meant for debugging.
  554. #
  555. # Returns: VirtQueueStatus of the VirtQueue
  556. #
  557. # .. note:: last_avail_idx will not be displayed in the case where the
  558. # selected VirtIODevice has a running vhost device and the
  559. # VirtIODevice VirtQueue index (queue) does not exist for the
  560. # corresponding vhost device vhost_virtqueue. Also,
  561. # shadow_avail_idx will not be displayed in the case where the
  562. # selected VirtIODevice has a running vhost device.
  563. #
  564. # Since: 7.2
  565. #
  566. # .. qmp-example::
  567. # :annotated:
  568. #
  569. # Get VirtQueueStatus for virtio-vsock (vhost-vsock running)
  570. # ::
  571. #
  572. # -> { "execute": "x-query-virtio-queue-status",
  573. # "arguments": { "path": "/machine/peripheral/vsock0/virtio-backend",
  574. # "queue": 1 }
  575. # }
  576. # <- { "return": {
  577. # "signalled-used": 0,
  578. # "inuse": 0,
  579. # "name": "vhost-vsock",
  580. # "vring-align": 4096,
  581. # "vring-desc": 5217370112,
  582. # "signalled-used-valid": false,
  583. # "vring-num-default": 128,
  584. # "vring-avail": 5217372160,
  585. # "queue-index": 1,
  586. # "last-avail-idx": 0,
  587. # "vring-used": 5217372480,
  588. # "used-idx": 0,
  589. # "vring-num": 128
  590. # }
  591. # }
  592. #
  593. # .. qmp-example::
  594. # :annotated:
  595. #
  596. # Get VirtQueueStatus for virtio-serial (no vhost)
  597. # ::
  598. #
  599. # -> { "execute": "x-query-virtio-queue-status",
  600. # "arguments": { "path": "/machine/peripheral-anon/device[0]/virtio-backend",
  601. # "queue": 20 }
  602. # }
  603. # <- { "return": {
  604. # "signalled-used": 0,
  605. # "inuse": 0,
  606. # "name": "virtio-serial",
  607. # "vring-align": 4096,
  608. # "vring-desc": 5182074880,
  609. # "signalled-used-valid": false,
  610. # "vring-num-default": 128,
  611. # "vring-avail": 5182076928,
  612. # "queue-index": 20,
  613. # "last-avail-idx": 0,
  614. # "vring-used": 5182077248,
  615. # "used-idx": 0,
  616. # "shadow-avail-idx": 0,
  617. # "vring-num": 128
  618. # }
  619. # }
  620. ##
  621. { 'command': 'x-query-virtio-queue-status',
  622. 'data': { 'path': 'str', 'queue': 'uint16' },
  623. 'returns': 'VirtQueueStatus',
  624. 'features': [ 'unstable' ] }
  625. ##
  626. # @VirtVhostQueueStatus:
  627. #
  628. # Information of a vhost device's vhost_virtqueue, including most
  629. # members of the vhost_dev vhost_virtqueue data structure.
  630. #
  631. # @name: Name of the VirtIODevice that uses this vhost_virtqueue
  632. #
  633. # @kick: vhost_virtqueue kick
  634. #
  635. # @call: vhost_virtqueue call
  636. #
  637. # @desc: vhost_virtqueue desc
  638. #
  639. # @avail: vhost_virtqueue avail
  640. #
  641. # @used: vhost_virtqueue used
  642. #
  643. # @num: vhost_virtqueue num
  644. #
  645. # @desc-phys: vhost_virtqueue desc_phys (descriptor area physical
  646. # address)
  647. #
  648. # @desc-size: vhost_virtqueue desc_size
  649. #
  650. # @avail-phys: vhost_virtqueue avail_phys (driver area physical
  651. # address)
  652. #
  653. # @avail-size: vhost_virtqueue avail_size
  654. #
  655. # @used-phys: vhost_virtqueue used_phys (device area physical address)
  656. #
  657. # @used-size: vhost_virtqueue used_size
  658. #
  659. # Since: 7.2
  660. ##
  661. { 'struct': 'VirtVhostQueueStatus',
  662. 'data': { 'name': 'str',
  663. 'kick': 'int',
  664. 'call': 'int',
  665. 'desc': 'uint64',
  666. 'avail': 'uint64',
  667. 'used': 'uint64',
  668. 'num': 'int',
  669. 'desc-phys': 'uint64',
  670. 'desc-size': 'uint32',
  671. 'avail-phys': 'uint64',
  672. 'avail-size': 'uint32',
  673. 'used-phys': 'uint64',
  674. 'used-size': 'uint32' } }
  675. ##
  676. # @x-query-virtio-vhost-queue-status:
  677. #
  678. # Return information of a given vhost device's vhost_virtqueue
  679. #
  680. # @path: VirtIODevice canonical QOM path
  681. #
  682. # @queue: vhost_virtqueue index to examine
  683. #
  684. # Features:
  685. #
  686. # @unstable: This command is meant for debugging.
  687. #
  688. # Returns: VirtVhostQueueStatus of the vhost_virtqueue
  689. #
  690. # Since: 7.2
  691. #
  692. # .. qmp-example::
  693. # :title: Get vhost_virtqueue status for vhost-crypto
  694. #
  695. # -> { "execute": "x-query-virtio-vhost-queue-status",
  696. # "arguments": { "path": "/machine/peripheral/crypto0/virtio-backend",
  697. # "queue": 0 }
  698. # }
  699. # <- { "return": {
  700. # "avail-phys": 5216124928,
  701. # "name": "virtio-crypto",
  702. # "used-phys": 5216127040,
  703. # "avail-size": 2054,
  704. # "desc-size": 16384,
  705. # "used-size": 8198,
  706. # "desc": 140141447430144,
  707. # "num": 1024,
  708. # "call": 0,
  709. # "avail": 140141447446528,
  710. # "desc-phys": 5216108544,
  711. # "used": 140141447448640,
  712. # "kick": 0
  713. # }
  714. # }
  715. #
  716. # .. qmp-example::
  717. # :title: Get vhost_virtqueue status for vhost-vsock
  718. #
  719. # -> { "execute": "x-query-virtio-vhost-queue-status",
  720. # "arguments": { "path": "/machine/peripheral/vsock0/virtio-backend",
  721. # "queue": 0 }
  722. # }
  723. # <- { "return": {
  724. # "avail-phys": 5182261248,
  725. # "name": "vhost-vsock",
  726. # "used-phys": 5182261568,
  727. # "avail-size": 262,
  728. # "desc-size": 2048,
  729. # "used-size": 1030,
  730. # "desc": 140141413580800,
  731. # "num": 128,
  732. # "call": 0,
  733. # "avail": 140141413582848,
  734. # "desc-phys": 5182259200,
  735. # "used": 140141413583168,
  736. # "kick": 0
  737. # }
  738. # }
  739. ##
  740. { 'command': 'x-query-virtio-vhost-queue-status',
  741. 'data': { 'path': 'str', 'queue': 'uint16' },
  742. 'returns': 'VirtVhostQueueStatus',
  743. 'features': [ 'unstable' ] }
  744. ##
  745. # @VirtioRingDesc:
  746. #
  747. # Information regarding the vring descriptor area
  748. #
  749. # @addr: Guest physical address of the descriptor area
  750. #
  751. # @len: Length of the descriptor area
  752. #
  753. # @flags: List of descriptor flags
  754. #
  755. # Since: 7.2
  756. ##
  757. { 'struct': 'VirtioRingDesc',
  758. 'data': { 'addr': 'uint64',
  759. 'len': 'uint32',
  760. 'flags': [ 'str' ] } }
  761. ##
  762. # @VirtioRingAvail:
  763. #
  764. # Information regarding the avail vring (a.k.a. driver area)
  765. #
  766. # @flags: VRingAvail flags
  767. #
  768. # @idx: VRingAvail index
  769. #
  770. # @ring: VRingAvail ring[] entry at provided index
  771. #
  772. # Since: 7.2
  773. ##
  774. { 'struct': 'VirtioRingAvail',
  775. 'data': { 'flags': 'uint16',
  776. 'idx': 'uint16',
  777. 'ring': 'uint16' } }
  778. ##
  779. # @VirtioRingUsed:
  780. #
  781. # Information regarding the used vring (a.k.a. device area)
  782. #
  783. # @flags: VRingUsed flags
  784. #
  785. # @idx: VRingUsed index
  786. #
  787. # Since: 7.2
  788. ##
  789. { 'struct': 'VirtioRingUsed',
  790. 'data': { 'flags': 'uint16',
  791. 'idx': 'uint16' } }
  792. ##
  793. # @VirtioQueueElement:
  794. #
  795. # Information regarding a VirtQueue's VirtQueueElement including
  796. # descriptor, driver, and device areas
  797. #
  798. # @name: Name of the VirtIODevice that uses this VirtQueue
  799. #
  800. # @index: Index of the element in the queue
  801. #
  802. # @descs: List of descriptors (VirtioRingDesc)
  803. #
  804. # @avail: VRingAvail info
  805. #
  806. # @used: VRingUsed info
  807. #
  808. # Since: 7.2
  809. ##
  810. { 'struct': 'VirtioQueueElement',
  811. 'data': { 'name': 'str',
  812. 'index': 'uint32',
  813. 'descs': [ 'VirtioRingDesc' ],
  814. 'avail': 'VirtioRingAvail',
  815. 'used': 'VirtioRingUsed' } }
  816. ##
  817. # @x-query-virtio-queue-element:
  818. #
  819. # Return the information about a VirtQueue's VirtQueueElement
  820. #
  821. # @path: VirtIODevice canonical QOM path
  822. #
  823. # @queue: VirtQueue index to examine
  824. #
  825. # @index: Index of the element in the queue (default: head of the
  826. # queue)
  827. #
  828. # Features:
  829. #
  830. # @unstable: This command is meant for debugging.
  831. #
  832. # Returns: VirtioQueueElement information
  833. #
  834. # Since: 7.2
  835. #
  836. # .. qmp-example::
  837. # :title: Introspect on virtio-net's VirtQueue 0 at index 5
  838. #
  839. # -> { "execute": "x-query-virtio-queue-element",
  840. # "arguments": { "path": "/machine/peripheral-anon/device[1]/virtio-backend",
  841. # "queue": 0,
  842. # "index": 5 }
  843. # }
  844. # <- { "return": {
  845. # "index": 5,
  846. # "name": "virtio-net",
  847. # "descs": [
  848. # {
  849. # "flags": ["write"],
  850. # "len": 1536,
  851. # "addr": 5257305600
  852. # }
  853. # ],
  854. # "avail": {
  855. # "idx": 256,
  856. # "flags": 0,
  857. # "ring": 5
  858. # },
  859. # "used": {
  860. # "idx": 13,
  861. # "flags": 0
  862. # }
  863. # }
  864. # }
  865. #
  866. # .. qmp-example::
  867. # :title: Introspect on virtio-crypto's VirtQueue 1 at head
  868. #
  869. # -> { "execute": "x-query-virtio-queue-element",
  870. # "arguments": { "path": "/machine/peripheral/crypto0/virtio-backend",
  871. # "queue": 1 }
  872. # }
  873. # <- { "return": {
  874. # "index": 0,
  875. # "name": "virtio-crypto",
  876. # "descs": [
  877. # {
  878. # "flags": [],
  879. # "len": 0,
  880. # "addr": 8080268923184214134
  881. # }
  882. # ],
  883. # "avail": {
  884. # "idx": 280,
  885. # "flags": 0,
  886. # "ring": 0
  887. # },
  888. # "used": {
  889. # "idx": 280,
  890. # "flags": 0
  891. # }
  892. # }
  893. # }
  894. #
  895. # .. qmp-example::
  896. # :title: Introspect on virtio-scsi's VirtQueue 2 at head
  897. #
  898. # -> { "execute": "x-query-virtio-queue-element",
  899. # "arguments": { "path": "/machine/peripheral-anon/device[2]/virtio-backend",
  900. # "queue": 2 }
  901. # }
  902. # <- { "return": {
  903. # "index": 19,
  904. # "name": "virtio-scsi",
  905. # "descs": [
  906. # {
  907. # "flags": ["used", "indirect", "write"],
  908. # "len": 4099327944,
  909. # "addr": 12055409292258155293
  910. # }
  911. # ],
  912. # "avail": {
  913. # "idx": 1147,
  914. # "flags": 0,
  915. # "ring": 19
  916. # },
  917. # "used": {
  918. # "idx": 280,
  919. # "flags": 0
  920. # }
  921. # }
  922. # }
  923. ##
  924. { 'command': 'x-query-virtio-queue-element',
  925. 'data': { 'path': 'str', 'queue': 'uint16', '*index': 'uint16' },
  926. 'returns': 'VirtioQueueElement',
  927. 'features': [ 'unstable' ] }
  928. ##
  929. # @IOThreadVirtQueueMapping:
  930. #
  931. # Describes the subset of virtqueues assigned to an IOThread.
  932. #
  933. # @iothread: the id of IOThread object
  934. #
  935. # @vqs: an optional array of virtqueue indices that will be handled by
  936. # this IOThread. When absent, virtqueues are assigned round-robin
  937. # across all IOThreadVirtQueueMappings provided. Either all
  938. # IOThreadVirtQueueMappings must have @vqs or none of them must
  939. # have it.
  940. #
  941. # Since: 9.0
  942. ##
  943. { 'struct': 'IOThreadVirtQueueMapping',
  944. 'data': { 'iothread': 'str', '*vqs': ['uint16'] } }
  945. ##
  946. # @DummyVirtioForceArrays:
  947. #
  948. # Not used by QMP; hack to let us use IOThreadVirtQueueMappingList
  949. # internally
  950. #
  951. # Since: 9.0
  952. ##
  953. { 'struct': 'DummyVirtioForceArrays',
  954. 'data': { 'unused-iothread-vq-mapping': ['IOThreadVirtQueueMapping'] } }
  955. ##
  956. # @GranuleMode:
  957. #
  958. # @4k: granule page size of 4KiB
  959. #
  960. # @8k: granule page size of 8KiB
  961. #
  962. # @16k: granule page size of 16KiB
  963. #
  964. # @64k: granule page size of 64KiB
  965. #
  966. # @host: granule matches the host page size
  967. #
  968. # Since: 9.0
  969. ##
  970. { 'enum': 'GranuleMode',
  971. 'data': [ '4k', '8k', '16k', '64k', 'host' ] }
  972. ##
  973. # @VMAppleVirtioBlkVariant:
  974. #
  975. # @unspecified: The default, not a valid setting.
  976. #
  977. # @root: Block device holding the root volume
  978. #
  979. # @aux: Block device holding auxiliary data required for boot
  980. #
  981. # Since: 9.2
  982. ##
  983. { 'enum': 'VMAppleVirtioBlkVariant',
  984. 'data': [ 'unspecified', 'root', 'aux' ] }