From: Hyman Huang <yong.huang@smartx.com>
To: qemu-devel@nongnu.org
Cc: "Michael S . Tsirkin" <mst@redhat.com>,
Eric Blake <eblake@redhat.com>,
Markus Armbruster <armbru@redhat.com>,
yong.huang@smartx.com
Subject: [PATCH v4 3/3] qapi: Define VhostDeviceProtocols and VirtioDeviceFeatures as plain C types
Date: Wed, 21 Feb 2024 22:28:53 +0800 [thread overview]
Message-ID: <8c1c1c6982854c64af0e30982aaead3db24a99c9.1708525606.git.yong.huang@smartx.com> (raw)
In-Reply-To: <cover.1708525606.git.yong.huang@smartx.com>
VhostDeviceProtocols and VirtioDeviceFeatures are only used in
virtio-hmp-cmds.c. So define them as plain C types there, and drop
them from the QAPI schema.
Signed-off-by: Hyman Huang <yong.huang@smartx.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
---
hw/virtio/virtio-hmp-cmds.c | 16 +++++++++++++++
qapi/virtio.json | 39 -------------------------------------
2 files changed, 16 insertions(+), 39 deletions(-)
diff --git a/hw/virtio/virtio-hmp-cmds.c b/hw/virtio/virtio-hmp-cmds.c
index f95bad0069..045b472228 100644
--- a/hw/virtio/virtio-hmp-cmds.c
+++ b/hw/virtio/virtio-hmp-cmds.c
@@ -29,6 +29,22 @@
#include CONFIG_DEVICES
+typedef struct VhostDeviceProtocols VhostDeviceProtocols;
+struct VhostDeviceProtocols {
+ strList *protocols;
+ bool has_unknown_protocols;
+ uint64_t unknown_protocols;
+};
+
+typedef struct VirtioDeviceFeatures VirtioDeviceFeatures;
+struct VirtioDeviceFeatures {
+ strList *transports;
+ bool has_dev_features;
+ strList *dev_features;
+ bool has_unknown_dev_features;
+ uint64_t unknown_dev_features;
+};
+
#define FEATURE_ENTRY(name, desc) (qmp_virtio_feature_map_t) \
{ .virtio_bit = name, .feature_desc = desc }
diff --git a/qapi/virtio.json b/qapi/virtio.json
index 26516fb29c..42dbc87f2f 100644
--- a/qapi/virtio.json
+++ b/qapi/virtio.json
@@ -300,45 +300,6 @@
'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.2
-##
-{ '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.2
-##
-{ 'struct': 'VirtioDeviceFeatures',
- 'data': { 'transports': [ 'str' ],
- '*dev-features': [ 'str' ],
- '*unknown-dev-features': 'uint64' } }
-
##
# @VirtQueueStatus:
#
--
2.39.3
next prev parent reply other threads:[~2024-02-21 15:47 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-21 14:28 [PATCH v4 0/3] Adjust the output of x-query-virtio-status Hyman Huang
2024-02-21 14:28 ` [PATCH v4 1/3] qmp: Switch x-query-virtio-status back to numeric encoding Hyman Huang
2024-02-21 14:28 ` [PATCH v4 2/3] virtio: Declare the decoding functions to static Hyman Huang
2024-02-22 7:58 ` Markus Armbruster
2024-02-21 14:28 ` Hyman Huang [this message]
2024-03-12 16:39 ` [PATCH v4 0/3] Adjust the output of x-query-virtio-status Michael S. Tsirkin
2024-03-13 8:20 ` Markus Armbruster
2024-03-13 9:18 ` Michael S. Tsirkin
2024-03-13 9:40 ` Markus Armbruster
2024-03-13 11:08 ` Michael S. Tsirkin
2024-03-13 11:11 ` Michael S. Tsirkin
2024-03-15 7:51 ` Markus Armbruster
2024-03-15 12:56 ` Yong 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=8c1c1c6982854c64af0e30982aaead3db24a99c9.1708525606.git.yong.huang@smartx.com \
--to=yong.huang@smartx.com \
--cc=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
/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).