OSDN Git Service

qapi: Rework name checking in preparation of stricter checking
authorMarkus Armbruster <armbru@redhat.com>
Tue, 23 Mar 2021 09:40:07 +0000 (10:40 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Tue, 23 Mar 2021 21:30:51 +0000 (22:30 +0100)
commiteaab06faa5540e02e4f4782c1a650c9805a36671
treeb2603475c29726bf34c554f4c93832f72ff366b0
parent0825f62c842f2c07c5471391c6d7fd3f4fe83732
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]
scripts/qapi/expr.py