From nobody Tue Dec 16 07:33:17 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650874942; cv=none; d=zohomail.com; s=zohoarc; b=RfpkeSKqFLEQO87us3PJonesNE7jvGzpBHeeLu3eHjcy1IZcJa+BidUzCffcm0H7tSUJF/ayqYGKLWaYtXemmu/htYlw7WSFzByjCz7iC/m5nkyloJO150OUnK1wN4q0dzoPrECnvtg3BVej/FMvZ5Rc8ZihBLeSanM2NJc/GgM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650874942; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=UZepi0m5BVgKJx/HPDJyrJ5ZvGt/JKxiUh6H4LwnwPg=; b=D0LFbNwDyRPW+zjlUP/d9r68JeqnGsGoh5YzkKYfFa7HW4eJ+46rJWG/fzSl6r1TfA72iXJfARHGg1zTtcYzHcxOVxXALvgt9X9/SqUAKncsjMU0LjGrcfMxPs30yO2jz7ICJL8/h6YtzYLryDNuGWOxc8/9RoQD2um29y5uX/M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1650874942942512.1193339404067; Mon, 25 Apr 2022 01:22:22 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-645-0ZL-PKX8PMSFdLMD2Quj6Q-1; Mon, 25 Apr 2022 04:22:18 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3D9B2811E76; Mon, 25 Apr 2022 08:22:13 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 290E040D0187; Mon, 25 Apr 2022 08:22:13 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id DD32F1940355; Mon, 25 Apr 2022 08:22:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 931861947BBE for ; Mon, 25 Apr 2022 08:22:10 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 71A81C44AE8; Mon, 25 Apr 2022 08:22:10 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast07.extmail.prod.ext.rdu2.redhat.com [10.11.55.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6DC2CC44AF5 for ; Mon, 25 Apr 2022 08:22:10 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 51F513C021AD for ; Mon, 25 Apr 2022 08:22:10 +0000 (UTC) Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-575-j7K960ycO2q3ihNzySoDWQ-1; Mon, 25 Apr 2022 04:22:06 -0400 Received: by mail-wr1-f70.google.com with SMTP id w4-20020adfbac4000000b0020acba4b779so1640358wrg.22 for ; Mon, 25 Apr 2022 01:22:06 -0700 (PDT) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id g13-20020a05600c4ecd00b00393ec8be5cfsm1755054wmq.24.2022.04.25.01.22.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Apr 2022 01:22:04 -0700 (PDT) Received: from wheatley.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 3F2DC67B1B5C; Mon, 25 Apr 2022 10:22:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650874942; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=UZepi0m5BVgKJx/HPDJyrJ5ZvGt/JKxiUh6H4LwnwPg=; b=H3qkY9n8fc4Vpk+4sOa2c/Q6beub+L7sfuev8d0Q8o14f5kGga7KWeR902ZCXPh9W2UqeH xUrCmby4HvR7nhhIOSgeS72XW9XhkbB3lZjmiKnSGGqawjG21ENAtRO420zGgAsd5cQ12V TxovftppW2cAm2kWaLUsi6fs+TH5II4= X-MC-Unique: 0ZL-PKX8PMSFdLMD2Quj6Q-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: j7K960ycO2q3ihNzySoDWQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UZepi0m5BVgKJx/HPDJyrJ5ZvGt/JKxiUh6H4LwnwPg=; b=fQUn/A/vLJtrjc1rlQsneHKtZUsegSFiQl3iTCwmhb4iBw4LUzGdPq2tP86vaevGNq M+JQKqVU8ASB4h3lYoVj4/g5LvJ9Hn44UQpp58AE9AIul33dgj+EtfG+hn10OLBSXf9g yWEEHkEi/WtXuk+x6VL6GQCM1/VKd9e41L1C+p7BGUWwclQJ79o+sZXPKLeTzf3J/J8L NzWuI+Bggo/djGiT7wJ2UFE6Z35dVrJhng3FYNu1OnpXS5JpzbG1OCnXUuJd5tnNTjgj qs4sqYxZ/jPfOvtgnnLKKnZTNDn04VTNNjuvXmfFdf+5S/R2Jocht9fKUYvH07NyQTPB HS2g== X-Gm-Message-State: AOAM531OH0HmsqGPMzvF1zaopURD3dTUCmQJ9gq/4cKRMzK75AszLifv SKn4CldIxQwVcYtxg2lXYXk1/wFwtn+ILv8QJz2SFsNLJX7iE4ZYyOGqogNBGGFkQrx2j4vGtcB Ssdo9e2pedJofG6AjruY= X-Received: by 2002:a7b:c8d5:0:b0:392:b12e:fd11 with SMTP id f21-20020a7bc8d5000000b00392b12efd11mr15517529wml.96.1650874925078; Mon, 25 Apr 2022 01:22:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUahLQt6GhA+0msQeYylE6Fv6b6MYTVsGx0uQ2lBLi4J52QheCVTnDPzDtU109D1faST8FXQ== X-Received: by 2002:a7b:c8d5:0:b0:392:b12e:fd11 with SMTP id f21-20020a7bc8d5000000b00392b12efd11mr15517503wml.96.1650874924883; Mon, 25 Apr 2022 01:22:04 -0700 (PDT) From: Martin Kletzander To: qemu-devel@nongnu.org Subject: [PATCH 07/18] Introduce machine's default-audiodev property Date: Mon, 25 Apr 2022 10:21:50 +0200 Message-Id: <49192ccd62fc98c474bb0b627a22cc28a634e8b8.1650874791.git.mkletzan@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Stefan Hajnoczi , libvir-list@redhat.com, Christian Schoenebeck , Yanan Wang , Gerd Hoffmann , "Edgar E. Iglesias" , Qiuhao Li , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Marcel Apfelbaum , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Laurent Vivier , Thomas Huth , Alistair Francis , Alexander Bulekov , Bandan Das , qemu-arm@nongnu.org, Jan Kiszka , Pavel Dovgalyuk , Eduardo Habkost , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1650874972717100005 Content-Type: text/plain; charset="utf-8"; x-default="true" Many machine types have default audio devices with no way to set the underl= ying audiodev. Instead of adding an option for each and every one of them this = new property can be used as a default during machine initialisation when creati= ng such devices. Signed-off-by: Martin Kletzander --- hw/core/machine.c | 23 +++++++++++++++++++++++ include/hw/boards.h | 1 + 2 files changed, 24 insertions(+) diff --git a/hw/core/machine.c b/hw/core/machine.c index cb9bbc844d24..d055a126d398 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -596,6 +596,22 @@ static void machine_set_memdev(Object *obj, const char= *value, Error **errp) ms->ram_memdev_id =3D g_strdup(value); } =20 +static char *machine_get_default_audiodev(Object *obj, Error **errp) +{ + MachineState *ms =3D MACHINE(obj); + + return g_strdup(ms->default_audiodev); +} + +static void machine_set_default_audiodev(Object *obj, const char *value, + Error **errp) +{ + MachineState *ms =3D MACHINE(obj); + + g_free(ms->default_audiodev); + ms->default_audiodev =3D g_strdup(value); +} + HotpluggableCPUList *machine_query_hotpluggable_cpus(MachineState *machine) { int i; @@ -867,6 +883,12 @@ static void machine_class_init(ObjectClass *oc, void *= data) object_class_property_set_description(oc, "confidential-guest-support", "Set confidential guest scheme t= o support"); =20 + object_class_property_add_str(oc, "default-audiodev", + machine_get_default_audiodev, + machine_set_default_audiodev); + object_class_property_set_description(oc, "default-audiodev", + "Audiodev to use for default mac= hine devices"); + /* For compatibility */ object_class_property_add_str(oc, "memory-encryption", machine_get_memory_encryption, machine_set_memory_encryption); @@ -961,6 +983,7 @@ static void machine_finalize(Object *obj) g_free(ms->device_memory); g_free(ms->nvdimms_state); g_free(ms->numa_state); + g_free(ms->default_audiodev); } =20 bool machine_usb(MachineState *machine) diff --git a/include/hw/boards.h b/include/hw/boards.h index d64b5481e834..5be1de50af03 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -346,6 +346,7 @@ struct MachineState { */ MemoryRegion *ram; DeviceMemoryState *device_memory; + char *default_audiodev; =20 ram_addr_t ram_size; ram_addr_t maxram_size; --=20 2.35.1