add a simple help option for -audio and -audiodev
to show the list of available drivers, and document them.
Signed-off-by: Claudio Fontana <cfontana@suse.de>
---
audio/audio.c | 20 ++++++++++++++++++++
audio/audio.h | 1 +
qemu-options.hx | 10 ++++++----
softmmu/vl.c | 9 +++++++--
4 files changed, 34 insertions(+), 6 deletions(-)
v1 -> v2: also extend the help to -audio.
-audio help
-audio driver=help
-audiodev help
will all show the same results.
diff --git a/audio/audio.c b/audio/audio.c
index 4f4bb10cce..ffb09ec825 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -32,6 +32,7 @@
#include "qapi/qapi-visit-audio.h"
#include "qemu/cutils.h"
#include "qemu/module.h"
+#include "qemu/help_option.h"
#include "sysemu/sysemu.h"
#include "sysemu/replay.h"
#include "sysemu/runstate.h"
@@ -2105,10 +2106,29 @@ static void audio_validate_opts(Audiodev *dev, Error
**errp)
}
}
+void audio_help(void)
+{
+ int i;
+
+ printf("Available audio drivers:\n");
+ printf("none\n");
+
+ for (i = 0; audio_prio_list[i]; i++) {
+ audio_driver *driver = audio_driver_lookup(audio_prio_list[i]);