qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 7552cb: qapi/pragma: Tidy up after removal of


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 7552cb: qapi/pragma: Tidy up after removal of deprecated c...
Date: Tue, 23 Mar 2021 16:47:28 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 7552cbe1d0aacf2fd5b7f69cb65534891e9e23d3
      
https://github.com/qemu/qemu/commit/7552cbe1d0aacf2fd5b7f69cb65534891e9e23d3
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M qapi/pragma.json

  Log Message:
  -----------
  qapi/pragma: Tidy up after removal of deprecated commands

Commit cbde7be900 "migrate: remove QMP/HMP commands for speed,
downtime and cache size" neglected to remove query-migrate-cache-size
from pragma returns-whitelist.

Commit 8af54b9172 "machine: remove 'query-cpus' QMP command" neglected
to remove CpuInfo & friends from pragma name-case-exceptions.

Remove these now.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210323094025.3569441-2-armbru@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>


  Commit: 00d16f239f3a1ba0b1ea09dc0852386a25a144bc
      
https://github.com/qemu/qemu/commit/00d16f239f3a1ba0b1ea09dc0852386a25a144bc
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    R tests/qapi-schema/flat-union-inline.err
    R tests/qapi-schema/flat-union-inline.json
    R tests/qapi-schema/flat-union-inline.out
    M tests/qapi-schema/meson.build

  Log Message:
  -----------
  tests/qapi-schema: Drop redundant flat-union-inline test

flat-union-inline.json covers longhand branch definition with an
invalid type value.  It's redundant: longhand branch definition is
covered by flat-union-inline-invalid-dict.json, and invalid type value
is covered by nested-struct-data.json.  Drop the test.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210323094025.3569441-3-armbru@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>


  Commit: 5bd18d98cd88e2df1e1e274546a06ebe7fdd5eec
      
https://github.com/qemu/qemu/commit/5bd18d98cd88e2df1e1e274546a06ebe7fdd5eec
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M tests/qapi-schema/event-member-invalid-dict.err
    M tests/qapi-schema/event-member-invalid-dict.json
    M tests/qapi-schema/flat-union-inline-invalid-dict.json
    M tests/qapi-schema/nested-struct-data-invalid-dict.err
    M tests/qapi-schema/nested-struct-data-invalid-dict.json
    M tests/qapi-schema/nested-struct-data.json
    M tests/qapi-schema/struct-member-invalid-dict.err
    M tests/qapi-schema/struct-member-invalid-dict.json

  Log Message:
  -----------
  tests/qapi-schema: Rework comments on longhand member definitions

A few old comments talk about "desired future use of defaults" and
"anonymous inline branch types".  Kind of misleading since commit
87adbbffd4 "qapi: add a dictionary form for TYPE" added longhand
member definitions.  Talk about that instead.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210323094025.3569441-4-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>


  Commit: 27ae2f0787ae42eca9ec34961d2269d7a1fc5230
      
https://github.com/qemu/qemu/commit/27ae2f0787ae42eca9ec34961d2269d7a1fc5230
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M tests/qapi-schema/alternate-clash.err
    M tests/qapi-schema/alternate-clash.json

  Log Message:
  -----------
  tests/qapi-schema: Belatedly update comment on alternate clash

Commit 0426d53c65 "qapi: Simplify visiting of alternate types"
eliminated the implicit alternate enum, but neglected to update a
comment about it in a test.  Do that now.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210323094025.3569441-5-armbru@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>


  Commit: 1444989a3a4e8399e366ceecf4ed5bbd2d83c727
      
https://github.com/qemu/qemu/commit/1444989a3a4e8399e366ceecf4ed5bbd2d83c727
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M tests/qapi-schema/flat-union-no-base.err
    M tests/qapi-schema/flat-union-no-base.json

  Log Message:
  -----------
  tests/qapi-schema: Drop TODO comment on simple unions

Simple unions don't need more features, they need to die.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210323094025.3569441-6-armbru@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>


  Commit: 73c40b07c6fffcb2725f4c9d3f361967e39aef97
      
https://github.com/qemu/qemu/commit/73c40b07c6fffcb2725f4c9d3f361967e39aef97
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M tests/qapi-schema/reserved-member-u.err
    M tests/qapi-schema/reserved-member-u.json
    M tests/qapi-schema/reserved-member-u.out

  Log Message:
  -----------
  tests/qapi-schema: Tweak to demonstrate buggy member name check

Member name 'u' and names starting with 'has-' or 'has_' are reserved
for the generator.  check_type() enforces this, covered by tests
reserved-member-u and reserved-member-has.

These tests neglect to cover optional members, where the name starts
with '*'.  Tweak reserved-member-u to fix that.  Test
reserved-member-has still covers non-optional members.

This demonstrates the reserved member name check is broken for
optional members.  The next commit will fix it.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210323094025.3569441-7-armbru@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
[Commit message improved slightly]


  Commit: dbfe3c7c289c6b95a920b4e2a178e583c17c62a8
      
https://github.com/qemu/qemu/commit/dbfe3c7c289c6b95a920b4e2a178e583c17c62a8
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M scripts/qapi/expr.py
    M tests/qapi-schema/reserved-member-u.err
    M tests/qapi-schema/reserved-member-u.json
    M tests/qapi-schema/reserved-member-u.out

  Log Message:
  -----------
  qapi: Fix to reject optional members with reserved names

check_type() fails to reject optional members with reserved names,
because it neglects to strip off the leading '*'.  Fix that.

The stripping in check_name_str() is now useless.  Drop.

Also drop the "no leading '*'" assertion, because valid_name.match()
ensures it can't fail.

Fixes: 9fb081e0b98409556d023c7193eeb68947cd1211
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210323094025.3569441-8-armbru@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>


  Commit: 5fbc78dd3675832062894aeca89a52c90a96f954
      
https://github.com/qemu/qemu/commit/5fbc78dd3675832062894aeca89a52c90a96f954
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M scripts/qapi/common.py
    M scripts/qapi/expr.py

  Log Message:
  -----------
  qapi: Permit flat union members for any tag value

Flat union branch names match the tag enum's member names.  Omitted
branches default to "no members for this tag value".

Branch names starting with a digit get rejected like "'data' member
'0' has an invalid name".  However, omitting the branch works.

This is because flat union tag values get checked twice: as enum
member name, and as union branch name.  The former accepts leading
digits, the latter doesn't.

Branches whose names start with a digit therefore cannot have members.
Feels wrong.  Get rid of the restriction by skipping the latter check.

This can expose c_name() to input it can't handle: a name starting
with a digit.  Improve it to return a valid C identifier for any
input.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210323094025.3569441-9-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[Commit message rewritten]


  Commit: 0825f62c842f2c07c5471391c6d7fd3f4fe83732
      
https://github.com/qemu/qemu/commit/0825f62c842f2c07c5471391c6d7fd3f4fe83732
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M scripts/qapi/expr.py

  Log Message:
  -----------
  qapi: Lift enum-specific code out of check_name_str()

check_name_str() masks leading digits when passed enum_member=True.
Only check_enum() does.  Lift the masking into check_enum().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210323094025.3569441-10-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>


  Commit: eaab06faa5540e02e4f4782c1a650c9805a36671
      
https://github.com/qemu/qemu/commit/eaab06faa5540e02e4f4782c1a650c9805a36671
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M scripts/qapi/expr.py

  Log Message:
  -----------
  qapi: Rework name checking in preparation of stricter checking

Naming rules differ for the various kinds of names.  To prepare
enforcing them, define functions to check them: check_name_upper(),
check_name_lower(), and check_name_camel().  For now, these merely
wrap around check_name_str(), but that will change shortly.  Replace
the other uses of check_name_str() by appropriate uses of the
wrappers.  No change in behavior just yet.

check_name_str() now returns the name without downstream and x-
prefix, for use by the wrappers in later patches.  Requires tweaking
regexp @valid_name.  It accepts the same strings as before.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210323094025.3569441-11-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[Commit message improved]


  Commit: d224e0c092653f0b9cff77ba6852147687b1bedb
      
https://github.com/qemu/qemu/commit/d224e0c092653f0b9cff77ba6852147687b1bedb
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M scripts/qapi/expr.py

  Log Message:
  -----------
  qapi: Move uppercase rejection to check_name_lower()

check_name_lower() is the only user of check_name_str() using
permit_upper=False.  Move the associated code from check_name_str() to
check_name_lower(), and drop the parameter.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210323094025.3569441-12-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>


  Commit: 00ffe242d64f7622965c52c62adb06fd9664ada8
      
https://github.com/qemu/qemu/commit/00ffe242d64f7622965c52c62adb06fd9664ada8
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M scripts/qapi/expr.py

  Log Message:
  -----------
  qapi: Consistently permit any case in downstream prefixes

We require lowercase __RFQDN_ downstream prefixes only where we
require the prefixed name to be lowercase.  Don't; permit any case in
__RFQDN_ prefixes anywhere.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210323094025.3569441-13-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>


  Commit: d4f4cae8de19d2bdfcf09cdc4676e9b99857dcf2
      
https://github.com/qemu/qemu/commit/d4f4cae8de19d2bdfcf09cdc4676e9b99857dcf2
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M scripts/qapi/expr.py
    M tests/qapi-schema/doc-good.json
    M tests/qapi-schema/doc-good.out
    M tests/qapi-schema/doc-good.txt
    M tests/qapi-schema/doc-invalid-return.json
    M tests/qapi-schema/event-case.err
    M tests/qapi-schema/event-case.json
    M tests/qapi-schema/event-case.out
    M tests/qapi-schema/qapi-schema-test.json
    M tests/qapi-schema/qapi-schema-test.out
    M tests/unit/test-qmp-event.c

  Log Message:
  -----------
  qapi: Enforce event naming rules

Event names should be ALL_CAPS with words separated by underscore.
Enforce this.  The only offenders are in tests/.  Fix them.  Existing
test event-case covers the new error.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210323094025.3569441-14-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>


  Commit: 3e6c8a633113fb6a60369c40cf2061de50727bf6
      
https://github.com/qemu/qemu/commit/3e6c8a633113fb6a60369c40cf2061de50727bf6
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M scripts/qapi/expr.py
    M tests/qapi-schema/doc-bad-union-member.json
    M tests/qapi-schema/double-type.err
    M tests/qapi-schema/double-type.json
    M tests/qapi-schema/features-deprecated-type.err
    M tests/qapi-schema/features-deprecated-type.json
    M tests/qapi-schema/meson.build
    M tests/qapi-schema/redefined-builtin.err
    M tests/qapi-schema/redefined-builtin.json
    M tests/qapi-schema/redefined-type.err
    M tests/qapi-schema/redefined-type.json
    M tests/qapi-schema/struct-data-invalid.err
    M tests/qapi-schema/struct-data-invalid.json
    M tests/qapi-schema/struct-member-invalid-dict.err
    M tests/qapi-schema/struct-member-invalid-dict.json
    M tests/qapi-schema/struct-member-invalid.err
    M tests/qapi-schema/struct-member-invalid.json
    A tests/qapi-schema/type-case.err
    A tests/qapi-schema/type-case.json
    A tests/qapi-schema/type-case.out
    M tests/qapi-schema/unknown-expr-key.err
    M tests/qapi-schema/unknown-expr-key.json

  Log Message:
  -----------
  qapi: Enforce type naming rules

Type names should be CamelCase.  Enforce this.  The only offenders are
in tests/.  Fix them.  Add test type-case to cover the new error.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210323094025.3569441-15-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[Regexp simplified, new test made more robust]


  Commit: 492db12ec3b42be6f971ba8436e080bc096b58b5
      
https://github.com/qemu/qemu/commit/492db12ec3b42be6f971ba8436e080bc096b58b5
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M tests/qapi-schema/meson.build
    R tests/qapi-schema/redefined-builtin.err
    R tests/qapi-schema/redefined-builtin.json
    R tests/qapi-schema/redefined-builtin.out
    A tests/qapi-schema/redefined-predefined.err
    A tests/qapi-schema/redefined-predefined.json
    A tests/qapi-schema/redefined-predefined.out

  Log Message:
  -----------
  tests/qapi-schema: Rename redefined-builtin to redefined-predefined

The previous commit changed this test to clash with a predefined enum
type, not a built-in type.  Adjust its name.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210323094025.3569441-16-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>


  Commit: 4a67bd31a4a45773ed1e33ebd06ff949ff9525d7
      
https://github.com/qemu/qemu/commit/4a67bd31a4a45773ed1e33ebd06ff949ff9525d7
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M scripts/qapi/parser.py

  Log Message:
  -----------
  qapi: Factor out QAPISchemaParser._check_pragma_list_of_str()

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210323094025.3569441-17-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>


  Commit: e90a61e3cc1ab30a2069173aee8b592933d827a1
      
https://github.com/qemu/qemu/commit/e90a61e3cc1ab30a2069173aee8b592933d827a1
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M tests/qapi-schema/meson.build
    R tests/qapi-schema/pragma-doc-required-crap.err
    R tests/qapi-schema/pragma-doc-required-crap.json
    R tests/qapi-schema/pragma-doc-required-crap.out
    R tests/qapi-schema/pragma-name-case-whitelist-crap.err
    R tests/qapi-schema/pragma-name-case-whitelist-crap.json
    R tests/qapi-schema/pragma-name-case-whitelist-crap.out
    R tests/qapi-schema/pragma-returns-whitelist-crap.err
    R tests/qapi-schema/pragma-returns-whitelist-crap.json
    R tests/qapi-schema/pragma-returns-whitelist-crap.out
    A tests/qapi-schema/pragma-value-not-bool.err
    A tests/qapi-schema/pragma-value-not-bool.json
    A tests/qapi-schema/pragma-value-not-bool.out
    A tests/qapi-schema/pragma-value-not-list-of-str.err
    A tests/qapi-schema/pragma-value-not-list-of-str.json
    A tests/qapi-schema/pragma-value-not-list-of-str.out
    A tests/qapi-schema/pragma-value-not-list.err
    A tests/qapi-schema/pragma-value-not-list.json
    A tests/qapi-schema/pragma-value-not-list.out

  Log Message:
  -----------
  tests/qapi-schema: Rename pragma-*-crap to pragma-value-not-*

Rename pragma-doc-required-crap to pragma-not-bool,
pragma-returns-whitelist-crap to pragma-value-not-list, and
pragma-name-case-whitelist-crap to pragma-value-not-list-of-str.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210323094025.3569441-18-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>


  Commit: ef8b3829f6d194c856d7db34e14117e8ed90a396
      
https://github.com/qemu/qemu/commit/ef8b3829f6d194c856d7db34e14117e8ed90a396
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M tests/qapi-schema/meson.build
    A tests/qapi-schema/returns-bad-type.err
    A tests/qapi-schema/returns-bad-type.json
    A tests/qapi-schema/returns-bad-type.out
    R tests/qapi-schema/returns-whitelist.err
    R tests/qapi-schema/returns-whitelist.json
    R tests/qapi-schema/returns-whitelist.out

  Log Message:
  -----------
  tests/qapi-schema: Rename returns-whitelist to returns-bad-type

This test covers returning "bad" types.  Pragma returns-whitelist is
just one aspect.  Naming it returns-whitelist is suboptimal.  Rename
to returns-bad-type.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210323094025.3569441-19-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>


  Commit: b86df374784897c58b965939c9913c2a6c590426
      
https://github.com/qemu/qemu/commit/b86df374784897c58b965939c9913c2a6c590426
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M docs/devel/qapi-code-gen.txt
    M qapi/pragma.json
    M qga/qapi-schema.json
    M scripts/qapi/expr.py
    M scripts/qapi/parser.py
    M scripts/qapi/schema.py
    M scripts/qapi/source.py
    M tests/qapi-schema/enum-member-case.json
    M tests/qapi-schema/pragma-value-not-list-of-str.err
    M tests/qapi-schema/pragma-value-not-list-of-str.json
    M tests/qapi-schema/pragma-value-not-list.err
    M tests/qapi-schema/pragma-value-not-list.json
    M tests/qapi-schema/qapi-schema-test.json
    M tests/qapi-schema/returns-bad-type.json

  Log Message:
  -----------
  qapi: Rename pragma *-whitelist to *-exceptions

Rename pragma returns-whitelist to command-returns-exceptions, and
name-case-whitelist to member-name-case-exceptions.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210323094025.3569441-20-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>


  Commit: b48a1033041c52c2ae12bd38a2caa36fe46ef466
      
https://github.com/qemu/qemu/commit/b48a1033041c52c2ae12bd38a2caa36fe46ef466
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M qapi/pragma.json

  Log Message:
  -----------
  qapi/pragma: Streamline comments on member-name-exceptions

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210323094025.3569441-21-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>


  Commit: 6e2e12a70c0b7f7fe71a7938b9c49bdaa608ce58
      
https://github.com/qemu/qemu/commit/6e2e12a70c0b7f7fe71a7938b9c49bdaa608ce58
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M tests/unit/test-qmp-cmds.c

  Log Message:
  -----------
  tests-qmp-cmds: Drop unused and incorrect qmp_TestIfCmd()

Commit 967c885108 "qapi: add 'if' to top-level expressions" added
command TestIfCmd with an 'if' condition.  It also added the
qmp_TestIfCmd() to go with it, guarded by the corresponding #if.
Commit ccadd6bcba "qapi: Add 'if' to implicit struct members" changed
the command, but not the function.  Compiles only because we don't
satisfy the #if.  Instead of fixing the function, simply drop it.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210323094025.3569441-22-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>


  Commit: 9af4b6b9e80daeab2ce47664ff422b5e421814de
      
https://github.com/qemu/qemu/commit/9af4b6b9e80daeab2ce47664ff422b5e421814de
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M scripts/qapi/expr.py
    M tests/qapi-schema/args-member-case.err
    M tests/qapi-schema/enum-member-case.err
    M tests/qapi-schema/union-branch-case.err

  Log Message:
  -----------
  qapi: Prepare for rejecting underscore in command and member names

Command names and member names within a type should be all lower case
with words separated by a hyphen.  We also accept underscore.  Rework
check_name_lower() to optionally reject underscores, but don't use
that option, yet.

Update expected test output for the changed error message.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210323094025.3569441-23-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>


  Commit: e744708a7783624292f8c405ca840f50a10b0003
      
https://github.com/qemu/qemu/commit/e744708a7783624292f8c405ca840f50a10b0003
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M scripts/qapi/expr.py

  Log Message:
  -----------
  qapi: Enforce feature naming rules

Feature names should use '-', not '_'.  Enforce this.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210323094025.3569441-24-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>


  Commit: 05ebf841efac494d8bd1f6d74642c3e9a3df4c19
      
https://github.com/qemu/qemu/commit/05ebf841efac494d8bd1f6d74642c3e9a3df4c19
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M docs/devel/qapi-code-gen.txt
    M qapi/pragma.json
    M scripts/qapi/expr.py
    M scripts/qapi/parser.py
    M scripts/qapi/source.py
    M tests/qapi-schema/qapi-schema-test.json
    M tests/qapi-schema/qapi-schema-test.out
    M tests/unit/test-qmp-cmds.c

  Log Message:
  -----------
  qapi: Enforce command naming rules

Command names should be lower-case.  Enforce this.  Fix the fixable
offenders (all in tests/), and add the remainder to pragma
command-name-exceptions.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210323094025.3569441-25-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>


  Commit: e75d4225b76842ec899f25e8ff39b070119f033f
      
https://github.com/qemu/qemu/commit/e75d4225b76842ec899f25e8ff39b070119f033f
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    R tests/qapi-schema/args-name-clash.err
    R tests/qapi-schema/args-name-clash.json
    R tests/qapi-schema/args-name-clash.out
    M tests/qapi-schema/meson.build
    A tests/qapi-schema/struct-member-name-clash.err
    A tests/qapi-schema/struct-member-name-clash.json
    A tests/qapi-schema/struct-member-name-clash.out

  Log Message:
  -----------
  tests/qapi-schema: Switch member name clash test to struct

Test args-name-clash covers command parameter name clash.  This
effectively covers struct member name clash as well.  The next commit
will make parameter name clash impossible.  Convert args-name-clash
from testing command to testing a struct, and rename it to
struct-member-name-clash.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210323094025.3569441-26-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[Commit message typo fixed]


  Commit: 5aceeac04de50e3a9d5c2a965379324659a94be0
      
https://github.com/qemu/qemu/commit/5aceeac04de50e3a9d5c2a965379324659a94be0
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M docs/devel/qapi-code-gen.txt
    M qapi/pragma.json
    M qga/qapi-schema.json
    M scripts/qapi/expr.py
    M tests/qapi-schema/qapi-schema-test.json
    M tests/qapi-schema/qapi-schema-test.out
    M tests/qapi-schema/struct-member-name-clash.err
    M tests/qapi-schema/struct-member-name-clash.json

  Log Message:
  -----------
  qapi: Enforce struct member naming rules

Struct members, including command arguments, event data, and union
inline base members, should use '-', not '_'.  Enforce this.  Fix the
fixable offenders (all in tests/), and add the remainder to pragma
member-name-exceptions.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210323094025.3569441-27-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>


  Commit: 407efbf9e776ade8e8d09b778851834f91b225a1
      
https://github.com/qemu/qemu/commit/407efbf9e776ade8e8d09b778851834f91b225a1
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M qapi/pragma.json
    M scripts/qapi/expr.py
    M tests/qapi-schema/enum-clash-member.err
    M tests/qapi-schema/enum-clash-member.json

  Log Message:
  -----------
  qapi: Enforce enum member naming rules

Enum members should use '-', not '_'.  Enforce this.  Fix the fixable
offenders (all in tests/), and add the remainder to pragma
member-name-exceptions.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210323094025.3569441-28-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>


  Commit: d83b47646ec2bdf4f7be9c2078f1bcbbb0544b2e
      
https://github.com/qemu/qemu/commit/d83b47646ec2bdf4f7be9c2078f1bcbbb0544b2e
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M scripts/qapi/expr.py
    M tests/qapi-schema/alternate-clash.err
    M tests/qapi-schema/alternate-clash.json
    M tests/qapi-schema/qapi-schema-test.json
    M tests/qapi-schema/qapi-schema-test.out
    M tests/qapi-schema/union-clash-branches.err
    M tests/qapi-schema/union-clash-branches.json

  Log Message:
  -----------
  qapi: Enforce union and alternate branch naming rules

Union branch names should use '-', not '_'.  Enforce this.  The only
offenders are in tests/.  Fix them.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210323094025.3569441-29-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[Commit message typo fixed]


  Commit: bdabafc6836edc0f34732cac473899cb4e77a296
      
https://github.com/qemu/qemu/commit/bdabafc6836edc0f34732cac473899cb4e77a296
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M block/monitor/block-hmp-cmds.c
    M blockdev.c
    M hmp-commands.hx
    M qapi/block-core.json
    M qapi/pragma.json

  Log Message:
  -----------
  block: Remove monitor command block_passwd

Command block_passwd always fails since

Commit c01c214b69 "block: remove all encryption handling APIs"
(v2.10.0) turned block_passwd into a stub that always fails, and
hardcoded encryption_key_missing to false in query-named-block-nodes
and query-block.

Commit ad1324e044 "block: remove 'encryption_key_missing' flag from
QAPI" just landed.  Complete the cleanup job: remove block_passwd.

Cc: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210323101951.3686029-1-armbru@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: 266469947161aa10b1d36843580d369d5aa38589
      
https://github.com/qemu/qemu/commit/266469947161aa10b1d36843580d369d5aa38589
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M block/monitor/block-hmp-cmds.c
    M blockdev.c
    M docs/devel/qapi-code-gen.txt
    M hmp-commands.hx
    M qapi/block-core.json
    M qapi/pragma.json
    M qga/qapi-schema.json
    M scripts/qapi/common.py
    M scripts/qapi/expr.py
    M scripts/qapi/parser.py
    M scripts/qapi/schema.py
    M scripts/qapi/source.py
    M tests/qapi-schema/alternate-clash.err
    M tests/qapi-schema/alternate-clash.json
    M tests/qapi-schema/args-member-case.err
    R tests/qapi-schema/args-name-clash.err
    R tests/qapi-schema/args-name-clash.json
    R tests/qapi-schema/args-name-clash.out
    M tests/qapi-schema/doc-bad-union-member.json
    M tests/qapi-schema/doc-good.json
    M tests/qapi-schema/doc-good.out
    M tests/qapi-schema/doc-good.txt
    M tests/qapi-schema/doc-invalid-return.json
    M tests/qapi-schema/double-type.err
    M tests/qapi-schema/double-type.json
    M tests/qapi-schema/enum-clash-member.err
    M tests/qapi-schema/enum-clash-member.json
    M tests/qapi-schema/enum-member-case.err
    M tests/qapi-schema/enum-member-case.json
    M tests/qapi-schema/event-case.err
    M tests/qapi-schema/event-case.json
    M tests/qapi-schema/event-case.out
    M tests/qapi-schema/event-member-invalid-dict.err
    M tests/qapi-schema/event-member-invalid-dict.json
    M tests/qapi-schema/features-deprecated-type.err
    M tests/qapi-schema/features-deprecated-type.json
    M tests/qapi-schema/flat-union-inline-invalid-dict.json
    R tests/qapi-schema/flat-union-inline.err
    R tests/qapi-schema/flat-union-inline.json
    R tests/qapi-schema/flat-union-inline.out
    M tests/qapi-schema/flat-union-no-base.err
    M tests/qapi-schema/flat-union-no-base.json
    M tests/qapi-schema/meson.build
    M tests/qapi-schema/nested-struct-data-invalid-dict.err
    M tests/qapi-schema/nested-struct-data-invalid-dict.json
    M tests/qapi-schema/nested-struct-data.json
    R tests/qapi-schema/pragma-doc-required-crap.err
    R tests/qapi-schema/pragma-doc-required-crap.json
    R tests/qapi-schema/pragma-doc-required-crap.out
    R tests/qapi-schema/pragma-name-case-whitelist-crap.err
    R tests/qapi-schema/pragma-name-case-whitelist-crap.json
    R tests/qapi-schema/pragma-name-case-whitelist-crap.out
    R tests/qapi-schema/pragma-returns-whitelist-crap.err
    R tests/qapi-schema/pragma-returns-whitelist-crap.json
    R tests/qapi-schema/pragma-returns-whitelist-crap.out
    A tests/qapi-schema/pragma-value-not-bool.err
    A tests/qapi-schema/pragma-value-not-bool.json
    A tests/qapi-schema/pragma-value-not-bool.out
    A tests/qapi-schema/pragma-value-not-list-of-str.err
    A tests/qapi-schema/pragma-value-not-list-of-str.json
    A tests/qapi-schema/pragma-value-not-list-of-str.out
    A tests/qapi-schema/pragma-value-not-list.err
    A tests/qapi-schema/pragma-value-not-list.json
    A tests/qapi-schema/pragma-value-not-list.out
    M tests/qapi-schema/qapi-schema-test.json
    M tests/qapi-schema/qapi-schema-test.out
    R tests/qapi-schema/redefined-builtin.err
    R tests/qapi-schema/redefined-builtin.json
    R tests/qapi-schema/redefined-builtin.out
    A tests/qapi-schema/redefined-predefined.err
    A tests/qapi-schema/redefined-predefined.json
    A tests/qapi-schema/redefined-predefined.out
    M tests/qapi-schema/redefined-type.err
    M tests/qapi-schema/redefined-type.json
    M tests/qapi-schema/reserved-member-u.err
    M tests/qapi-schema/reserved-member-u.json
    A tests/qapi-schema/returns-bad-type.err
    A tests/qapi-schema/returns-bad-type.json
    A tests/qapi-schema/returns-bad-type.out
    R tests/qapi-schema/returns-whitelist.err
    R tests/qapi-schema/returns-whitelist.json
    R tests/qapi-schema/returns-whitelist.out
    M tests/qapi-schema/struct-data-invalid.err
    M tests/qapi-schema/struct-data-invalid.json
    M tests/qapi-schema/struct-member-invalid-dict.err
    M tests/qapi-schema/struct-member-invalid-dict.json
    M tests/qapi-schema/struct-member-invalid.err
    M tests/qapi-schema/struct-member-invalid.json
    A tests/qapi-schema/struct-member-name-clash.err
    A tests/qapi-schema/struct-member-name-clash.json
    A tests/qapi-schema/struct-member-name-clash.out
    A tests/qapi-schema/type-case.err
    A tests/qapi-schema/type-case.json
    A tests/qapi-schema/type-case.out
    M tests/qapi-schema/union-branch-case.err
    M tests/qapi-schema/union-clash-branches.err
    M tests/qapi-schema/union-clash-branches.json
    M tests/qapi-schema/unknown-expr-key.err
    M tests/qapi-schema/unknown-expr-key.json
    M tests/unit/test-qmp-cmds.c
    M tests/unit/test-qmp-event.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2021-03-23' into 
staging

QAPI patches patches for 2021-03-23

# gpg: Signature made Tue 23 Mar 2021 21:37:53 GMT
# gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
# gpg:                issuer "armbru@redhat.com"
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
# gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653

* remotes/armbru/tags/pull-qapi-2021-03-23: (29 commits)
  block: Remove monitor command block_passwd
  qapi: Enforce union and alternate branch naming rules
  qapi: Enforce enum member naming rules
  qapi: Enforce struct member naming rules
  tests/qapi-schema: Switch member name clash test to struct
  qapi: Enforce command naming rules
  qapi: Enforce feature naming rules
  qapi: Prepare for rejecting underscore in command and member names
  tests-qmp-cmds: Drop unused and incorrect qmp_TestIfCmd()
  qapi/pragma: Streamline comments on member-name-exceptions
  qapi: Rename pragma *-whitelist to *-exceptions
  tests/qapi-schema: Rename returns-whitelist to returns-bad-type
  tests/qapi-schema: Rename pragma-*-crap to pragma-value-not-*
  qapi: Factor out QAPISchemaParser._check_pragma_list_of_str()
  tests/qapi-schema: Rename redefined-builtin to redefined-predefined
  qapi: Enforce type naming rules
  qapi: Enforce event naming rules
  qapi: Consistently permit any case in downstream prefixes
  qapi: Move uppercase rejection to check_name_lower()
  qapi: Rework name checking in preparation of stricter checking
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/1a4d83b5643e...266469947161



reply via email to

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