From: Hyman Huang <yong.huang@smartx.com>
To: qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>,
"Michael S . Tsirkin" <mst@redhat.com>,
Eric Blake <eblake@redhat.com>,
yong.huang@smartx.com
Subject: [PATCH v3 3/3] qapi: Define VhostDeviceProtocols and VirtioDeviceFeatures as plain C types
Date: Fri, 2 Feb 2024 22:32:17 +0800 [thread overview]
Message-ID: <4ce51ef3d64fe2b09443cd0529da91115476b35a.1706883915.git.yong.huang@smartx.com> (raw)
In-Reply-To: <cover.1706883915.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>
---
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.31.1
next prev parent reply other threads:[~2024-02-02 14:35 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-02 14:32 [PATCH v3 0/3] Adjust the output of x-query-virtio-status Hyman Huang
2024-02-02 14:32 ` [PATCH v3 1/3] qmp: Switch x-query-virtio-status back to numeric encoding Hyman Huang
2024-02-13 10:26 ` Michael S. Tsirkin
2024-02-15 12:49 ` Yong Huang
2024-02-19 15:32 ` Markus Armbruster
2024-02-20 1:27 ` Yong Huang
2024-02-19 15:18 ` Markus Armbruster
2024-02-02 14:32 ` [PATCH v3 2/3] virtio: Declare the decoding functions to static Hyman Huang
2024-02-19 15:38 ` Markus Armbruster
2024-02-21 3:59 ` Yong Huang
2024-02-02 14:32 ` Hyman Huang [this message]
2024-02-19 15:33 ` [PATCH v3 3/3] qapi: Define VhostDeviceProtocols and VirtioDeviceFeatures as plain C types Markus Armbruster
2024-02-13 10:25 ` [PATCH v3 0/3] Adjust the output of x-query-virtio-status Michael S. Tsirkin
2024-02-13 13:30 ` Markus Armbruster
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=4ce51ef3d64fe2b09443cd0529da91115476b35a.1706883915.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).