aboutsummaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
Diffstat (limited to 'audio')
-rw-r--r--audio/audio.c19
-rw-r--r--audio/audio.h1
2 files changed, 20 insertions, 0 deletions
diff --git a/audio/audio.c b/audio/audio.c
index 76b8735b44..cfa4119c05 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"
@@ -2101,10 +2102,28 @@ static void audio_validate_opts(Audiodev *dev, Error **errp)
}
}
+void audio_help(void)
+{
+ int i;
+
+ printf("Available audio drivers:\n");
+
+ for (i = 0; i < AUDIODEV_DRIVER__MAX; i++) {
+ audio_driver *driver = audio_driver_lookup(AudiodevDriver_str(i));
+ if (driver) {
+ printf("%s\n", driver->name);
+ }
+ }
+}
+
void audio_parse_option(const char *opt)
{
Audiodev *dev = NULL;
+ if (is_help_option(opt)) {
+ audio_help();
+ exit(EXIT_SUCCESS);
+ }
Visitor *v = qobject_input_visitor_new_str(opt, "driver", &error_fatal);
visit_type_Audiodev(v, NULL, &dev, &error_fatal);
visit_free(v);
diff --git a/audio/audio.h b/audio/audio.h
index 27e67079a0..01bdc567fb 100644
--- a/audio/audio.h
+++ b/audio/audio.h
@@ -171,6 +171,7 @@ void audio_sample_from_uint64(void *samples, int pos,
void audio_define(Audiodev *audio);
void audio_parse_option(const char *opt);
bool audio_init_audiodevs(void);
+void audio_help(void);
void audio_legacy_help(void);
AudioState *audio_state_by_name(const char *name);