From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:56005) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QM9Eu-0005I2-E6 for qemu-devel@nongnu.org; Mon, 16 May 2011 21:38:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QM9Es-0001Rr-J9 for qemu-devel@nongnu.org; Mon, 16 May 2011 21:38:24 -0400 Received: from mail-pw0-f45.google.com ([209.85.160.45]:60739) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QM9Es-0001Rm-8V for qemu-devel@nongnu.org; Mon, 16 May 2011 21:38:22 -0400 Received: by pwi6 with SMTP id 6so80142pwi.4 for ; Mon, 16 May 2011 18:38:21 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <1303722395-10791-1-git-send-email-dbaryshkov@gmail.com> <1303722395-10791-3-git-send-email-dbaryshkov@gmail.com> Date: Tue, 17 May 2011 03:38:21 +0200 Message-ID: From: andrzej zaborowski Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RESEND][PATCH 3/9] microdrive: qdevify List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Dmitry Eremin-Solenikov Cc: qemu-devel@nongnu.org On 16 May 2011 15:08, Dmitry Eremin-Solenikov wrote: > On 5/16/11, andrzej zaborowski wrote: >> On 16 May 2011 06:54, Dmitry Eremin-Solenikov wro= te: >>> Socket is required, as we have to know the QBus before creating the >>> device on it. >> >> Let's skip the qbusification then. =C2=A0It seems that qbus is a wrong >> choice for pcmcia and there are no new features or bugs fixed by the >> conversion, it's code motion? =C2=A0I also don't see why the socket >> structure should be needed at the creation time of a PCI device for >> example, the BusInfo should be enough logically. > > Major point for qbus'ification was ability to create PCMCIA devices from > command line/via other management tools. This would also allow us e.g. > to move microdrive driver to common ide parts, etc. That would be nice but it may be better to use separate command line switches / monitor commands for hotpluggable busses. > > For creation of a DeviceState via qdev_create you need BusState (which > is a part of PCMCIASocket). Of course I can make one global QBus for > all PCMCIA devices and make some artificial hacks to attach/detach cards > to artificial sockets, but this seems like a hack. I considered that for a moment too but it's uglier than current code and doesn't achieve what you want, because the command line has no provision for triggering attachment. A major problem with qdev I see now is that the creation and attachment of a device are one event instead of two, which is the case for pcmcia. So your patch tries to merge these two events. Cheers