[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/3] qapi: provide a friendly string representation of QAPI c
From: |
Eric Blake |
Subject: |
Re: [PATCH 3/3] qapi: provide a friendly string representation of QAPI classes |
Date: |
Tue, 2 Mar 2021 13:06:17 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 |
On 3/2/21 11:55 AM, Daniel P. Berrangé wrote:
> If printing a QAPI schema object for debugging we get the classname and
> a hex value for the instance. With this change we instead get the
> classname and the human friendly name of the QAPI type instance.
>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
> scripts/qapi/schema.py | 3 +++
> 1 file changed, 3 insertions(+)
Reviewed-by: Eric Blake <eblake@redhat.com>
>
> diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
> index ff16578f6d..800bc5994b 100644
> --- a/scripts/qapi/schema.py
> +++ b/scripts/qapi/schema.py
> @@ -46,6 +46,9 @@ def __init__(self, name: str, info, doc, ifcond=None,
> features=None):
> self.features = features or []
> self._checked = False
>
> + def __repr__(self):
> + return "%s<%s>" % (type(self).__name__, self.name)
> +
> def c_name(self):
> return c_name(self.name)
>
>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
[PATCH 3/3] qapi: provide a friendly string representation of QAPI classes, Daniel P . Berrangé, 2021/03/02
[PATCH 1/3] qapi, audio: add query-audiodev command, Daniel P . Berrangé, 2021/03/02
Re: [PATCH 1/3] qapi, audio: add query-audiodev command, Markus Armbruster, 2021/03/05