[PATCH] docs/devel/qapi-code-gen: Fix up examples

Markus Armbruster posted 1 patch 5 years ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20201027121026.3025930-1-armbru@redhat.com
Maintainers: Michael Roth <mdroth@linux.vnet.ibm.com>, Markus Armbruster <armbru@redhat.com>
docs/devel/qapi-code-gen.txt | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
[PATCH] docs/devel/qapi-code-gen: Fix up examples
Posted by Markus Armbruster 5 years ago
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 docs/devel/qapi-code-gen.txt | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/docs/devel/qapi-code-gen.txt b/docs/devel/qapi-code-gen.txt
index c6438c6aa9..6906a06ad2 100644
--- a/docs/devel/qapi-code-gen.txt
+++ b/docs/devel/qapi-code-gen.txt
@@ -393,7 +393,7 @@ is identical on the wire to:
  { 'enum': 'Enum', 'data': ['one', 'two'] }
  { 'struct': 'Branch1', 'data': { 'data': 'str' } }
  { 'struct': 'Branch2', 'data': { 'data': 'int' } }
- { 'union': 'Flat': 'base': { 'type': 'Enum' }, 'discriminator': 'type',
+ { 'union': 'Flat', 'base': { 'type': 'Enum' }, 'discriminator': 'type',
    'data': { 'one': 'Branch1', 'two': 'Branch2' } }
 
 The optional 'if' member specifies a conditional.  See "Configuring
@@ -590,6 +590,8 @@ When in doubt, do not implement OOB execution support.
 Member 'allow-preconfig' declares whether the command is available
 before the machine is built.  It defaults to false.  For example:
 
+ { 'enum': 'QMPCapability',
+   'data': [ 'oob' ] }
  { 'command': 'qmp_capabilities',
    'data': { '*enable': [ 'QMPCapability' ] },
    'allow-preconfig': true }
@@ -824,7 +826,7 @@ Example: a struct with conditional feature 'allow-negative-numbers'
 { 'struct': 'TestType',
   'data': { 'number': 'int' },
   'features': [ { 'name': 'allow-negative-numbers',
-                  'if' 'defined(IFCOND)' } ] }
+                  'if': 'defined(IFCOND)' } ] }
 
 Please note that you are responsible to ensure that the C code will
 compile with an arbitrary combination of conditions, since the
-- 
2.26.2


Re: [PATCH] docs/devel/qapi-code-gen: Fix up examples
Posted by Marc-André Lureau 5 years ago
On Tue, Oct 27, 2020 at 4:22 PM Markus Armbruster <armbru@redhat.com> wrote:

> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

---
>  docs/devel/qapi-code-gen.txt | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/docs/devel/qapi-code-gen.txt b/docs/devel/qapi-code-gen.txt
> index c6438c6aa9..6906a06ad2 100644
> --- a/docs/devel/qapi-code-gen.txt
> +++ b/docs/devel/qapi-code-gen.txt
> @@ -393,7 +393,7 @@ is identical on the wire to:
>   { 'enum': 'Enum', 'data': ['one', 'two'] }
>   { 'struct': 'Branch1', 'data': { 'data': 'str' } }
>   { 'struct': 'Branch2', 'data': { 'data': 'int' } }
> - { 'union': 'Flat': 'base': { 'type': 'Enum' }, 'discriminator': 'type',
> + { 'union': 'Flat', 'base': { 'type': 'Enum' }, 'discriminator': 'type',
>     'data': { 'one': 'Branch1', 'two': 'Branch2' } }
>
>  The optional 'if' member specifies a conditional.  See "Configuring
> @@ -590,6 +590,8 @@ When in doubt, do not implement OOB execution support.
>  Member 'allow-preconfig' declares whether the command is available
>  before the machine is built.  It defaults to false.  For example:
>
> + { 'enum': 'QMPCapability',
> +   'data': [ 'oob' ] }
>   { 'command': 'qmp_capabilities',
>     'data': { '*enable': [ 'QMPCapability' ] },
>     'allow-preconfig': true }
> @@ -824,7 +826,7 @@ Example: a struct with conditional feature
> 'allow-negative-numbers'
>  { 'struct': 'TestType',
>    'data': { 'number': 'int' },
>    'features': [ { 'name': 'allow-negative-numbers',
> -                  'if' 'defined(IFCOND)' } ] }
> +                  'if': 'defined(IFCOND)' } ] }
>
>  Please note that you are responsible to ensure that the C code will
>  compile with an arbitrary combination of conditions, since the
> --
> 2.26.2
>
>
>

-- 
Marc-André Lureau