On 15/6/26 22:38, Marc-André Lureau wrote:
Replace the hand-written SpdmTransportType C enum and QEnumLookup
table with a QAPI schema definition in qapi/sockets.json. Update
all users in hw/nvme/ctrl.c to use the QAPI-generated enum constants
(SPDM_TRANSPORT_TYPE_* instead of SPDM_SOCKET_TRANSPORT_TYPE_*).
Signed-off-by: Marc-André Lureau <[email protected]>
---
qapi/sockets.json | 20 ++++++++++++++++++++
include/system/spdm-socket.h | 28 +++++++++++-----------------
backends/spdm-socket.c | 23 +++++++----------------
hw/nvme/ctrl.c | 26 +++++++++++++-------------
4 files changed, 51 insertions(+), 46 deletions(-)
diff --git a/qapi/sockets.json b/qapi/sockets.json
index 473be2ac58a..dbb452cfb72 100644
--- a/qapi/sockets.json
+++ b/qapi/sockets.json
@@ -252,3 +252,23 @@
'unix': 'UnixSocketAddress',
'vsock': 'VsockSocketAddress',
'fd': 'FdSocketAddress' } }
+
+##
+# @SpdmTransportType:
+#
+# SPDM transport type
+#
+# @unspecified: Unspecified transport
+#
+# @mctp: MCTP transport
+#
+# @doe: PCI Data Object Exchange (DOE) transport
+#
+# @scsi: SCSI transport
+#
+# @nvme: NVMe transport
+#
+# Since: 11.1
+##
+{ 'enum': 'SpdmTransportType',
+ 'data': [ 'unspecified', 'mctp', 'doe', 'scsi', 'nvme' ] }
The change is correct, so:
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
But I believe SPDM_SOCKET_TRANSPORT_TYPE_UNSPEC was a mistake
and shouldn't be included. Not sure if worth a distinct patch
or mention here.
(Cc'ing SPDM maintainers to get confirmation)