Skip to contentSkip to conversation

qom/object.h: remove some child/parent doc

PATCH In review [email protected] 5 participants 7 messages Sep 4, 2015 – Sep 11, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qom/object.h: remove some child/parent doc

From: Marc-André Lureau <[email protected]>

It looks like this documentation is obsolete: a child object may lookup its parent stored in the Object struct.

---
 include/qom/object.h | 3 ---
 1 file changed, 3 deletions(-)
include/qom/object.h +0 -3
index 2f95ab3..653699f 100644
@@ -1261,9 +1261,6 @@ Object *object_resolve_path_component(Object *parent, const gchar *part);
  * Child properties form the composition tree.  All objects need to be a child
  * of another object.  Objects can only be a child of one object.
  *
- * There is no way for a child to determine what its parent is.  It is not
- * a bidirectional relationship.  This is by design.
- *
  * The value of a child property as a C string will be the child object's
  * canonical path. It can be retrieved using object_property_get_str().
  * The child object itself can be retrieved using object_property_get_link().
Signature · 1 line
2.4.3
#1 lore raw
Quoted 5 lines · On Fri, Sep 4, 2015 at 2:01 PM, <[email protected]> wrote:

From: Marc-André Lureau <[email protected]>

It looks like this documentation is obsolete: a child object may lookup its parent stored in the Object struct.

Using a function wrapper or direct access to Object structure field?

The latter would indicate they are workarounds. Which legit uses of parent identification are you referring to?

Regards,
Peter

Quoted 23 lines
---
 include/qom/object.h | 3 ---
 1 file changed, 3 deletions(-)
include/qom/object.h +0 -4
index 2f95ab3..653699f 100644
@@ -1261,9 +1261,6 @@ Object *object_resolve_path_component(Object *parent, const gchar *part);
  * Child properties form the composition tree.  All objects need to be a child
  * of another object.  Objects can only be a child of one object.
  *
- * There is no way for a child to determine what its parent is.  It is not
- * a bidirectional relationship.  This is by design.
- *
  * The value of a child property as a C string will be the child object's
  * canonical path. It can be retrieved using object_property_get_str().
  * The child object itself can be retrieved using object_property_get_link().
--

2.4.3

#2 lore raw

Hi

Quoted 8 lines · Peter Crosthwaite
Quoted 5 lines · On Fri, Sep 4, 2015 at 2:01 PM, <[email protected]> wrote:

From: Marc-André Lureau <[email protected]>

It looks like this documentation is obsolete: a child object may lookup its parent stored in the Object struct.

Using a function wrapper or direct access to Object structure field?

By direct access to the struct field.

Quoted 3 lines

The latter would indicate they are workarounds. Which legit uses of parent identification are you referring to?

I am not saying this is legit or not to use this field, it's just wrong documentation to me: the relationship is bidirectionnal. That's one of the few differences with the link<> properties.

regards

Signature · 1 line
Marc-André Lureau
#3 lore raw
Quoted 16 lines · Marc-André Lureau

Hi

Quoted 8 lines · Peter Crosthwaite
Quoted 5 lines · On Fri, Sep 4, 2015 at 2:01 PM, <[email protected]> wrote:

From: Marc-André Lureau <[email protected]>

It looks like this documentation is obsolete: a child object may lookup its parent stored in the Object struct.

Using a function wrapper or direct access to Object structure field?

By direct access to the struct field.

Quoted 1 line
Quoted 7 lines
Quoted 2 lines

The latter would indicate they are workarounds. Which legit uses of parent identification are you referring to?

I am not saying this is legit or not to use this field, it's just wrong documentation to me: the relationship is bidirectionnal. That's one of the few differences with the link<> properties.

It is biderctional for the implementation but not for the QOM API. I think the comment is correct as long as there is no exposed API to do this.

Regards,
Peter

Quoted 4 lines

regards

--
Marc-André Lureau

#4 lore raw
In reply to [email protected]

Am 04.09.2015 um 23:01 schrieb [email protected]:

Quoted 9 lines

From: Marc-André Lureau <[email protected]>

It looks like this documentation is obsolete: a child object may lookup its parent stored in the Object struct.

---
 include/qom/object.h | 3 ---
 1 file changed, 3 deletions(-)

Either once again you are trying to do stuff behind my back, or your setup is really broken: I double-checked that include/qom/ is listed in MAINTAINERS, so I should've been CC'ed rather than just -trivial.

It's been a valid rule not to mess with these internal fields, therefore this is not trivial at all, and that's one reason why my x86 CPU series using it was an RFC. We should either come up with a proper wrapper function object_get_parent(), or with a wrapper function adding a link<> property (where we would need to be careful with ref counts) - long time only the composition tree needed to mess with an object's parent.

If you have a concrete use case of parent access, please point to it.

Regards,
Andreas

Signature · 2 lines
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton; HRB 21284 (AG Nürnberg)
#5 lore raw
Quoted 15 lines · Andreas Färber

Am 04.09.2015 um 23:01 schrieb [email protected]:

Quoted 9 lines

From: Marc-André Lureau <[email protected]>

It looks like this documentation is obsolete: a child object may lookup its parent stored in the Object struct.

---
 include/qom/object.h | 3 ---
 1 file changed, 3 deletions(-)

Either once again you are trying to do stuff behind my back, or your setup is really broken: I double-checked that include/qom/ is listed in MAINTAINERS, so I should've been CC'ed rather than just -trivial.

Quoted 8 lines

It's been a valid rule not to mess with these internal fields, therefore this is not trivial at all, and that's one reason why my x86 CPU series using it was an RFC. We should either come up with a proper wrapper function object_get_parent(), or with a wrapper function adding a link<> property (where we would need to be careful with ref counts) - long time only the composition tree needed to mess with an object's parent.

If you have a concrete use case of parent access, please point to it.

So, should the current documentation remain, or should the patch be applied? If the latter, Andreas, please take care of it.

Thanks,

/mjt

#6 lore raw

Am 11.09.2015 um 12:13 schrieb Michael Tokarev:

Quoted 23 lines
Quoted 22 lines · Andreas Färber

Am 04.09.2015 um 23:01 schrieb [email protected]:

Quoted 9 lines

From: Marc-André Lureau <[email protected]>

It looks like this documentation is obsolete: a child object may lookup its parent stored in the Object struct.

---
 include/qom/object.h | 3 ---
 1 file changed, 3 deletions(-)

Either once again you are trying to do stuff behind my back, or your setup is really broken: I double-checked that include/qom/ is listed in MAINTAINERS, so I should've been CC'ed rather than just -trivial.

It's been a valid rule not to mess with these internal fields, therefore this is not trivial at all, and that's one reason why my x86 CPU series using it was an RFC. We should either come up with a proper wrapper function object_get_parent(), or with a wrapper function adding a link<> property (where we would need to be careful with ref counts) - long time only the composition tree needed to mess with an object's parent.

Quoted 4 lines
Quoted 1 line

If you have a concrete use case of parent access, please point to it.

So, should the current documentation remain, or should the patch be applied? If the latter, Andreas, please take care of it.

This patch should not be applied, NACK.

I outlined ideas for a v2 series above though.

Thanks,
Andreas

Quoted 5 lines

Thanks,

/mjt

Signature · 2 lines
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton; HRB 21284 (AG Nürnberg)