From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59839) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yue1x-00071B-BJ for qemu-devel@nongnu.org; Tue, 19 May 2015 05:41:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yue1w-0003AD-Jm for qemu-devel@nongnu.org; Tue, 19 May 2015 05:41:45 -0400 Sender: Paolo Bonzini Message-ID: <555B054E.8050107@redhat.com> Date: Tue, 19 May 2015 11:41:34 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1430335224-6716-1-git-send-email-mdroth@linux.vnet.ibm.com> <1430335224-6716-3-git-send-email-mdroth@linux.vnet.ibm.com> <55422F91.4050504@redhat.com> <20150430230331.11253.37707@loki> <5543E581.9000809@redhat.com> <20150501225407.24247.3106@loki> <55473D4F.2090901@redhat.com> <20150505154843.25451.27981@loki> In-Reply-To: <20150505154843.25451.27981@loki> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH 02/15] qdev: store DeviceState's canonical path to use when unparenting List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Roth , qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , aik@ozlabs.ru, qemu-ppc@nongnu.org, bharata@linux.vnet.ibm.com, nfont@linux.vnet.ibm.com, david@gibson.dropbear.id.au 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.