From: Markus Armbruster <armbru@redhat.com>
To: Jonah Palmer <jonah.palmer@oracle.com>
Cc: mst@redhat.com, qemu_oss@crudebyte.com, qemu-devel@nongnu.org,
kraxel@redhat.com, si-wei.liu@oracle.com,
joao.m.martins@oracle.com, eblake@redhat.com,
qemu-block@nongnu.org, david@redhat.com, arei.gonglei@huawei.com,
marcandre.lureau@redhat.com, lvivier@redhat.com,
thuth@redhat.com, michael.roth@amd.com, groug@kaod.org,
dgilbert@redhat.com, eric.auger@redhat.com, stefanha@redhat.com,
boris.ostrovsky@oracle.com, kwolf@redhat.com,
mathieu.poirier@linaro.org, raphael.norwitz@nutanix.com,
pbonzini@redhat.com
Subject: Re: [PATCH v12 5/8] qmp: decode feature & status bits in virtio-status
Date: Fri, 11 Feb 2022 13:30:32 +0100 [thread overview]
Message-ID: <871r09pouv.fsf@pond.sub.org> (raw)
In-Reply-To: <1644488520-21604-6-git-send-email-jonah.palmer@oracle.com> (Jonah Palmer's message of "Thu, 10 Feb 2022 05:21:57 -0500")
Jonah Palmer <jonah.palmer@oracle.com> writes:
> From: Laurent Vivier <lvivier@redhat.com>
>
> Display feature names instead of bitmaps for host, guest, and
> backend for VirtIODevices.
>
> Display status names instead of bitmaps for VirtIODevices.
>
> Display feature names instead of bitmaps for backend, protocol,
> acked, and features (hdev->features) for vhost devices.
>
> Decode features according to device ID. Decode statuses
> according to configuration status bitmap (config_status_map).
> Decode vhost user protocol features according to vhost user
> protocol bitmap (vhost_user_protocol_map).
>
> Transport features are on the first line. Undecoded bits (if
> any) are stored in a separate field.
>
> Signed-off-by: Jonah Palmer <jonah.palmer@oracle.com>
[...]
> diff --git a/qapi/virtio.json b/qapi/virtio.json
> index ba61d83..474a8bd 100644
> --- a/qapi/virtio.json
> +++ b/qapi/virtio.json
> @@ -106,10 +106,10 @@
> 'n-tmp-sections': 'int',
> 'nvqs': 'uint32',
> 'vq-index': 'int',
> - 'features': 'uint64',
> - 'acked-features': 'uint64',
> - 'backend-features': 'uint64',
> - 'protocol-features': 'uint64',
> + 'features': 'VirtioDeviceFeatures',
> + 'acked-features': 'VirtioDeviceFeatures',
> + 'backend-features': 'VirtioDeviceFeatures',
> + 'protocol-features': 'VhostDeviceProtocols',
> 'max-queues': 'uint64',
> 'backend-cap': 'uint64',
> 'log-enabled': 'bool',
> @@ -176,11 +176,11 @@
> 'device-id': 'uint16',
> 'vhost-started': 'bool',
> 'device-endian': 'str',
> - 'guest-features': 'uint64',
> - 'host-features': 'uint64',
> - 'backend-features': 'uint64',
> + 'guest-features': 'VirtioDeviceFeatures',
> + 'host-features': 'VirtioDeviceFeatures',
> + 'backend-features': 'VirtioDeviceFeatures',
> 'num-vqs': 'int',
> - 'status': 'uint8',
> + 'status': 'VirtioDeviceStatus',
> 'isr': 'uint8',
> 'queue-sel': 'uint16',
> 'vm-running': 'bool',
> @@ -222,14 +222,28 @@
> # "name": "virtio-crypto",
> # "started": true,
> # "device-id": 20,
> -# "backend-features": 0,
> +# "backend-features": {
> +# "transports": [],
> +# "dev-features": []
> +# },
> # "start-on-kick": false,
> # "isr": 1,
> # "broken": false,
> -# "status": 15,
> +# "status": {
> +# "statuses": ["ACKNOWLEDGE", "DRIVER", "FEATURES_OK",
> +# "DRIVER_OK"]
> +# },
> # "num-vqs": 2,
> -# "guest-features": 5100273664,
> -# "host-features": 6325010432,
> +# "guest-features": {
> +# "transports": ["EVENT_IDX", "INDIRECT_DESC", "VERSION_1"],
> +# "dev-features": []
> +# },
> +# "host-features": {
> +# "transports": ["PROTOCOL_FEATURES", "EVENT_IDX",
> +# "INDIRECT_DESC", "VERSION_1", "ANY_LAYOUT",
> +# "NOTIFY_ON_EMPTY"],
> +# "dev-features": []
> +# },
> # "use-guest-notifier-mask": true,
> # "vm-running": true,
> # "queue-sel": 1,
> @@ -257,22 +271,65 @@
> # "max-queues": 1,
> # "backend-cap": 2,
> # "log-size": 0,
> -# "backend-features": 0,
> +# "backend-features": {
> +# "transports": [],
> +# "dev-features": []
> +# },
> # "nvqs": 2,
> -# "protocol-features": 0,
> +# "protocol-features": {
> +# "protocols": []
> +# },
> # "vq-index": 0,
> # "log-enabled": false,
> -# "acked-features": 5100306432,
> -# "features": 13908344832
> +# "acked-features": {
> +# "transports": ["EVENT_IDX", "INDIRECT_DESC", "VERSION_1",
> +# "ANY_LAYOUT", "NOTIFY_ON_EMPTY"],
> +# "dev-features": ["MRG_RXBUF"]
> +# },
> +# "features": {
> +# "transports": ["EVENT_IDX", "INDIRECT_DESC",
> +# "IOMMU_PLATFORM", "VERSION_1", "ANY_LAYOUT",
> +# "NOTIFY_ON_EMPTY"],
> +# "dev-features": ["LOG_ALL", "MRG_RXBUF"]
> +# }
> +# },
> +# "backend-features": {
> +# "transports": ["PROTOCOL_FEATURES", "EVENT_IDX", "INDIRECT_DESC",
> +# "VERSION_1", "ANY_LAYOUT", "NOTIFY_ON_EMPTY"],
> +# "dev-features": ["GSO", "CTRL_MAC_ADDR", "GUEST_ANNOUNCE", "CTRL_RX_EXTRA",
> +# "CTRL_VLAN", "CTRL_RX", "CTRL_VQ", "STATUS", "MRG_RXBUF",
> +# "HOST_UFO", "HOST_ECN", "HOST_TSO6", "HOST_TSO4",
> +# "GUEST_UFO", "GUEST_ECN", "GUEST_TSO6", "GUEST_TSO4",
> +# "MAC", "CTRL_GUEST_OFFLOADS", "GUEST_CSUM", "CSUM"]
> # },
> -# "backend-features": 6337593319,
> # "start-on-kick": false,
> # "isr": 1,
> # "broken": false,
> -# "status": 15,
> +# "status": {
> +# "statuses": ["ACKNOWLEDGE", "DRIVER", "FEATURES_OK", "DRIVER_OK"]
> +# },
> # "num-vqs": 3,
> -# "guest-features": 5111807911,
> -# "host-features": 6337593319,
> +# "guest-features": {
> +# "transports": ["EVENT_IDX", "INDIRECT_DESC", "VERSION_1"],
> +# "dev-features": ["CTRL_MAC_ADDR", "GUEST_ANNOUNCE", "CTRL_VLAN",
> +# "CTRL_RX", "CTRL_VQ", "STATUS", "MRG_RXBUF",
> +# "HOST_UFO", "HOST_ECN", "HOST_TSO6",
> +# "HOST_TSO4", "GUEST_UFO", "GUEST_ECN",
> +# "GUEST_TSO6", "GUEST_TSO4", "MAC",
> +# "CTRL_GUEST_OFFLOADS", "GUEST_CSUM", "CSUM"]
> +# },
> +# "host-features": {
> +# "transports": ["PROTOCOL_FEATURES", "EVENT_IDX",
> +# "INDIRECT_DESC", "VERSION_1", "ANY_LAYOUT",
> +# "NOTIFY_ON_EMPTY"],
> +# "dev-features": ["GSO", "CTRL_MAC_ADDR", "GUEST_ANNOUNCE",
> +# "CTRL_RX_EXTRA", "CTRL_VLAN", "CTRL_RX",
> +# "CTRL_VQ", "STATUS", "MRG_RXBUF", "HOST_UFO",
> +# "HOST_ECN", "HOST_TSO4", "HOST_TSO4",
> +# "GUEST_UFO", "GUEST_ECN", "GUEST_TSO6",
> +# "GUEST_TSO4", "MAC", "CTRL_GUEST_OFFLOADS",
> +# "GUEST_CSUM", "CSUM"]
> +# },
> # "use-guest-notifier-mask": true,
> # "vm-running": true,
> # "queue-sel": 2,
> @@ -288,3 +345,62 @@
> 'data': { 'path': 'str' },
> 'returns': 'VirtioStatus',
> 'features': [ 'unstable' ] }
> +
> +##
> +# @VirtioDeviceStatus:
> +#
> +# A structure defined to list the configuration statuses of a virtio
> +# device
> +#
> +# @statuses: List of decoded configuration statuses of the virtio
> +# device
> +#
> +# @unknown-statuses: Virtio device statuses bitmap that have not been decoded
> +#
> +# Since: 7.0
> +##
> +
> +{ 'struct': 'VirtioDeviceStatus',
> + 'data': { 'statuses': [ 'str' ],
> + '*unknown-statuses': 'uint8' } }
> +
> +##
> +# @VhostDeviceProtocols:
> +#
> +# A structure defined to list the vhost user protocol features of a
> +# Vhost User device
> +#
> +# @protocols: List of decoded vhost user protocol features of a vhost
> +# user device
> +#
> +# @unknown-protocols: Vhost user device protocol features bitmap that
> +# have not been decoded
> +#
> +# Since: 7.0
> +##
> +
> +{ 'struct': 'VhostDeviceProtocols',
> + 'data': { 'protocols': [ 'str' ],
> + '*unknown-protocols': 'uint64' } }
> +
> +##
> +# @VirtioDeviceFeatures:
> +#
> +# The common fields that apply to most Virtio devices. Some devices
> +# may not have their own device-specific features (e.g. virtio-rng).
> +#
> +# @transports: List of transport features of the virtio device
> +#
> +# @dev-features: List of device-specific features (if the device has
> +# unique features)
> +#
> +# @unknown-dev-features: Virtio device features bitmap that have not
> +# been decoded
> +#
> +# Since: 7.0
> +##
> +
> +{ 'struct': 'VirtioDeviceFeatures',
> + 'data': { 'transports': [ 'str' ],
> + '*dev-features': [ 'str' ],
> + '*unknown-dev-features': 'uint64' } }
I think I'd factor out the common pair of members (list of strings, list
of integers). This is not a demand.
QAPI schema
Acked-by: Markus Armbruster <armbru@redhat.com>
next prev parent reply other threads:[~2022-02-11 13:21 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-10 10:21 [PATCH v12 0/8] hmp,qmp: Add commands to introspect virtio devices Jonah Palmer
2022-02-10 10:21 ` [PATCH v12 1/8] virtio: drop name parameter for virtio_init() Jonah Palmer
2022-02-10 14:55 ` Pankaj Gupta
2022-02-10 15:08 ` Christian Schoenebeck
2022-02-10 10:21 ` [PATCH v12 2/8] virtio: add vhost support for virtio devices Jonah Palmer
2022-02-10 10:21 ` [PATCH v12 3/8] qmp: add QMP command x-query-virtio Jonah Palmer
2022-02-10 15:01 ` Pankaj Gupta
2022-02-11 12:03 ` Markus Armbruster
2022-02-10 10:21 ` [PATCH v12 4/8] qmp: add QMP command x-query-virtio-status Jonah Palmer
2022-02-10 15:17 ` Pankaj Gupta
2022-02-11 12:03 ` Markus Armbruster
2022-02-10 10:21 ` [PATCH v12 5/8] qmp: decode feature & status bits in virtio-status Jonah Palmer
2022-02-11 12:30 ` Markus Armbruster [this message]
2022-02-10 10:21 ` [PATCH v12 6/8] qmp: add QMP commands for virtio/vhost queue-status Jonah Palmer
2022-02-11 12:09 ` Markus Armbruster
2022-02-10 10:21 ` [PATCH v12 7/8] qmp: add QMP command x-query-virtio-queue-element Jonah Palmer
2022-02-11 12:10 ` Markus Armbruster
2022-02-10 10:22 ` [PATCH v12 8/8] hmp: add virtio commands Jonah Palmer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871r09pouv.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=arei.gonglei@huawei.com \
--cc=boris.ostrovsky@oracle.com \
--cc=david@redhat.com \
--cc=dgilbert@redhat.com \
--cc=eblake@redhat.com \
--cc=eric.auger@redhat.com \
--cc=groug@kaod.org \
--cc=joao.m.martins@oracle.com \
--cc=jonah.palmer@oracle.com \
--cc=kraxel@redhat.com \
--cc=kwolf@redhat.com \
--cc=lvivier@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mathieu.poirier@linaro.org \
--cc=michael.roth@amd.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu_oss@crudebyte.com \
--cc=raphael.norwitz@nutanix.com \
--cc=si-wei.liu@oracle.com \
--cc=stefanha@redhat.com \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.