qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 6e2bb3: qapi: Update qapi-code-gen.txt exampl


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 6e2bb3: qapi: Update qapi-code-gen.txt example to match cu...
Date: Mon, 19 May 2014 08:00:06 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 6e2bb3ec70e2a23ba74328031c9b82f34c3d4eb9
      
https://github.com/qemu/qemu/commit/6e2bb3ec70e2a23ba74328031c9b82f34c3d4eb9
  Author: Markus Armbruster <address@hidden>
  Date:   2014-05-15 (Thu, 15 May 2014)

  Changed paths:
    M docs/qapi-code-gen.txt

  Log Message:
  -----------
  qapi: Update qapi-code-gen.txt example to match current code

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Luiz Capitulino <address@hidden>


  Commit: f9bee751be1292c9433a95d835474dc38a134a95
      
https://github.com/qemu/qemu/commit/f9bee751be1292c9433a95d835474dc38a134a95
  Author: Markus Armbruster <address@hidden>
  Date:   2014-05-15 (Thu, 15 May 2014)

  Changed paths:
    M docs/qapi-code-gen.txt
    M scripts/qapi-commands.py

  Log Message:
  -----------
  qapi: Normalize marshalling's visitor initialization and cleanup

Input and output marshalling functions do it differently.  Change them
to work the same: initialize the I/O visitor, use it, clean it up,
initialize the dealloc visitor, use it, clean it up.

This delays dealloc visitor initialization in output marshalling
functions, and input visitor cleanup in input marshalling functions.
No functional change, but the latter will be convenient when I change
the error handling.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Luiz Capitulino <address@hidden>


  Commit: cbc95538eda98929d2c5c8ff0d9db9043fcf1ae6
      
https://github.com/qemu/qemu/commit/cbc95538eda98929d2c5c8ff0d9db9043fcf1ae6
  Author: Markus Armbruster <address@hidden>
  Date:   2014-05-15 (Thu, 15 May 2014)

  Changed paths:
    M include/qapi/visitor-impl.h
    M qapi/qapi-visit-core.c

  Log Message:
  -----------
  qapi: Remove unused Visitor callbacks start_handle(), end_handle()

These have never been called or implemented by anything, and their
intended use is undocumented, like all of the visitor API.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Luiz Capitulino <address@hidden>


  Commit: e2cd0f4fb42b1fae65ad22e8efde9804446e6254
      
https://github.com/qemu/qemu/commit/e2cd0f4fb42b1fae65ad22e8efde9804446e6254
  Author: Markus Armbruster <address@hidden>
  Date:   2014-05-15 (Thu, 15 May 2014)

  Changed paths:
    M include/qapi/visitor-impl.h
    M include/qapi/visitor.h
    M qapi/opts-visitor.c
    M qapi/qapi-visit-core.c
    M qapi/qmp-input-visitor.c
    M qapi/string-input-visitor.c
    M scripts/qapi-commands.py
    M scripts/qapi-visit.py

  Log Message:
  -----------
  qapi: Replace start_optional()/end_optional() by optional()

Semantics of end_optional() differ subtly from the other end_FOO()
callbacks: when start_FOO() succeeds, the matching end_FOO() gets
called regardless of what happens in between.  end_optional() gets
called only when everything in between succeeds as well.  Entirely
undocumented, like all of the visitor API.

The only user of Visitor Callback end_optional() never did anything,
and was removed in commit 9f9ab46.

I'm about to clean up error handling in the generated visitor code,
and end_optional() is in my way.  No users mean no test cases, and
making non-trivial cleanup transformations without test cases doesn't
strike me as a good idea.

Drop end_optional(), and rename start_optional() to optional().  We
can always go back to a pair of callbacks when we have an actual need.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Luiz Capitulino <address@hidden>


  Commit: 468866b816f13c8141b692ac0280706c16b30185
      
https://github.com/qemu/qemu/commit/468866b816f13c8141b692ac0280706c16b30185
  Author: Markus Armbruster <address@hidden>
  Date:   2014-05-15 (Thu, 15 May 2014)

  Changed paths:
    M scripts/qapi-visit.py

  Log Message:
  -----------
  qapi-visit.py: Clean up confusing push_indent() / pop_indent() use

Changing implicit indentation in the middle of generating a block
makes following the code being generated unnecessarily hard.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Luiz Capitulino <address@hidden>


  Commit: 4fa953f20d418256504d24ea16f1b39791d12e5b
      
https://github.com/qemu/qemu/commit/4fa953f20d418256504d24ea16f1b39791d12e5b
  Author: Markus Armbruster <address@hidden>
  Date:   2014-05-15 (Thu, 15 May 2014)

  Changed paths:
    M scripts/qapi-visit.py

  Log Message:
  -----------
  qapi: Clean up shadowing of parameters and locals in inner scopes

By un-inlining the visit of nested complex types.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Luiz Capitulino <address@hidden>


  Commit: 192cca60aec59eda9a36501f03fc9dabf4d66a16
      
https://github.com/qemu/qemu/commit/192cca60aec59eda9a36501f03fc9dabf4d66a16
  Author: Markus Armbruster <address@hidden>
  Date:   2014-05-15 (Thu, 15 May 2014)

  Changed paths:
    M scripts/qapi-visit.py

  Log Message:
  -----------
  qapi-visit.py: Clean up a sloppy use of field prefix

generate_visit_struct_fields() generates the base type's struct member
name both with and without the field prefix.  Harmless, because the
field prefix is always empty there: only unboxed complex members have
a prefix, and those can't have a base type.

Clean it up anyway.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Luiz Capitulino <address@hidden>


  Commit: be3c771796cb5ca4e7de2e04ed3cd2e3b6b76185
      
https://github.com/qemu/qemu/commit/be3c771796cb5ca4e7de2e04ed3cd2e3b6b76185
  Author: Markus Armbruster <address@hidden>
  Date:   2014-05-15 (Thu, 15 May 2014)

  Changed paths:
    M scripts/qapi-visit.py

  Log Message:
  -----------
  qapi: Un-inline visit of implicit struct

In preparation of error handling changes.  Bonus: generates less
duplicated code.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Luiz Capitulino <address@hidden>


  Commit: f9f3a5ecde4cb636d8eb43edc0d097bd364ffe75
      
https://github.com/qemu/qemu/commit/f9f3a5ecde4cb636d8eb43edc0d097bd364ffe75
  Author: Markus Armbruster <address@hidden>
  Date:   2014-05-15 (Thu, 15 May 2014)

  Changed paths:
    M hmp.c

  Log Message:
  -----------
  hmp: Call visit_end_struct() after visit_start_struct() succeeds

When visit_start_struct() succeeds, visit_end_struct() must be called.
hmp_object_add() doesn't when a member visit fails.  As far as I can
tell, the opts visitor copes okay with the misuse.  Fix it anyway.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Luiz Capitulino <address@hidden>


  Commit: 2ddb16a95f7d4edab4022ef4707d926c0c28db8d
      
https://github.com/qemu/qemu/commit/2ddb16a95f7d4edab4022ef4707d926c0c28db8d
  Author: Markus Armbruster <address@hidden>
  Date:   2014-05-15 (Thu, 15 May 2014)

  Changed paths:
    M hw/timer/mc146818rtc.c
    M hw/virtio/virtio-balloon.c

  Log Message:
  -----------
  hw: Don't call visit_end_struct() after visit_start_struct() fails

When visit_start_struct() fails, visit_end_struct() must not be
called.  rtc_get_date() and balloon_stats_all() call it anyway.  As
far as I can tell, they're only used with the string output visitor,
which doesn't care.  Fix them anyway.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Luiz Capitulino <address@hidden>


  Commit: cdaec3808e756fee3c4e17d0168ec6429eff0dbc
      
https://github.com/qemu/qemu/commit/cdaec3808e756fee3c4e17d0168ec6429eff0dbc
  Author: Markus Armbruster <address@hidden>
  Date:   2014-05-15 (Thu, 15 May 2014)

  Changed paths:
    M tests/test-qmp-input-strict.c
    M tests/test-qmp-output-visitor.c
    M tests/test-visitor-serialization.c

  Log Message:
  -----------
  tests: Don't call visit_end_struct() after visit_start_struct() fails

When visit_start_struct() fails, visit_end_struct() must not be
called.  Three out of four visit_type_TestStruct() call it anyway.  As
far as I can tell, visit_start_struct() doesn't actually fail there.
Fix them anyway.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Luiz Capitulino <address@hidden>


  Commit: 297a3646c2947ee64a6d42ca264039732c6218e0
      
https://github.com/qemu/qemu/commit/297a3646c2947ee64a6d42ca264039732c6218e0
  Author: Markus Armbruster <address@hidden>
  Date:   2014-05-15 (Thu, 15 May 2014)

  Changed paths:
    M docs/qapi-code-gen.txt
    M hw/timer/mc146818rtc.c
    M hw/virtio/virtio-balloon.c
    M qapi/qapi-visit-core.c
    M scripts/qapi-commands.py
    M scripts/qapi-visit.py
    M tests/test-qmp-input-strict.c
    M tests/test-qmp-input-visitor.c
    M tests/test-qmp-output-visitor.c
    M tests/test-visitor-serialization.c

  Log Message:
  -----------
  qapi: Replace uncommon use of the error API by the common one

We commonly use the error API like this:

    err = NULL;
    foo(..., &err);
    if (err) {
  goto out;
    }
    bar(..., &err);

Every error source is checked separately.  The second function is only
called when the first one succeeds.  Both functions are free to pass
their argument to error_set().  Because error_set() asserts no error
has been set, this effectively means they must not be called with an
error set.

The qapi-generated code uses the error API differently:

    // *errp was initialized to NULL somewhere up the call chain
    frob(..., errp);
    gnat(..., errp);

Errors accumulate in *errp: first error wins, subsequent errors get
dropped.  To make this work, the second function does nothing when
called with an error set.  Requires non-null errp, or else the second
function can't see the first one fail.

This usage has also bled into visitor tests, and two device model
object property getters rtc_get_date() and balloon_stats_get_all().

With the "accumulate" technique, you need fewer error checks in
callers, and buy that with an error check in every callee.  Can be
nice.

However, mixing the two techniques is confusing.  You can't use the
"accumulate" technique with functions designed for the "check
separately" technique.  You can use the "check separately" technique
with functions designed for the "accumulate" technique, but then
error_set() can't catch you setting an error more than once.

Standardize on the "check separately" technique for now, because it's
overwhelmingly prevalent.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Luiz Capitulino <address@hidden>


  Commit: 87a560c455dfc53c151f7f5dd4a305f6d44e00dd
      
https://github.com/qemu/qemu/commit/87a560c455dfc53c151f7f5dd4a305f6d44e00dd
  Author: Markus Armbruster <address@hidden>
  Date:   2014-05-15 (Thu, 15 May 2014)

  Changed paths:
    M docs/qapi-code-gen.txt

  Log Message:
  -----------
  qapi: Show qapi-commands.py invocation in qapi-code-gen.txt

While there, pare down the shell prompts.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Luiz Capitulino <address@hidden>


  Commit: 29136cd8a4883f2ce97387f3a01c156ac1c43869
      
https://github.com/qemu/qemu/commit/29136cd8a4883f2ce97387f3a01c156ac1c43869
  Author: Hani Benhabiles <address@hidden>
  Date:   2014-05-15 (Thu, 15 May 2014)

  Changed paths:
    M hmp-commands.hx
    M hmp.h
    M monitor.c

  Log Message:
  -----------
  monitor: Convert sendkey to use command_completion.

Signed-off-by: Hani Benhabiles <address@hidden>
Signed-off-by: Luiz Capitulino <address@hidden>


  Commit: 6297d9a279ccaf404d26a2c6bdc1a09891bcf5ae
      
https://github.com/qemu/qemu/commit/6297d9a279ccaf404d26a2c6bdc1a09891bcf5ae
  Author: Hani Benhabiles <address@hidden>
  Date:   2014-05-15 (Thu, 15 May 2014)

  Changed paths:
    M hmp-commands.hx
    M hmp.h
    M monitor.c

  Log Message:
  -----------
  monitor: Add chardev-remove command completion.

Signed-off-by: Hani Benhabiles <address@hidden>
Signed-off-by: Luiz Capitulino <address@hidden>


  Commit: 13e315dadaaa8fa6d04d10ae762ba63b54ede0ca
      
https://github.com/qemu/qemu/commit/13e315dadaaa8fa6d04d10ae762ba63b54ede0ca
  Author: Hani Benhabiles <address@hidden>
  Date:   2014-05-15 (Thu, 15 May 2014)

  Changed paths:
    M hmp-commands.hx
    M hmp.h
    M monitor.c

  Log Message:
  -----------
  monitor: Add chardev-add backend argument completion.

Signed-off-by: Hani Benhabiles <address@hidden>
Signed-off-by: Luiz Capitulino <address@hidden>


  Commit: 40d19394b792fb80dba2f536fc13b5b604780a4d
      
https://github.com/qemu/qemu/commit/40d19394b792fb80dba2f536fc13b5b604780a4d
  Author: Hani Benhabiles <address@hidden>
  Date:   2014-05-15 (Thu, 15 May 2014)

  Changed paths:
    M hmp-commands.hx
    M hmp.h
    M monitor.c
    M net/net.c

  Log Message:
  -----------
  monitor: Add set_link arguments completion.

Make it possible to query all net clients without specifying an ID when calling
qemu_find_net_clients_except().

This also adds the add_completion_option() function which is to be used for
other commands completions as well.

Signed-off-by: Hani Benhabiles <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Luiz Capitulino <address@hidden>


  Commit: b162b49adc4cc6aa2c2ed0a31998f23dfe5983e6
      
https://github.com/qemu/qemu/commit/b162b49adc4cc6aa2c2ed0a31998f23dfe5983e6
  Author: Hani Benhabiles <address@hidden>
  Date:   2014-05-15 (Thu, 15 May 2014)

  Changed paths:
    M hmp-commands.hx
    M hmp.h
    M monitor.c

  Log Message:
  -----------
  monitor: Add netdev_add type argument completion.

Also update the command's documentation.

Signed-off-by: Hani Benhabiles <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Luiz Capitulino <address@hidden>


  Commit: 11b389f21e4531c23fb8a8474bc8fc7ac2e136a5
      
https://github.com/qemu/qemu/commit/11b389f21e4531c23fb8a8474bc8fc7ac2e136a5
  Author: Hani Benhabiles <address@hidden>
  Date:   2014-05-15 (Thu, 15 May 2014)

  Changed paths:
    M hmp-commands.hx
    M hmp.h
    M monitor.c

  Log Message:
  -----------
  monitor: Add netdev_del id argument completion.

Signed-off-by: Hani Benhabiles <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Luiz Capitulino <address@hidden>


  Commit: 24fd848950b44de7e2d71fb69ba52b90d6acb220
      
https://github.com/qemu/qemu/commit/24fd848950b44de7e2d71fb69ba52b90d6acb220
  Author: BenoƮt Canet <address@hidden>
  Date:   2014-05-16 (Fri, 16 May 2014)

  Changed paths:
    M docs/qapi-code-gen.txt
    M scripts/qapi.py
    M tests/Makefile
    A tests/qapi-schema/include-repetition-sub.json
    A tests/qapi-schema/include-repetition.err
    A tests/qapi-schema/include-repetition.exit
    A tests/qapi-schema/include-repetition.json
    A tests/qapi-schema/include-repetition.out

  Log Message:
  -----------
  qapi: skip redundant includes

The purpose of this change is to help create a json file containing
common definitions; each bit of generated C code must be emitted
only one time.

A second history global to all QAPISchema instances has been added
to detect when a file is included more than one time and skip these
includes.
It does not act as a stack and the changes made to it by the
__init__ function are propagated back to the caller so it's really
a global state.

Signed-off-by: Benoit Canet <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Luiz Capitulino <address@hidden>


  Commit: c5fa6c86d0765f837515d1c10654c621724a77e0
      
https://github.com/qemu/qemu/commit/c5fa6c86d0765f837515d1c10654c621724a77e0
  Author: Peter Maydell <address@hidden>
  Date:   2014-05-19 (Mon, 19 May 2014)

  Changed paths:
    M docs/qapi-code-gen.txt
    M hmp-commands.hx
    M hmp.c
    M hmp.h
    M hw/timer/mc146818rtc.c
    M hw/virtio/virtio-balloon.c
    M include/qapi/visitor-impl.h
    M include/qapi/visitor.h
    M monitor.c
    M net/net.c
    M qapi/opts-visitor.c
    M qapi/qapi-visit-core.c
    M qapi/qmp-input-visitor.c
    M qapi/string-input-visitor.c
    M scripts/qapi-commands.py
    M scripts/qapi-visit.py
    M scripts/qapi.py
    M tests/Makefile
    A tests/qapi-schema/include-repetition-sub.json
    A tests/qapi-schema/include-repetition.err
    A tests/qapi-schema/include-repetition.exit
    A tests/qapi-schema/include-repetition.json
    A tests/qapi-schema/include-repetition.out
    M tests/test-qmp-input-strict.c
    M tests/test-qmp-input-visitor.c
    M tests/test-qmp-output-visitor.c
    M tests/test-visitor-serialization.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/qmp-unstable/queue/qmp' into staging

* remotes/qmp-unstable/queue/qmp:
  qapi: skip redundant includes
  monitor: Add netdev_del id argument completion.
  monitor: Add netdev_add type argument completion.
  monitor: Add set_link arguments completion.
  monitor: Add chardev-add backend argument completion.
  monitor: Add chardev-remove command completion.
  monitor: Convert sendkey to use command_completion.
  qapi: Show qapi-commands.py invocation in qapi-code-gen.txt
  qapi: Replace uncommon use of the error API by the common one
  tests: Don't call visit_end_struct() after visit_start_struct() fails
  hw: Don't call visit_end_struct() after visit_start_struct() fails
  hmp: Call visit_end_struct() after visit_start_struct() succeeds
  qapi: Un-inline visit of implicit struct
  qapi-visit.py: Clean up a sloppy use of field prefix
  qapi: Clean up shadowing of parameters and locals in inner scopes
  qapi-visit.py: Clean up confusing push_indent() / pop_indent() use
  qapi: Replace start_optional()/end_optional() by optional()
  qapi: Remove unused Visitor callbacks start_handle(), end_handle()
  qapi: Normalize marshalling's visitor initialization and cleanup
  qapi: Update qapi-code-gen.txt example to match current code

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/5bc8f026dd5e...c5fa6c86d076

reply via email to

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