target/i386: check intercept for XSETBV
[qemu/ar7.git] / qapi / virtio.json
blobe6dcee7b83d142f569b3424f0ae31f09000d25f9
1 # -*- Mode: Python -*-
2 # vim: filetype=python
5 ##
6 # = Virtio devices
7 ##
9 ##
10 # @VirtioInfo:
12 # Basic information about a given VirtIODevice
14 # @path: The VirtIODevice's canonical QOM path
16 # @name: Name of the VirtIODevice
18 # Since: 7.2
20 { 'struct': 'VirtioInfo',
21   'data': { 'path': 'str',
22             'name': 'str' } }
25 # @x-query-virtio:
27 # Returns a list of all realized VirtIODevices
29 # Features:
31 # @unstable: This command is meant for debugging.
33 # Returns: List of gathered VirtIODevices
35 # Since: 7.2
37 # Example:
39 # -> { "execute": "x-query-virtio" }
40 # <- { "return": [
41 #          {
42 #              "name": "virtio-input",
43 #              "path": "/machine/peripheral-anon/device[4]/virtio-backend"
44 #          },
45 #          {
46 #              "name": "virtio-crypto",
47 #              "path": "/machine/peripheral/crypto0/virtio-backend"
48 #          },
49 #          {
50 #              "name": "virtio-scsi",
51 #              "path": "/machine/peripheral-anon/device[2]/virtio-backend"
52 #          },
53 #          {
54 #              "name": "virtio-net",
55 #              "path": "/machine/peripheral-anon/device[1]/virtio-backend"
56 #          },
57 #          {
58 #              "name": "virtio-serial",
59 #              "path": "/machine/peripheral-anon/device[0]/virtio-backend"
60 #          }
61 #      ]
62 #    }
64 { 'command': 'x-query-virtio',
65   'returns': [ 'VirtioInfo' ],
66   'features': [ 'unstable' ] }
69 # @VhostStatus:
71 # Information about a vhost device.  This information will only be
72 # displayed if the vhost device is active.
74 # @n-mem-sections: vhost_dev n_mem_sections
76 # @n-tmp-sections: vhost_dev n_tmp_sections
78 # @nvqs: vhost_dev nvqs (number of virtqueues being used)
80 # @vq-index: vhost_dev vq_index
82 # @features: vhost_dev features
84 # @acked-features: vhost_dev acked_features
86 # @backend-features: vhost_dev backend_features
88 # @protocol-features: vhost_dev protocol_features
90 # @max-queues: vhost_dev max_queues
92 # @backend-cap: vhost_dev backend_cap
94 # @log-enabled: vhost_dev log_enabled flag
96 # @log-size: vhost_dev log_size
98 # Since: 7.2
100 { 'struct': 'VhostStatus',
101   'data': { 'n-mem-sections': 'int',
102             'n-tmp-sections': 'int',
103             'nvqs': 'uint32',
104             'vq-index': 'int',
105             'features': 'VirtioDeviceFeatures',
106             'acked-features': 'VirtioDeviceFeatures',
107             'backend-features': 'VirtioDeviceFeatures',
108             'protocol-features': 'VhostDeviceProtocols',
109             'max-queues': 'uint64',
110             'backend-cap': 'uint64',
111             'log-enabled': 'bool',
112             'log-size': 'uint64' } }
115 # @VirtioStatus:
117 # Full status of the virtio device with most VirtIODevice members.
118 # Also includes the full status of the corresponding vhost device if
119 # the vhost device is active.
121 # @name: VirtIODevice name
123 # @device-id: VirtIODevice ID
125 # @vhost-started: VirtIODevice vhost_started flag
127 # @guest-features: VirtIODevice guest_features
129 # @host-features: VirtIODevice host_features
131 # @backend-features: VirtIODevice backend_features
133 # @device-endian: VirtIODevice device_endian
135 # @num-vqs: VirtIODevice virtqueue count.  This is the number of
136 #     active virtqueues being used by the VirtIODevice.
138 # @status: VirtIODevice configuration status (VirtioDeviceStatus)
140 # @isr: VirtIODevice ISR
142 # @queue-sel: VirtIODevice queue_sel
144 # @vm-running: VirtIODevice vm_running flag
146 # @broken: VirtIODevice broken flag
148 # @disabled: VirtIODevice disabled flag
150 # @use-started: VirtIODevice use_started flag
152 # @started: VirtIODevice started flag
154 # @start-on-kick: VirtIODevice start_on_kick flag
156 # @disable-legacy-check: VirtIODevice disabled_legacy_check flag
158 # @bus-name: VirtIODevice bus_name
160 # @use-guest-notifier-mask: VirtIODevice use_guest_notifier_mask flag
162 # @vhost-dev: Corresponding vhost device info for a given
163 #     VirtIODevice.  Present if the given VirtIODevice has an active
164 #     vhost device.
166 # Since: 7.2
168 { 'struct': 'VirtioStatus',
169   'data': { 'name': 'str',
170             'device-id': 'uint16',
171             'vhost-started': 'bool',
172             'device-endian': 'str',
173             'guest-features': 'VirtioDeviceFeatures',
174             'host-features': 'VirtioDeviceFeatures',
175             'backend-features': 'VirtioDeviceFeatures',
176             'num-vqs': 'int',
177             'status': 'VirtioDeviceStatus',
178             'isr': 'uint8',
179             'queue-sel': 'uint16',
180             'vm-running': 'bool',
181             'broken': 'bool',
182             'disabled': 'bool',
183             'use-started': 'bool',
184             'started': 'bool',
185             'start-on-kick': 'bool',
186             'disable-legacy-check': 'bool',
187             'bus-name': 'str',
188             'use-guest-notifier-mask': 'bool',
189             '*vhost-dev': 'VhostStatus' } }
192 # @x-query-virtio-status:
194 # Poll for a comprehensive status of a given virtio device
196 # @path: Canonical QOM path of the VirtIODevice
198 # Features:
200 # @unstable: This command is meant for debugging.
202 # Returns: VirtioStatus of the virtio device
204 # Since: 7.2
206 # Examples:
208 # 1. Poll for the status of virtio-crypto (no vhost-crypto active)
210 # -> { "execute": "x-query-virtio-status",
211 #      "arguments": { "path": "/machine/peripheral/crypto0/virtio-backend" }
212 #    }
213 # <- { "return": {
214 #          "device-endian": "little",
215 #          "bus-name": "",
216 #          "disable-legacy-check": false,
217 #          "name": "virtio-crypto",
218 #          "started": true,
219 #          "device-id": 20,
220 #          "backend-features": {
221 #              "transports": [],
222 #              "dev-features": []
223 #          },
224 #          "start-on-kick": false,
225 #          "isr": 1,
226 #          "broken": false,
227 #          "status": {
228 #              "statuses": [
229 #                  "VIRTIO_CONFIG_S_ACKNOWLEDGE: Valid virtio device found",
230 #                  "VIRTIO_CONFIG_S_DRIVER: Guest OS compatible with device",
231 #                  "VIRTIO_CONFIG_S_FEATURES_OK: Feature negotiation complete",
232 #                  "VIRTIO_CONFIG_S_DRIVER_OK: Driver setup and ready"
233 #              ]
234 #          },
235 #          "num-vqs": 2,
236 #          "guest-features": {
237 #              "dev-features": [],
238 #              "transports": [
239 #                  "VIRTIO_RING_F_EVENT_IDX: Used & avail. event fields enabled",
240 #                  "VIRTIO_RING_F_INDIRECT_DESC: Indirect descriptors supported",
241 #                  "VIRTIO_F_VERSION_1: Device compliant for v1 spec (legacy)"
242 #              ]
243 #          },
244 #          "host-features": {
245 #              "unknown-dev-features": 1073741824,
246 #              "dev-features": [],
247 #              "transports": [
248 #                  "VIRTIO_RING_F_EVENT_IDX: Used & avail. event fields enabled",
249 #                  "VIRTIO_RING_F_INDIRECT_DESC: Indirect descriptors supported",
250 #                  "VIRTIO_F_VERSION_1: Device compliant for v1 spec (legacy)",
251 #                  "VIRTIO_F_ANY_LAYOUT: Device accepts arbitrary desc. layouts",
252 #                  "VIRTIO_F_NOTIFY_ON_EMPTY: Notify when device runs out of avail. descs. on VQ"
253 #              ]
254 #          },
255 #          "use-guest-notifier-mask": true,
256 #          "vm-running": true,
257 #          "queue-sel": 1,
258 #          "disabled": false,
259 #          "vhost-started": false,
260 #          "use-started": true
261 #      }
262 #    }
264 # 2. Poll for the status of virtio-net (vhost-net is active)
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 #    }
432 { 'command': 'x-query-virtio-status',
433   'data': { 'path': 'str' },
434   'returns': 'VirtioStatus',
435   'features': [ 'unstable' ] }
438 # @VirtioDeviceStatus:
440 # A structure defined to list the configuration statuses of a virtio
441 # device
443 # @statuses: List of decoded configuration statuses of the virtio
444 #     device
446 # @unknown-statuses: Virtio device statuses bitmap that have not been
447 #     decoded
449 # Since: 7.2
451 { 'struct': 'VirtioDeviceStatus',
452   'data': { 'statuses': [ 'str' ],
453             '*unknown-statuses': 'uint8' } }
456 # @VhostDeviceProtocols:
458 # A structure defined to list the vhost user protocol features of a
459 # Vhost User device
461 # @protocols: List of decoded vhost user protocol features of a vhost
462 #     user device
464 # @unknown-protocols: Vhost user device protocol features bitmap that
465 #     have not been decoded
467 # Since: 7.2
469 { 'struct': 'VhostDeviceProtocols',
470   'data': { 'protocols': [ 'str' ],
471             '*unknown-protocols': 'uint64' } }
474 # @VirtioDeviceFeatures:
476 # The common fields that apply to most Virtio devices.  Some devices
477 # may not have their own device-specific features (e.g. virtio-rng).
479 # @transports: List of transport features of the virtio device
481 # @dev-features: List of device-specific features (if the device has
482 #     unique features)
484 # @unknown-dev-features: Virtio device features bitmap that have not
485 #     been decoded
487 # Since: 7.2
489 { 'struct': 'VirtioDeviceFeatures',
490   'data': { 'transports': [ 'str' ],
491             '*dev-features': [ 'str' ],
492             '*unknown-dev-features': 'uint64' } }
495 # @VirtQueueStatus:
497 # Information of a VirtIODevice VirtQueue, including most members of
498 # the VirtQueue data structure.
500 # @name: Name of the VirtIODevice that uses this VirtQueue
502 # @queue-index: VirtQueue queue_index
504 # @inuse: VirtQueue inuse
506 # @vring-num: VirtQueue vring.num
508 # @vring-num-default: VirtQueue vring.num_default
510 # @vring-align: VirtQueue vring.align
512 # @vring-desc: VirtQueue vring.desc (descriptor area)
514 # @vring-avail: VirtQueue vring.avail (driver area)
516 # @vring-used: VirtQueue vring.used (device area)
518 # @last-avail-idx: VirtQueue last_avail_idx or return of vhost_dev
519 #     vhost_get_vring_base (if vhost active)
521 # @shadow-avail-idx: VirtQueue shadow_avail_idx
523 # @used-idx: VirtQueue used_idx
525 # @signalled-used: VirtQueue signalled_used
527 # @signalled-used-valid: VirtQueue signalled_used_valid flag
529 # Since: 7.2
531 { 'struct': 'VirtQueueStatus',
532   'data': { 'name': 'str',
533             'queue-index': 'uint16',
534             'inuse': 'uint32',
535             'vring-num': 'uint32',
536             'vring-num-default': 'uint32',
537             'vring-align': 'uint32',
538             'vring-desc': 'uint64',
539             'vring-avail': 'uint64',
540             'vring-used': 'uint64',
541             '*last-avail-idx': 'uint16',
542             '*shadow-avail-idx': 'uint16',
543             'used-idx': 'uint16',
544             'signalled-used': 'uint16',
545             'signalled-used-valid': 'bool' } }
548 # @x-query-virtio-queue-status:
550 # Return the status of a given VirtIODevice's VirtQueue
552 # @path: VirtIODevice canonical QOM path
554 # @queue: VirtQueue index to examine
556 # Features:
558 # @unstable: This command is meant for debugging.
560 # Returns: VirtQueueStatus of the VirtQueue
562 # Notes: last_avail_idx will not be displayed in the case where the
563 #     selected VirtIODevice has a running vhost device and the
564 #     VirtIODevice VirtQueue index (queue) does not exist for the
565 #     corresponding vhost device vhost_virtqueue.  Also,
566 #     shadow_avail_idx will not be displayed in the case where the
567 #     selected VirtIODevice has a running vhost device.
569 # Since: 7.2
571 # Examples:
573 # 1. Get VirtQueueStatus for virtio-vsock (vhost-vsock running)
575 # -> { "execute": "x-query-virtio-queue-status",
576 #      "arguments": { "path": "/machine/peripheral/vsock0/virtio-backend",
577 #                     "queue": 1 }
578 #    }
579 # <- { "return": {
580 #          "signalled-used": 0,
581 #          "inuse": 0,
582 #          "name": "vhost-vsock",
583 #          "vring-align": 4096,
584 #          "vring-desc": 5217370112,
585 #          "signalled-used-valid": false,
586 #          "vring-num-default": 128,
587 #          "vring-avail": 5217372160,
588 #          "queue-index": 1,
589 #          "last-avail-idx": 0,
590 #          "vring-used": 5217372480,
591 #          "used-idx": 0,
592 #          "vring-num": 128
593 #      }
594 #    }
596 # 2. Get VirtQueueStatus for virtio-serial (no vhost)
598 # -> { "execute": "x-query-virtio-queue-status",
599 #      "arguments": { "path": "/machine/peripheral-anon/device[0]/virtio-backend",
600 #                     "queue": 20 }
601 #    }
602 # <- { "return": {
603 #          "signalled-used": 0,
604 #          "inuse": 0,
605 #          "name": "virtio-serial",
606 #          "vring-align": 4096,
607 #          "vring-desc": 5182074880,
608 #          "signalled-used-valid": false,
609 #          "vring-num-default": 128,
610 #          "vring-avail": 5182076928,
611 #          "queue-index": 20,
612 #          "last-avail-idx": 0,
613 #          "vring-used": 5182077248,
614 #          "used-idx": 0,
615 #          "shadow-avail-idx": 0,
616 #          "vring-num": 128
617 #      }
618 #    }
620 { 'command': 'x-query-virtio-queue-status',
621   'data': { 'path': 'str', 'queue': 'uint16' },
622   'returns': 'VirtQueueStatus',
623   'features': [ 'unstable' ] }
626 # @VirtVhostQueueStatus:
628 # Information of a vhost device's vhost_virtqueue, including most
629 # members of the vhost_dev vhost_virtqueue data structure.
631 # @name: Name of the VirtIODevice that uses this vhost_virtqueue
633 # @kick: vhost_virtqueue kick
635 # @call: vhost_virtqueue call
637 # @desc: vhost_virtqueue desc
639 # @avail: vhost_virtqueue avail
641 # @used: vhost_virtqueue used
643 # @num: vhost_virtqueue num
645 # @desc-phys: vhost_virtqueue desc_phys (descriptor area phys. addr.)
647 # @desc-size: vhost_virtqueue desc_size
649 # @avail-phys: vhost_virtqueue avail_phys (driver area phys. addr.)
651 # @avail-size: vhost_virtqueue avail_size
653 # @used-phys: vhost_virtqueue used_phys (device area phys. addr.)
655 # @used-size: vhost_virtqueue used_size
657 # Since: 7.2
659 { 'struct': 'VirtVhostQueueStatus',
660   'data': { 'name': 'str',
661             'kick': 'int',
662             'call': 'int',
663             'desc': 'uint64',
664             'avail': 'uint64',
665             'used': 'uint64',
666             'num': 'int',
667             'desc-phys': 'uint64',
668             'desc-size': 'uint32',
669             'avail-phys': 'uint64',
670             'avail-size': 'uint32',
671             'used-phys': 'uint64',
672             'used-size': 'uint32' } }
675 # @x-query-virtio-vhost-queue-status:
677 # Return information of a given vhost device's vhost_virtqueue
679 # @path: VirtIODevice canonical QOM path
681 # @queue: vhost_virtqueue index to examine
683 # Features:
685 # @unstable: This command is meant for debugging.
687 # Returns: VirtVhostQueueStatus of the vhost_virtqueue
689 # Since: 7.2
691 # Examples:
693 # 1. Get vhost_virtqueue status for vhost-crypto
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 #    }
716 # 2. Get vhost_virtqueue status for vhost-vsock
718 # -> { "execute": "x-query-virtio-vhost-queue-status",
719 #      "arguments": { "path": "/machine/peripheral/vsock0/virtio-backend",
720 #                     "queue": 0 }
721 #    }
722 # <- { "return": {
723 #          "avail-phys": 5182261248,
724 #          "name": "vhost-vsock",
725 #          "used-phys": 5182261568,
726 #          "avail-size": 262,
727 #          "desc-size": 2048,
728 #          "used-size": 1030,
729 #          "desc": 140141413580800,
730 #          "num": 128,
731 #          "call": 0,
732 #          "avail": 140141413582848,
733 #          "desc-phys": 5182259200,
734 #          "used": 140141413583168,
735 #          "kick": 0
736 #      }
737 #    }
739 { 'command': 'x-query-virtio-vhost-queue-status',
740   'data': { 'path': 'str', 'queue': 'uint16' },
741   'returns': 'VirtVhostQueueStatus',
742   'features': [ 'unstable' ] }
745 # @VirtioRingDesc:
747 # Information regarding the vring descriptor area
749 # @addr: Guest physical address of the descriptor area
751 # @len: Length of the descriptor area
753 # @flags: List of descriptor flags
755 # Since: 7.2
757 { 'struct': 'VirtioRingDesc',
758   'data': { 'addr': 'uint64',
759             'len': 'uint32',
760             'flags': [ 'str' ] } }
763 # @VirtioRingAvail:
765 # Information regarding the avail vring (a.k.a. driver area)
767 # @flags: VRingAvail flags
769 # @idx: VRingAvail index
771 # @ring: VRingAvail ring[] entry at provided index
773 # Since: 7.2
775 { 'struct': 'VirtioRingAvail',
776   'data': { 'flags': 'uint16',
777             'idx': 'uint16',
778             'ring': 'uint16' } }
781 # @VirtioRingUsed:
783 # Information regarding the used vring (a.k.a. device area)
785 # @flags: VRingUsed flags
787 # @idx: VRingUsed index
789 # Since: 7.2
791 { 'struct': 'VirtioRingUsed',
792   'data': { 'flags': 'uint16',
793             'idx': 'uint16' } }
796 # @VirtioQueueElement:
798 # Information regarding a VirtQueue's VirtQueueElement including
799 # descriptor, driver, and device areas
801 # @name: Name of the VirtIODevice that uses this VirtQueue
803 # @index: Index of the element in the queue
805 # @descs: List of descriptors (VirtioRingDesc)
807 # @avail: VRingAvail info
809 # @used: VRingUsed info
811 # Since: 7.2
813 { 'struct': 'VirtioQueueElement',
814   'data': { 'name': 'str',
815             'index': 'uint32',
816             'descs': [ 'VirtioRingDesc' ],
817             'avail': 'VirtioRingAvail',
818             'used': 'VirtioRingUsed' } }
821 # @x-query-virtio-queue-element:
823 # Return the information about a VirtQueue's VirtQueueElement
825 # @path: VirtIODevice canonical QOM path
827 # @queue: VirtQueue index to examine
829 # @index: Index of the element in the queue (default: head of the
830 #     queue)
832 # Features:
834 # @unstable: This command is meant for debugging.
836 # Returns: VirtioQueueElement information
838 # Since: 7.2
840 # Examples:
842 # 1. Introspect on virtio-net's VirtQueue 0 at index 5
844 # -> { "execute": "x-query-virtio-queue-element",
845 #      "arguments": { "path": "/machine/peripheral-anon/device[1]/virtio-backend",
846 #                     "queue": 0,
847 #                     "index": 5 }
848 #    }
849 # <- { "return": {
850 #          "index": 5,
851 #          "name": "virtio-net",
852 #          "descs": [
853 #              {
854 #                  "flags": ["write"],
855 #                  "len": 1536,
856 #                  "addr": 5257305600
857 #              }
858 #          ],
859 #          "avail": {
860 #              "idx": 256,
861 #              "flags": 0,
862 #              "ring": 5
863 #          },
864 #          "used": {
865 #              "idx": 13,
866 #              "flags": 0
867 #          }
868 #      }
869 #    }
871 # 2. Introspect on virtio-crypto's VirtQueue 1 at head
873 # -> { "execute": "x-query-virtio-queue-element",
874 #      "arguments": { "path": "/machine/peripheral/crypto0/virtio-backend",
875 #                     "queue": 1 }
876 #    }
877 # <- { "return": {
878 #          "index": 0,
879 #          "name": "virtio-crypto",
880 #          "descs": [
881 #              {
882 #                  "flags": [],
883 #                  "len": 0,
884 #                  "addr": 8080268923184214134
885 #              }
886 #          ],
887 #          "avail": {
888 #              "idx": 280,
889 #              "flags": 0,
890 #              "ring": 0
891 #          },
892 #          "used": {
893 #              "idx": 280,
894 #              "flags": 0
895 #          }
896 #      }
897 #    }
899 # 3. Introspect on virtio-scsi's VirtQueue 2 at head
901 # -> { "execute": "x-query-virtio-queue-element",
902 #      "arguments": { "path": "/machine/peripheral-anon/device[2]/virtio-backend",
903 #                     "queue": 2 }
904 #    }
905 # <- { "return": {
906 #          "index": 19,
907 #          "name": "virtio-scsi",
908 #          "descs": [
909 #              {
910 #                  "flags": ["used", "indirect", "write"],
911 #                  "len": 4099327944,
912 #                  "addr": 12055409292258155293
913 #              }
914 #          ],
915 #          "avail": {
916 #              "idx": 1147,
917 #              "flags": 0,
918 #              "ring": 19
919 #          },
920 #          "used": {
921 #              "idx": 280,
922 #              "flags": 0
923 #          }
924 #      }
925 #    }
927 { 'command': 'x-query-virtio-queue-element',
928   'data': { 'path': 'str', 'queue': 'uint16', '*index': 'uint16' },
929   'returns': 'VirtioQueueElement',
930   'features': [ 'unstable' ] }