Jonah Palmer <jonah.pal...@oracle.com> writes: > From: Laurent Vivier <lviv...@redhat.com> > > This new command shows internal status of a VirtQueue. > (vrings and indexes). > > 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 78873cd..7007e0c 100644 > --- a/qapi/virtio.json > +++ b/qapi/virtio.json > @@ -406,3 +406,105 @@ > 'data': { 'path': 'str' }, > 'returns': 'VirtioStatus' > } > + > +## > +# @VirtQueueStatus: > +# > +# Status of a VirtQueue > +# > +# @device-type: VirtIO device type > +# > +# @queue-index: VirtQueue queue_index > +# > +# @inuse: VirtQueue inuse > +# > +# @vring-num: VirtQueue vring.num > +# > +# @vring-num-default: VirtQueue vring.num_default > +# > +# @vring-align: VirtQueue vring.align > +# > +# @vring-desc: VirtQueue vring.desc > +# > +# @vring-avail: VirtQueue vring.avail > +# > +# @vring-used: VirtQueue vring.used > +# > +# @last-avail-idx: VirtQueue last_avail_idx > +# > +# @shadow-avail-idx: VirtQueue shadow_avail_idx > +# > +# @used-idx: VirtQueue used_idx > +# > +# @signalled-used: VirtQueue signalled_used > +# > +# @signalled-used-valid: VirtQueue signalled_used_valid > +# > +# Since: 6.1 > +# > +## > + > +{ 'struct': 'VirtQueueStatus', > + 'data': { > + 'device-type': 'VirtioType', > + 'queue-index': 'uint16', > + 'inuse': 'uint32', > + 'vring-num': 'int', > + 'vring-num-default': 'int', > + 'vring-align': 'int', > + 'vring-desc': 'uint64', > + 'vring-avail': 'uint64', > + 'vring-used': 'uint64', > + 'last-avail-idx': 'uint16', > + 'shadow-avail-idx': 'uint16', > + 'used-idx': 'uint16', > + 'signalled-used': 'uint16', > + 'signalled-used-valid': 'uint16' > + } > +} I can't check the member types like I did for VirtioStatus in PATCH 2 right now. Please double-check them. > + > +## > +# @x-debug-virtio-queue-status: > +# > +# Return the status of a given VirtQueue > +# > +# @path: QOBject path of the VirtIODevice > +# > +# @queue: queue number to examine > +# > +# Returns: Status of the VirtQueue > +# > +# Since: 6.1 > +# > +# Example: > +# > +# -> { "execute": "x-debug-virtio-queue-status", > +# "arguments": { > +# "path": "/machine/peripheral-anon/device[3]/virtio-backend", > +# "queue": 0 > +# } > +# } > +# <- { "return": { > +# "signalled-used": 373, > +# "inuse": 0, > +# "vring-align": 4096, > +# "vring-desc": 864411648, > +# "signalled-used-valid": 0, > +# "vring-num-default": 256, > +# "vring-avail": 864415744, > +# "queue-index": 0, > +# "last-avail-idx": 373, > +# "vring-used": 864416320, > +# "used-idx": 373, > +# "device-type": "virtio-net", > +# "shadow-avail-idx": 619, > +# "vring-num": 256 > +# } > +# } > +# > +## > + > +{ 'command': 'x-debug-virtio-queue-status', > + 'data': { 'path': 'str', 'queue': 'uint16' }, > + 'returns': 'VirtQueueStatus' > +}