QAPI schema review only. Jonah Palmer <jonah.pal...@oracle.com> writes:
> From: Laurent Vivier <lviv...@redhat.com> > > This new command lists all the instances of VirtIODevice with > their path and virtio type. > > Signed-off-by: Laurent Vivier <lviv...@redhat.com> > Reviewed-by: Eric Blake <ebl...@redhat.com> > Signed-off-by: Jonah Palmer <jonah.pal...@oracle.com> [...] > diff --git a/qapi/qapi-schema.json b/qapi/qapi-schema.json > index 4912b97..0c89789 100644 > --- a/qapi/qapi-schema.json > +++ b/qapi/qapi-schema.json > @@ -91,5 +91,6 @@ > { 'include': 'misc.json' } > { 'include': 'misc-target.json' } > { 'include': 'audio.json' } > +{ 'include': 'virtio.json' } > { 'include': 'acpi.json' } > { 'include': 'pci.json' } > diff --git a/qapi/virtio.json b/qapi/virtio.json > new file mode 100644 > index 0000000..804adbe > --- /dev/null > +++ b/qapi/virtio.json > @@ -0,0 +1,72 @@ Please insert at the beginning # -*- Mode: Python -*- # vim: filetype=python # > +## > +# = Virtio devices > +## > + > +## > +# @VirtioType: > +# > +# An enumeration of Virtio device types. > +# > +# Since: 6.1 6.2 now, here and below. > +## > +{ 'enum': 'VirtioType', > + 'data': [ 'unknown', 'virtio-net', 'virtio-blk', 'virtio-console', > + 'virtio-rng', 'virtio-balloon', 'virtio-iomem', 'virtio-rpmsg', > + 'virtio-scsi', 'virtio-9p', 'virtio-mac80211-wlan', > + 'virtio-serial', 'virtio-caif', 'virtio-memory-balloon', > + 'unknown-14', 'unknown-15', 'virtio-gpu', 'virtio-clock', > + 'virtio-input', 'vhost-vsock', 'virtio-crypto', > 'virtio-signal-dist', > + 'virtio-pstore', 'virtio-iommu', 'virtio-mem', 'unknown-25', > + 'vhost-user-fs', 'virtio-pmem', 'unknown-28', > 'virtio-mac80211-hwsim' ] Please limit line length to approximately 70 characters. > +} > + > +## > +# @VirtioInfo: > +# > +# Information about a given VirtIODevice > +# > +# @path: VirtIO device canonical path. Peeking ahead at the example, I conclude this is a QOM path. Please spell that out, e.g. "@path: the device's canonical QOM path". > +# > +# @type: VirtIO device type. > +# > +# Since: 6.1 > +# > +## > +{ 'struct': 'VirtioInfo', > + 'data': { > + 'path': 'str', > + 'type': 'VirtioType' > + } > +} > + > +## > +# @x-debug-query-virtio: > +# > +# Return the list of all VirtIO devices > +# > +# Returns: list of @VirtioInfo > +# > +# Since: 6.1 > +# > +# Example: > +# > +# -> { "execute": "x-debug-query-virtio" } > +# <- { "return": [ > +# { > +# "path": "/machine/peripheral-anon/device[3]/virtio-backend", > +# "type": "virtio-net" > +# }, > +# { > +# "path": "/machine/peripheral-anon/device[1]/virtio-backend", > +# "type": "virtio-serial" > +# }, > +# { > +# "path": "/machine/peripheral-anon/device[0]/virtio-backend", > +# "type": "virtio-blk" > +# } > +# ] > +# } > +# > +## > + > +{ 'command': 'x-debug-query-virtio', 'returns': ['VirtioInfo'] } [...]