mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
qapi: Improve reporting of redefinition
Point to the previous definition, unless it's a built-in. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20190927134639.4284-26-armbru@redhat.com>
This commit is contained in:
parent
f63326985a
commit
56d2df5e65
4 changed files with 14 additions and 3 deletions
|
@ -1759,6 +1759,11 @@ class QAPISchema(object):
|
|||
# because they're liable to clash in generated C.
|
||||
other_ent = self._entity_dict.get(ent.name)
|
||||
if other_ent:
|
||||
if other_ent.info:
|
||||
where = QAPIError(other_ent.info, None, "previous definition")
|
||||
raise QAPISemError(
|
||||
ent.info,
|
||||
"'%s' is already defined\n%s" % (ent.name, where))
|
||||
raise QAPISemError(
|
||||
ent.info, "%s is already defined" % other_ent.describe())
|
||||
self._entity_dict[ent.name] = ent
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue