[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] fixup! qapi: Enforce (or whitelist) case convention
From: |
Eric Blake |
Subject: |
[Qemu-devel] [PATCH] fixup! qapi: Enforce (or whitelist) case conventions on qapi members |
Date: |
Wed, 2 Dec 2015 08:30:27 -0700 |
Whitelist must now include implicit names, and update the testsuite
to use names that match returns-whitelist
Signed-off-by: Eric Blake <address@hidden>
---
To be applied on top of Markus' fixup, if we indeed want to drop
info['name'] and allow implicit names in the whitelist.
scripts/qapi.py | 4 ++++
tests/qapi-schema/args-member-case.err | 2 +-
tests/qapi-schema/args-member-case.json | 5 +++--
tests/qapi-schema/enum-member-case.err | 2 +-
tests/qapi-schema/enum-member-case.json | 3 ++-
tests/qapi-schema/union-branch-case.err | 2 +-
tests/qapi-schema/union-branch-case.json | 5 +++--
7 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/scripts/qapi.py b/scripts/qapi.py
index 131638a..bebd8c7 100644
--- a/scripts/qapi.py
+++ b/scripts/qapi.py
@@ -71,6 +71,10 @@ case_whitelist = [
'QapiErrorClass', # all members, visible through errors
'UuidInfo', # UUID, visible through query-uuid
'X86CPURegister32', # all members, visible indirectly through qom-get
+
+ # For use in the testsuite
+ ':obj-x-UuidInfo-arg', # args-member-case
+ 'x-UuidInfoKind', # union-branch-case
]
enum_types = []
diff --git a/tests/qapi-schema/args-member-case.err
b/tests/qapi-schema/args-member-case.err
index 44c31ea..aeab66d 100644
--- a/tests/qapi-schema/args-member-case.err
+++ b/tests/qapi-schema/args-member-case.err
@@ -1 +1 @@
-tests/qapi-schema/args-member-case.json:3: 'Arg' (parameter of Foo) should not
use uppercase
+tests/qapi-schema/args-member-case.json:4: 'Arg' (parameter of
no-way-this-will-get-whitelisted) should not use uppercase
diff --git a/tests/qapi-schema/args-member-case.json
b/tests/qapi-schema/args-member-case.json
index 1bc823a..c5cd07f 100644
--- a/tests/qapi-schema/args-member-case.json
+++ b/tests/qapi-schema/args-member-case.json
@@ -1,3 +1,4 @@
# Member names should be 'lower-case' unless the struct/command is whitelisted
-{ 'command': 'UuidInfo', 'data': { 'Arg': 'int' } }
-{ 'command': 'Foo', 'data': { 'Arg': 'int' } }
+{ 'command': 'x-UuidInfo', 'data': { 'Arg': 'int' } }
+
+{ 'command': 'no-way-this-will-get-whitelisted', 'data': { 'Arg': 'int' } }
diff --git a/tests/qapi-schema/enum-member-case.err
b/tests/qapi-schema/enum-member-case.err
index a1d67c6..3c67a3a 100644
--- a/tests/qapi-schema/enum-member-case.err
+++ b/tests/qapi-schema/enum-member-case.err
@@ -1 +1 @@
-tests/qapi-schema/enum-member-case.json:3: 'Value' (member of Foo) should not
use uppercase
+tests/qapi-schema/enum-member-case.json:4: 'Value' (member of
NoWayThisWillGetWhitelisted) should not use uppercase
diff --git a/tests/qapi-schema/enum-member-case.json
b/tests/qapi-schema/enum-member-case.json
index 5101275..cdede72 100644
--- a/tests/qapi-schema/enum-member-case.json
+++ b/tests/qapi-schema/enum-member-case.json
@@ -1,3 +1,4 @@
# Member names should be 'lower-case' unless the enum is whitelisted
{ 'enum': 'UuidInfo', 'data': [ 'Value' ] }
-{ 'enum': 'Foo', 'data': [ 'Value' ] }
+
+{ 'enum': 'NoWayThisWillGetWhitelisted', 'data': [ 'Value' ] }
diff --git a/tests/qapi-schema/union-branch-case.err
b/tests/qapi-schema/union-branch-case.err
index 0b4c1b5..34b13db 100644
--- a/tests/qapi-schema/union-branch-case.err
+++ b/tests/qapi-schema/union-branch-case.err
@@ -1 +1 @@
-tests/qapi-schema/union-branch-case.json:3: 'Branch' (branch of Foo) should
not use uppercase
+tests/qapi-schema/union-branch-case.json:4: 'Branch' (branch of
NoWayThisWillGetWhitelisted) should not use uppercase
diff --git a/tests/qapi-schema/union-branch-case.json
b/tests/qapi-schema/union-branch-case.json
index a5951f1..880c173 100644
--- a/tests/qapi-schema/union-branch-case.json
+++ b/tests/qapi-schema/union-branch-case.json
@@ -1,3 +1,4 @@
# Branch names should be 'lower-case' unless the union is whitelisted
-{ 'union': 'UuidInfo', 'data': { 'Branch': 'int' } }
-{ 'union': 'Foo', 'data': { 'Branch': 'int' } }
+{ 'union': 'x-UuidInfo', 'data': { 'Branch': 'int' } }
+
+{ 'union': 'NoWayThisWillGetWhitelisted', 'data': { 'Branch': 'int' } }
--
2.4.3
- [Qemu-devel] [PATCH v14 15/15] qapi: Detect base class loops, (continued)
- [Qemu-devel] [PATCH v14 15/15] qapi: Detect base class loops, Eric Blake, 2015/12/02
- [Qemu-devel] [PATCH v14 13/15] qapi: Enforce (or whitelist) case conventions on qapi members, Eric Blake, 2015/12/02
- Re: [Qemu-devel] [PATCH v14 13/15] qapi: Enforce (or whitelist) case conventions on qapi members, Markus Armbruster, 2015/12/02
- Re: [Qemu-devel] [PATCH v14 13/15] qapi: Enforce (or whitelist) case conventions on qapi members, Eric Blake, 2015/12/02
- Re: [Qemu-devel] [PATCH v14 13/15] qapi: Enforce (or whitelist) case conventions on qapi members, Eric Blake, 2015/12/02
- Re: [Qemu-devel] [PATCH v14 13/15] qapi: Enforce (or whitelist) case conventions on qapi members, Markus Armbruster, 2015/12/02
- Re: [Qemu-devel] [PATCH v14 13/15] qapi: Enforce (or whitelist) case conventions on qapi members, Eric Blake, 2015/12/02
- Re: [Qemu-devel] [PATCH v14 13/15] qapi: Enforce (or whitelist) case conventions on qapi members, Markus Armbruster, 2015/12/02
- Re: [Qemu-devel] [PATCH v14 13/15] qapi: Enforce (or whitelist) case conventions on qapi members, Markus Armbruster, 2015/12/02
- Re: [Qemu-devel] [PATCH v14 13/15] qapi: Enforce (or whitelist) case conventions on qapi members, Eric Blake, 2015/12/02
- [Qemu-devel] [PATCH] fixup! qapi: Enforce (or whitelist) case conventions on qapi members,
Eric Blake <=
[Qemu-devel] [PATCH v14 12/15] qapi: Populate info['name'] for each entity, Eric Blake, 2015/12/02
[Qemu-devel] [PATCH v14 04/15] qapi: Simplify visiting of alternate types, Eric Blake, 2015/12/02
[Qemu-devel] [PATCH v14 14/15] qapi: Move duplicate collision checks to schema check(), Eric Blake, 2015/12/02
Re: [Qemu-devel] [PATCH v14 00/15] qapi member collision (post-introspection cleanups, subset D), Markus Armbruster, 2015/12/02