From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MV9Ra-0006aU-Hf for qemu-devel@nongnu.org; Sun, 26 Jul 2009 15:31:38 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MV9RV-0006Tb-NA for qemu-devel@nongnu.org; Sun, 26 Jul 2009 15:31:38 -0400 Received: from [199.232.76.173] (port=45604 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MV9RV-0006TU-I5 for qemu-devel@nongnu.org; Sun, 26 Jul 2009 15:31:33 -0400 Received: from mx20.gnu.org ([199.232.41.8]:38289) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MV9RV-00085C-5b for qemu-devel@nongnu.org; Sun, 26 Jul 2009 15:31:33 -0400 Received: from mail-gx0-f220.google.com ([209.85.217.220]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MV9RU-0003wK-Fe for qemu-devel@nongnu.org; Sun, 26 Jul 2009 15:31:32 -0400 Received: by gxk20 with SMTP id 20so12800225gxk.10 for ; Sun, 26 Jul 2009 12:31:31 -0700 (PDT) Message-ID: <4A6CAF10.4010700@codemonkey.ws> Date: Sun, 26 Jul 2009 14:31:28 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <4A6C5903.4000708@codemonkey.ws> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 45/46] Remove AUDIO_DRIVERS define List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org Juan Quintela wrote: > Anthony Liguori wrote: > >> malc wrote: >> >>> On Fri, 24 Jul 2009, Juan Quintela wrote: >>> >>> >>> >>>> Signed-off-by: Juan Quintela >>>> --- >>>> audio/audio.c | 25 ++++++++++++++++++++++++- >>>> configure | 3 --- >>>> 2 files changed, 24 insertions(+), 4 deletions(-) >>>> >>>> >>> That's how it used to be before, i see no reason of going back to this >>> style. >>> >>> >> Right. The way to get rid of AUDIO_DRIVERS is to convert drvtab[] to >> be a list with an appropriate audio driver registration function. >> >> Each .c file should have an audio_init() method that then registers >> the audio_driver structure. Individual audio drivers can be >> added/removed by simply building or not building the file. >> >> Just like how the block infrastructure works. >> >> Regards, >> >> Anthony Liguori >> > > Not enough. See malc hint (g show 0c58ac1c7) > > The order in audio_drivers is important, that means you can have a > different default sound driver. > Block drivers have the same problem and they get around it by having a priority that's explicit in the registration structure. Well, it's sort of implicit as it's based on the return value of probe(). For audio, a static integer priority system should handle things. > After some thinking, my current plan is exporting audio_drv_list > to the Makefile, and then generating something similar to AUDIO_DRIVERS. > > Notice that the "ordering" problems not only happens with sound drivers, > we have the same problems with graphics console, which one is the > default one? It depends on what you have configured, and changing the > default order is far from trivial. > For all subsystems, we can address this problem through priorities. Ideally, priorities are abstract enough that to set one priority doesn't require knowledge of other drivers but you can certainly also use priorities to set a fixed order. Regards, Anthony Liguori