From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:45325) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QLwsM-0002pI-4T for qemu-devel@nongnu.org; Mon, 16 May 2011 08:26:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QLwsL-0001xz-7p for qemu-devel@nongnu.org; Mon, 16 May 2011 08:26:18 -0400 Received: from mail-pz0-f45.google.com ([209.85.210.45]:38893) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QLwsL-0001xr-3H for qemu-devel@nongnu.org; Mon, 16 May 2011 08:26:17 -0400 Received: by pzk30 with SMTP id 30so2625018pzk.4 for ; Mon, 16 May 2011 05:26:16 -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: Mon, 16 May 2011 14:26:15 +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 06:54, Dmitry Eremin-Solenikov wrote: > Hello, > > On 5/16/11, andrzej zaborowski wrote: >> On 25 April 2011 11:06, Dmitry Eremin-Solenikov >> wrote: >>> Switch dscm1xxxx microdrive driver to use qdev infrastructure. >>> --- >>> =C2=A0hw/ide/microdrive.c | =C2=A0 49 >>> +++++++++++++++++++++++++++++++++++++++---------- >>> =C2=A0hw/pcmcia.h =C2=A0 =C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A02 +- >>> =C2=A0hw/spitz.c =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A0 =C2=A05 +++= +- >>> =C2=A0hw/tosa.c =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A05 +++= +- >>> =C2=A04 files changed, 48 insertions(+), 13 deletions(-) >>> >>> diff --git a/hw/ide/microdrive.c b/hw/ide/microdrive.c >>> index 9fbbf0e..7692603 100644 >>> --- a/hw/ide/microdrive.c >>> +++ b/hw/ide/microdrive.c >>> @@ -38,8 +38,8 @@ >>> >>> =C2=A0/* DSCM-1XXXX Microdrive hard disk with CF+ II / PCMCIA interface= . =C2=A0*/ >>> =C2=A0typedef struct { >>> - =C2=A0 =C2=A0IDEBus bus; >>> =C2=A0 =C2=A0 PCMCIACardState card; >>> + =C2=A0 =C2=A0IDEBus bus; >>> =C2=A0 =C2=A0 uint32_t attr_base; >>> =C2=A0 =C2=A0 uint32_t io_base; >>> >>> @@ -529,22 +529,51 @@ static int dscm1xxxx_detach(void *opaque) >>> =C2=A0 =C2=A0 return 0; >>> =C2=A0} >>> >>> -PCMCIACardState *dscm1xxxx_init(DriveInfo *bdrv) >>> +PCMCIACardState *dscm1xxxx_init(PCMCIASocket *socket, DriveInfo *bdrv) >> >> This looks like a regression that you have to pass the socket when >> creating a PCMCIA card. =C2=A0I consider it an advantage of the current >> code that pcmcia cards are hotswappable. =C2=A0Can we keep that with >> qdevification? =C2=A0Otherwise is there a gain from the qdevification? > > Socket is required, as we have to know the QBus before creating the > device on it. Let's skip the qbusification then. It 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? I 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. Cheers