Jonah Palmer <jonah.pal...@oracle.com> writes: > From: Laurent Vivier <lviv...@redhat.com> > > This new command shows the status of a VirtIODevice > (features, endianness and number of virtqueues) > > Next patch will improve output by decoding feature bits. > > Signed-off-by: Laurent Vivier <lviv...@redhat.com> > Signed-off-by: Jonah Palmer <jonah.pal...@oracle.com>
[...] > diff --git a/qapi/virtio.json b/qapi/virtio.json > index 804adbe..4bd09c9 100644 > --- a/qapi/virtio.json > +++ b/qapi/virtio.json > @@ -70,3 +70,79 @@ > ## > > { 'command': 'x-debug-query-virtio', 'returns': ['VirtioInfo'] } > + > +## > +# @VirtioStatusEndianness: > +# > +# Enumeration of endianness for VirtioDevice > +# > +# Since: 6.1 6.2 now, here, below, and in the remainder of this series. > +## > +{ 'enum': 'VirtioStatusEndianness', > + 'data': [ 'unknown', 'little', 'big' ] > +} > + > +## > +# @VirtioStatus: > +# > +# @device-id: VirtIODevice status "status"? Really? > +# > +# @device-endian: VirtIODevice device_endian > +# > +# @guest-features: VirtIODevice guest_features > +# > +# @host-features: VirtIODevice host_features > +# > +# @backend-features: VirtIODevice backend_features > +# > +# @num-vqs: number of VirtIODevice queues > +# > +# Since: 6.1 > +# > +## > + > +{ 'struct': 'VirtioStatus', > + 'data': { > + 'device-id': 'int', VirtIODevice member @device_id is uint64_t. Should this be 'uint16'? > + 'device-endian': 'VirtioStatusEndianness', > + 'guest-features': 'uint64', > + 'host-features': 'uint64', > + 'backend-features': 'uint64', > + 'num-vqs': 'uint16' virtio_get_num_queues() returns int. Sure 'uint16' is the right type? > + } > +} > + > +## > +# @x-debug-virtio-status: > +# > +# Return the status of virtio device "of a virtio device" > +# > +# @path: QOBject path of the VirtIODevice "QOM path", please. > +# > +# Returns: status of the VirtIODevice > +# > +# Since: 6.1 > +# > +# Example: > +# > +# -> { "execute": "x-debug-virtio-status", > +# "arguments": { > +# "path": "/machine/peripheral-anon/device[3]/virtio-backend" > +# } > +# } > +# <- { "return": { > +# "backend-features": 0, > +# "guest-features": 5111807911, > +# "num-vqs": 3, > +# "host-features": 6337593319, > +# "device-endian": "little", > +# "device-id": 1 > +# } > +# } > +# > +## > + > +{ 'command': 'x-debug-virtio-status', > + 'data': { 'path': 'str' }, > + 'returns': 'VirtioStatus' > +}