|
From: | Anthony Liguori |
Subject: | [Qemu-devel] Re: [PATCH 45/46] Remove AUDIO_DRIVERS define |
Date: | Sun, 26 Jul 2009 14:31:28 -0500 |
User-agent: | Thunderbird 2.0.0.21 (X11/20090320) |
Juan Quintela wrote:
Anthony Liguori <address@hidden> wrote:malc wrote:On Fri, 24 Jul 2009, Juan Quintela wrote:Signed-off-by: Juan Quintela <address@hidden> --- 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 LiguoriNot 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
[Prev in Thread] | Current Thread | [Next in Thread] |