qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 04/14] qapi: add a 'command-features' pragma


From: Markus Armbruster
Subject: Re: [PATCH 04/14] qapi: add a 'command-features' pragma
Date: Fri, 12 Jul 2024 10:07:34 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Daniel P. Berrangé <berrange@redhat.com> writes:

> The 'command-features' pragma allows for defining additional
> special features that are unique to a particular QAPI schema
> instance and its implementation.

So far, we have special features (predefined, known to the generator and
treated specially), and normal features (user-defined, not known to the
generator).  You create a new kind in between: user-defined, not known
to the generator, yet treated specially (I guess?).  Hmm.

Could you at least hint at indented use here?  What special treatment do
you have in mind?

> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  scripts/qapi/parser.py | 2 ++
>  scripts/qapi/source.py | 2 ++
>  2 files changed, 4 insertions(+)
>
> diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
> index 7b13a583ac..36a9046243 100644
> --- a/scripts/qapi/parser.py
> +++ b/scripts/qapi/parser.py
> @@ -243,6 +243,8 @@ def check_list_str(name: str, value: object) -> List[str]:
>              pragma.documentation_exceptions = check_list_str(name, value)
>          elif name == 'member-name-exceptions':
>              pragma.member_name_exceptions = check_list_str(name, value)
> +        elif name == 'command-features':
> +            pragma.command_features = check_list_str(name, value)
>          else:
>              raise QAPISemError(info, "unknown pragma '%s'" % name)
>  
> diff --git a/scripts/qapi/source.py b/scripts/qapi/source.py
> index 7b379fdc92..07c2958ac4 100644
> --- a/scripts/qapi/source.py
> +++ b/scripts/qapi/source.py
> @@ -28,6 +28,8 @@ def __init__(self) -> None:
>          self.documentation_exceptions: List[str] = []
>          # Types whose member names may violate case conventions
>          self.member_name_exceptions: List[str] = []
> +        # Arbitrary extra features recorded against commands
> +        self.command_features: List[str] = []
>  
>  
>  class QAPISourceInfo:




reply via email to

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