qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC 2/5] qmp: add QMP command virtio-status


From: Eric Blake
Subject: Re: [RFC 2/5] qmp: add QMP command virtio-status
Date: Thu, 2 Apr 2020 09:27:40 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0

On 4/2/20 5:02 AM, Laurent Vivier wrote:
This new command shows the status of a VirtIODevice
(features, endianness and number of virtqueues)

Signed-off-by: Laurent Vivier <address@hidden>
---

+++ b/qapi/virtio.json
@@ -52,3 +52,68 @@
  ##
{ 'command': 'query-virtio', 'returns': ['VirtioInfo'] }
+
+##
+# @VirtioStatus:
+#
+# @device_id: VirtIODevice status

As this is a new API, it should stick to our naming conventions:

device-id

+#
+# @device_endian: VirtIODevice device_endian

device-endian

+#
+# @guest_features: VirtIODevice guest_features

guest-features

+#
+# @host_features: VirtIODevice host_features

host-features

+#
+# @backend_features: VirtIODevice backend_features

backend-features

+#
+# @num_vqs: number of VirtIODevice queues

num-vqs

+#
+# Since: 5.1
+#
+##
+
+{ 'struct': 'VirtioStatus',
+  'data': {
+    'device_id': 'int',
+    'device_endian': 'str',
+    'guest_features': 'uint64',
+    'host_features': 'uint64',
+    'backend_features': 'uint64',

A bare int requires subsequent decoding. Can this instead be an array of enum values, with enum values naming each enabled feature?

+    'num_vqs': 'uint16'
+  }
+}
+
+##
+# @virtio-status:
+#
+# Return the status of virtio device
+#
+# @path: QOBject path of the VirtIODevice
+#
+# Returns: status of the VirtIODevice
+#
+# Since: 5.1
+#
+# Example:
+#
+# -> { "execute": "virtio-status",
+#      "arguments": {
+#          "path": "/machine/peripheral-anon/device[3]/virtio-backend"
+#      }
+#   }
+# <- { "return": {
+#          "backend_features": 0,
+#          "guest_features": 5111807911,

again, this means nothing to me.
  "guest-features": ["feature-a","feature-b"]
is vastly more usable if I'm inspecting the query output, compared to decoding the decimal number back into bits then doing a lookup into the documentation of which bits mean which features.

+#          "num_vqs": 3,
+#          "host_features": 6337593319,
+#          "device_endian": "little",
+#          "device_id": 1
+#      }
+#    }
+#
+##
+
+{ 'command': 'virtio-status',
+  'data': { 'path': 'str' },
+  'returns': 'VirtioStatus'
+}


--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]