qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: "Andreas Färber" <afaerber@suse.de>
Cc: pbonzini@redhat.com, qemu-devel@nongnu.org,
	Luiz Capitulino <lcapitulino@redhat.com>
Subject: Re: [Qemu-devel] [PATCH qom-next 2/7] qom: Add get_id
Date: Fri, 08 Jun 2012 15:44:06 +0800	[thread overview]
Message-ID: <4FD1AD46.9040607@codemonkey.ws> (raw)
In-Reply-To: <4FD1A5B8.20700@suse.de>

On 06/08/2012 03:11 PM, Andreas Färber wrote:
> Am 08.06.2012 03:22, schrieb Anthony Liguori:
>> On 06/08/2012 03:31 AM, Andreas Färber wrote:
>>> From: Paolo Bonzini<pbonzini@redhat.com>
>>>
>>> Some classes may present objects differently in errors, for example if
>>> they
>>> are not part of the composition tree or if they are not assigned an id by
>>> the user.  Let them do this with a get_id method on Object, and use the
>>> method consistently where a %(device) appears in the error.
>>>
>>> Signed-off-by: Paolo Bonzini<pbonzini@redhat.com>
>>> [AF: Renamed _object_get_id() to object_instance_get_id(), avoid ?:.]
>>> [AF: Use object_property_is_child().]
>>> Signed-off-by: Andreas Färber<afaerber@suse.de>
>>
>> Nack.
>
> Unfortunately that comment comes a bit late (original submission May
> 23rd, me specifically cc'ing you in my reply that it's new and not
> covered by your carte blanche).

Uh, that was a week before the release.  Don't send significant things during 
the final part of a release and expect to get significant review.

> The general idea as I understand it is to have a mechanism for having
> devices fill in their ID into %(device) in the error messages once the
> code emitting those errors is at Object level. Peter's improved error
> message practically becomes "Property '.propertyname' ..." because
> without it we'll need to fill in "" in lack of an actual value.

Ambiguity is fundamentally bad.  If you want to return the path, return the 
path.  If you want to return the type, return the type.  Returning the type 
because we're too lazy to implement the path properly is not acceptable and 
makes the error messages useless (because they're ambiguous).

Have a separate 'path' and 'typename' attribute in the errors.  With some 
cleverness, you can probably use '%p' and interpret the pointer an as Object * 
and automagically generate an embedded 'device': { 'path': '/path/to/device', 
'typename': 'FancyType' }.

>>
>> We should use a canonical path IMHO instead of returning a partial name.
>>
>> Partial names are ambiguous.
>
> Possibly, but a partial name still is an improvement over the current
> situation with no name at all. Also my previous request to not use
> %(device) for Object-level API was rejected with reference to existing
> QMP users, so by the same argument we cannot stuff a QOM path into
> %(device) either and would need a new QMP field %(path) or so. Cc'ing Luiz.

Since qdev->id is NULL 90% of the time, I don't think a user can realistically 
rely on it.  I don't think changing the type of the data in the error is going 
to be a problem.

Doesn't libvirt ignore the contents of an error object?

Regards,

Anthony Liguori

>
> There is no guarantee that the object actually has a canonical path at
> that point, and object_get_canonical_path() would g_assert() in such a case.
>
> Please advise on how to proceed with this series.
>
> Andreas
>

  reply	other threads:[~2012-06-08  7:44 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-07 19:30 [Qemu-devel] [PATCH qom-next 0/7] QOM realize, revised Andreas Färber
2012-06-07 19:30 ` [Qemu-devel] [PATCH qom-next 1/7] qdev: Push state up to Object Andreas Färber
2012-06-08  1:19   ` Anthony Liguori
2012-06-10 15:49     ` Paolo Bonzini
2012-06-10 17:35       ` Anthony Liguori
2012-06-10 17:38       ` Andreas Färber
2012-06-11  8:25         ` Kevin Wolf
2012-06-11 13:21           ` Anthony Liguori
2012-06-11 14:38             ` Kevin Wolf
2012-06-11 21:31             ` Andreas Färber
2012-06-11 21:43               ` Andreas Färber
2012-06-11 21:48               ` Anthony Liguori
2012-06-12  0:14                 ` Andreas Färber
2012-06-07 19:31 ` [Qemu-devel] [PATCH qom-next 2/7] qom: Add get_id Andreas Färber
2012-06-08  1:22   ` Anthony Liguori
2012-06-08  7:11     ` Andreas Färber
2012-06-08  7:44       ` Anthony Liguori [this message]
2012-06-08  8:17         ` Andreas Färber
2012-06-08 10:59           ` [Qemu-devel] [libvirt] " Daniel P. Berrange
2012-06-08 11:58         ` [Qemu-devel] " Eric Blake
2012-06-07 19:31 ` [Qemu-devel] [PATCH qom-next 3/7] qdev: Generalize properties to Objects Andreas Färber
2012-06-08  1:23   ` Anthony Liguori
2012-06-07 19:31 ` [Qemu-devel] [PATCH qom-next 4/7] qdev: Move bulk of qdev-properties.c to qom/object-properties.c Andreas Färber
2012-06-07 23:23   ` Paolo Bonzini
2012-06-08  1:26   ` Anthony Liguori
2012-06-07 19:31 ` [Qemu-devel] [PATCH qom-next 5/7] qom: Push static properties to Object Andreas Färber
2012-06-08  1:26   ` Anthony Liguori
2012-06-07 19:31 ` [Qemu-devel] [PATCH qom-next 6/7] qom: Add "realized" property Andreas Färber
2012-06-08  1:26   ` Anthony Liguori
2012-06-07 19:31 ` [Qemu-devel] [PATCH qom-next 7/7] qom: Add QERR_PROPERTY_SET_AFTER_REALIZE Andreas Färber
2012-06-07 19:56   ` Andreas Färber
2012-06-07 23:22 ` [Qemu-devel] [PATCH qom-next 0/7] QOM realize, revised Paolo Bonzini

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=4FD1AD46.9040607@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=afaerber@suse.de \
    --cc=lcapitulino@redhat.com \
    --cc=pbonzini@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).