qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 02/18] qapi: add ModuleInfo schema


From: Markus Armbruster
Subject: Re: [PATCH v2 02/18] qapi: add ModuleInfo schema
Date: Mon, 14 Jun 2021 09:48:23 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

Gerd Hoffmann <kraxel@redhat.com> writes:

> Add QAPI schema for the module info database.
>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  qapi/meson.build      |  1 +
>  qapi/modules.json     | 36 ++++++++++++++++++++++++++++++++++++
>  qapi/qapi-schema.json |  1 +
>  3 files changed, 38 insertions(+)
>  create mode 100644 qapi/modules.json
>
> diff --git a/qapi/meson.build b/qapi/meson.build
> index 376f4ceafe74..596aa5d71168 100644
> --- a/qapi/meson.build
> +++ b/qapi/meson.build
> @@ -36,6 +36,7 @@ qapi_all_modules = [
>    'migration',
>    'misc',
>    'misc-target',
> +  'modules',
>    'net',
>    'pragma',
>    'qom',
> diff --git a/qapi/modules.json b/qapi/modules.json
> new file mode 100644
> index 000000000000..5420977d8765
> --- /dev/null
> +++ b/qapi/modules.json
> @@ -0,0 +1,36 @@
> +# -*- Mode: Python -*-
> +# vim: filetype=python
> +

Missing a section heading like

   ##
   # = Loadable modules
   ##

Without it, the contents gets appended to whatever section precedes it
in qapi-schema.json, which is almost certainly not what you want.

> +##
> +# @ModuleInfo:
> +#
> +# qemu module metadata

It's spelled QEMU :)

Suggest "Loadable module meta-data".

> +#
> +# @name: module name
> +#
> +# @objs: list of qom objects implemented by the module.

s/qom objects/QOM types/

> +#
> +# @deps: list of other modules this module depends on.

Suggest to spell out that these are @name of other loadable modules.

> +#
> +# @arch: module architecture.

Semantics?

Should this be enum SysEmuTarget?

> +#
> +# @opts: qemu opts implemented by module.

Is this the name of a QemuOptsList?

Since this isn't a list, a module can only ever provide one
QemuOptsList.  Sure that's okay?

> +#
> +# Since: 6.1
> +##
> +{ 'struct': 'ModuleInfo',
> +  'data': { 'name'  : 'str',
> +            '*objs' : ['str'],
> +            '*deps' : ['str'],
> +            '*arch' : 'str',
> +            '*opts' : 'str'}}
> +
> +##
> +# @Modules:
> +#
> +# qemu module list
> +#
> +# Since: 6.1
> +##
> +{ 'struct': 'Modules',
> +  'data': { 'list' : ['ModuleInfo']}}

This defines only types, no QMP commands or events.  Why do you need the
types to be QAPI types?

> diff --git a/qapi/qapi-schema.json b/qapi/qapi-schema.json
> index 4912b9744e69..5baa511c2ff5 100644
> --- a/qapi/qapi-schema.json
> +++ b/qapi/qapi-schema.json
> @@ -93,3 +93,4 @@
>  { 'include': 'audio.json' }
>  { 'include': 'acpi.json' }
>  { 'include': 'pci.json' }
> +{ 'include': 'modules.json' }

Is this the place you want the section to be?  Remember, generated
documentation follows source order.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]