qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: mkletzan@redhat.com
Subject: [PATCH 7/9] vl: recognize audiodev groups in configuration files
Date: Fri, 22 Sep 2023 11:44:57 +0200	[thread overview]
Message-ID: <20230922094459.265509-8-pbonzini@redhat.com> (raw)
In-Reply-To: <20230922094459.265509-1-pbonzini@redhat.com>

This is necessary for the q35 configuration tests to pass,
once audiodev becomes mandatory.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 docs/config/q35-emulated.cfg         |  4 ++++
 docs/config/q35-virtio-graphical.cfg |  4 ++++
 softmmu/vl.c                         | 10 ++++++++++
 3 files changed, 18 insertions(+)

diff --git a/docs/config/q35-emulated.cfg b/docs/config/q35-emulated.cfg
index c8806e6d362..b4bd7e858a9 100644
--- a/docs/config/q35-emulated.cfg
+++ b/docs/config/q35-emulated.cfg
@@ -288,3 +288,7 @@
   driver = "hda-duplex"
   bus = "ich9-hda-audio.0"
   cad = "0"
+  audiodev = "audiodev0"
+
+[audiodev "audiodev0"]
+  driver = "none"                      # CHANGE ME
diff --git a/docs/config/q35-virtio-graphical.cfg b/docs/config/q35-virtio-graphical.cfg
index 148b5d2c5e4..820860aefe0 100644
--- a/docs/config/q35-virtio-graphical.cfg
+++ b/docs/config/q35-virtio-graphical.cfg
@@ -248,3 +248,7 @@
   driver = "hda-duplex"
   bus = "sound.0"
   cad = "0"
+  audiodev = "audiodev0"
+
+[audiodev "audiodev0"]
+  driver = "none"                      # CHANGE ME
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 70c9eb34dcf..f74fc3d3e40 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -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")) {
@@ -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
-- 
2.41.0



  parent reply	other threads:[~2023-09-22  9:46 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-22  9:44 [PATCH 0/9] audio: make sound cards require the audiodev property Paolo Bonzini
2023-09-22  9:44 ` [PATCH 1/9] audio: Add easy dummy audio initialiser Paolo Bonzini
2023-09-22 11:45   ` Marc-André Lureau
2023-09-22  9:44 ` [PATCH 2/9] Introduce machine property "audiodev" Paolo Bonzini
2023-09-22  9:44 ` [PATCH 3/9] vl: support -audio BACKEND without model Paolo Bonzini
2023-09-22  9:44 ` [PATCH 4/9] hw/arm: Support machine-default audiodev with fallback Paolo Bonzini
2023-09-22  9:44 ` [PATCH 5/9] hw/ppc: " Paolo Bonzini
2023-09-22  9:44 ` [PATCH 6/9] vt82c686: " Paolo Bonzini
2023-09-22 12:16   ` BALATON Zoltan
2023-09-22 13:32     ` Paolo Bonzini
2023-09-22 23:54       ` BALATON Zoltan
2023-09-22  9:44 ` Paolo Bonzini [this message]
2023-09-22  9:44 ` [PATCH 8/9] audio: Make AUD_register_card fallible and require audiodev= Paolo Bonzini
2023-09-22 11:17   ` Philippe Mathieu-Daudé
2023-09-22  9:44 ` [PATCH 9/9] audio: Be more strict during audio backend initialisation Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230922094459.265509-8-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=mkletzan@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).