Received: from [140.186.70.92] (port=50332 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PR2Es-0007yw-2d for qemu-devel@nongnu.org; Fri, 10 Dec 2010 07:38:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PR2El-0006j9-Pv for qemu-devel@nongnu.org; Fri, 10 Dec 2010 07:38:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]:6595) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PR2El-0006iq-E3 for qemu-devel@nongnu.org; Fri, 10 Dec 2010 07:38:11 -0500 From: Markus Armbruster Subject: Re: [Qemu-devel] [PATCH 10/11] config: Add header file for device config options References: <1290135413-21462-1-git-send-email-agraf@suse.de> <1290135413-21462-11-git-send-email-agraf@suse.de> <5FA968A4-DFE7-4BCB-BF7C-B00611D0AD44@suse.de> Date: Fri, 10 Dec 2010 13:37:41 +0100 In-Reply-To: <5FA968A4-DFE7-4BCB-BF7C-B00611D0AD44@suse.de> (Alexander Graf's message of "Sun, 21 Nov 2010 13:45:57 +0100") 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: Alexander Graf Cc: Kevin Wolf , Stefan Hajnoczi , QEMU-devel Developers , Blue Swirl , Gerd Hoffmann , Joerg Roedel , tj@kernel.org, Roland Elek , Sebastian Herbszt Alexander Graf writes: > On 21.11.2010, at 13:37, Blue Swirl wrote: > >> On Fri, Nov 19, 2010 at 2:56 AM, Alexander Graf wrote: >>> So far we have C preprocessor defines for target and host config >>> options, but we're lacking any information on which devices are >>> available. >>> >>> We do need that information at times though, for example in the >>> ahci patch where we need to call a legacy init function depending >>> on whether we have support compiled in or not. >> >> That does not seem right. Devices should not care about what other >> devices may exist. Perhaps stub style approach would be better. > > Well, for the -drive parameter we need to know what devices we can create and I'd like to keep that code as close as possible to the actual device code. Stupid question: why can't we just try to create, then check status to figure out whether it failed because the device isn't available? [...]