Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
vl: recognize audiodev groups in configuration files
This is necessary for the q35 configuration tests to pass,
once audiodev becomes mandatory.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
bonzini committed Sep 22, 2023
1 parent 5033348 commit adf7f6b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/config/q35-emulated.cfg
Expand Up @@ -288,3 +288,7 @@
driver = "hda-duplex"
bus = "ich9-hda-audio.0"
cad = "0"
audiodev = "audiodev0"

[audiodev "audiodev0"]
driver = "none" # CHANGE ME
4 changes: 4 additions & 0 deletions docs/config/q35-virtio-graphical.cfg
Expand Up @@ -248,3 +248,7 @@
driver = "hda-duplex"
bus = "sound.0"
cad = "0"
audiodev = "audiodev0"

[audiodev "audiodev0"]
driver = "none" # CHANGE ME
10 changes: 10 additions & 0 deletions softmmu/vl.c
Expand Up @@ -2125,6 +2125,7 @@ static int global_init_func(void *opaque, QemuOpts *opts, Error **errp)
static bool is_qemuopts_group(const char *group)
{
if (g_str_equal(group, "object") ||
g_str_equal(group, "audiodev") ||
g_str_equal(group, "machine") ||
g_str_equal(group, "smp-opts") ||
g_str_equal(group, "boot-opts")) {
Expand All @@ -2140,6 +2141,15 @@ static void qemu_record_config_group(const char *group, QDict *dict,
Visitor *v = qobject_input_visitor_new_keyval(QOBJECT(dict));
object_option_add_visitor(v);
visit_free(v);

} else if (g_str_equal(group, "audiodev")) {
Audiodev *dev = NULL;
Visitor *v = qobject_input_visitor_new_keyval(QOBJECT(dict));
if (visit_type_Audiodev(v, NULL, &dev, errp)) {
audio_define(dev);
}
visit_free(v);

} else if (g_str_equal(group, "machine")) {
/*
* Cannot merge string-valued and type-safe dictionaries, so JSON
Expand Down

0 comments on commit adf7f6b

Please sign in to comment.