summaryrefslogtreecommitdiffstats
path: root/softmmu
diff options
context:
space:
mode:
authorClaudio Fontana2022-09-08 10:14:41 +0200
committerPaolo Bonzini2022-09-19 15:15:59 +0200
commit5e03b6daf66dfb0f5512a0dfc9e21e749b6f67b7 (patch)
treedec53f75a01efdb02bf44dfb4e44c9880837a6a1 /softmmu
parenttests/tcg: remove old SSE tests (diff)
downloadqemu-5e03b6daf66dfb0f5512a0dfc9e21e749b6f67b7.tar.gz
qemu-5e03b6daf66dfb0f5512a0dfc9e21e749b6f67b7.tar.xz
qemu-5e03b6daf66dfb0f5512a0dfc9e21e749b6f67b7.zip
audio: add help option for -audio and -audiodev
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> Message-Id: <20220908081441.7111-1-cfontana@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'softmmu')
-rw-r--r--softmmu/vl.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 263f029a8e..e62b9cc35d 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -2842,11 +2842,16 @@ void qemu_init(int argc, char **argv, char **envp)
audio_parse_option(optarg);
break;
case QEMU_OPTION_audio: {
- QDict *dict = keyval_parse(optarg, "driver", NULL, &error_fatal);
+ bool help;
char *model;
Audiodev *dev = NULL;
Visitor *v;
-
+ QDict *dict = keyval_parse(optarg, "driver", &help, &error_fatal);
+ if (help || (qdict_haskey(dict, "driver") &&
+ is_help_option(qdict_get_str(dict, "driver")))) {
+ audio_help();
+ exit(EXIT_SUCCESS);
+ }
if (!qdict_haskey(dict, "id")) {
qdict_put_str(dict, "id", "audiodev0");
}