All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: "Markus Armbruster" <armbru@redhat.com>,
	"Cédric Le Goater" <clg@kaod.org>
Cc: Corey Minyard <cminyard@mvista.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	Andrew Jeffery <andrew@aj.id.au>,
	qemu-devel@nongnu.org, qemu-arm@nongnu.org,
	Joel Stanley <joel@jms.id.au>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH v4 4/8] hw/misc/pca9552: Add a 'description' property for debugging purpose
Date: Thu, 25 Jun 2020 10:12:34 +0200	[thread overview]
Message-ID: <2d1b8b24-3b2c-d84e-8026-e369f6531247@amsat.org> (raw)
In-Reply-To: <877dvv4pmg.fsf@dusky.pond.sub.org>

On 6/25/20 8:37 AM, Markus Armbruster wrote:
> Cédric Le Goater <clg@kaod.org> writes:
> 
>> On 6/22/20 10:31 AM, Philippe Mathieu-Daudé wrote:
>>> On 6/22/20 8:27 AM, Cédric Le Goater wrote:
>>>> On 6/21/20 12:58 AM, Philippe Mathieu-Daudé wrote:
>>>>> Add a description field to distinguish between multiple devices.
> 
> Pardon my lack of imagination: how does this help you with debugging?

Ah, the patch subject is indeed incorrect, this should be:
"... for *tracing* purpose" (I use tracing when debugging).

In the next patch, we use the 'description' property:

+# pca9552.c
+pca9552_gpio_status(const char *description, const char *buf) "%s GPIOs
0-15 [%s]"

So when the machine has multiple PCA9552 and guest accesses both,
we can distinct which one is used. For me having "pca1" / "pca0"
is easier to follow than the address of the QOM object.

> 
>>>> Reviewed-by: Cédric Le Goater <clg@kaod.org>
>>>>
>>>> Could it be a QOM attribute ? 
>>>
>>> What do you call a 'QOM attribute'?
>>> Is it what qdev properties implement?
>>> (in this case via DEFINE_PROP_STRING).
>>
>> I meant a default Object property, which would apply to all Objects. 
> 
> Good point.  Many devices have multiple component objects of the same
> type.
> 
>> What you did is fine, so :
>>
>> Reviewed-by: Cédric Le Goater <clg@kaod.org>
>>
>> but, may be, a well defined child name is enough for the purpose.
> 
> object_get_canonical_path() returns a distinct path for each (component)
> object.  The path components are the child property names.
> 
> Properties can have descriptions: object_property_set_description().

TIL object_property_set_description :>

Ah, there is no equivalent object_property_get_description(),
we have to use object_get_canonical_path(). Hmm, not obvious.

> 
> Sufficient?

I don't know... This seems a complex way to do something simple...
This is already a QDEV. Having to use QOM API seems going
backward, since we have the DEFINE_PROP_STRING() macros available
in "hw/qdev-properties.h".

Maybe I'm not seeing the advantages clearly. I'll try later.

Thanks for your review,

Phil.


  reply	other threads:[~2020-06-25  8:13 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-20 22:58 [PATCH v4 0/8] hw/misc/pca9552: Trace GPIO change events Philippe Mathieu-Daudé
2020-06-20 22:58 ` [PATCH v4 1/8] hw/i2c/core: Add i2c_try_create_slave() and i2c_realize_and_unref() Philippe Mathieu-Daudé
2020-06-22  8:28   ` Philippe Mathieu-Daudé
2020-06-22 15:17   ` Markus Armbruster
2020-06-22 15:41     ` Philippe Mathieu-Daudé
2020-06-23  7:26       ` Markus Armbruster
2020-06-20 22:58 ` [PATCH v4 2/8] hw/misc/pca9552: Replace magic value by PCA9552_PIN_COUNT definition Philippe Mathieu-Daudé
2020-06-22  6:27   ` Cédric Le Goater
2020-06-20 22:58 ` [PATCH v4 3/8] hw/misc/pca9552: Use the " Philippe Mathieu-Daudé
2020-06-22  6:25   ` Cédric Le Goater
2020-06-22  8:37     ` Philippe Mathieu-Daudé
2020-06-22 13:15       ` Cédric Le Goater
2020-06-20 22:58 ` [PATCH v4 4/8] hw/misc/pca9552: Add a 'description' property for debugging purpose Philippe Mathieu-Daudé
2020-06-22  6:27   ` Cédric Le Goater
2020-06-22  8:31     ` Philippe Mathieu-Daudé
2020-06-22 13:24       ` Cédric Le Goater
2020-06-25  6:37         ` Markus Armbruster
2020-06-25  8:12           ` Philippe Mathieu-Daudé [this message]
2020-06-25 14:23             ` Philippe Mathieu-Daudé
2020-06-26  5:49               ` Markus Armbruster
2020-06-26  9:43                 ` Philippe Mathieu-Daudé
2020-06-27  6:52                   ` Markus Armbruster
2020-06-20 22:58 ` [PATCH v4 5/8] hw/misc/pca9552: Trace GPIO High/Low events Philippe Mathieu-Daudé
2020-06-22  6:47   ` Cédric Le Goater
2020-06-20 22:58 ` [PATCH v4 6/8] hw/arm/aspeed: Describe each PCA9552 device Philippe Mathieu-Daudé
2020-06-22  6:49   ` Cédric Le Goater
2020-06-22  8:35     ` Philippe Mathieu-Daudé
2020-06-24 16:54       ` Philippe Mathieu-Daudé
2020-06-24 17:02         ` Cédric Le Goater
2020-06-20 22:58 ` [PATCH v4 7/8] hw/misc/pca9552: Trace GPIO change events Philippe Mathieu-Daudé
2020-06-22  7:01   ` Cédric Le Goater
2020-06-22  9:52     ` Philippe Mathieu-Daudé
2020-06-20 22:58 ` [PATCH v4 8/8] hw/misc/pca9552: Model qdev output GPIOs Philippe Mathieu-Daudé
2020-06-22  7:02   ` Cédric Le Goater

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=2d1b8b24-3b2c-d84e-8026-e369f6531247@amsat.org \
    --to=f4bug@amsat.org \
    --cc=andrew@aj.id.au \
    --cc=armbru@redhat.com \
    --cc=clg@kaod.org \
    --cc=cminyard@mvista.com \
    --cc=joel@jms.id.au \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --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.