All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>,
	Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Cc: 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: Wed, 20 Aug 2014 17:58:30 +0200	[thread overview]
Message-ID: <53F4C5A6.8000009@redhat.com> (raw)
In-Reply-To: <CAFEAcA9TF7weiSKSRTyjPkJD9f=pg9nkc7wiQuzJMVuRBNQrfA@mail.gmail.com>

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.

Paolo

  parent reply	other threads:[~2014-08-20 15:58 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 [this message]
2014-08-21  3:10       ` Peter Crosthwaite

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=53F4C5A6.8000009@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=peter.crosthwaite@xilinx.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.