|
From: | Jonah Palmer |
Subject: | Re: [PATCH v9 3/8] qmp: add QMP command x-query-virtio |
Date: | Thu, 11 Nov 2021 04:07:30 -0500 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 |
Jonah Palmer <jonah.palmer@oracle.com> writes:From: Laurent Vivier <lvivier@redhat.com> This new command lists all the instances of VirtIODevice with their QOM paths and virtio type/name. Signed-off-by: Jonah Palmer <jonah.palmer@oracle.com>[...]diff --git a/qapi/qapi-schema.json b/qapi/qapi-schema.json index 4912b97..1512ada 100644 --- a/qapi/qapi-schema.json +++ b/qapi/qapi-schema.json @@ -93,3 +93,4 @@ { 'include': 'audio.json' } { 'include': 'acpi.json' } { 'include': 'pci.json' } +{ 'include': 'virtio.json' } diff --git a/qapi/virtio.json b/qapi/virtio.json new file mode 100644 index 0000000..324ba8c --- /dev/null +++ b/qapi/virtio.json @@ -0,0 +1,55 @@ +# -*- Mode: Python -*- +# vim: filetype=python +# + +## +# = Virtio devices +## + +## +# @VirtioInfo: +# +# Basic information about a given VirtIODevice +# +# @path: the device's canonical QOM path +# +# @type: VirtIO device name +# +# Since: 6.3I expect the next release to be numbered 7.0.
Got it. I'll update this for next series.
+# +## +{ 'struct': 'VirtioInfo', + 'data': { 'path': 'str', + 'type': 'str' } } + +## +# @x-query-virtio: +# +# Returns a list of all realized VirtIO devices +# +# Features: +# @unstable: This command is meant for debugging. +# +# Returns: list of gathered @VirtioInfo devices +# +# Since: 6.3 +# +# Example: +# +# -> { "execute": "x-query-virtio" } +# <- { "return": [ { "path": "/machine/peripheral-anon/device[4]/virtio-backend", +# "type": "virtio-input" }, +# { "path": "/machine/peripheral/crypto0/virtio-backend", +# "type": "virtio-crypto" }, +# { "path": "/machine/peripheral-anon/device[2]/virtio-backend", +# "type": "virtio-scsi" }, +# { "path": "/machine/peripheral-anon/device[1]/virtio-backend", +# "type": "virtio-net" }, +# { "path": "/machine/peripheral-anon/device[0]/virtio-backend", +# "type": "virtio-serial" } +# ] }Any particular reason for reformatting the example? For what it's worth, I'd prefer the previous version. Aside: consistent formatting of examples would be nice. Not in this series.
I think I got a little too excited reformatting. I'll revert the examples back to their original format and make sure the rest of the examples throughout the entire series are consistent with each other.
+# +## + +{ 'command': 'x-query-virtio', 'returns': ['VirtioInfo'], + 'features': [ 'unstable' ] } diff --git a/tests/qtest/qmp-cmd-test.c b/tests/qtest/qmp-cmd-test.c index 7f103ea..fd00ee2 100644 --- a/tests/qtest/qmp-cmd-test.c +++ b/tests/qtest/qmp-cmd-test.c @@ -103,6 +103,7 @@ static bool query_is_ignored(const char *cmd) "query-gic-capabilities", /* arm */ /* Success depends on target-specific build configuration: */ "query-pci", /* CONFIG_PCI */ + "x-query-virtio", /* CONFIG_VIRTIO */ /* Success depends on launching SEV guest */ "query-sev-launch-measure", /* Success depends on Host or Hypervisor SEV support */
[Prev in Thread] | Current Thread | [Next in Thread] |