qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 06/18] qom: add child properties (composition)


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH 06/18] qom: add child properties (composition)
Date: Fri, 02 Dec 2011 08:54:51 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.21) Gecko/20110831 Lightning/1.0b2 Thunderbird/3.1.13

On 12/02/2011 05:54 AM, Kevin Wolf wrote:
Am 30.11.2011 22:03, schrieb Anthony Liguori:
Child properties express a relationship of composition.

Signed-off-by: Anthony Liguori<address@hidden>

Do we have a flag or something that makes sure that a child is never
removed without its parent? The code assumes that child stays valid as
long as the parent lives.

Good question.  This is an interesting issue with qdev.

The child property is not writable so you cannot detach a child. That's because the child's life cycle is supposed to be tied to the parents.

qdev doesn't have the right bits to handle this right now. I think that's fixable by just adding a new flag to DeviceState.


@@ -499,4 +499,24 @@ gchar *qdev_get_canonical_path(DeviceState *dev);
   */
  DeviceState *qdev_resolve_path(const char *path, bool *ambiguous);

+/**
+ * @qdev_property_add_child - Add a child property to a device
+ *
+ * Child properties form the composition tree.  All devices need to be a child
+ * of another device.  Devices can only be a child of one device.
+ *
+ * There is no way for a child to determine what it's parent is.  It is not

s/it's/its/

Ack.

Regards,

Anthony Liguori

Kevin





reply via email to

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