All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: qemu-devel@nongnu.org,  Michael Roth <michael.roth@amd.com>
Subject: Re: [PATCH v2] qapi: provide a friendly string representation of QAPI classes
Date: Wed, 18 Oct 2023 13:52:54 +0200	[thread overview]
Message-ID: <87ttqop2p5.fsf@pond.sub.org> (raw)
In-Reply-To: <ZS+75MJ74uKBXGBc@redhat.com> ("Daniel P. Berrangé"'s message of "Wed, 18 Oct 2023 12:05:08 +0100")

Daniel P. Berrangé <berrange@redhat.com> writes:

> On Wed, Oct 18, 2023 at 12:54:28PM +0200, Markus Armbruster wrote:
>> Daniel P. Berrangé <berrange@redhat.com> writes:
>> 
>> > If printing a QAPI schema object for debugging we get the classname and
>> > a hex value for the instance:
>> >
>> >   <qapi.schema.QAPISchemaEnumType object at 0x7f0ab4c2dad0>
>> >   <qapi.schema.QAPISchemaObjectType object at 0x7f0ab4c2dd90>
>> >   <qapi.schema.QAPISchemaArrayType object at 0x7f0ab4c2df90>
>> >
>> > With this change we instead get the classname and the human friendly
>> > name of the QAPI type instance:
>> >
>> >   <QAPISchemaEnumType:CpuS390State>
>> >   <QAPISchemaObjectType:CpuInfoS390>
>> >   <QAPISchemaArrayType:CpuInfoFastList>
>> 
>> This gains the QAPI name (good), but loses the address.  The actual
>> address is rarely useful (when it is, you're deep in Python innards;
>> good luck, you'll need it).  Except they let me see which objects are
>> the same, and which are different.  Could that be preserved without
>> trouble somehow?
>
> It appears the hex value comes from  'id(obj)', so yes, I can
> insert the same hex value into the new representation.

I'd appreciate that.

>> > Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
>> > ---
>> >
>> > v1 was two & half years ago:
>> >
>> >   https://mail.gnu.org/archive/html/qemu-devel/2021-03/msg01645.html
>> 
>> Was it my fault?  If yes, I apologize.
>
> No, I forgot about it until I was moving old branches from my previous
> laptop to my new laptops :-)

Puh!

[...]



      reply	other threads:[~2023-10-18 11:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-22 15:32 [PATCH v2] qapi: provide a friendly string representation of QAPI classes Daniel P. Berrangé
2023-10-18 10:54 ` Markus Armbruster
2023-10-18 11:05   ` Daniel P. Berrangé
2023-10-18 11:52     ` Markus Armbruster [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ttqop2p5.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=michael.roth@amd.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.