From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=42609 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PfBJJ-0006zU-Bn for qemu-devel@nongnu.org; Tue, 18 Jan 2011 08:09:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PfBJI-00063J-4R for qemu-devel@nongnu.org; Tue, 18 Jan 2011 08:09:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33582) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PfBJH-000634-U6 for qemu-devel@nongnu.org; Tue, 18 Jan 2011 08:09:20 -0500 Message-ID: <4D3590F9.7010701@redhat.com> Date: Tue, 18 Jan 2011 14:09:13 +0100 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH 6/8] ahci: make number of ports runtime determined References: <1292879604-22268-1-git-send-email-agraf@suse.de> <1292879604-22268-7-git-send-email-agraf@suse.de> <4D358A3C.3060703@redhat.com> In-Reply-To: <4D358A3C.3060703@redhat.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Joerg Roedel , Sebastian Herbszt , Alexander Graf , qemu-devel Developers Hi, >> diff --git a/hw/ide/ich.c b/hw/ide/ich.c >> index 70cb766..f242d7a 100644 >> --- a/hw/ide/ich.c >> +++ b/hw/ide/ich.c >> @@ -100,7 +100,7 @@ static int pci_ich9_ahci_init(PCIDevice *dev) >> >> msi_init(dev, 0x50, 1, true, false); >> >> - ahci_init(&d->ahci,&dev->qdev); >> + ahci_init(&d->ahci,&dev->qdev, 6); >> d->ahci.irq = d->card.irq[0]; > > What about a qdev property instead of just hardcoding the value > somewhere else? That particular piece of emulated hardware (ich9-ahci) actually has 6 ports. ich7 has 4 ports. A thin hardware-specific wrapper which hardcodes this stuff (and pci ids and maybe some other minor differences) looks fine to me. Maybe alex should add a ich7 variant just to prove the point ;) cheers, Gerd