Received: from [140.186.70.92] (port=57744 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PAhKJ-0001Lg-No for qemu-devel@nongnu.org; Tue, 26 Oct 2010 07:04:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PAhKI-0005kC-Do for qemu-devel@nongnu.org; Tue, 26 Oct 2010 07:04:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:17505) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PAhKI-0005k4-5i for qemu-devel@nongnu.org; Tue, 26 Oct 2010 07:04:22 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o9QB4LtM007407 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 26 Oct 2010 07:04:21 -0400 From: Markus Armbruster Subject: Re: [Qemu-devel] [PATCH 0/2] Add get_dev_path callback to ISA bus. References: <1287928933-11423-1-git-send-email-gleb@redhat.com> <20101025170007.GC31633@redhat.com> <20101025180610.GA877@redhat.com> <20101026103818.GP2343@redhat.com> Date: Tue, 26 Oct 2010 13:04:18 +0200 In-Reply-To: <20101026103818.GP2343@redhat.com> (Gleb Natapov's message of "Tue, 26 Oct 2010 12:38:18 +0200") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gleb Natapov Cc: qemu-devel@nongnu.org Gleb Natapov writes: > On Tue, Oct 26, 2010 at 11:57:53AM +0200, Markus Armbruster wrote: >> Gleb Natapov writes: >> >> > On Mon, Oct 25, 2010 at 07:53:41PM +0200, Markus Armbruster wrote: >> >> Gleb Natapov writes: >> >> >> >> > On Mon, Oct 25, 2010 at 05:10:15PM +0200, Markus Armbruster wrote: >> >> >> Gleb Natapov writes: >> >> >> >> >> >> > PCI bus already has one. For ISA bus this patch series uses device's >> >> >> > ioports to uniquely describe it. For isa-ide, for example, get_dev_path >> >> >> > method returns: >> >> >> > 01f0-01f7,03f6 for first IDE controller >> >> >> > 0170-0177,0376 for second one >> >> >> >> >> >> Any I/O port used by the device identifies it. I'd say a common >> >> >> identifier is the "I/O base", the lowest I/O port used. >> >> > So use only first port from the string. More information is better then >> >> > less information. You can always drop information you do not need. >> >> >> >> I'd prefer canonical bus addresses to be terse. It's not the place to >> >> give additional information. >> > >> > I'd prefer them to give full info but not more. I don't see why you >> > point is more valid then mine. >> >> Full information about ISA resources is more than I/O ports, it also >> includes IRQs and DMA channels. > So you are arguing to add more info there? :) Theoretically there is > nothing that prevents ISA devices from sharing IRQ line (existing ISA > devices just not built to do that and nobody produces new once) and > DMA is separate device on ISA bus AFAIK. > >> >> An address is not the place to give full information. The purpose of an >> address is to name a thing, not to give full information about that >> thing. >> > Address should contain info that allows to find device easily. If > whoever looking for a device knows only one port device is using he > will not find the device if we'll use different port to name it. May be > not the problem in practice. If he knows only one port, he can't form the address proposed by you. He needs to know *all* ports. So what he does is search all the devices for the one that uses the port in question. Same for the address I propose. The proposal differ for the case where the user remembers just the base address. I believe that's the common case. >> By the way, get_dev_path() really needs a written contract. Actually, >> all the qdev and qbus callbacks do. > What do you mean by that? It should be stable ABI, is this what you > mean? A contract between qdev core and the device models, so that device model authors know what exactly their callback functions are supposed to do. Stability is a separate matter. Since it's a purely internal interface, we don't want it.