qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 9b89b6: docs: Move files from docs/qmp/ to do


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 9b89b6: docs: Move files from docs/qmp/ to docs/
Date: Tue, 13 Oct 2015 04:00:05 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 9b89b6a2872f1473ef82acdcb64c901982e0ef88
      
https://github.com/qemu/qemu/commit/9b89b6a2872f1473ef82acdcb64c901982e0ef88
  Author: Markus Armbruster <address@hidden>
  Date:   2015-10-12 (Mon, 12 Oct 2015)

  Changed paths:
    M MAINTAINERS
    A docs/qmp-events.txt
    A docs/qmp-intro.txt
    A docs/qmp-spec.txt
    R docs/qmp/README
    R docs/qmp/qmp-events.txt
    R docs/qmp/qmp-spec.txt

  Log Message:
  -----------
  docs: Move files from docs/qmp/ to docs/

Giving QMP its own subdirectory in docs/ is hardly worthwhile when we
have just four files, and one of them isn't even in the subdirectory.
Move the files from docs/qmp/ to docs/, renaming docs/qmp/README to
docs/qmp-intro.

Update MAINTAINERS.  The new pattern also captures the fourth file
docs/writing-qmp-commands.txt.

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


  Commit: 7735d2b50477b171446b38efd2d8866d3c966162
      
https://github.com/qemu/qemu/commit/7735d2b50477b171446b38efd2d8866d3c966162
  Author: Markus Armbruster <address@hidden>
  Date:   2015-10-12 (Mon, 12 Oct 2015)

  Changed paths:
    M MAINTAINERS

  Log Message:
  -----------
  MAINTAINERS: Specify QObject include and test files

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


  Commit: ac4abb9aeb734f36eb90b149b9eed0cc8fdb2872
      
https://github.com/qemu/qemu/commit/ac4abb9aeb734f36eb90b149b9eed0cc8fdb2872
  Author: Markus Armbruster <address@hidden>
  Date:   2015-10-12 (Mon, 12 Oct 2015)

  Changed paths:
    M MAINTAINERS

  Log Message:
  -----------
  MAINTAINERS: Specify QAPI include and test files

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


  Commit: 1ffe818a395cb883746f3baf8d9a0b6988375e8b
      
https://github.com/qemu/qemu/commit/1ffe818a395cb883746f3baf8d9a0b6988375e8b
  Author: Eric Blake <address@hidden>
  Date:   2015-10-12 (Mon, 12 Oct 2015)

  Changed paths:
    M tests/Makefile

  Log Message:
  -----------
  qapi: Sort qapi-schema tests

Recent changes to qapi have provided quite a bit of churn in
the makefile, because we are inconsistent on what order test
names appear in, and on whether to re-wrap the list of tests or
just add arbitrary line lengths.  Writing the list in a sorted
fashion, one test per line, will make future patches easier
to see what tests are being added or removed by a patch.

Although it is tempting to use $(wildcard qapi-schema/*.json)
for a more compact listing, such an approach would risk picking
up leftover garbage .json files in the directory; so keeping
the list explicit is safer for ensuring reproducible tarballs
and test results.

Signed-off-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 7408fb67c0f9403f6e40aecf97cf798fc14e2cd8
      
https://github.com/qemu/qemu/commit/7408fb67c0f9403f6e40aecf97cf798fc14e2cd8
  Author: Eric Blake <address@hidden>
  Date:   2015-10-12 (Mon, 12 Oct 2015)

  Changed paths:
    M scripts/qapi.py
    M tests/qapi-schema/include-non-file.err
    M tests/qapi-schema/include-non-file.json

  Log Message:
  -----------
  qapi: Improve 'include' error message

Use of '"...%s" % include' to print non-strings can lead to
ugly messages, such as this (if the .json change is applied
without the qapi.py change):
 Expected a file name (string), got: OrderedDict()

Better is to just omit the actual non-string value in the
message.

Signed-off-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 59b00542659c8947f9d4e8c28d2d528ab3ab61a5
      
https://github.com/qemu/qemu/commit/59b00542659c8947f9d4e8c28d2d528ab3ab61a5
  Author: Eric Blake <address@hidden>
  Date:   2015-10-12 (Mon, 12 Oct 2015)

  Changed paths:
    M scripts/qapi.py

  Log Message:
  -----------
  qapi: Invoke exception superclass initializer

pylint recommends that every exception class should explicitly
invoke the superclass __init__, even though things seem to work
fine without it.

Signed-off-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 437db2549be383e52acad6cd4bf2862e98fdfc93
      
https://github.com/qemu/qemu/commit/437db2549be383e52acad6cd4bf2862e98fdfc93
  Author: Eric Blake <address@hidden>
  Date:   2015-10-12 (Mon, 12 Oct 2015)

  Changed paths:
    M scripts/ordereddict.py
    M scripts/qapi.py

  Log Message:
  -----------
  qapi: Clean up qapi.py per pep8

Silence pep8, and make pylint a bit happier.  Just style cleanups,
plus killing a useless comment in camel_to_upper(); no semantic
changes.

Signed-off-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: d220fbcd1db2097de5ff3037e85317fcb5433e4e
      
https://github.com/qemu/qemu/commit/d220fbcd1db2097de5ff3037e85317fcb5433e4e
  Author: Eric Blake <address@hidden>
  Date:   2015-10-12 (Mon, 12 Oct 2015)

  Changed paths:
    M tests/Makefile
    M tests/qapi-schema/alternate-clash.err
    M tests/qapi-schema/alternate-clash.json
    A tests/qapi-schema/args-name-clash.err
    A tests/qapi-schema/args-name-clash.exit
    A tests/qapi-schema/args-name-clash.json
    A tests/qapi-schema/args-name-clash.out
    M tests/qapi-schema/duplicate-key.err
    M tests/qapi-schema/duplicate-key.json
    M tests/qapi-schema/flat-union-base-union.err
    M tests/qapi-schema/flat-union-base-union.json
    R tests/qapi-schema/flat-union-branch-clash.err
    R tests/qapi-schema/flat-union-branch-clash.exit
    R tests/qapi-schema/flat-union-branch-clash.json
    R tests/qapi-schema/flat-union-branch-clash.out
    A tests/qapi-schema/flat-union-clash-branch.err
    A tests/qapi-schema/flat-union-clash-branch.exit
    A tests/qapi-schema/flat-union-clash-branch.json
    A tests/qapi-schema/flat-union-clash-branch.out
    A tests/qapi-schema/flat-union-clash-member.err
    A tests/qapi-schema/flat-union-clash-member.exit
    A tests/qapi-schema/flat-union-clash-member.json
    A tests/qapi-schema/flat-union-clash-member.out
    A tests/qapi-schema/flat-union-clash-type.err
    A tests/qapi-schema/flat-union-clash-type.exit
    A tests/qapi-schema/flat-union-clash-type.json
    A tests/qapi-schema/flat-union-clash-type.out
    M tests/qapi-schema/qapi-schema-test.json
    M tests/qapi-schema/qapi-schema-test.out
    A tests/qapi-schema/struct-base-clash-base.err
    A tests/qapi-schema/struct-base-clash-base.exit
    A tests/qapi-schema/struct-base-clash-base.json
    A tests/qapi-schema/struct-base-clash-base.out
    M tests/qapi-schema/struct-base-clash-deep.err
    M tests/qapi-schema/struct-base-clash-deep.json
    M tests/qapi-schema/struct-base-clash.err
    M tests/qapi-schema/struct-base-clash.json
    A tests/qapi-schema/union-clash-branches.err
    A tests/qapi-schema/union-clash-branches.exit
    A tests/qapi-schema/union-clash-branches.json
    A tests/qapi-schema/union-clash-branches.out
    A tests/qapi-schema/union-clash-data.err
    A tests/qapi-schema/union-clash-data.exit
    A tests/qapi-schema/union-clash-data.json
    A tests/qapi-schema/union-clash-data.out
    A tests/qapi-schema/union-clash-type.err
    A tests/qapi-schema/union-clash-type.exit
    A tests/qapi-schema/union-clash-type.json
    A tests/qapi-schema/union-clash-type.out

  Log Message:
  -----------
  qapi: Test for various name collisions

Expose some weaknesses in the generator: we don't always forbid
the generation of structs that contain multiple members that map
to the same C or QMP name.  This has already been marked FIXME in
qapi.py in commit d90675f, but having more tests will make sure
future patches produce desired behavior; and updating existing
patches to better document things doesn't hurt, either.  Some of
these collisions are already caught in the old-style parser
checks, but ultimately we want all collisions to be caught in the
new-style QAPISchema*.check() methods.

This patch focuses on C struct members, and does not consider
collisions between commands and events (affecting C function
names), or even collisions between generated C type names with
user type names (for things like automatic FOOList struct
representing array types or FOOKind for an implicit enum).

There are two types of struct collisions we want to catch:
 1) Collision between two keys in a JSON object. qapi.py prevents
    that within a single struct (see test duplicate-key), but it is
    possible to have collisions between a type's members and its
    base type's members (existing tests struct-base-clash,
    struct-base-clash-deep), and its flat union variant members
    (renamed test flat-union-clash-member).
 2) Collision between two members of the C struct that is generated
    for a given QAPI type:
    a) Multiple QAPI names map to the same C name (new test
       args-name-clash)
    b) A QAPI name maps to a C name that is used for another purpose
       (new tests flat-union-clash-branch, struct-base-clash-base,
       union-clash-data). We already fixed some such cases in commit
       0f61af3e and 1e6c1616, but more remain.
    c) Two C names generated for other purposes clash
       (updated test alternate-clash, new test union-clash-branches,
       union-clash-type, flat-union-clash-type)

Ultimately, if we need to have a flat union where a tag value
clashes with a base member name, we could change the generator to
name the union (using 'foo.u.value' rather than 'foo.value') or
otherwise munge the C name corresponding to tag values.  But
unless such a need arises, it will probably be easier to just
forbid these collisions.

Some of these negative tests will be deleted later, and positive
tests added to qapi-schema-test.json in their place, when the
generator code is reworked to avoid particular code generation
collisions in class 2).

[Note that viewing this patch with git rename detection enabled
may see some confusion due to renaming some tests while adding
others, but where the content is similar enough that git picks
the wrong pre- and post-patch files to associate]

Signed-off-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
[Improve commit message and comments a bit, drop an unrelated test]
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 7b2a5c2f9a52c4a08630fa741052f03fe5d3cc8a
      
https://github.com/qemu/qemu/commit/7b2a5c2f9a52c4a08630fa741052f03fe5d3cc8a
  Author: Eric Blake <address@hidden>
  Date:   2015-10-12 (Mon, 12 Oct 2015)

  Changed paths:
    M scripts/qapi.py
    M tests/qapi-schema/flat-union-clash-type.err
    M tests/qapi-schema/flat-union-clash-type.json
    M tests/qapi-schema/union-clash-type.err
    M tests/qapi-schema/union-clash-type.json

  Log Message:
  -----------
  qapi: Avoid assertion failure on union 'type' collision

The previous commit added two tests that triggered an assertion
failure. It's fairly straightforward to avoid the failure by
just outright forbidding the collision between a union's tag
values and its discriminator name (including the implicit name
'kind' supplied for simple unions [*]).  Ultimately, we'd like
to move the collision detection into QAPISchema*.check(), but
for now it is easier just to enhance the existing checks.

[*] Of course, down the road, we have plans to rename the simple
union tag name to 'type' to match the QMP wire name, but the
idea of the collision will still be present even then.

Technically, we could avoid the collision by naming the C union
members representing each enum value as '_case_value' rather
than 'value'; but until we have an actual qapi client (and not
just our testsuite) that has a legitimate reason to match a
case label to the name of a QMP key and needs the name munging
to satisfy the compiler, it's easier to just reject the qapi
as invalid.

Signed-off-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
[Polished a few comments]
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 8d25dd101f759425456b8005b3180062689d71e7
      
https://github.com/qemu/qemu/commit/8d25dd101f759425456b8005b3180062689d71e7
  Author: Eric Blake <address@hidden>
  Date:   2015-10-12 (Mon, 12 Oct 2015)

  Changed paths:
    M tests/Makefile
    A tests/qapi-schema/alternate-empty.err
    A tests/qapi-schema/alternate-empty.exit
    A tests/qapi-schema/alternate-empty.json
    A tests/qapi-schema/alternate-empty.out
    M tests/qapi-schema/alternate-nested.json
    M tests/qapi-schema/alternate-unknown.json
    A tests/qapi-schema/flat-union-empty.err
    A tests/qapi-schema/flat-union-empty.exit
    A tests/qapi-schema/flat-union-empty.json
    A tests/qapi-schema/flat-union-empty.out
    A tests/qapi-schema/union-empty.err
    A tests/qapi-schema/union-empty.exit
    A tests/qapi-schema/union-empty.json
    A tests/qapi-schema/union-empty.out

  Log Message:
  -----------
  qapi: Add tests for empty unions

The documentation claims that alternates are useful for
allowing two or more types, although nothing enforces this.
Meanwhile, it is silent on whether empty unions are allowed.
In practice, the generated code will compile, in part because
we have a 'void *data' branch; but attempting to visit such a
type will cause an abort().  While there's no technical reason
that a degenerate union could not be made to work, it's harder
to justify the time spent in chasing known (the current
abort() during visit) and unknown corner cases, than it would
be to just outlaw them.  A future patch will probably take the
approach of forbidding them; in the meantime, we can at least
add testsuite coverage to make it obvious where things stand.

In addition to adding tests to expose the problems, we also
need to adjust existing tests that are meant to test something
else, but which could fail for the wrong reason if we reject
degenerate alternates/unions.

Note that empty structs are explicitly supported (for example,
right now they are the only way to specify that one branch of a
flat union adds no additional members), and empty enums are
covered by the testsuite as working (even if they do not seem
to have much use).

Signed-off-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 9c51b4412959c5331a8a931d848c4b755b5bb36a
      
https://github.com/qemu/qemu/commit/9c51b4412959c5331a8a931d848c4b755b5bb36a
  Author: Eric Blake <address@hidden>
  Date:   2015-10-12 (Mon, 12 Oct 2015)

  Changed paths:
    M tests/qapi-schema/qapi-schema-test.json
    M tests/qapi-schema/qapi-schema-test.out
    M tests/test-qmp-input-visitor.c

  Log Message:
  -----------
  qapi: Test use of 'number' within alternates

Add some testsuite exposure for use of a 'number' as part of
an alternate.  The current state of the tree has a few bugs
exposed by this: our input parser depends on the ordering of
how the qapi schema declared the alternate, and the parser
does not accept integers for a 'number' in an alternate even
though it does for numbers outside of an alternate.

Mixing 'int' and 'number' in the same alternate is unusual,
since both are supplied by json-numbers, but there does not
seem to be a technical reason to forbid it given that our
json lexer distinguishes between json-numbers that can be
represented as an int vs. those that cannot.

Improve the existing test_visitor_in_alternate() to match the
style of the new test_visitor_in_alternate_number(), and to
ensure full coverage of all possible qtype parsing.

Signed-off-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
[Eric's follow-up fixes squashed in]
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 376863ef4895ae709aadb6f26365a5973310ef09
      
https://github.com/qemu/qemu/commit/376863ef4895ae709aadb6f26365a5973310ef09
  Author: Eric Blake <address@hidden>
  Date:   2015-10-12 (Mon, 12 Oct 2015)

  Changed paths:
    M scripts/qapi.py
    M tests/qapi-schema/flat-union-bad-base.err
    M tests/qapi-schema/flat-union-base-any.err
    M tests/qapi-schema/flat-union-base-union.err
    M tests/qapi-schema/flat-union-inline.err
    M tests/qapi-schema/flat-union-inline.json
    M tests/qapi-schema/flat-union-no-base.err
    M tests/qapi-schema/union-invalid-base.err

  Log Message:
  -----------
  qapi: Reuse code for flat union base validation

Rather than open-code the check for a valid base type, we
should reuse the common functionality. This allows for
consistent error messages, and also makes it easier for a
later patch to turn on support for inline anonymous base
structures.

Test flat-union-inline is updated to test only one feature
(anonymous branch dictionaries), which can be implemented
independently (test flat-union-bad-base already covers the
idea of an anonymous base dictionary).

Signed-off-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 2a0f50e8d973b01eda4c63bac4a5c79ea0f584ef
      
https://github.com/qemu/qemu/commit/2a0f50e8d973b01eda4c63bac4a5c79ea0f584ef
  Author: Eric Blake <address@hidden>
  Date:   2015-10-12 (Mon, 12 Oct 2015)

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

  Log Message:
  -----------
  qapi: Consistent generated code: prefer error 'err'

We had some pointless differences in the generated code for visit,
command marshalling, and events; unifying them makes it easier for
future patches to consolidate to common helper functions.
This is one patch of a series to clean up these differences.

This patch consistently names the local error variable 'err' rather
than 'local_err'.

No change in semantics to the generated code.

Signed-off-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: f8b7f1a8eafa9f565ebecfe409e8741d38cd786b
      
https://github.com/qemu/qemu/commit/f8b7f1a8eafa9f565ebecfe409e8741d38cd786b
  Author: Eric Blake <address@hidden>
  Date:   2015-10-12 (Mon, 12 Oct 2015)

  Changed paths:
    M docs/qapi-code-gen.txt
    M qom/object.c
    M qom/qom-qobject.c
    M scripts/qapi-commands.py
    M scripts/qapi-types.py
    M scripts/qapi-visit.py

  Log Message:
  -----------
  qapi: Consistent generated code: prefer visitor 'v'

We had some pointless differences in the generated code for visit,
command marshalling, and events; unifying them makes it easier for
future patches to consolidate to common helper functions.
This is one patch of a series to clean up these differences.

This patch names the local visitor variable 'v' rather than 'm'.
Related objects, such as 'QapiDeallocVisitor', are also named by
their initials instead of an unrelated leading m.

No change in semantics to the generated code.

Signed-off-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: f782399cb4fa3fc4182cb046817f65a6db92ab07
      
https://github.com/qemu/qemu/commit/f782399cb4fa3fc4182cb046817f65a6db92ab07
  Author: Eric Blake <address@hidden>
  Date:   2015-10-12 (Mon, 12 Oct 2015)

  Changed paths:
    M scripts/qapi-event.py
    M scripts/qapi-visit.py

  Log Message:
  -----------
  qapi: Consistent generated code: prefer common labels

We had some pointless differences in the generated code for visit,
command marshalling, and events; unifying them makes it easier for
future patches to consolidate to common helper functions.
This is one patch of a series to clean up these differences.

This patch names the goto labels 'out' (not 'clean') and 'out_obj'
(not 'out_end').  Additionally, the generator was inconsistent on
whether labels had a leading space [our HACKING is silent; while
emacs 'gnu' style adds the space to avoid littering column 1].
For minimal churn, prefer no leading space; this also matches
the style that is more prevalent in current qemu.git.

No change in semantics to the generated code.

Signed-off-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: e36c714e6aad7c9266132350833e2f263f6d8874
      
https://github.com/qemu/qemu/commit/e36c714e6aad7c9266132350833e2f263f6d8874
  Author: Eric Blake <address@hidden>
  Date:   2015-10-12 (Mon, 12 Oct 2015)

  Changed paths:
    M scripts/qapi-visit.py

  Log Message:
  -----------
  qapi: Consistent generated code: prefer common indentation

We had some pointless differences in the generated code for visit,
command marshalling, and events; unifying them makes it easier for
future patches to consolidate to common helper functions.
This is one patch of a series to clean up these differences.

This patch adjusts gen_visit_union() to use the same indentation
as other functions, namely, by jumping early to the error label
if the object was not set rather than placing the rest of the
body inside an if for when it is set.

No change in semantics to the generated code.

Signed-off-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 05372f708a8cb3556e4d67458de79417dadf241f
      
https://github.com/qemu/qemu/commit/05372f708a8cb3556e4d67458de79417dadf241f
  Author: Eric Blake <address@hidden>
  Date:   2015-10-12 (Mon, 12 Oct 2015)

  Changed paths:
    M scripts/qapi-commands.py
    M scripts/qapi-visit.py

  Log Message:
  -----------
  qapi: Consistent generated code: minimize push_indent() usage

We had some pointless differences in the generated code for visit,
command marshalling, and events; unifying them makes it easier for
future patches to consolidate to common helper functions.
This is one patch of a series to clean up these differences.

This patch reduces the number of push_indent()/pop_indent() pairs
so that generated code is typically already at its natural output
indentation in the python files.  It is easier to reason about
generated code if the reader does not have to track how much
spacing will be inserted alongside the code, and moreso when all
of the generators use the same patterns (qapi-type and qapi-event
were already using in-place indentation).

Arguably, the resulting python may be a bit harder to read with C
code at the same indentation as python; on the other hand, not
having to think about push_indent() is a win, and most decent
editors provide syntax highlighting that makes it easier to
visually distinguish python code from string literals that will
become C code.

There is no change to the generated output.

Signed-off-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 1f35334489a43800df4d20cd91362a87cee39a29
      
https://github.com/qemu/qemu/commit/1f35334489a43800df4d20cd91362a87cee39a29
  Author: Eric Blake <address@hidden>
  Date:   2015-10-12 (Mon, 12 Oct 2015)

  Changed paths:
    M scripts/qapi-commands.py
    M scripts/qapi-event.py
    M scripts/qapi-visit.py
    M scripts/qapi.py

  Log Message:
  -----------
  qapi: Share gen_err_check()

qapi-commands has a nice helper gen_err_check(), but did not
use it everywhere. In fact, using it in more places makes it
easier to reduce the lines of code used for generating error
checks.  This in turn will make it easier for later patches
to consolidate another common pattern among the generators.

The generated code has fewer blank lines in qapi-event.c functions,
but has no semantic difference.

Signed-off-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
[Drop another blank line for symmetry]
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 82ca8e469666b169ccf818a0e36136aee97d7db0
      
https://github.com/qemu/qemu/commit/82ca8e469666b169ccf818a0e36136aee97d7db0
  Author: Eric Blake <address@hidden>
  Date:   2015-10-12 (Mon, 12 Oct 2015)

  Changed paths:
    M scripts/qapi-commands.py
    M scripts/qapi-event.py
    M scripts/qapi-visit.py
    M scripts/qapi.py

  Log Message:
  -----------
  qapi: Share gen_visit_fields()

Consolidate the code between visit, command marshalling, and
event generation that iterates over the members of a struct.
It reduces code duplication in the generator, so that a future
patch can reduce the size of generated code while touching only
one instead of three locations.

There are no changes to the generated marshal code.

The visitor code becomes slightly more verbose, but remains
semantically equivalent, and is actually easier to read as
it follows a more common idiom:

|     visit_optional(v, &(*obj)->has_device, "device", &err);
|-    if (!err && (*obj)->has_device) {
|-        visit_type_str(v, &(*obj)->device, "device", &err);
|-    }
|     if (err) {
|         goto out;
|     }
|+    if ((*obj)->has_device) {
|+        visit_type_str(v, &(*obj)->device, "device", &err);
|+        if (err) {
|+            goto out;
|+        }
|+    }

The event code becomes slightly more verbose, but this is
arguably a bug fix: although the visitors are not well
documented, use of an optional member should not be attempted
unless guarded by a prior call to visit_optional().  Works only
because the output qmp visitor has a no-op visit_optional():

|+    visit_optional(v, &has_offset, "offset", &err);
|+    if (err) {
|+        goto out;
|+    }
|     if (has_offset) {
|         visit_type_int(v, &offset, "offset", &err);

Signed-off-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 18bdbc3ac8b477e160d56aa6ecd6942495ce44d0
      
https://github.com/qemu/qemu/commit/18bdbc3ac8b477e160d56aa6ecd6942495ce44d0
  Author: Eric Blake <address@hidden>
  Date:   2015-10-12 (Mon, 12 Oct 2015)

  Changed paths:
    M scripts/qapi-commands.py
    M scripts/qapi.py

  Log Message:
  -----------
  qapi: Simplify gen_visit_fields() error handling

Since we have consolidated all generated code to use 'err' as
the name of the local variable for error detection, we can
simplify the decision on whether to skip error detection (useful
for deallocation paths) to be a boolean.

Signed-off-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
[Change to gen_visit_fields() simplified]
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: c49d3411faae8ffaab8f7e5db47405a008411c10
      
https://github.com/qemu/qemu/commit/c49d3411faae8ffaab8f7e5db47405a008411c10
  Author: Peter Maydell <address@hidden>
  Date:   2015-10-13 (Tue, 13 Oct 2015)

  Changed paths:
    M MAINTAINERS
    M docs/qapi-code-gen.txt
    A docs/qmp-events.txt
    A docs/qmp-intro.txt
    A docs/qmp-spec.txt
    R docs/qmp/README
    R docs/qmp/qmp-events.txt
    R docs/qmp/qmp-spec.txt
    M qom/object.c
    M qom/qom-qobject.c
    M scripts/ordereddict.py
    M scripts/qapi-commands.py
    M scripts/qapi-event.py
    M scripts/qapi-types.py
    M scripts/qapi-visit.py
    M scripts/qapi.py
    M tests/Makefile
    M tests/qapi-schema/alternate-clash.err
    M tests/qapi-schema/alternate-clash.json
    A tests/qapi-schema/alternate-empty.err
    A tests/qapi-schema/alternate-empty.exit
    A tests/qapi-schema/alternate-empty.json
    A tests/qapi-schema/alternate-empty.out
    M tests/qapi-schema/alternate-nested.json
    M tests/qapi-schema/alternate-unknown.json
    A tests/qapi-schema/args-name-clash.err
    A tests/qapi-schema/args-name-clash.exit
    A tests/qapi-schema/args-name-clash.json
    A tests/qapi-schema/args-name-clash.out
    M tests/qapi-schema/duplicate-key.err
    M tests/qapi-schema/duplicate-key.json
    M tests/qapi-schema/flat-union-bad-base.err
    M tests/qapi-schema/flat-union-base-any.err
    M tests/qapi-schema/flat-union-base-union.err
    M tests/qapi-schema/flat-union-base-union.json
    R tests/qapi-schema/flat-union-branch-clash.err
    R tests/qapi-schema/flat-union-branch-clash.exit
    R tests/qapi-schema/flat-union-branch-clash.json
    R tests/qapi-schema/flat-union-branch-clash.out
    A tests/qapi-schema/flat-union-clash-branch.err
    A tests/qapi-schema/flat-union-clash-branch.exit
    A tests/qapi-schema/flat-union-clash-branch.json
    A tests/qapi-schema/flat-union-clash-branch.out
    A tests/qapi-schema/flat-union-clash-member.err
    A tests/qapi-schema/flat-union-clash-member.exit
    A tests/qapi-schema/flat-union-clash-member.json
    A tests/qapi-schema/flat-union-clash-member.out
    A tests/qapi-schema/flat-union-clash-type.err
    A tests/qapi-schema/flat-union-clash-type.exit
    A tests/qapi-schema/flat-union-clash-type.json
    A tests/qapi-schema/flat-union-clash-type.out
    A tests/qapi-schema/flat-union-empty.err
    A tests/qapi-schema/flat-union-empty.exit
    A tests/qapi-schema/flat-union-empty.json
    A tests/qapi-schema/flat-union-empty.out
    M tests/qapi-schema/flat-union-inline.err
    M tests/qapi-schema/flat-union-inline.json
    M tests/qapi-schema/flat-union-no-base.err
    M tests/qapi-schema/include-non-file.err
    M tests/qapi-schema/include-non-file.json
    M tests/qapi-schema/qapi-schema-test.json
    M tests/qapi-schema/qapi-schema-test.out
    A tests/qapi-schema/struct-base-clash-base.err
    A tests/qapi-schema/struct-base-clash-base.exit
    A tests/qapi-schema/struct-base-clash-base.json
    A tests/qapi-schema/struct-base-clash-base.out
    M tests/qapi-schema/struct-base-clash-deep.err
    M tests/qapi-schema/struct-base-clash-deep.json
    M tests/qapi-schema/struct-base-clash.err
    M tests/qapi-schema/struct-base-clash.json
    A tests/qapi-schema/union-clash-branches.err
    A tests/qapi-schema/union-clash-branches.exit
    A tests/qapi-schema/union-clash-branches.json
    A tests/qapi-schema/union-clash-branches.out
    A tests/qapi-schema/union-clash-data.err
    A tests/qapi-schema/union-clash-data.exit
    A tests/qapi-schema/union-clash-data.json
    A tests/qapi-schema/union-clash-data.out
    A tests/qapi-schema/union-clash-type.err
    A tests/qapi-schema/union-clash-type.exit
    A tests/qapi-schema/union-clash-type.json
    A tests/qapi-schema/union-clash-type.out
    A tests/qapi-schema/union-empty.err
    A tests/qapi-schema/union-empty.exit
    A tests/qapi-schema/union-empty.json
    A tests/qapi-schema/union-empty.out
    M tests/qapi-schema/union-invalid-base.err
    M tests/test-qmp-input-visitor.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2015-10-12' into 
staging

QAPI patches

# gpg: Signature made Mon 12 Oct 2015 18:56:35 BST using RSA key ID EB918653
# gpg: Good signature from "Markus Armbruster <address@hidden>"
# gpg:                 aka "Markus Armbruster <address@hidden>"

* remotes/armbru/tags/pull-qapi-2015-10-12:
  qapi: Simplify gen_visit_fields() error handling
  qapi: Share gen_visit_fields()
  qapi: Share gen_err_check()
  qapi: Consistent generated code: minimize push_indent() usage
  qapi: Consistent generated code: prefer common indentation
  qapi: Consistent generated code: prefer common labels
  qapi: Consistent generated code: prefer visitor 'v'
  qapi: Consistent generated code: prefer error 'err'
  qapi: Reuse code for flat union base validation
  qapi: Test use of 'number' within alternates
  qapi: Add tests for empty unions
  qapi: Avoid assertion failure on union 'type' collision
  qapi: Test for various name collisions
  qapi: Clean up qapi.py per pep8
  qapi: Invoke exception superclass initializer
  qapi: Improve 'include' error message
  qapi: Sort qapi-schema tests
  MAINTAINERS: Specify QAPI include and test files
  MAINTAINERS: Specify QObject include and test files
  docs: Move files from docs/qmp/ to docs/

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


Compare: https://github.com/qemu/qemu/compare/5451316ed07b...c49d3411faae

reply via email to

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