From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Hyman Huang <yong.huang@smartx.com>, qemu-devel@nongnu.org
Cc: "Michael S . Tsirkin" <mst@redhat.com>,
Markus Armbruster <armbru@redhat.com>,
Eric Blake <eblake@redhat.com>
Subject: Re: [PATCH 1/2] qapi/virtio: Keep feature and status bits in the QMP output
Date: Fri, 29 Dec 2023 10:31:49 +0100 [thread overview]
Message-ID: <2f7919b1-eb19-4998-9fd6-c89351255e34@linaro.org> (raw)
In-Reply-To: <138716dee4162ad959ac3580da0d4681fabd6185.1703787712.git.yong.huang@smartx.com>
Hi,
On 28/12/23 19:52, Hyman Huang wrote:
> Maintain the feature and status bits in the x-query-virtio-status
> output and, as usual, add human-readable output only in HMP.
>
> Applications may find it useful to compare features and status
> information directly. An upper application, for example, could
> use the QMP command x-query-virtio-status to retrieve vhost-user
> net device features and the "ovs-vsctl list interface" command to
> retrieve interface features (in number format) in order to verify
> the correctness of the virtio negotiation between guest, QEMU,
> and OVS-DPDK. The application could then compare the two features
> directly, without the need for additional feature encoding.
>
> Signed-off-by: Hyman Huang <yong.huang@smartx.com>
> ---
> hw/virtio/virtio-hmp-cmds.c | 25 +++--
> hw/virtio/virtio-qmp.c | 23 ++---
> qapi/virtio.json | 192 ++++--------------------------------
> 3 files changed, 45 insertions(+), 195 deletions(-)
>
> diff --git a/hw/virtio/virtio-hmp-cmds.c b/hw/virtio/virtio-hmp-cmds.c
> index 477c97dea2..721c630ab0 100644
> --- a/hw/virtio/virtio-hmp-cmds.c
> +++ b/hw/virtio/virtio-hmp-cmds.c
> @@ -6,6 +6,7 @@
> */
>
> #include "qemu/osdep.h"
> +#include "virtio-qmp.h"
> #include "monitor/hmp.h"
> #include "monitor/monitor.h"
> #include "qapi/qapi-commands-virtio.h"
> @@ -145,13 +146,17 @@ void hmp_virtio_status(Monitor *mon, const QDict *qdict)
> monitor_printf(mon, " endianness: %s\n",
> s->device_endian);
> monitor_printf(mon, " status:\n");
> - hmp_virtio_dump_status(mon, s->status);
> + hmp_virtio_dump_status(mon,
> + qmp_decode_status(s->status));
Why not let the callee do this call?
> monitor_printf(mon, " Guest features:\n");
> - hmp_virtio_dump_features(mon, s->guest_features);
> + hmp_virtio_dump_features(mon,
> + qmp_decode_features(s->device_id, s->guest_features));
> monitor_printf(mon, " Host features:\n");
> - hmp_virtio_dump_features(mon, s->host_features);
> + hmp_virtio_dump_features(mon,
> + qmp_decode_features(s->device_id, s->host_features));
> monitor_printf(mon, " Backend features:\n");
> - hmp_virtio_dump_features(mon, s->backend_features);
> + hmp_virtio_dump_features(mon,
> + qmp_decode_features(s->device_id, s->backend_features));
>
> if (s->vhost_dev) {
> monitor_printf(mon, " VHost:\n");
> @@ -172,13 +177,17 @@ void hmp_virtio_status(Monitor *mon, const QDict *qdict)
> monitor_printf(mon, " log_size: %"PRId64"\n",
> s->vhost_dev->log_size);
> monitor_printf(mon, " Features:\n");
> - hmp_virtio_dump_features(mon, s->vhost_dev->features);
> + hmp_virtio_dump_features(mon,
> + qmp_decode_features(s->device_id, s->vhost_dev->features));
Ditto.
> monitor_printf(mon, " Acked features:\n");
> - hmp_virtio_dump_features(mon, s->vhost_dev->acked_features);
> + hmp_virtio_dump_features(mon,
> + qmp_decode_features(s->device_id, s->vhost_dev->acked_features));
> monitor_printf(mon, " Backend features:\n");
> - hmp_virtio_dump_features(mon, s->vhost_dev->backend_features);
> + hmp_virtio_dump_features(mon,
> + qmp_decode_features(s->device_id, s->vhost_dev->backend_features));
> monitor_printf(mon, " Protocol features:\n");
> - hmp_virtio_dump_protocols(mon, s->vhost_dev->protocol_features);
> + hmp_virtio_dump_protocols(mon,
> + qmp_decode_protocols(s->vhost_dev->protocol_features));
> }
next prev parent reply other threads:[~2023-12-29 9:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-28 18:52 [PATCH 0/2] Adjust the output of x-query-virtio-status Hyman Huang
2023-12-28 18:52 ` [PATCH 1/2] qapi/virtio: Keep feature and status bits in the QMP output Hyman Huang
2023-12-29 9:31 ` Philippe Mathieu-Daudé [this message]
2024-01-03 1:30 ` Yong Huang
2023-12-28 18:52 ` [PATCH 2/2] hmp: Drop unknown feature and status bits Hyman Huang
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=2f7919b1-eb19-4998-9fd6-c89351255e34@linaro.org \
--to=philmd@linaro.org \
--cc=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=yong.huang@smartx.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).