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