[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [RFC PATCH 02/15] qdev: store DeviceState's canonical pat
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-ppc] [RFC PATCH 02/15] qdev: store DeviceState's canonical path to use when unparenting |
Date: |
Tue, 19 May 2015 11:41:34 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 |
On 05/05/2015 17:48, Michael Roth wrote:
> Well, I was referring to:
>
> sPAPRTCETable *spapr_tce_new_table(DeviceState *owner, uint32_t liobn)
>
> and:
>
> sPAPRDRConnector *spapr_dr_connector_new(Object *owner,
> sPAPRDRConnectorType type,
> uint32_t id)
>
> It wasn't immediately obvious to me that this would result in the
> resulting objects attaching themselves as children, but in retrospect
> that does seem to be implied by the 'owner' parameter.
I guess that's okay, as long as the callers of these functions pass
their "this" object (or "self", or whatever :)) as the owner.
Paolo
> If there are cases where this is done with a parameter that isn't explicitly
> named 'owner' though it might be somewhat ambiguous (could be pulling out
> individual fields as opposed to attaching itself), but I don't see any
> examples outside of local functions or qdev-managed devices.