From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=33744 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PAkPp-0001Fv-6D for qemu-devel@nongnu.org; Tue, 26 Oct 2010 10:22:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PAkJf-0002ef-5x for qemu-devel@nongnu.org; Tue, 26 Oct 2010 10:15:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:21495) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PAkJe-0002eW-Vk for qemu-devel@nongnu.org; Tue, 26 Oct 2010 10:15:55 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o9QEFrMO031641 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 26 Oct 2010 10:15:53 -0400 Subject: Re: [Qemu-devel] [PATCH] initialize unit id of IDE bus From: Alex Williamson In-Reply-To: References: <20101024162315.GG2343@redhat.com> <20101025154236.GH2343@redhat.com> <20101026072843.GK2343@redhat.com> <20101026101549.GM2343@redhat.com> Content-Type: text/plain; charset="UTF-8" Date: Tue, 26 Oct 2010 08:15:52 -0600 Message-ID: <1288102552.5129.86.camel@x201> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org, Gleb Natapov On Tue, 2010-10-26 at 13:20 +0200, Markus Armbruster wrote: > >> How to tell whether it's primary or secondary? Primary uses I/O ports > >> 0x1f0..0x1ff,0x3f0..0x3ff and IRQ 14. IRQ could be easier to check, > >> because it should be right in ISADevice member isairq[0]. > >> Alternatively, upcast to ISAIDEState and check members iobase or isairq. > > Again idebus_dev_path() should not care about what device IDEBus resides on. > > We really need to define what qbus's get_dev_path() callback is supposed > to do before we continue. Alex, you created it. What's your take on > its semantics? Perhaps going into too much detail, but the idea of get_dev_path() is that it's a recursive call up the device try, where each level adds a string to come up with a unique description. We currently only have this of PCI because it's device path is obvious, while others are not, particularly ISA. To start, I'd think IDE could easily implement a get_dev_path(), where the IDE qbus calls up to it's parent bus, then appends IDE channel and slot. So for a PCI IDE controller, we get something like PCI:0000:00:03.0/piix3-IDE0.master (change this to match qdev info strings, I'm just making it up here). An ISA IDE controller is harder since ISA doesn't have a bus enumeration mechanism. IIRC, there we some suggestions to use ioports and/or irqs to define a path on ISA, but not all ISA qdev devices expose these. So perhaps we'd want something like isa.irq14/piix3-IDE0.master. Doing ISA correctly probably means standardizing some portion of the qdev info for all the ISA devices. Thanks, Alex