[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC v5 1/6] qmp: add QMP command x-debug-query-virtio
From: |
Dr. David Alan Gilbert |
Subject: |
Re: [RFC v5 1/6] qmp: add QMP command x-debug-query-virtio |
Date: |
Wed, 24 Mar 2021 18:31:51 +0000 |
User-agent: |
Mutt/2.0.5 (2021-01-21) |
* Jonah Palmer (jonah.palmer@oracle.com) wrote:
> From: Laurent Vivier <lvivier@redhat.com>
>
<snip>
> --- /dev/null
> +++ b/qapi/virtio.json
> @@ -0,0 +1,68 @@
> +##
> +# = Virtio devices
> +##
> +
> +##
> +# @VirtioType:
> +#
> +# An enumeration of Virtio device types.
> +#
> +# Since: 6.0
> +##
> +{ 'enum': 'VirtioType',
> + 'data': [ 'unknown', 'virtio-9p', 'virtio-blk', 'virtio-serial',
> + 'virtio-gpu', 'virtio-input', 'virtio-net', 'virtio-scsi',
> + 'vhost-user-fs', 'vhost-vsock', 'virtio-balloon',
> 'virtio-crypto',
> + 'virtio-iommu', 'virtio-pmem', 'virtio-rng' ]
Can we make this be a complete list that's in the same order as
include/standard-headers/linux/virtio_ids.h
then if we add a few asserts somewhere to make sure we don't screwup, we
don't need to do any translation.
Dave
> +}
> +
> +##
> +# @VirtioInfo:
> +#
> +# Information about a given VirtIODevice
> +#
> +# @path: VirtIO device canonical path.
> +#
> +# @type: VirtIO device type.
> +#
> +# Since: 6.0
> +#
> +##
> +{ 'struct': 'VirtioInfo',
> + 'data': {
> + 'path': 'str',
> + 'type': 'VirtioType'
> + }
> +}
> +
> +##
> +# @x-debug-query-virtio:
> +#
> +# Return the list of all VirtIO devices
> +#
> +# Returns: list of @VirtioInfo
> +#
> +# Since: 6.0
> +#
> +# Example:
> +#
> +# -> { "execute": "x-debug-query-virtio" }
> +# <- { "return": [
> +# {
> +# "path": "/machine/peripheral-anon/device[3]/virtio-backend",
> +# "type": "virtio-net"
> +# },
> +# {
> +# "path": "/machine/peripheral-anon/device[1]/virtio-backend",
> +# "type": "virtio-serial"
> +# },
> +# {
> +# "path": "/machine/peripheral-anon/device[0]/virtio-backend",
> +# "type": "virtio-blk"
> +# }
> +# ]
> +# }
> +#
> +##
> +
> +{ 'command': 'x-debug-query-virtio', 'returns': ['VirtioInfo'] }
> diff --git a/tests/qtest/qmp-cmd-test.c b/tests/qtest/qmp-cmd-test.c
> index 1c7186e..8f0ae20 100644
> --- a/tests/qtest/qmp-cmd-test.c
> +++ b/tests/qtest/qmp-cmd-test.c
> @@ -95,6 +95,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-debug-query-virtio", /* CONFIG_VIRTIO */
> /* Success depends on launching SEV guest */
> "query-sev-launch-measure",
> /* Success depends on Host or Hypervisor SEV support */
> --
> 1.8.3.1
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
- [RFC v5 0/6] hmp,qmp: Add some commands to introspect virtio deices, Jonah Palmer, 2021/03/18
- [RFC v5 3/6] qmp: decode feature bits in virtio-status, Jonah Palmer, 2021/03/18
- [RFC v5 4/6] qmp: add QMP command x-debug-virtio-queue-status, Jonah Palmer, 2021/03/18
- [RFC v5 5/6] qmp: add QMP command x-debug-virtio-queue-element, Jonah Palmer, 2021/03/18
- [RFC v5 2/6] qmp: add QMP command x-debug-virtio-status, Jonah Palmer, 2021/03/18
- [RFC v5 6/6] hmp: add virtio commands, Jonah Palmer, 2021/03/18
- [RFC v5 1/6] qmp: add QMP command x-debug-query-virtio, Jonah Palmer, 2021/03/18
- Re: [RFC v5 0/6] hmp, qmp: Add some commands to introspect virtio deices, no-reply, 2021/03/18