diff mbox series

docs/devel/qapi-code-gen: Fix up examples

Message ID 20201027121026.3025930-1-armbru@redhat.com
State Accepted
Commit c4cdf54cff933d7176083581523748d4171db6e6
Headers show
Series docs/devel/qapi-code-gen: Fix up examples | expand

Commit Message

Markus Armbruster Oct. 27, 2020, 12:10 p.m. UTC
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 docs/devel/qapi-code-gen.txt | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Marc-André Lureau Oct. 27, 2020, 12:25 p.m. UTC | #1
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
<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Oct 27, 2020 at 4:22 PM Markus Armbruster &lt;<a href="mailto:armbru@redhat.com">armbru@redhat.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Signed-off-by: Markus Armbruster &lt;<a href="mailto:armbru@redhat.com" target="_blank">armbru@redhat.com</a>&gt;<br></blockquote><div><br></div><div>Reviewed-by: Marc-André Lureau &lt;<a href="mailto:marcandre.lureau@redhat.com">marcandre.lureau@redhat.com</a>&gt;</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
---<br>
 docs/devel/qapi-code-gen.txt | 6 ++++--<br>
 1 file changed, 4 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/docs/devel/qapi-code-gen.txt b/docs/devel/qapi-code-gen.txt<br>
index c6438c6aa9..6906a06ad2 100644<br>
--- a/docs/devel/qapi-code-gen.txt<br>
+++ b/docs/devel/qapi-code-gen.txt<br>
@@ -393,7 +393,7 @@ is identical on the wire to:<br>
  { &#39;enum&#39;: &#39;Enum&#39;, &#39;data&#39;: [&#39;one&#39;, &#39;two&#39;] }<br>
  { &#39;struct&#39;: &#39;Branch1&#39;, &#39;data&#39;: { &#39;data&#39;: &#39;str&#39; } }<br>
  { &#39;struct&#39;: &#39;Branch2&#39;, &#39;data&#39;: { &#39;data&#39;: &#39;int&#39; } }<br>
- { &#39;union&#39;: &#39;Flat&#39;: &#39;base&#39;: { &#39;type&#39;: &#39;Enum&#39; }, &#39;discriminator&#39;: &#39;type&#39;,<br>
+ { &#39;union&#39;: &#39;Flat&#39;, &#39;base&#39;: { &#39;type&#39;: &#39;Enum&#39; }, &#39;discriminator&#39;: &#39;type&#39;,<br>
    &#39;data&#39;: { &#39;one&#39;: &#39;Branch1&#39;, &#39;two&#39;: &#39;Branch2&#39; } }<br>
<br>
 The optional &#39;if&#39; member specifies a conditional.  See &quot;Configuring<br>
@@ -590,6 +590,8 @@ When in doubt, do not implement OOB execution support.<br>
 Member &#39;allow-preconfig&#39; declares whether the command is available<br>
 before the machine is built.  It defaults to false.  For example:<br>
<br>
+ { &#39;enum&#39;: &#39;QMPCapability&#39;,<br>
+   &#39;data&#39;: [ &#39;oob&#39; ] }<br>
  { &#39;command&#39;: &#39;qmp_capabilities&#39;,<br>
    &#39;data&#39;: { &#39;*enable&#39;: [ &#39;QMPCapability&#39; ] },<br>
    &#39;allow-preconfig&#39;: true }<br>
@@ -824,7 +826,7 @@ Example: a struct with conditional feature &#39;allow-negative-numbers&#39;<br>
 { &#39;struct&#39;: &#39;TestType&#39;,<br>
   &#39;data&#39;: { &#39;number&#39;: &#39;int&#39; },<br>
   &#39;features&#39;: [ { &#39;name&#39;: &#39;allow-negative-numbers&#39;,<br>
-                  &#39;if&#39; &#39;defined(IFCOND)&#39; } ] }<br>
+                  &#39;if&#39;: &#39;defined(IFCOND)&#39; } ] }<br>
<br>
 Please note that you are responsible to ensure that the C code will<br>
 compile with an arbitrary combination of conditions, since the<br>
-- <br>
2.26.2<br>
<br>
<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature">Marc-André Lureau<br></div></div>
diff mbox series

Patch

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