qemu-block
[Top][All Lists]
Advanced

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

Re: [PATCH v9 3/8] qmp: add QMP command x-query-virtio


From: Markus Armbruster
Subject: Re: [PATCH v9 3/8] qmp: add QMP command x-query-virtio
Date: Wed, 10 Nov 2021 13:03:01 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

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.3

I expect the next release to be numbered 7.0.

> +#
> +##
> +{ '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.

> +#
> +##
> +
> +{ '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 */




reply via email to

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