Re: [PATCH v2 40/53] spdm-socket: convert SpdmTransportType to QAPI enum

Alistair Francis <[email protected]>
Newsgroups org.nongnu.qemu-devel
Message-ID <[email protected]>
On Sun, 2026-08-16 at 11:03 +0200, Philippe Mathieu-Daudé wrote:
> 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]>

Reviewed-by: Alistair Francis <[email protected]>

Alistair

> > ---
> >   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)

It's included to match the enums from the original spdm-emu:

https://github.com/DMTF/spdm-emu/blob/64cf999e8037bd3e0fa95f69332ff4c1d277f705/spdm_emu/spdm_emu_common/command.h#L29

So I think it should stay

Alistair
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.