qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 4247f8: qapi: Clarify docs on including the s


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 4247f8: qapi: Clarify docs on including the same file mult...
Date: Fri, 04 Sep 2015 10:00:05 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 4247f839009159cb2cbaddfbd41513e180c4fe52
      
https://github.com/qemu/qemu/commit/4247f839009159cb2cbaddfbd41513e180c4fe52
  Author: Markus Armbruster <address@hidden>
  Date:   2015-09-04 (Fri, 04 Sep 2015)

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

  Log Message:
  -----------
  qapi: Clarify docs on including the same file multiple times

It's idempotent.

While there, update examples to current code.

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


  Commit: 77e703b861d34bb2879f3e845482d5cf0a3a0ad1
      
https://github.com/qemu/qemu/commit/77e703b861d34bb2879f3e845482d5cf0a3a0ad1
  Author: Markus Armbruster <address@hidden>
  Date:   2015-09-04 (Fri, 04 Sep 2015)

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

  Log Message:
  -----------
  qapi: Clean up cgen() and mcgen()

Commit 05dfb26 added eatspace stripping to mcgen().  Move it to
cgen(), just in case somebody gets tempted to use cgen() directly
instead of via mcgen().

cgen() indents blank lines.  No such lines get generated right now,
but fix it anyway.

We use triple-quoted strings for program text, like this:

    '''
    Program text
    any number of lines
    '''

Keeps the program text relatively readable, but puts an extra newline
at either end.  mcgen() "fixes" that by dropping the first and last
line outright.  Drop only the newlines.

This unmasks a bug in qapi-commands.py: four quotes instead of three.
Fix it up.

Output doesn't change

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


  Commit: 00dfc3b2c272d98556ec6095d56bdd8b036babf9
      
https://github.com/qemu/qemu/commit/00dfc3b2c272d98556ec6095d56bdd8b036babf9
  Author: Markus Armbruster <address@hidden>
  Date:   2015-09-04 (Fri, 04 Sep 2015)

  Changed paths:
    M scripts/qapi.py

  Log Message:
  -----------
  qapi: Simplify guardname()

The guards around built-in declarations lose their _H.  It never made
much sense anyway.

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


  Commit: 016a335bd8ca624f43adbb08fa1698c29ec52a1a
      
https://github.com/qemu/qemu/commit/016a335bd8ca624f43adbb08fa1698c29ec52a1a
  Author: Markus Armbruster <address@hidden>
  Date:   2015-09-04 (Fri, 04 Sep 2015)

  Changed paths:
    M docs/qapi-code-gen.txt
    M scripts/qapi-event.py
    M tests/test-qmp-event.c

  Log Message:
  -----------
  qapi-event: Clean up how name of enum QAPIEvent is made

Use c_name() instead of ad hoc code.  Doesn't upcase the -p prefix,
which is an improvement in my book.  Unbreaks prefix containing '.',
but other funny characters remain broken.  To be fixed next.

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


  Commit: 1cf47a15f18312436c7fa2d97be5fbe6df0292f5
      
https://github.com/qemu/qemu/commit/1cf47a15f18312436c7fa2d97be5fbe6df0292f5
  Author: Markus Armbruster <address@hidden>
  Date:   2015-09-04 (Fri, 04 Sep 2015)

  Changed paths:
    M scripts/qapi.py

  Log Message:
  -----------
  qapi: Reject -p arguments that break qapi-event.py

qapi-event.py breaks when you ask for a funny prefix like '@'.
Protect it.

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


  Commit: 5aa05d3f72e556752167f7005d6a3dea0f4432c5
      
https://github.com/qemu/qemu/commit/5aa05d3f72e556752167f7005d6a3dea0f4432c5
  Author: Markus Armbruster <address@hidden>
  Date:   2015-09-04 (Fri, 04 Sep 2015)

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

  Log Message:
  -----------
  qapi: Drop unused and useless parameters and variables

gen_sync_call()'s parameter indent is useless: gen_sync_call() uses it
only as optional argument for push_indent() and pop_indent(), their
default is four, and gen_sync_call()'s only caller passes four.  Drop
the parameter.

gen_visitor_input_containers_decl()'s parameter obj is always
"QOBJECT(args)".  Use that, and drop the parameter.

Drop unused parameters of gen_marshal_output(),
gen_marshal_input_decl(), generate_visit_struct_body(),
generate_visit_list(), generate_visit_enum(), generate_declaration(),
generate_enum_declaration(), generate_decl_enum().

Drop unused variables in generate_event_enum_lookup(),
generate_enum_lookup(), generate_visit_struct_fields(), check_event().

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


  Commit: 0f61af3eb396ae163cd1572ce12e05f5d08d7c15
      
https://github.com/qemu/qemu/commit/0f61af3eb396ae163cd1572ce12e05f5d08d7c15
  Author: Markus Armbruster <address@hidden>
  Date:   2015-09-04 (Fri, 04 Sep 2015)

  Changed paths:
    M scripts/qapi-types.py
    M scripts/qapi-visit.py
    M tests/test-qmp-input-visitor.c
    M tests/test-qmp-output-visitor.c

  Log Message:
  -----------
  qapi: Fix generated code when flat union has member 'kind'

A flat union's tag member gets renamed to 'kind' in the generated
code.  Breaks when another member named 'kind' exists.

Example, adapted from qapi-schema-test.json:

    { 'struct': 'UserDefUnionBase',
      'data': { 'kind': 'str', 'enum1': 'EnumOne' } }

We generate:

    struct UserDefFlatUnion
    {
  EnumOne kind;
  union {
      void *data;
      UserDefA *value1;
      UserDefB *value2;
      UserDefB *value3;
  };
  char *kind;
    };

Kill the silly rename.

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


  Commit: 1e6c1616a91cdcbe9a8387541f7689b8c11632aa
      
https://github.com/qemu/qemu/commit/1e6c1616a91cdcbe9a8387541f7689b8c11632aa
  Author: Markus Armbruster <address@hidden>
  Date:   2015-09-04 (Fri, 04 Sep 2015)

  Changed paths:
    M scripts/qapi-types.py

  Log Message:
  -----------
  qapi: Generate a nicer struct for flat unions

The struct generated for a flat union is weird: the members of its
base are at the end, except for the union tag, which is at the
beginning.

Example: qapi-schema-test.json has

    { 'struct': 'UserDefUnionBase',
      'data': { 'string': 'str', 'enum1': 'EnumOne' } }

    { 'union': 'UserDefFlatUnion',
      'base': 'UserDefUnionBase',
      'discriminator': 'enum1',
      'data': { 'value1' : 'UserDefA',
          'value2' : 'UserDefB',
          'value3' : 'UserDefB' } }

We generate:

    struct UserDefFlatUnion
    {
  EnumOne enum1;
  union {
      void *data;
      UserDefA *value1;
      UserDefB *value2;
      UserDefB *value3;
  };
  char *string;
    };

Change to put all base members at the beginning, unadulterated.  Not
only is this easier to understand, it also permits casting the flat
union to its base, if that should become useful.

We now generate:

    struct UserDefFlatUnion
    {
  /* Members inherited from UserDefUnionBase: */
  char *string;
  EnumOne enum1;
  /* Own members: */
  union { /* union tag is @enum1 */
      void *data;
      UserDefA *value1;
      UserDefB *value2;
      UserDefB *value3;
  };
    };

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


  Commit: 8c3f8e77215bfedb7854221868f655e148506936
      
https://github.com/qemu/qemu/commit/8c3f8e77215bfedb7854221868f655e148506936
  Author: Markus Armbruster <address@hidden>
  Date:   2015-09-04 (Fri, 04 Sep 2015)

  Changed paths:
    M scripts/qapi-visit.py
    M tests/qapi-schema/qapi-schema-test.json
    M tests/qapi-schema/qapi-schema-test.out

  Log Message:
  -----------
  qapi-visit: Fix generated code when schema has forward refs

The visit_type_implicit_FOO() are generated on demand, right before
their first use.  Used by visit_type_STRUCT_fields() when STRUCT has
base FOO, and by visit_type_UNION() when flat UNION has member a FOO.

If the schema defines FOO after its first use as struct base or flat
union member, visit_type_implicit_FOO() calls
visit_type_implicit_FOO() before its definition, which doesn't
compile.

Rearrange qapi-schema-test.json to demonstrate the bug.

Fix by generating the necessary forward declaration.

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


  Commit: 8c07eddc619d618965fdd7a96bfe3b5c59f42b52
      
https://github.com/qemu/qemu/commit/8c07eddc619d618965fdd7a96bfe3b5c59f42b52
  Author: Markus Armbruster <address@hidden>
  Date:   2015-09-04 (Fri, 04 Sep 2015)

  Changed paths:
    M scripts/qapi-visit.py

  Log Message:
  -----------
  qapi-visit: Replace list implicit_structs by set

Use set because that's what it is.  While there, rename to
implicit_structs_seen.

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


  Commit: 40b3adec13a9e022ff5a2e2b81c243fc0a026746
      
https://github.com/qemu/qemu/commit/40b3adec13a9e022ff5a2e2b81c243fc0a026746
  Author: Markus Armbruster <address@hidden>
  Date:   2015-09-04 (Fri, 04 Sep 2015)

  Changed paths:
    M scripts/qapi-visit.py

  Log Message:
  -----------
  qapi-visit: Fix two name arguments passed to visitors

The generated code passes mangled schema names to visit_type_enum()
and union's visit_start_struct().  Fix it to pass the names
unadulterated, like we do everywhere else.

Only qapi-schema-test.json actually has names where this makes a
difference: enum __org.qemu_x-Enum, flat union __org.qemu_x-Union2,
simple union __org.qemu_x-Union1 and its implicit enum
__org.qemu_x-Union1Kind.

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


  Commit: 422e16aac4bd4476f5b40bee3049089de34ef6b6
      
https://github.com/qemu/qemu/commit/422e16aac4bd4476f5b40bee3049089de34ef6b6
  Author: Markus Armbruster <address@hidden>
  Date:   2015-09-04 (Fri, 04 Sep 2015)

  Changed paths:
    M tests/qapi-schema/qapi-schema-test.json

  Log Message:
  -----------
  tests/qapi-schema: Document alternate's enum lacks visit function

We generate a declaration, but no definition.

The QMP schema has two: Qcow2OverlapChecks and BlockdevRef.  Neither
visit_type_Qcow2OverlapChecksKind() nor visit_type_BlockdevRefKind()
is actually used.

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


  Commit: 999387782f736d7ac0083f4f02e2bc4ce7a9a27b
      
https://github.com/qemu/qemu/commit/999387782f736d7ac0083f4f02e2bc4ce7a9a27b
  Author: Markus Armbruster <address@hidden>
  Date:   2015-09-04 (Fri, 04 Sep 2015)

  Changed paths:
    M tests/qapi-schema/qapi-schema-test.json

  Log Message:
  -----------
  tests/qapi-schema: Document events with base don't work

When event FOO's 'data' is a struct with a base, we consider only the
struct's direct members, and ignore its base.  The generated
qapi_event_send_foo() doesn't take arguments for base members.

No such events currently exist in the QMP schema.

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


  Commit: 2f52e20597ebd55ede668b2b7d162a84f419b03e
      
https://github.com/qemu/qemu/commit/2f52e20597ebd55ede668b2b7d162a84f419b03e
  Author: Eric Blake <address@hidden>
  Date:   2015-09-04 (Fri, 04 Sep 2015)

  Changed paths:
    M scripts/qapi-visit.py
    M tests/test-qmp-input-visitor.c

  Log Message:
  -----------
  qapi: Document that input visitor semantics are prone to leaks

Most functions that can return a pointer or set an Error ** value
are decent enough to guarantee a NULL return when reporting an error.
Not so with our generated qapi visitor functions.  If the caller
is not careful to clean up partially-allocated objects on error,
then the caller suffers a memory leak.

Properly fixing it is probably complex enough to save for a later
day, so merely document it for now.

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


  Commit: ca56a822dd538017715345cbbe1f8829e0cc2742
      
https://github.com/qemu/qemu/commit/ca56a822dd538017715345cbbe1f8829e0cc2742
  Author: Eric Blake <address@hidden>
  Date:   2015-09-04 (Fri, 04 Sep 2015)

  Changed paths:
    M scripts/qapi-types.py

  Log Message:
  -----------
  qapi: Document shortcoming with union 'data' branch

Add a FIXME to remind us to fully audit whether removing the
'void *data' branch of each qapi union type can be done safely.

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


  Commit: d90675fa4bc256238b3dd3a7fdd5f9029eca00b8
      
https://github.com/qemu/qemu/commit/d90675fa4bc256238b3dd3a7fdd5f9029eca00b8
  Author: Markus Armbruster <address@hidden>
  Date:   2015-09-04 (Fri, 04 Sep 2015)

  Changed paths:
    M scripts/qapi.py

  Log Message:
  -----------
  qapi: Document flaws in checking of names

We don't actually enforce our "other than downstream extensions [...],
all names should begin with a letter" rule.  Add a FIXME.

We should reject names that differ only in '_' vs. '.'  vs. '-',
because they're liable to clash in generated C.  Add a FIXME.

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


  Commit: 80e60a19a82cf872652d1923e800fecef5cc7def
      
https://github.com/qemu/qemu/commit/80e60a19a82cf872652d1923e800fecef5cc7def
  Author: Markus Armbruster <address@hidden>
  Date:   2015-09-04 (Fri, 04 Sep 2015)

  Changed paths:
    M tests/qapi-schema/qapi-schema-test.json
    M tests/qapi-schema/qapi-schema-test.out

  Log Message:
  -----------
  tests/qapi-schema: Restore test case for flat union base bug

Test case added in commit 2fc0043, and messed up in commit 5223070.

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


  Commit: 6af9a8fc8ec83f823c079211bc7a2414b1d4e5fe
      
https://github.com/qemu/qemu/commit/6af9a8fc8ec83f823c079211bc7a2414b1d4e5fe
  Author: Markus Armbruster <address@hidden>
  Date:   2015-09-04 (Fri, 04 Sep 2015)

  Changed paths:
    M tests/Makefile
    A tests/qapi-schema/args-array-empty.err
    A tests/qapi-schema/args-array-empty.exit
    A tests/qapi-schema/args-array-empty.json
    A tests/qapi-schema/args-array-empty.out
    A tests/qapi-schema/args-array-unknown.err
    A tests/qapi-schema/args-array-unknown.exit
    A tests/qapi-schema/args-array-unknown.json
    A tests/qapi-schema/args-array-unknown.out
    A tests/qapi-schema/args-int.err
    A tests/qapi-schema/args-int.exit
    A tests/qapi-schema/args-int.json
    A tests/qapi-schema/args-int.out
    A tests/qapi-schema/args-member-array-bad.err
    A tests/qapi-schema/args-member-array-bad.exit
    A tests/qapi-schema/args-member-array-bad.json
    A tests/qapi-schema/args-member-array-bad.out
    A tests/qapi-schema/args-member-array.err
    A tests/qapi-schema/args-member-array.exit
    A tests/qapi-schema/args-member-array.json
    A tests/qapi-schema/args-member-array.out
    A tests/qapi-schema/args-member-unknown.err
    A tests/qapi-schema/args-member-unknown.exit
    A tests/qapi-schema/args-member-unknown.json
    A tests/qapi-schema/args-member-unknown.out
    A tests/qapi-schema/args-unknown.err
    A tests/qapi-schema/args-unknown.exit
    A tests/qapi-schema/args-unknown.json
    A tests/qapi-schema/args-unknown.out
    R tests/qapi-schema/data-array-empty.err
    R tests/qapi-schema/data-array-empty.exit
    R tests/qapi-schema/data-array-empty.json
    R tests/qapi-schema/data-array-empty.out
    R tests/qapi-schema/data-array-unknown.err
    R tests/qapi-schema/data-array-unknown.exit
    R tests/qapi-schema/data-array-unknown.json
    R tests/qapi-schema/data-array-unknown.out
    R tests/qapi-schema/data-int.err
    R tests/qapi-schema/data-int.exit
    R tests/qapi-schema/data-int.json
    R tests/qapi-schema/data-int.out
    R tests/qapi-schema/data-member-array-bad.err
    R tests/qapi-schema/data-member-array-bad.exit
    R tests/qapi-schema/data-member-array-bad.json
    R tests/qapi-schema/data-member-array-bad.out
    R tests/qapi-schema/data-member-array.err
    R tests/qapi-schema/data-member-array.exit
    R tests/qapi-schema/data-member-array.json
    R tests/qapi-schema/data-member-array.out
    R tests/qapi-schema/data-member-unknown.err
    R tests/qapi-schema/data-member-unknown.exit
    R tests/qapi-schema/data-member-unknown.json
    R tests/qapi-schema/data-member-unknown.out
    R tests/qapi-schema/data-unknown.err
    R tests/qapi-schema/data-unknown.exit
    R tests/qapi-schema/data-unknown.json
    R tests/qapi-schema/data-unknown.out

  Log Message:
  -----------
  tests/qapi-schema: Rename tests from data- to args-

Since every schema entity has 'data', the data- prefix conveys no
information.  These tests actually exercise commands.  Only commands
have arguments, so change the prefix to to args-.

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


  Commit: d9658d58e33128df32093b7a84bed76b527fb884
      
https://github.com/qemu/qemu/commit/d9658d58e33128df32093b7a84bed76b527fb884
  Author: Markus Armbruster <address@hidden>
  Date:   2015-09-04 (Fri, 04 Sep 2015)

  Changed paths:
    M tests/Makefile
    A tests/qapi-schema/args-alternate.err
    A tests/qapi-schema/args-alternate.exit
    A tests/qapi-schema/args-alternate.json
    A tests/qapi-schema/args-alternate.out
    A tests/qapi-schema/args-union.err
    A tests/qapi-schema/args-union.exit
    A tests/qapi-schema/args-union.json
    A tests/qapi-schema/args-union.out

  Log Message:
  -----------
  qapi-tests: New tests for union, alternate command arguments

A command's 'data' must be a struct type, given either as a
dictionary, or as struct type name.

Existing test case data-int.json covers simple type 'int'.  Add test
cases for type names referring to union and alternate types.

The latter is caught (good), but the former is not (bug).

Events have the same problem, but since they get checked by the same
code, we don't bother to duplicate the tests.

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


  Commit: 315932b5edb86597adafbd1faa2d29c46499d8c3
      
https://github.com/qemu/qemu/commit/315932b5edb86597adafbd1faa2d29c46499d8c3
  Author: Markus Armbruster <address@hidden>
  Date:   2015-09-04 (Fri, 04 Sep 2015)

  Changed paths:
    M docs/qapi-code-gen.txt
    M scripts/qapi.py
    M tests/qapi-schema/args-union.err
    M tests/qapi-schema/args-union.exit
    M tests/qapi-schema/args-union.json
    M tests/qapi-schema/args-union.out

  Log Message:
  -----------
  qapi: Fix to reject union command and event arguments

A command's or event's 'data' must be a struct type, given either as a
dictionary, or as struct type name.

Commit dd883c6 tightened the checking there, but not enough: we still
accept 'union'.  Fix to reject it.

We may want to support union types there, but we'll have to extend
qapi-commands.py and qapi-events.py for it.

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


  Commit: 9b090d42aea9a0abbf39a1d75561a186057b5fe6
      
https://github.com/qemu/qemu/commit/9b090d42aea9a0abbf39a1d75561a186057b5fe6
  Author: Markus Armbruster <address@hidden>
  Date:   2015-09-04 (Fri, 04 Sep 2015)

  Changed paths:
    M docs/qapi-code-gen.txt
    M scripts/qapi.py
    M tests/Makefile
    M tests/qapi-schema/command-int.json
    M tests/qapi-schema/nested-struct-data.json
    R tests/qapi-schema/nested-struct-returns.err
    R tests/qapi-schema/nested-struct-returns.exit
    R tests/qapi-schema/nested-struct-returns.json
    R tests/qapi-schema/nested-struct-returns.out
    A tests/qapi-schema/returns-dict.err
    A tests/qapi-schema/returns-dict.exit
    A tests/qapi-schema/returns-dict.json
    A tests/qapi-schema/returns-dict.out

  Log Message:
  -----------
  qapi: Command returning anonymous type doesn't work, outlaw

Reproducer: with

    { 'command': 'user_def_cmd4', 'returns': { 'a': 'int' } }

added to qapi-schema-test.json, qapi-commands.py dies when it tries to
generate the command handler function

    Traceback (most recent call last):
      File "/work/armbru/qemu/scripts/qapi-commands.py", line 359, in <module>
  ret = generate_command_decl(cmd['command'], arglist, ret_type) + "\n"
      File "/work/armbru/qemu/scripts/qapi-commands.py", line 29, in 
generate_command_decl
  ret_type=c_type(ret_type), name=c_name(name),
      File "/work/armbru/qemu/scripts/qapi.py", line 927, in c_type
  assert isinstance(value, str) and value != ""
    AssertionError

because the return type doesn't exist.

Simply outlaw this usage, and drop or dumb down test cases accordingly.

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


  Commit: 8102307f51e68280ac965a140a87073d5c31e9a5
      
https://github.com/qemu/qemu/commit/8102307f51e68280ac965a140a87073d5c31e9a5
  Author: Markus Armbruster <address@hidden>
  Date:   2015-09-04 (Fri, 04 Sep 2015)

  Changed paths:
    M scripts/qapi-commands.py

  Log Message:
  -----------
  qapi-commands: Fix gen_err_check(e) for e and e != 'local_err'

gen_err_check() hard-codes 'local_err' instead of substituting the
argument.  Currently harmless, since all callers pass either None or
'local_err'.

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


  Commit: e02bca281c82f874d84578af4deea46142232115
      
https://github.com/qemu/qemu/commit/e02bca281c82f874d84578af4deea46142232115
  Author: Markus Armbruster <address@hidden>
  Date:   2015-09-04 (Fri, 04 Sep 2015)

  Changed paths:
    M scripts/qapi-commands.py

  Log Message:
  -----------
  qapi-commands: Inline gen_marshal_output_call()

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


  Commit: 1f9a7a1a5862ad224aa86f9b4c046248ffc27aa3
      
https://github.com/qemu/qemu/commit/1f9a7a1a5862ad224aa86f9b4c046248ffc27aa3
  Author: Markus Armbruster <address@hidden>
  Date:   2015-09-04 (Fri, 04 Sep 2015)

  Changed paths:
    M scripts/qapi-commands.py

  Log Message:
  -----------
  qapi-commands: Don't feed output of mcgen() to mcgen() again

Multiple passes through mcgen() is prone to produce unwanted blank
lines, which we then combat by sprinkling .rstrip() on top.  Just
don't do it.

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


  Commit: 3f99144cd9afbf51a7fbddf20b921402c2d4f68c
      
https://github.com/qemu/qemu/commit/3f99144cd9afbf51a7fbddf20b921402c2d4f68c
  Author: Markus Armbruster <address@hidden>
  Date:   2015-09-04 (Fri, 04 Sep 2015)

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

  Log Message:
  -----------
  qapi-commands: Drop useless initialization

In generated command handlers, the assignment to retval dominates its
only use.  Therefore, its initialization is useless.  Drop it.

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


  Commit: 3a864e7c52af15017d5082a9ee39a7919f46d2b5
      
https://github.com/qemu/qemu/commit/3a864e7c52af15017d5082a9ee39a7919f46d2b5
  Author: Markus Armbruster <address@hidden>
  Date:   2015-09-04 (Fri, 04 Sep 2015)

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

  Log Message:
  -----------
  qapi: Generated code cleanup

Clean up white-space, brace placement, and superfluous #ifdef
QAPI_TYPES_BUILTIN_CLEANUP_DEF.

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


  Commit: 65fbe125451da9421070ab03944c9600a264eefc
      
https://github.com/qemu/qemu/commit/65fbe125451da9421070ab03944c9600a264eefc
  Author: Markus Armbruster <address@hidden>
  Date:   2015-09-04 (Fri, 04 Sep 2015)

  Changed paths:
    M scripts/qapi.py
    M tests/qapi-schema/union-base-no-discriminator.err

  Log Message:
  -----------
  qapi: Drop one of two "simple union must not have base" checks

The first check ensures the second one can't trigger.  Drop the first
one, because the second one is in a more logical place, and emits a
nicer error message.

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


  Commit: 91f9816da4d505d379753896f3f7b6abb910324b
      
https://github.com/qemu/qemu/commit/91f9816da4d505d379753896f3f7b6abb910324b
  Author: Markus Armbruster <address@hidden>
  Date:   2015-09-04 (Fri, 04 Sep 2015)

  Changed paths:
    M tests/Makefile
    A tests/qapi-schema/leading-comma-list.err
    A tests/qapi-schema/leading-comma-list.exit
    A tests/qapi-schema/leading-comma-list.json
    A tests/qapi-schema/leading-comma-list.out
    A tests/qapi-schema/leading-comma-object.err
    A tests/qapi-schema/leading-comma-object.exit
    A tests/qapi-schema/leading-comma-object.json
    A tests/qapi-schema/leading-comma-object.out

  Log Message:
  -----------
  tests/qapi-schema: Cover two more syntax errors

Syntax error coverage should now be complete.

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


  Commit: 10689e36eb99e99751497ac8cef2a946e9a3a850
      
https://github.com/qemu/qemu/commit/10689e36eb99e99751497ac8cef2a946e9a3a850
  Author: Markus Armbruster <address@hidden>
  Date:   2015-09-04 (Fri, 04 Sep 2015)

  Changed paths:
    M tests/Makefile
    A tests/qapi-schema/args-invalid.err
    A tests/qapi-schema/args-invalid.exit
    A tests/qapi-schema/args-invalid.json
    A tests/qapi-schema/args-invalid.out
    A tests/qapi-schema/struct-data-invalid.err
    A tests/qapi-schema/struct-data-invalid.exit
    A tests/qapi-schema/struct-data-invalid.json
    A tests/qapi-schema/struct-data-invalid.out
    A tests/qapi-schema/struct-member-invalid.err
    A tests/qapi-schema/struct-member-invalid.exit
    A tests/qapi-schema/struct-member-invalid.json
    A tests/qapi-schema/struct-member-invalid.out

  Log Message:
  -----------
  tests/qapi-schema: Cover non-string, non-dictionary members

We always report "should be a dictionary" then.  This is misleading:
when allow_dict, it can be a dictionary or a type name string, else it
can only be a type name.

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


  Commit: c6b71e5ae73802057d700e2419b80aef1651f213
      
https://github.com/qemu/qemu/commit/c6b71e5ae73802057d700e2419b80aef1651f213
  Author: Markus Armbruster <address@hidden>
  Date:   2015-09-04 (Fri, 04 Sep 2015)

  Changed paths:
    M scripts/qapi.py
    M tests/qapi-schema/args-invalid.err
    M tests/qapi-schema/args-invalid.json
    M tests/qapi-schema/struct-data-invalid.err
    M tests/qapi-schema/struct-data-invalid.json
    M tests/qapi-schema/struct-member-invalid.err
    M tests/qapi-schema/struct-member-invalid.json

  Log Message:
  -----------
  qapi: Fix errors for non-string, non-dictionary members

Fixes the errors demonstrated by the previous commit.

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


  Commit: eddf817bd823a90df209dfbdc2a0b2ec33b7cb77
      
https://github.com/qemu/qemu/commit/eddf817bd823a90df209dfbdc2a0b2ec33b7cb77
  Author: Markus Armbruster <address@hidden>
  Date:   2015-09-04 (Fri, 04 Sep 2015)

  Changed paths:
    M scripts/qapi.py
    M tests/qapi-schema/args-array-unknown.err
    M tests/qapi-schema/returns-whitelist.err

  Log Message:
  -----------
  qapi: Simplify error reporting for array types

check_type() first checks and peels off the array type, then checks
the element type.  For two out of four error messages, it takes pains
to report errors for "array of T" instead of just T.  Odd.  Let's
examine the errors.

* Unknown element type, e.g.
  tests/qapi-schema/args-array-unknown.json:

      Member 'array' of 'data' for command 'oops' uses unknown type
      'array of NoSuchType'

  To make sense of this, you need to know that 'array of NoSuchType'
  refers to '[NoSuchType]'.  Easy enough.  However, simply reporting

      Member 'array' of 'data' for command 'oops' uses unknown type
      'NoSuchType'

  is at least as easy to understand.

* Element type's meta-type is inadmissible, e.g.
  tests/qapi-schema/returns-whitelist.json:

      'returns' for command 'no-way-this-will-get-whitelisted' cannot
      use built-in type 'array of int'

  'array of int' is technically not a built-in type, but that's
  pedantry.  However, simply reporting

      'returns' for command 'no-way-this-will-get-whitelisted' cannot
      use built-in type 'int'

  avoids the issue, and is at least as easy to understand.

* The remaining two errors are unreachable, because the array checking
  ensures that value is a string.

Thus, reporting some errors for "array of T" instead of just T works,
but doesn't really improve things.  Drop it.

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


  Commit: 94a3f0af388820d74a9d89d1a856d2baa448c696
      
https://github.com/qemu/qemu/commit/94a3f0af388820d74a9d89d1a856d2baa448c696
  Author: Markus Armbruster <address@hidden>
  Date:   2015-09-04 (Fri, 04 Sep 2015)

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

  Log Message:
  -----------
  docs/qapi-code-gen.txt: Fix QAPI schema examples

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


  Commit: c4f498fe8532cdacc609262b104322911108df54
      
https://github.com/qemu/qemu/commit/c4f498fe8532cdacc609262b104322911108df54
  Author: Markus Armbruster <address@hidden>
  Date:   2015-09-04 (Fri, 04 Sep 2015)

  Changed paths:
    M scripts/qapi.py

  Log Message:
  -----------
  qapi: Generators crash when --output-dir isn't given, fix

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


  Commit: b5bff7518d8e4feda95f5c523cb24f72863c1df6
      
https://github.com/qemu/qemu/commit/b5bff7518d8e4feda95f5c523cb24f72863c1df6
  Author: Peter Maydell <address@hidden>
  Date:   2015-09-04 (Fri, 04 Sep 2015)

  Changed paths:
    M docs/qapi-code-gen.txt
    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
    A tests/qapi-schema/args-alternate.err
    A tests/qapi-schema/args-alternate.exit
    A tests/qapi-schema/args-alternate.json
    A tests/qapi-schema/args-alternate.out
    A tests/qapi-schema/args-array-empty.err
    A tests/qapi-schema/args-array-empty.exit
    A tests/qapi-schema/args-array-empty.json
    A tests/qapi-schema/args-array-empty.out
    A tests/qapi-schema/args-array-unknown.err
    A tests/qapi-schema/args-array-unknown.exit
    A tests/qapi-schema/args-array-unknown.json
    A tests/qapi-schema/args-array-unknown.out
    A tests/qapi-schema/args-int.err
    A tests/qapi-schema/args-int.exit
    A tests/qapi-schema/args-int.json
    A tests/qapi-schema/args-int.out
    A tests/qapi-schema/args-invalid.err
    A tests/qapi-schema/args-invalid.exit
    A tests/qapi-schema/args-invalid.json
    A tests/qapi-schema/args-invalid.out
    A tests/qapi-schema/args-member-array-bad.err
    A tests/qapi-schema/args-member-array-bad.exit
    A tests/qapi-schema/args-member-array-bad.json
    A tests/qapi-schema/args-member-array-bad.out
    A tests/qapi-schema/args-member-array.err
    A tests/qapi-schema/args-member-array.exit
    A tests/qapi-schema/args-member-array.json
    A tests/qapi-schema/args-member-array.out
    A tests/qapi-schema/args-member-unknown.err
    A tests/qapi-schema/args-member-unknown.exit
    A tests/qapi-schema/args-member-unknown.json
    A tests/qapi-schema/args-member-unknown.out
    A tests/qapi-schema/args-union.err
    A tests/qapi-schema/args-union.exit
    A tests/qapi-schema/args-union.json
    A tests/qapi-schema/args-union.out
    A tests/qapi-schema/args-unknown.err
    A tests/qapi-schema/args-unknown.exit
    A tests/qapi-schema/args-unknown.json
    A tests/qapi-schema/args-unknown.out
    M tests/qapi-schema/command-int.json
    R tests/qapi-schema/data-array-empty.err
    R tests/qapi-schema/data-array-empty.exit
    R tests/qapi-schema/data-array-empty.json
    R tests/qapi-schema/data-array-empty.out
    R tests/qapi-schema/data-array-unknown.err
    R tests/qapi-schema/data-array-unknown.exit
    R tests/qapi-schema/data-array-unknown.json
    R tests/qapi-schema/data-array-unknown.out
    R tests/qapi-schema/data-int.err
    R tests/qapi-schema/data-int.exit
    R tests/qapi-schema/data-int.json
    R tests/qapi-schema/data-int.out
    R tests/qapi-schema/data-member-array-bad.err
    R tests/qapi-schema/data-member-array-bad.exit
    R tests/qapi-schema/data-member-array-bad.json
    R tests/qapi-schema/data-member-array-bad.out
    R tests/qapi-schema/data-member-array.err
    R tests/qapi-schema/data-member-array.exit
    R tests/qapi-schema/data-member-array.json
    R tests/qapi-schema/data-member-array.out
    R tests/qapi-schema/data-member-unknown.err
    R tests/qapi-schema/data-member-unknown.exit
    R tests/qapi-schema/data-member-unknown.json
    R tests/qapi-schema/data-member-unknown.out
    R tests/qapi-schema/data-unknown.err
    R tests/qapi-schema/data-unknown.exit
    R tests/qapi-schema/data-unknown.json
    R tests/qapi-schema/data-unknown.out
    A tests/qapi-schema/leading-comma-list.err
    A tests/qapi-schema/leading-comma-list.exit
    A tests/qapi-schema/leading-comma-list.json
    A tests/qapi-schema/leading-comma-list.out
    A tests/qapi-schema/leading-comma-object.err
    A tests/qapi-schema/leading-comma-object.exit
    A tests/qapi-schema/leading-comma-object.json
    A tests/qapi-schema/leading-comma-object.out
    M tests/qapi-schema/nested-struct-data.json
    R tests/qapi-schema/nested-struct-returns.err
    R tests/qapi-schema/nested-struct-returns.exit
    R tests/qapi-schema/nested-struct-returns.json
    R tests/qapi-schema/nested-struct-returns.out
    M tests/qapi-schema/qapi-schema-test.json
    M tests/qapi-schema/qapi-schema-test.out
    A tests/qapi-schema/returns-dict.err
    A tests/qapi-schema/returns-dict.exit
    A tests/qapi-schema/returns-dict.json
    A tests/qapi-schema/returns-dict.out
    M tests/qapi-schema/returns-whitelist.err
    A tests/qapi-schema/struct-data-invalid.err
    A tests/qapi-schema/struct-data-invalid.exit
    A tests/qapi-schema/struct-data-invalid.json
    A tests/qapi-schema/struct-data-invalid.out
    A tests/qapi-schema/struct-member-invalid.err
    A tests/qapi-schema/struct-member-invalid.exit
    A tests/qapi-schema/struct-member-invalid.json
    A tests/qapi-schema/struct-member-invalid.out
    M tests/qapi-schema/union-base-no-discriminator.err
    M tests/test-qmp-event.c
    M tests/test-qmp-input-visitor.c
    M tests/test-qmp-output-visitor.c

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

qapi: Another round of fixes and cleanups

# gpg: Signature made Fri 04 Sep 2015 14:48:54 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-09-04: (33 commits)
  qapi: Generators crash when --output-dir isn't given, fix
  docs/qapi-code-gen.txt: Fix QAPI schema examples
  qapi: Simplify error reporting for array types
  qapi: Fix errors for non-string, non-dictionary members
  tests/qapi-schema: Cover non-string, non-dictionary members
  tests/qapi-schema: Cover two more syntax errors
  qapi: Drop one of two "simple union must not have base" checks
  qapi: Generated code cleanup
  qapi-commands: Drop useless initialization
  qapi-commands: Don't feed output of mcgen() to mcgen() again
  qapi-commands: Inline gen_marshal_output_call()
  qapi-commands: Fix gen_err_check(e) for e and e != 'local_err'
  qapi: Command returning anonymous type doesn't work, outlaw
  qapi: Fix to reject union command and event arguments
  qapi-tests: New tests for union, alternate command arguments
  tests/qapi-schema: Rename tests from data- to args-
  tests/qapi-schema: Restore test case for flat union base bug
  qapi: Document flaws in checking of names
  qapi: Document shortcoming with union 'data' branch
  qapi: Document that input visitor semantics are prone to leaks
  ...

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


Compare: https://github.com/qemu/qemu/compare/b041066421e8...b5bff7518d8e

reply via email to

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