From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56819) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aAPX3-0000sp-0U for qemu-devel@nongnu.org; Sat, 19 Dec 2015 16:59:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aAPX2-0005aN-4l for qemu-devel@nongnu.org; Sat, 19 Dec 2015 16:59:16 -0500 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]:34136) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aAPX1-0005aA-S3 for qemu-devel@nongnu.org; Sat, 19 Dec 2015 16:59:16 -0500 Received: by mail-wm0-x22e.google.com with SMTP id l126so26429553wml.1 for ; Sat, 19 Dec 2015 13:59:15 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <567448AC.7060404@redhat.com> References: <0209faa3788f57deeb3ce4a197019b095bc2c05f.1450300479.git.alistair.francis@xilinx.com> <5671F2A1.6060005@redhat.com> <56728E36.7010807@redhat.com> <5672989C.7020404@redhat.com> <567448AC.7060404@redhat.com> Date: Sat, 19 Dec 2015 13:59:15 -0800 Message-ID: From: Peter Crosthwaite Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v5 5/6] xlnx-zynqmp: Connect the SPI devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Peter Maydell , QEMU Developers , Alistair Francis On Fri, Dec 18, 2015 at 9:55 AM, Paolo Bonzini wrote: > > > On 18/12/2015 18:17, Alistair Francis wrote: >> Does anyone have any ideas on how we can do this? >> >> AFAIK there is no way to currently do this, so we need to add >> something. What is the preferred way to expose the buses? > > For now, what you're doing is okay for me, just moving the funky code in > zynq-specific files. > OK I think I have a real fix on this that doesn't require any funk. Backing up, qdev currently doubly connects buses and devices and devices to devs. The two connections are: 1: The child bus list 2: As QOM children Ultimately what we need here is an aliasing mechanism. I don't thing detaching and re-attaching works in the local sense, as it is realistic for a container device to make a few local connections to a bus (by ref to the controller bus) while also pinning it out on the container level. The bus should remain accessible on the two different entities. So QOM aliases make the most sense to me. The real problem is that qdev_get_child_bus only uses the child bus list and cannot resolve a QOM path. My solution is to add preferred attempt to use a QOM path to implement qdev_get_child_bus and fallback to the current child-bus-list behaviour on failure. I'll send a v5 within the next few hours after cleanup. Regards, Peter > Thanks, > > Paolo > >> Thanks, >> >> Alistair