[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH bugfix v1 3/3] qom: object.h: Update object_get_

From: Paolo Bonzini
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
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0

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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]