qemu-devel
[Top][All Lists]
Advanced

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

Re: Realize methods realizing "sideways" in the composition tree


From: Markus Armbruster
Subject: Re: Realize methods realizing "sideways" in the composition tree
Date: Tue, 19 Jan 2021 12:36:00 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Peter Maydell <peter.maydell@linaro.org> writes:

> On Fri, 15 Jan 2021 at 15:45, Markus Armbruster <armbru@redhat.com> wrote:
>>
>> The .realize() method realizes the child at (1).  It should use
>> qdev_realize() like we do everywhere else, since commit ce189ab230
>> "qdev: Convert bus-less devices to qdev_realize() with Coccinelle".
>>
>> It sets a link property from the child back to the parent at (2).  Why
>> do we need a link?  Each QOM Object contains a pointer to its parent,
>> doesn't it?
>
> It does, but what should parent object pointers be used for?
> My assumption is that you'd only use those where you really
> wanted to traverse the QOM tree. Generally I would use a link
> property when I wanted one object to have a pointer to the
> other regardless of what the QOM-tree relationship happens to
> be. Today all the users of XHCIState happen to create it in a
> way that means they're parents of it, but that doesn't seem
> like it should be an inherent requirement that we bake into
> its API.

Makes sense.

I'll post a patch to use qdev_realize().

Thanks!




reply via email to

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