Patchwork [v4,1/3] QMP: Introduce the documentation for query-available-devices

login
register
mail settings
Submitter Miguel Di Ciurcio Filho
Date July 23, 2010, 4:47 p.m.
Message ID <1279903660-9607-2-git-send-email-miguel.filho@gmail.com>
Download mbox | patch
Permalink /patch/59821/
State New
Headers show

Comments

Miguel Di Ciurcio Filho - July 23, 2010, 4:47 p.m.
---
 qemu-monitor.hx |   71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 71 insertions(+), 0 deletions(-)

Patch

diff --git a/qemu-monitor.hx b/qemu-monitor.hx
index 2af3de6..f6b976a 100644
--- a/qemu-monitor.hx
+++ b/qemu-monitor.hx
@@ -2490,6 +2490,77 @@  STEXI
 show device tree
 @item info qdm
 show qdev device model list
+ETEXI
+SQMP
+query-available-devices
+-----------------------
+
+Describe the capabilities of all devices registered with qdev.
+
+The returned output is a json-array, each element is a json-object describing
+a single device type.
+
+Each json-object contains the following:
+
+- "name": name of the device (json-string)
+- "bus": the name of the bus type for the device (json-string)
+    - Possible values: PCI, SCSI, I2C, ISA, SSI, USB, virtio-serial-bus, System,
+                        IDE, s390-virtio
+- "alias": an alias by which the device is also known (json-string, optional)
+- "description": description of the device  (json-string, optional)
+- "creatable": whether this device can be created by the user (json-boolean)
+- "properties": a json-array where each item is a json-object that describes a
+  property of the device. If the device has no property to be setup, this item
+  will not be present. Each json-object contains the following:
+     - "name": the name of the property (json-string)
+     - "type": the json type of the property (json-string)
+            - Possible values: integer, string, boolean
+
+Example:
+
+-> { "execute": "query-available-devices" }
+<- {
+      "return": [
+        {
+           "name": "virtio-blk-pci",
+           "creatable": true,
+           "bus": "PCI",
+           "properties": [
+             {
+                 "name": "indirect_desc",
+                 "type": "boolean" 
+             },
+             {
+                 "name": "logical_block_size",
+                 "type": "integer"
+             },
+             {
+                 "name": "opt_io_size",
+                 "type": "integer"
+             },
+             {
+                 "name": "drive",
+                 "type": "string"
+             }
+           ]
+        },
+        {
+           "name": "virtio-balloon-pci",
+           "creatable": true,
+           "bus": "PCI",
+           "properties": [
+             {
+                 "name": "indirect_desc",
+                 "type": "boolean"
+             }
+           ]
+        },
+      ....
+    ]
+
+EQMP
+
+STEXI
 @item info roms
 show roms
 @end table