All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH bugfix v1 3/3] qom: object.h: Update object_get_canon_path* doc
Date: Thu, 21 Aug 2014 13:10:20 +1000	[thread overview]
Message-ID: <CAEgOgz78wcn4b4026oMkNTjjC3eRVxZ+G-_mibDte-_FS-bF-Q@mail.gmail.com> (raw)
In-Reply-To: <53F4C5A6.8000009@redhat.com>

On Thu, Aug 21, 2014 at 1:58 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> Il 20/08/2014 11:07, Peter Maydell ha scritto:
>> The other thing you need to say is that the returned string is
>> only valid for as long as the object remains a child property
>> of its parent. (Is that right? I'm not clear. It also sounds like
>> a really awkward lifetime management requirement, which
>> suggests to me that really the "return-a-copy" semantics are
>> nicer.)
>
> They are indeed nicer, but harder to use in C.
>
> Unparenting is (currently) always done under the BQL, so guaranteeing
> that the returned string stays alive as long as you use it is currently
> not a problem.  This might change in the future, but I don't see many
> reasons to get rid completely of the BQL (as opposed to the surgical
> moving of stuff outside it that we've been doing so far).
>
>> Having object_get_canonical_path_component() and
>> object_get_canonical_path() having different return value
>> ownership semantics is likely to be a bit confusing I think.
>
> Right, though that could be solved by renaming the _component() function.
>

Yes that had crossed my mind too. object_get_canonical_path_component
is a mouthful and it's usages suggest object_get_name or
object_get_instance_name would be more fitting.

The fact that it is a canonical_path_component is more of an
implementation detail rather than its externally useful functionality.

Regards,
Peter

> Paolo
>

      reply	other threads:[~2014-08-21  3:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-20  5:06 [Qemu-devel] [PATCH bugfix v1 0/3] Fix Memory Region Name bugs Peter Crosthwaite
2014-08-20  5:07 ` [Qemu-devel] [PATCH bugfix v1 1/3] xen: hvm: Abstract away memory region name ref Peter Crosthwaite
2014-08-20  8:53   ` [Qemu-devel] [PATCH bugfix v1 1/3] xen: hvm: Abstract away memory region name ref (fix broken build) Stefan Weil
2014-08-20  8:55     ` Peter Maydell
2014-08-21 19:27       ` Stefano Stabellini
2014-08-20  5:07 ` [Qemu-devel] [PATCH bugfix v1 2/3] qom: return const for object_get_canon_path component Peter Crosthwaite
2014-08-20  5:08 ` [Qemu-devel] [PATCH bugfix v1 3/3] qom: object.h: Update object_get_canon_path* doc Peter Crosthwaite
2014-08-20  9:07   ` Peter Maydell
2014-08-20 14:54     ` Peter Crosthwaite
2014-08-20 15:58     ` Paolo Bonzini
2014-08-21  3:10       ` Peter Crosthwaite [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=CAEgOgz78wcn4b4026oMkNTjjC3eRVxZ+G-_mibDte-_FS-bF-Q@mail.gmail.com \
    --to=peter.crosthwaite@xilinx.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.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.