From nobody Wed May 15 06:24:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695375137; cv=none; d=zohomail.com; s=zohoarc; b=al1fe4oNvehKYt3xcY55OQWdSp7CamUzigsOBXtdSdYRt0ZwWPLn9RcdLKYVnl/Z8SV+b7XK8KvDl046gfIO8p+YW/kEcNp5KAbcYVNQvybTSCd0ZOj2qyrcMmTlvHKC668sM0FBbRMBdtDDMzLyCe98pwyLxQKrrsgm5DljDTY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695375137; h=Content-Type:Content-Transfer-Encoding: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=lyyUffVCCI6wnmLrjN9LYL/D6+d/aBzAyTI/qFrludo=; b=HaPSl2qPmxMc7YrSAyRtQvi3DzaWkHryvjmShn8ziQ0R0u1BAHnRL9tUHNurb5R/v5vUQYYc/h+z6Na2ygjs95e4I1OG2p2WCqTCQt35OWgb6J3fniC2Qh2i3rqegll8KPl8eECctJeusB67NbQPNkflRurQOcY/4vPKRidCZj8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695375137435286.5213256627219; Fri, 22 Sep 2023 02:32:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qjcVj-0004it-Lv; Fri, 22 Sep 2023 05:31:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjcVd-0004i1-ID for qemu-devel@nongnu.org; Fri, 22 Sep 2023 05:31:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjcVa-0003Lj-Dp for qemu-devel@nongnu.org; Fri, 22 Sep 2023 05:31:37 -0400 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-439-Vdmq72LaNruJv-n8MoPOSw-1; Fri, 22 Sep 2023 05:31:31 -0400 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-321544abeeeso1346586f8f.1 for ; Fri, 22 Sep 2023 02:31:31 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e]) by smtp.gmail.com with ESMTPSA id g10-20020adffc8a000000b003176c6e87b1sm3978072wrr.81.2023.09.22.02.31.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 02:31:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695375093; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lyyUffVCCI6wnmLrjN9LYL/D6+d/aBzAyTI/qFrludo=; b=ft/El+MepboU/c1Z2G07niji0RyrcDpUT+Jsj8WUZ7L0qmPI9tbaqveQ3uUBS3mUd8agji lLd0vTtwGAPvMJHKnTD0bxW6dU1mJdsZk/amPPc6qXz0V0OmXSseibb8RecktrLvERmw08 r1BXs3g3vJ/thN3kZFeVTWS+AnfVKX0= X-MC-Unique: Vdmq72LaNruJv-n8MoPOSw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695375090; x=1695979890; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lyyUffVCCI6wnmLrjN9LYL/D6+d/aBzAyTI/qFrludo=; b=BRAlwzvH4TShdg37PQPpzZS6cn42fSX7sHwD3wrJc7GnbTUE+kjhcRhSPM8E8bSLrG 97KQVyWWC3rJokpDkdUqnZuYicYAhaFYktqUxoSRUelYY2ZGuXlvUaYITBO9rAhZVwVu gj0r7ZPyij3YPN+larZjH1yF0WQARAwcx+abneh6D5u0/6NybZPTDZTX49F5Ru8zdgp/ 2E776PC7P/3jmrobFU4CJXidWVPPD80AKp/l9ixUO9+2U92MgN5UHjKQLQH3KvKrnvm1 OcBokvUrIdPEqvWVdBATmih/80/NZtm8D/bziceV6kNV9x6TY2ziS7yOnkl14v3/WxG9 Z29w== X-Gm-Message-State: AOJu0YzwP0sVKjzdT2WJBaZdexzV0be8Xor5UySAUH6q67ov/Y1rfvPK bX0Wqsj6UCsSAT3EQnUMMaJ3xXy1FPbIZXCpSnpfsn0jhn8TmyMthZTYIcc/8AzUBwtlfwfnpQu QuUvy8/RV0hfDQQ2bg54nIWOSq7EMGZA879Y3WPn29oH8Zmq11P6T1raYNcVORe1nYyw3p/bNL+ 8= X-Received: by 2002:adf:e88f:0:b0:31f:fe07:fdde with SMTP id d15-20020adfe88f000000b0031ffe07fddemr6996509wrm.12.1695375089816; Fri, 22 Sep 2023 02:31:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEvNFr39a1dF7umOtIeOR25lV/ObTKpQQrTZXVrMqHG7VRwBvOH3zhJjhzDHAqvz7abhAf/+Q== X-Received: by 2002:adf:e88f:0:b0:31f:fe07:fdde with SMTP id d15-20020adfe88f000000b0031ffe07fddemr6996494wrm.12.1695375089435; Fri, 22 Sep 2023 02:31:29 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 01/12] target/i386: enumerate bit 56 of MSR_IA32_VMX_BASIC Date: Fri, 22 Sep 2023 11:31:14 +0200 Message-ID: <20230922093126.264016-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230922093126.264016-1-pbonzini@redhat.com> References: <20230922093126.264016-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1695375139117100005 Content-Type: text/plain; charset="utf-8" On parts that enumerate IA32_VMX_BASIC MSR bit as 1, any exception vector can be delivered with or without an error code if the other consistency checks are satisfied. Signed-off-by: Paolo Bonzini --- scripts/kvm/vmxcap | 1 + target/i386/cpu.c | 1 + target/i386/cpu.h | 1 + 3 files changed, 3 insertions(+) diff --git a/scripts/kvm/vmxcap b/scripts/kvm/vmxcap index ce27f5e635a..3fb4d5b3425 100755 --- a/scripts/kvm/vmxcap +++ b/scripts/kvm/vmxcap @@ -115,6 +115,7 @@ controls =3D [ (50, 53): 'VMCS memory type', 54: 'INS/OUTS instruction information', 55: 'IA32_VMX_TRUE_*_CTLS support', + 56: 'Skip checks on event error code', }, msr =3D MSR_IA32_VMX_BASIC, ), diff --git a/target/i386/cpu.c b/target/i386/cpu.c index b2a20365e10..d48607b4e1e 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -1340,6 +1340,7 @@ FeatureWordInfo feature_word_info[FEATURE_WORDS] =3D { .feat_names =3D { [54] =3D "vmx-ins-outs", [55] =3D "vmx-true-ctls", + [56] =3D "vmx-any-errcode", }, .msr =3D { .index =3D MSR_IA32_VMX_BASIC, diff --git a/target/i386/cpu.h b/target/i386/cpu.h index fbb05eace57..d1ffadd78be 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1039,6 +1039,7 @@ uint64_t x86_cpu_get_supported_feature_word(FeatureWo= rd w, #define MSR_VMX_BASIC_DUAL_MONITOR (1ULL << 49) #define MSR_VMX_BASIC_INS_OUTS (1ULL << 54) #define MSR_VMX_BASIC_TRUE_CTLS (1ULL << 55) +#define MSR_VMX_BASIC_ANY_ERRCODE (1ULL << 56) =20 #define MSR_VMX_MISC_PREEMPTION_TIMER_SHIFT_MASK 0x1Full #define MSR_VMX_MISC_STORE_LMA (1ULL << 5) --=20 2.41.0 From nobody Wed May 15 06:24:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695375143; cv=none; d=zohomail.com; s=zohoarc; b=WUh0q94ZweYJrttlcZsas5WvncgYHVcHZX4bPK7ZTpmqsdTBbH5EaP5TofnJXrq1jQFH6LnVGE6MlI+HG/CapwcRfDWucBwqoml+K5dMRT6pNu+C0cDHUAh8h0PeroeoFK/KbI3Hxw0nOW3+tkaDutLlU3UfU36hVdRFRII94Og= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695375143; 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=MXr0dDzaioo9uY5bLIe7ScF/gjUT2yjP9YjbogdmloQ=; b=DlrpKg/l0ONg5TpvRKov3KcdFl9YqzFRctOXgMWoamIpaGts7qDhisvzK9qy6UefyMkIjj73IiCRGIV2RRB1gDObsery9KmyE5RP2httwpinLDjzB49eMW8l3wJWI01XLzIMzlk/+KL2rriHxo0b8vzdMe/nr4B6PzVUFNAaPGw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 169537514396433.622494327822665; Fri, 22 Sep 2023 02:32:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qjcVh-0004in-RO; Fri, 22 Sep 2023 05:31:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjcVd-0004iB-PJ for qemu-devel@nongnu.org; Fri, 22 Sep 2023 05:31:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjcVa-0003Lu-V7 for qemu-devel@nongnu.org; Fri, 22 Sep 2023 05:31:37 -0400 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-456-WKlffD0BP4GKmG5jvWIZcw-1; Fri, 22 Sep 2023 05:31:32 -0400 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-32153a4533eso1275247f8f.1 for ; Fri, 22 Sep 2023 02:31:32 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e]) by smtp.gmail.com with ESMTPSA id v9-20020a5d4b09000000b0032008f99216sm4031115wrq.96.2023.09.22.02.31.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 02:31:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695375094; h=from:from: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; bh=MXr0dDzaioo9uY5bLIe7ScF/gjUT2yjP9YjbogdmloQ=; b=Dvfrkqyk0ZXzO/gLzOuf747tq2/ijmXqSVegLAH3KpXeFc6vcqSLMkMYq0zSp9Wj2l+v3u 4WrFK09WqgSg6CyD7FeYfTGQGY6v3mA6Kj9TNs+sWU/PVJMUDMjK/NxBTXh7PunkSLSZAz BkeUeYgUC8aUzl64yQZNU464cmgrL9g= X-MC-Unique: WKlffD0BP4GKmG5jvWIZcw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695375091; x=1695979891; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MXr0dDzaioo9uY5bLIe7ScF/gjUT2yjP9YjbogdmloQ=; b=qRcGg7ickxXC9Zhhc7Tuqu/IKqa6i/KDYv54+1AUJVfg985D000e2yVl4bXTr+tAmC l8NS+sM7rJ8koRHioT1dj8AJsFQtLoz4Zh3+Q9uBU/VT5so7r1YkTf6gsRppFRtDvCNl a6M+1gigQKXLPnPySfVB7ycLRugbEnY/rWiWLE3e6YNXW9vDgwqK408TcxA1I/kR1Mwo XNAy6Y4uWd2vO0RUEXJTvNb2hjQHItR5hElKc1CSUDYP8Cm0tnk2AAOBqC6Qr4/mme8B SlEgLF4aqZeJ1nQRuWHXd2+dy0i5iGFW4s5ih21knzt1W5WPgmZ0fTTOUGn8OZgqTrD3 wZ4A== X-Gm-Message-State: AOJu0YzkDZcz+4AitBvIgDElsuYWa6NW6RAG75Hst2t2ZoC8WVz553Oj SVdTF0o3zuWnQTtBbtenmKlFTVW2aqwd3noMlSDtuHEFRLezBW1egjdZDVQQl8sllSBA+iM3cTl SCUyhalCd24s/94u2fNMKPBLbuDwHuHjFcT87ZbO0cW+RH9Qo8ryeBMHp9j+81hykOfGlmkdciR w= X-Received: by 2002:adf:e385:0:b0:31f:db12:f5db with SMTP id e5-20020adfe385000000b0031fdb12f5dbmr6744842wrm.32.1695375091189; Fri, 22 Sep 2023 02:31:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFKG1P9Q0331y8BXfy5K8NpJhVvRyDeMQfzRn5y5ezx/uzVzxvAsZh9tSD+5t4TuTOIymc1bw== X-Received: by 2002:adf:e385:0:b0:31f:db12:f5db with SMTP id e5-20020adfe385000000b0031fdb12f5dbmr6744831wrm.32.1695375090934; Fri, 22 Sep 2023 02:31:30 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Pawan Gupta , Jack Wang , Daniel Sneddon Subject: [PULL 02/12] target/i386: Export GDS_NO bit to guests Date: Fri, 22 Sep 2023 11:31:15 +0200 Message-ID: <20230922093126.264016-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230922093126.264016-1-pbonzini@redhat.com> References: <20230922093126.264016-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1695375145307100003 Content-Type: text/plain; charset="utf-8" From: Pawan Gupta Gather Data Sampling (GDS) is a side-channel attack using Gather instructions. Some Intel processors will set ARCH_CAP_GDS_NO bit in MSR IA32_ARCH_CAPABILITIES to report that they are not vulnerable to GDS. Make this bit available to guests. Closes: https://lore.kernel.org/qemu-devel/CAMGffEmG6TNq0n3+4OJAgXc8J0OevY6= 0KHZekXCBs3LoK9vehA@mail.gmail.com/ Reported-by: Jack Wang Signed-off-by: Pawan Gupta Tested-by: Jack Wang Tested-by: Daniel Sneddon Message-ID: Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index d48607b4e1e..f9e51a9d87e 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -1155,7 +1155,7 @@ FeatureWordInfo feature_word_info[FEATURE_WORDS] =3D { NULL, "sbdr-ssdp-no", "fbsdp-no", "psdp-no", NULL, "fb-clear", NULL, NULL, NULL, NULL, NULL, NULL, - "pbrsb-no", NULL, NULL, NULL, + "pbrsb-no", NULL, "gds-no", NULL, NULL, NULL, NULL, NULL, }, .msr =3D { --=20 2.41.0 From nobody Wed May 15 06:24:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695375147; cv=none; d=zohomail.com; s=zohoarc; b=LE/dox+7jPHOHfMhpA1+/juYweLwiO7nYqJfd0A/eVoVFY6XF2GFyKRo3P8xAFYC/PaApRWARCaNmy6JzedYJ+D/p2t6Mp7xbOSKZN55GZgDifTiICNPQ/dWpTknQh11hZy+VC7YWAFUvgkdN37IaxSXuDx2CXCoiaxubzgk0yc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695375147; 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=SrSO+Hs9yQZxcMhy+G9BaGpwPutEpMTpch02fxbPNas=; b=lf7QToQHEqIVoR4PKIxwytFdV75KyArB94NrYV+MmFCkbXLdr6PeJMAjnkJvQ2lD4NynDPwUsZijN0TQJDih/edP6Aqs8UB4DnKlDe6+M0DygaaeYkOIknzOXb4xIhCtFZMcHa7ujmYgs+YH6VMeBI6CmfyL7Vk13esbOJLVprI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695375147651981.1447576933606; Fri, 22 Sep 2023 02:32:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qjcVo-0004kv-PS; Fri, 22 Sep 2023 05:31:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjcVf-0004iS-IP for qemu-devel@nongnu.org; Fri, 22 Sep 2023 05:31:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjcVc-0003ML-Rv for qemu-devel@nongnu.org; Fri, 22 Sep 2023 05:31:38 -0400 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-589-XNtslg6oNUePoiaGumePrg-1; Fri, 22 Sep 2023 05:31:34 -0400 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-40478e6abd0so14088715e9.1 for ; Fri, 22 Sep 2023 02:31:34 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e]) by smtp.gmail.com with ESMTPSA id x17-20020a5d6b51000000b0031980294e9fsm3961523wrw.116.2023.09.22.02.31.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 02:31:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695375096; h=from:from: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; bh=SrSO+Hs9yQZxcMhy+G9BaGpwPutEpMTpch02fxbPNas=; b=gxhxIscZieVwFFOEDRUnKmab6sCmLwr0ljT178m8teQSfVWKGO5BIjCg7OPGd6oyBJC6nb d7hR24HAYT6UgqrqKLf+Ki/+GOd/wY3ayNXmEq+cxeP4iKR5f75xdC90JEulvn2LFp4yft 8Ivoy/KppSd2py8unfFsUVtta/hQglE= X-MC-Unique: XNtslg6oNUePoiaGumePrg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695375093; x=1695979893; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SrSO+Hs9yQZxcMhy+G9BaGpwPutEpMTpch02fxbPNas=; b=MapV1R4i4+7iipe47Ce9PKJeZzixEJI5flZkTSfbRna1A3o8r5qIdzTxwmqarmKmpK a2y5smdL3Buq6YCxWb/gvdlVN76J/zCf13PuwQOePOEPWQMQHQakWDYWMeMQSw7lmB/l H1Wp6ACfP6PL20+AZg02bFUZYPfOlKNu0Gw4zCA9pTDSnFlddlspJZKS9t3Q1tO5eD7a WRZQ2ZC0IECLu53FkpaajvucAhJmi/TT+lPxnf/YHrpYOtP/B2AWWyeRD43mgGfuv9UX GRjjX1C/NRlQDA/fEwNt0Ji/LQ1Owm2UJCxukiD6NyQJog0mFKfMjPGF3VxYYe8QeBnH PIxA== X-Gm-Message-State: AOJu0Yz8spJLmSBDvPHtxaL8rKJgSOiMyWRXIEzZmCeWFbRq51SCBDJi zry7cfA41EOBhZTOPw8/uqNSfqZ3zUOfQfTA8wW76m9Qbp0F60nBuBQ9ERmfCaKT90+KyC+NdC3 MpOSNV4NmT6qFKS+rX2+3qwaxUK9INKliyGXuF3Ec7Mt+QE7vhdU+wxfuR5tYhwN2w/2IQ6on+z c= X-Received: by 2002:a5d:638a:0:b0:321:6fe4:d4eb with SMTP id p10-20020a5d638a000000b003216fe4d4ebmr5768023wru.2.1695375092996; Fri, 22 Sep 2023 02:31:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFa+EQpr8RImb02/nGcCyGx1vTnb2G7B0Cj+sGYpUhQA9gsv3viohBf22PrMHHi5TxEtGR8Gw== X-Received: by 2002:a5d:638a:0:b0:321:6fe4:d4eb with SMTP id p10-20020a5d638a000000b003216fe4d4ebmr5768013wru.2.1695375092693; Fri, 22 Sep 2023 02:31:32 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: LIU Zhiwei Subject: [PULL 03/12] qemu/timer: Add host ticks function for RISC-V Date: Fri, 22 Sep 2023 11:31:16 +0200 Message-ID: <20230922093126.264016-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230922093126.264016-1-pbonzini@redhat.com> References: <20230922093126.264016-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1695375148509100001 Content-Type: text/plain; charset="utf-8" From: LIU Zhiwei Signed-off-by: LIU Zhiwei Message-ID: <20230911063223.742-1-zhiwei_liu@linux.alibaba.com> Signed-off-by: Paolo Bonzini --- include/qemu/timer.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/include/qemu/timer.h b/include/qemu/timer.h index 9a91cb1248a..9a366e551fb 100644 --- a/include/qemu/timer.h +++ b/include/qemu/timer.h @@ -979,6 +979,28 @@ static inline int64_t cpu_get_host_ticks(void) return cur - ofs; } =20 +#elif defined(__riscv) && __riscv_xlen =3D=3D 32 +static inline int64_t cpu_get_host_ticks(void) +{ + uint32_t lo, hi, tmph; + do { + asm volatile("RDTIMEH %0\n\t" + "RDTIME %1\n\t" + "RDTIMEH %2" + : "=3Dr"(hi), "=3Dr"(lo), "=3Dr"(tmph)); + } while (unlikely(tmph !=3D hi)); + return lo | (uint64_t)hi << 32; +} + +#elif defined(__riscv) && __riscv_xlen > 32 +static inline int64_t cpu_get_host_ticks(void) +{ + int64_t val; + + asm volatile("RDTIME %0" : "=3Dr"(val)); + return val; +} + #else /* The host CPU doesn't have an easily accessible cycle counter. Just return a monotonically increasing value. This will be --=20 2.41.0 From nobody Wed May 15 06:24:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695375200; cv=none; d=zohomail.com; s=zohoarc; b=gUVI1grMDasw9doWW/l3Ubf4K0lamGRx+NpuFsP0sPg+NUIzwqTdFkXp/HofDRQYrXQPptCPLQqx8HrSG5NLVTaXiid83bDtXIjr6ZsoZ9WWmDyGl2piXKa7bSQcoRFEPUF6vO8I4Y3pN6zfBecAIZTIkF7tNrXP+DT3WlQVKLw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695375200; h=Content-Type:Content-Transfer-Encoding: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=ZYaAXgCjWKIKQP2k6e7i1ysxrJ0oruwWu2CjsZL3JOA=; b=BlcSDjS6Ai03V6Y9SGRrZKGVGefcbbmYtwsKhmVZCVTOS/Zj/3wynMXUTCK4A0rS0zD1PSYPkXTeP5dvl/ErNGp1wNV1ePz/OPNUNVOjECXwaqY8fkd8j3IRbwk7TiqwSybIp+tfnhvybayKK5Em0MKYWTFdVKgfATv2zH485yM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695375200461414.0472392468222; Fri, 22 Sep 2023 02:33:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qjcVw-0004mX-Hb; Fri, 22 Sep 2023 05:31:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjcVj-0004j0-N2 for qemu-devel@nongnu.org; Fri, 22 Sep 2023 05:31:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjcVg-0003N1-F7 for qemu-devel@nongnu.org; Fri, 22 Sep 2023 05:31:43 -0400 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-472-kLjDhNkgMO6Hfaj__cJjMg-1; Fri, 22 Sep 2023 05:31:37 -0400 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-4053a5c6a59so7993095e9.3 for ; Fri, 22 Sep 2023 02:31:37 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e]) by smtp.gmail.com with ESMTPSA id z11-20020a7bc7cb000000b00402fa98abe3sm7000996wmk.46.2023.09.22.02.31.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 02:31:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695375099; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZYaAXgCjWKIKQP2k6e7i1ysxrJ0oruwWu2CjsZL3JOA=; b=cZ1aaZLMBeeSMtZyPa3rgF5OMWlTvqHE8+iTA9fyFVwd8AB7japgJn5sPVE5PGnMziV8LR qEw1ZjRP/uQq6JMocR7pH5b2G+7lCRST2/GQ8VClzrTfRXdXNWgt9vWQXABCSVNz8QNVr/ KfFaVaTakk/rLR8X6JQi6uSBwbFDl/U= X-MC-Unique: kLjDhNkgMO6Hfaj__cJjMg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695375095; x=1695979895; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZYaAXgCjWKIKQP2k6e7i1ysxrJ0oruwWu2CjsZL3JOA=; b=gBmb3E6PhkEhKhiBlYQS2NDB2b/voiqRXLwN1yumquCFi8QFjxkMjZpwY5zcP0rnkN TuNM2SAOMsccHvOucUz2oNxJFajYfIpfbRQ+2PJgP/rMJJnHEmzaGz//Qi9+RITchEVU VXgV6Wxmv/d3ouYH50hqdn/ED/fSMuU3BkoUOI87LzKJIYwjgnTYtN3Coo34919q47TL w7FmCqGc7Wzb0O3LsBP8xQdEO/avbkXDUxy7HL47i6YvJWkfsKyuwdz4jRWXnABXgboG LxqZUe3i7D/4RcKf7d7ZnLdOAgopt6vYMPmElOu/tBVQSZZQUOHipfvXbYmRr53YAaKK 6v+g== X-Gm-Message-State: AOJu0YwfGj2agV5IfxWJCC/xClT73J/qdReFOX1FGVas3RDVLRqD4Qux n/K+M7CMc8fBBNmanEs1KyyrDkRpoIKt30opL63lTskQBGGXWEo5MpptRl3+HaO2ZnUNJuoXroM dRd65k0fKG5kImGQRyeI5dMBwnYogbptJMe1zwh+rLNRVuZv1p6gghZvw+ZcXZtvMllR9Tw0+kf A= X-Received: by 2002:a7b:c3cf:0:b0:402:f8ea:be3e with SMTP id t15-20020a7bc3cf000000b00402f8eabe3emr6792768wmj.7.1695375095194; Fri, 22 Sep 2023 02:31:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGT0V5EjPj6nuCptt/KS4RkNXeGkjfYR/fHPdu/DSQt56tDnXW6rBgEBKMR6YzYqNV/V8L4uw== X-Received: by 2002:a7b:c3cf:0:b0:402:f8ea:be3e with SMTP id t15-20020a7bc3cf000000b00402f8eabe3emr6792727wmj.7.1695375094087; Fri, 22 Sep 2023 02:31:34 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 04/12] audio: remove QEMU_AUDIO_* and -audio-help support Date: Fri, 22 Sep 2023 11:31:17 +0200 Message-ID: <20230922093126.264016-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230922093126.264016-1-pbonzini@redhat.com> References: <20230922093126.264016-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1695375200762100005 These have been deprecated for a long time, and the introduction of -audio in 7.1.0 has cemented the new way of specifying an audio backend. Remove all the associated baggage, including the concept of "can_be_default" audio drivers. Signed-off-by: Paolo Bonzini --- audio/alsaaudio.c | 1 - audio/audio.c | 60 +--- audio/audio.h | 1 - audio/audio_int.h | 3 - audio/audio_legacy.c | 591 -------------------------------- audio/coreaudio.m | 1 - audio/dbusaudio.c | 1 - audio/dsoundaudio.c | 1 - audio/jackaudio.c | 1 - audio/meson.build | 1 - audio/noaudio.c | 1 - audio/ossaudio.c | 1 - audio/paaudio.c | 1 - audio/pwaudio.c | 1 - audio/sdlaudio.c | 1 - audio/sndioaudio.c | 1 - audio/wavaudio.c | 1 - docs/about/deprecated.rst | 8 - docs/about/removed-features.rst | 6 + qemu-options.hx | 10 - softmmu/vl.c | 4 - 21 files changed, 24 insertions(+), 672 deletions(-) delete mode 100644 audio/audio_legacy.c diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c index 057571dd1e0..5ffb39c4182 100644 --- a/audio/alsaaudio.c +++ b/audio/alsaaudio.c @@ -960,7 +960,6 @@ static struct audio_driver alsa_audio_driver =3D { .init =3D alsa_audio_init, .fini =3D alsa_audio_fini, .pcm_ops =3D &alsa_pcm_ops, - .can_be_default =3D 1, .max_voices_out =3D INT_MAX, .max_voices_in =3D INT_MAX, .voice_size_out =3D sizeof (ALSAVoiceOut), diff --git a/audio/audio.c b/audio/audio.c index 90c7c49d116..666ef4237dd 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -73,7 +73,7 @@ void audio_driver_register(audio_driver *drv) QLIST_INSERT_HEAD(&audio_drivers, drv, next); } =20 -audio_driver *audio_driver_lookup(const char *name) +static audio_driver *audio_driver_lookup(const char *name) { struct audio_driver *d; Error *local_err =3D NULL; @@ -111,8 +111,6 @@ const struct mixeng_volume nominal_volume =3D { #endif }; =20 -static bool legacy_config =3D true; - int audio_bug (const char *funcname, int cond) { if (cond) { @@ -1712,46 +1710,26 @@ static AudioState *audio_init(Audiodev *dev, const = char *name) /* silence gcc warning about uninitialized variable */ AudiodevListHead head =3D QSIMPLEQ_HEAD_INITIALIZER(head); =20 - if (using_spice) { - /* - * When using spice allow the spice audio driver being picked - * as default. - * - * Temporary hack. Using audio devices without explicit - * audiodev=3D property is already deprecated. Same goes for - * the -soundhw switch. Once this support gets finally - * removed we can also drop the concept of a default audio - * backend and this can go away. - */ - driver =3D audio_driver_lookup("spice"); - if (driver) { - driver->can_be_default =3D 1; - } - } - if (dev) { /* -audiodev option */ - legacy_config =3D false; drvname =3D AudiodevDriver_str(dev->driver); - } else if (!QTAILQ_EMPTY(&audio_states)) { - if (!legacy_config) { - dolog("Device %s: audiodev default parameter is deprecated, pl= ease " - "specify audiodev=3D%s\n", name, - QTAILQ_FIRST(&audio_states)->dev->id); - } - return QTAILQ_FIRST(&audio_states); } else { - /* legacy implicit initialization */ - head =3D audio_handle_legacy_opts(); - /* - * In case of legacy initialization, all Audiodevs in the list wil= l have - * the same configuration (except the driver), so it doesn't matte= r which - * one we chose. We need an Audiodev to set up AudioState before = we can - * init a driver. Also note that dev at this point is still in the - * list. - */ - dev =3D QSIMPLEQ_FIRST(&head)->dev; - audio_validate_opts(dev, &error_abort); + if (!QTAILQ_EMPTY(&audio_states)) { + dev =3D QTAILQ_FIRST(&audio_states)->dev; + if (!g_str_equal(dev->id, "#none")) { + dolog("Device %s: audiodev default parameter is deprecated= , please " + "specify audiodev=3D%s\n", name, + dev->id); + } + return QTAILQ_FIRST(&audio_states); + } + + dolog("No audio device specified\n"); + dev =3D g_new0(Audiodev, 1); + dev->id =3D g_strdup("#none"); + dev->driver =3D AUDIODEV_DRIVER_NONE; + dev->u.none.in =3D g_new0(AudiodevPerDirectionOptions, 1); + dev->u.none.out =3D g_new0(AudiodevPerDirectionOptions, 1); } =20 s =3D g_new0(AudioState, 1); @@ -1876,9 +1854,7 @@ CaptureVoiceOut *AUD_add_capture( struct capture_callback *cb; =20 if (!s) { - if (!legacy_config) { - dolog("Capturing without setting an audiodev is deprecated\n"); - } + dolog("Capturing without setting an audiodev is deprecated\n"); s =3D audio_init(NULL, NULL); } =20 diff --git a/audio/audio.h b/audio/audio.h index 01bdc567fb1..a276ec13eba 100644 --- a/audio/audio.h +++ b/audio/audio.h @@ -172,7 +172,6 @@ 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); =20 AudioState *audio_state_by_name(const char *name); const char *audio_get_id(QEMUSoundCard *card); diff --git a/audio/audio_int.h b/audio/audio_int.h index e57ff50155a..381c31ee0df 100644 --- a/audio/audio_int.h +++ b/audio/audio_int.h @@ -146,7 +146,6 @@ struct audio_driver { void (*set_dbus_server) (AudioState *s, GDBusObjectManagerServer *mana= ger, bool p2p); #endif struct audio_pcm_ops *pcm_ops; - int can_be_default; int max_voices_out; int max_voices_in; size_t voice_size_out; @@ -243,7 +242,6 @@ extern const struct mixeng_volume nominal_volume; extern const char *audio_prio_list[]; =20 void audio_driver_register(audio_driver *drv); -audio_driver *audio_driver_lookup(const char *name); =20 void audio_pcm_init_info (struct audio_pcm_info *info, struct audsettings = *as); void audio_pcm_info_clear_buf (struct audio_pcm_info *info, void *buf, int= len); @@ -297,7 +295,6 @@ typedef struct AudiodevListEntry { } AudiodevListEntry; =20 typedef QSIMPLEQ_HEAD(, AudiodevListEntry) AudiodevListHead; -AudiodevListHead audio_handle_legacy_opts(void); =20 void audio_free_audiodev_list(AudiodevListHead *head); =20 diff --git a/audio/audio_legacy.c b/audio/audio_legacy.c deleted file mode 100644 index dc72ba55e9a..00000000000 --- a/audio/audio_legacy.c +++ /dev/null @@ -1,591 +0,0 @@ -/* - * QEMU Audio subsystem: legacy configuration handling - * - * Copyright (c) 2015-2019 Zolt=C3=A1n K=C5=91v=C3=A1g=C3=B3 - * - * Permission is hereby granted, free of charge, to any person obtaining a= copy - * of this software and associated documentation files (the "Software"), t= o deal - * in the Software without restriction, including without limitation the r= ights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or se= ll - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included= in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OT= HER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING= FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS = IN - * THE SOFTWARE. - */ -#include "qemu/osdep.h" -#include "audio.h" -#include "audio_int.h" -#include "qemu/cutils.h" -#include "qemu/timer.h" -#include "qapi/error.h" -#include "qapi/qapi-visit-audio.h" -#include "qapi/visitor-impl.h" - -#define AUDIO_CAP "audio-legacy" -#include "audio_int.h" - -static uint32_t toui32(const char *str) -{ - uint64_t ret; - if (parse_uint_full(str, 10, &ret) || ret > UINT32_MAX) { - dolog("Invalid integer value `%s'\n", str); - exit(1); - } - return ret; -} - -/* helper functions to convert env variables */ -static void get_bool(const char *env, bool *dst, bool *has_dst) -{ - const char *val =3D getenv(env); - if (val) { - *dst =3D toui32(val) !=3D 0; - *has_dst =3D true; - } -} - -static void get_int(const char *env, uint32_t *dst, bool *has_dst) -{ - const char *val =3D getenv(env); - if (val) { - *dst =3D toui32(val); - *has_dst =3D true; - } -} - -static void get_str(const char *env, char **dst) -{ - const char *val =3D getenv(env); - if (val) { - g_free(*dst); - *dst =3D g_strdup(val); - } -} - -static void get_fmt(const char *env, AudioFormat *dst, bool *has_dst) -{ - const char *val =3D getenv(env); - if (val) { - size_t i; - for (i =3D 0; AudioFormat_lookup.size; ++i) { - if (strcasecmp(val, AudioFormat_lookup.array[i]) =3D=3D 0) { - *dst =3D i; - *has_dst =3D true; - return; - } - } - - dolog("Invalid audio format `%s'\n", val); - exit(1); - } -} - - -#if defined(CONFIG_AUDIO_ALSA) || defined(CONFIG_AUDIO_DSOUND) -static void get_millis_to_usecs(const char *env, uint32_t *dst, bool *has_= dst) -{ - const char *val =3D getenv(env); - if (val) { - *dst =3D toui32(val) * 1000; - *has_dst =3D true; - } -} -#endif - -#if defined(CONFIG_AUDIO_ALSA) || defined(CONFIG_AUDIO_COREAUDIO) || \ - defined(CONFIG_AUDIO_PA) || defined(CONFIG_AUDIO_SDL) || \ - defined(CONFIG_AUDIO_DSOUND) || defined(CONFIG_AUDIO_OSS) -static uint32_t frames_to_usecs(uint32_t frames, - AudiodevPerDirectionOptions *pdo) -{ - uint32_t freq =3D pdo->has_frequency ? pdo->frequency : 44100; - return (frames * 1000000 + freq / 2) / freq; -} -#endif - -#ifdef CONFIG_AUDIO_COREAUDIO -static void get_frames_to_usecs(const char *env, uint32_t *dst, bool *has_= dst, - AudiodevPerDirectionOptions *pdo) -{ - const char *val =3D getenv(env); - if (val) { - *dst =3D frames_to_usecs(toui32(val), pdo); - *has_dst =3D true; - } -} -#endif - -#if defined(CONFIG_AUDIO_PA) || defined(CONFIG_AUDIO_SDL) || \ - defined(CONFIG_AUDIO_DSOUND) || defined(CONFIG_AUDIO_OSS) -static uint32_t samples_to_usecs(uint32_t samples, - AudiodevPerDirectionOptions *pdo) -{ - uint32_t channels =3D pdo->has_channels ? pdo->channels : 2; - return frames_to_usecs(samples / channels, pdo); -} -#endif - -#if defined(CONFIG_AUDIO_PA) || defined(CONFIG_AUDIO_SDL) -static void get_samples_to_usecs(const char *env, uint32_t *dst, bool *has= _dst, - AudiodevPerDirectionOptions *pdo) -{ - const char *val =3D getenv(env); - if (val) { - *dst =3D samples_to_usecs(toui32(val), pdo); - *has_dst =3D true; - } -} -#endif - -#if defined(CONFIG_AUDIO_DSOUND) || defined(CONFIG_AUDIO_OSS) -static uint32_t bytes_to_usecs(uint32_t bytes, AudiodevPerDirectionOptions= *pdo) -{ - AudioFormat fmt =3D pdo->has_format ? pdo->format : AUDIO_FORMAT_S16; - uint32_t bytes_per_sample =3D audioformat_bytes_per_sample(fmt); - return samples_to_usecs(bytes / bytes_per_sample, pdo); -} - -static void get_bytes_to_usecs(const char *env, uint32_t *dst, bool *has_d= st, - AudiodevPerDirectionOptions *pdo) -{ - const char *val =3D getenv(env); - if (val) { - *dst =3D bytes_to_usecs(toui32(val), pdo); - *has_dst =3D true; - } -} -#endif - -/* backend specific functions */ - -#ifdef CONFIG_AUDIO_ALSA -/* ALSA */ -static void handle_alsa_per_direction( - AudiodevAlsaPerDirectionOptions *apdo, const char *prefix) -{ - char buf[64]; - size_t len =3D strlen(prefix); - bool size_in_usecs =3D false; - bool dummy; - - memcpy(buf, prefix, len); - strcpy(buf + len, "TRY_POLL"); - get_bool(buf, &apdo->try_poll, &apdo->has_try_poll); - - strcpy(buf + len, "DEV"); - get_str(buf, &apdo->dev); - - strcpy(buf + len, "SIZE_IN_USEC"); - get_bool(buf, &size_in_usecs, &dummy); - - strcpy(buf + len, "PERIOD_SIZE"); - get_int(buf, &apdo->period_length, &apdo->has_period_length); - if (apdo->has_period_length && !size_in_usecs) { - apdo->period_length =3D frames_to_usecs( - apdo->period_length, - qapi_AudiodevAlsaPerDirectionOptions_base(apdo)); - } - - strcpy(buf + len, "BUFFER_SIZE"); - get_int(buf, &apdo->buffer_length, &apdo->has_buffer_length); - if (apdo->has_buffer_length && !size_in_usecs) { - apdo->buffer_length =3D frames_to_usecs( - apdo->buffer_length, - qapi_AudiodevAlsaPerDirectionOptions_base(apdo)); - } -} - -static void handle_alsa(Audiodev *dev) -{ - AudiodevAlsaOptions *aopt =3D &dev->u.alsa; - handle_alsa_per_direction(aopt->in, "QEMU_ALSA_ADC_"); - handle_alsa_per_direction(aopt->out, "QEMU_ALSA_DAC_"); - - get_millis_to_usecs("QEMU_ALSA_THRESHOLD", - &aopt->threshold, &aopt->has_threshold); -} -#endif - -#ifdef CONFIG_AUDIO_COREAUDIO -/* coreaudio */ -static void handle_coreaudio(Audiodev *dev) -{ - get_frames_to_usecs( - "QEMU_COREAUDIO_BUFFER_SIZE", - &dev->u.coreaudio.out->buffer_length, - &dev->u.coreaudio.out->has_buffer_length, - qapi_AudiodevCoreaudioPerDirectionOptions_base(dev->u.coreaudio.ou= t)); - get_int("QEMU_COREAUDIO_BUFFER_COUNT", - &dev->u.coreaudio.out->buffer_count, - &dev->u.coreaudio.out->has_buffer_count); -} -#endif - -#ifdef CONFIG_AUDIO_DSOUND -/* dsound */ -static void handle_dsound(Audiodev *dev) -{ - get_millis_to_usecs("QEMU_DSOUND_LATENCY_MILLIS", - &dev->u.dsound.latency, &dev->u.dsound.has_latency= ); - get_bytes_to_usecs("QEMU_DSOUND_BUFSIZE_OUT", - &dev->u.dsound.out->buffer_length, - &dev->u.dsound.out->has_buffer_length, - dev->u.dsound.out); - get_bytes_to_usecs("QEMU_DSOUND_BUFSIZE_IN", - &dev->u.dsound.in->buffer_length, - &dev->u.dsound.in->has_buffer_length, - dev->u.dsound.in); -} -#endif - -#ifdef CONFIG_AUDIO_OSS -/* OSS */ -static void handle_oss_per_direction( - AudiodevOssPerDirectionOptions *opdo, const char *try_poll_env, - const char *dev_env) -{ - get_bool(try_poll_env, &opdo->try_poll, &opdo->has_try_poll); - get_str(dev_env, &opdo->dev); - - get_bytes_to_usecs("QEMU_OSS_FRAGSIZE", - &opdo->buffer_length, &opdo->has_buffer_length, - qapi_AudiodevOssPerDirectionOptions_base(opdo)); - get_int("QEMU_OSS_NFRAGS", &opdo->buffer_count, - &opdo->has_buffer_count); -} - -static void handle_oss(Audiodev *dev) -{ - AudiodevOssOptions *oopt =3D &dev->u.oss; - handle_oss_per_direction(oopt->in, "QEMU_AUDIO_ADC_TRY_POLL", - "QEMU_OSS_ADC_DEV"); - handle_oss_per_direction(oopt->out, "QEMU_AUDIO_DAC_TRY_POLL", - "QEMU_OSS_DAC_DEV"); - - get_bool("QEMU_OSS_MMAP", &oopt->try_mmap, &oopt->has_try_mmap); - get_bool("QEMU_OSS_EXCLUSIVE", &oopt->exclusive, &oopt->has_exclusive); - get_int("QEMU_OSS_POLICY", &oopt->dsp_policy, &oopt->has_dsp_policy); -} -#endif - -#ifdef CONFIG_AUDIO_PA -/* pulseaudio */ -static void handle_pa_per_direction( - AudiodevPaPerDirectionOptions *ppdo, const char *env) -{ - get_str(env, &ppdo->name); -} - -static void handle_pa(Audiodev *dev) -{ - handle_pa_per_direction(dev->u.pa.in, "QEMU_PA_SOURCE"); - handle_pa_per_direction(dev->u.pa.out, "QEMU_PA_SINK"); - - get_samples_to_usecs( - "QEMU_PA_SAMPLES", &dev->u.pa.in->buffer_length, - &dev->u.pa.in->has_buffer_length, - qapi_AudiodevPaPerDirectionOptions_base(dev->u.pa.in)); - get_samples_to_usecs( - "QEMU_PA_SAMPLES", &dev->u.pa.out->buffer_length, - &dev->u.pa.out->has_buffer_length, - qapi_AudiodevPaPerDirectionOptions_base(dev->u.pa.out)); - - get_str("QEMU_PA_SERVER", &dev->u.pa.server); -} -#endif - -#ifdef CONFIG_AUDIO_SDL -/* SDL */ -static void handle_sdl(Audiodev *dev) -{ - /* SDL is output only */ - get_samples_to_usecs("QEMU_SDL_SAMPLES", &dev->u.sdl.out->buffer_lengt= h, - &dev->u.sdl.out->has_buffer_length, - qapi_AudiodevSdlPerDirectionOptions_base(dev->u.sdl.out)); -} -#endif - -/* wav */ -static void handle_wav(Audiodev *dev) -{ - get_int("QEMU_WAV_FREQUENCY", - &dev->u.wav.out->frequency, &dev->u.wav.out->has_frequency); - get_fmt("QEMU_WAV_FORMAT", &dev->u.wav.out->format, - &dev->u.wav.out->has_format); - get_int("QEMU_WAV_DAC_FIXED_CHANNELS", - &dev->u.wav.out->channels, &dev->u.wav.out->has_channels); - get_str("QEMU_WAV_PATH", &dev->u.wav.path); -} - -/* general */ -static void handle_per_direction( - AudiodevPerDirectionOptions *pdo, const char *prefix) -{ - char buf[64]; - size_t len =3D strlen(prefix); - - memcpy(buf, prefix, len); - strcpy(buf + len, "FIXED_SETTINGS"); - get_bool(buf, &pdo->fixed_settings, &pdo->has_fixed_settings); - - strcpy(buf + len, "FIXED_FREQ"); - get_int(buf, &pdo->frequency, &pdo->has_frequency); - - strcpy(buf + len, "FIXED_FMT"); - get_fmt(buf, &pdo->format, &pdo->has_format); - - strcpy(buf + len, "FIXED_CHANNELS"); - get_int(buf, &pdo->channels, &pdo->has_channels); - - strcpy(buf + len, "VOICES"); - get_int(buf, &pdo->voices, &pdo->has_voices); -} - -static AudiodevListEntry *legacy_opt(const char *drvname) -{ - AudiodevListEntry *e =3D g_new0(AudiodevListEntry, 1); - e->dev =3D g_new0(Audiodev, 1); - e->dev->id =3D g_strdup(drvname); - e->dev->driver =3D qapi_enum_parse( - &AudiodevDriver_lookup, drvname, -1, &error_abort); - - audio_create_pdos(e->dev); - - handle_per_direction(audio_get_pdo_in(e->dev), "QEMU_AUDIO_ADC_"); - handle_per_direction(audio_get_pdo_out(e->dev), "QEMU_AUDIO_DAC_"); - - /* Original description: Timer period in HZ (0 - use lowest possible) = */ - get_int("QEMU_AUDIO_TIMER_PERIOD", - &e->dev->timer_period, &e->dev->has_timer_period); - if (e->dev->has_timer_period && e->dev->timer_period) { - e->dev->timer_period =3D NANOSECONDS_PER_SECOND / 1000 / - e->dev->timer_period; - } - - switch (e->dev->driver) { -#ifdef CONFIG_AUDIO_ALSA - case AUDIODEV_DRIVER_ALSA: - handle_alsa(e->dev); - break; -#endif - -#ifdef CONFIG_AUDIO_COREAUDIO - case AUDIODEV_DRIVER_COREAUDIO: - handle_coreaudio(e->dev); - break; -#endif - -#ifdef CONFIG_AUDIO_DSOUND - case AUDIODEV_DRIVER_DSOUND: - handle_dsound(e->dev); - break; -#endif - -#ifdef CONFIG_AUDIO_OSS - case AUDIODEV_DRIVER_OSS: - handle_oss(e->dev); - break; -#endif - -#ifdef CONFIG_AUDIO_PA - case AUDIODEV_DRIVER_PA: - handle_pa(e->dev); - break; -#endif - -#ifdef CONFIG_AUDIO_SDL - case AUDIODEV_DRIVER_SDL: - handle_sdl(e->dev); - break; -#endif - - case AUDIODEV_DRIVER_WAV: - handle_wav(e->dev); - break; - - default: - break; - } - - return e; -} - -AudiodevListHead audio_handle_legacy_opts(void) -{ - const char *drvname =3D getenv("QEMU_AUDIO_DRV"); - AudiodevListHead head =3D QSIMPLEQ_HEAD_INITIALIZER(head); - - if (drvname) { - AudiodevListEntry *e; - audio_driver *driver =3D audio_driver_lookup(drvname); - if (!driver) { - dolog("Unknown audio driver `%s'\n", drvname); - exit(1); - } - e =3D legacy_opt(drvname); - QSIMPLEQ_INSERT_TAIL(&head, e, next); - } else { - for (int i =3D 0; audio_prio_list[i]; i++) { - audio_driver *driver =3D audio_driver_lookup(audio_prio_list[i= ]); - if (driver && driver->can_be_default) { - AudiodevListEntry *e =3D legacy_opt(driver->name); - QSIMPLEQ_INSERT_TAIL(&head, e, next); - } - } - if (QSIMPLEQ_EMPTY(&head)) { - dolog("Internal error: no default audio driver available\n"); - exit(1); - } - } - - return head; -} - -/* visitor to print -audiodev option */ -typedef struct { - Visitor visitor; - - bool comma; - GList *path; -} LegacyPrintVisitor; - -static bool lv_start_struct(Visitor *v, const char *name, void **obj, - size_t size, Error **errp) -{ - LegacyPrintVisitor *lv =3D (LegacyPrintVisitor *) v; - lv->path =3D g_list_append(lv->path, g_strdup(name)); - return true; -} - -static void lv_end_struct(Visitor *v, void **obj) -{ - LegacyPrintVisitor *lv =3D (LegacyPrintVisitor *) v; - lv->path =3D g_list_delete_link(lv->path, g_list_last(lv->path)); -} - -static void lv_print_key(Visitor *v, const char *name) -{ - GList *e; - LegacyPrintVisitor *lv =3D (LegacyPrintVisitor *) v; - if (lv->comma) { - putchar(','); - } else { - lv->comma =3D true; - } - - for (e =3D lv->path; e; e =3D e->next) { - if (e->data) { - printf("%s.", (const char *) e->data); - } - } - - printf("%s=3D", name); -} - -static bool lv_type_int64(Visitor *v, const char *name, int64_t *obj, - Error **errp) -{ - lv_print_key(v, name); - printf("%" PRIi64, *obj); - return true; -} - -static bool lv_type_uint64(Visitor *v, const char *name, uint64_t *obj, - Error **errp) -{ - lv_print_key(v, name); - printf("%" PRIu64, *obj); - return true; -} - -static bool lv_type_bool(Visitor *v, const char *name, bool *obj, Error **= errp) -{ - lv_print_key(v, name); - printf("%s", *obj ? "on" : "off"); - return true; -} - -static bool lv_type_str(Visitor *v, const char *name, char **obj, Error **= errp) -{ - const char *str =3D *obj; - lv_print_key(v, name); - - while (*str) { - if (*str =3D=3D ',') { - putchar(','); - } - putchar(*str++); - } - return true; -} - -static void lv_complete(Visitor *v, void *opaque) -{ - LegacyPrintVisitor *lv =3D (LegacyPrintVisitor *) v; - assert(lv->path =3D=3D NULL); -} - -static void lv_free(Visitor *v) -{ - LegacyPrintVisitor *lv =3D (LegacyPrintVisitor *) v; - - g_list_free_full(lv->path, g_free); - g_free(lv); -} - -static Visitor *legacy_visitor_new(void) -{ - LegacyPrintVisitor *lv =3D g_new0(LegacyPrintVisitor, 1); - - lv->visitor.start_struct =3D lv_start_struct; - lv->visitor.end_struct =3D lv_end_struct; - /* lists not supported */ - lv->visitor.type_int64 =3D lv_type_int64; - lv->visitor.type_uint64 =3D lv_type_uint64; - lv->visitor.type_bool =3D lv_type_bool; - lv->visitor.type_str =3D lv_type_str; - - lv->visitor.type =3D VISITOR_OUTPUT; - lv->visitor.complete =3D lv_complete; - lv->visitor.free =3D lv_free; - - return &lv->visitor; -} - -void audio_legacy_help(void) -{ - AudiodevListHead head; - AudiodevListEntry *e; - - printf("Environment variable based configuration deprecated.\n"); - printf("Please use the new -audiodev option.\n"); - - head =3D audio_handle_legacy_opts(); - printf("\nEquivalent -audiodev to your current environment variables:\= n"); - if (!getenv("QEMU_AUDIO_DRV")) { - printf("(Since you didn't specify QEMU_AUDIO_DRV, I'll list all " - "possibilities)\n"); - } - - QSIMPLEQ_FOREACH(e, &head, next) { - Visitor *v; - Audiodev *dev =3D e->dev; - printf("-audiodev "); - - v =3D legacy_visitor_new(); - visit_type_Audiodev(v, NULL, &dev, &error_abort); - visit_free(v); - - printf("\n"); - } - audio_free_audiodev_list(&head); -} diff --git a/audio/coreaudio.m b/audio/coreaudio.m index 4695291621a..e5612138a74 100644 --- a/audio/coreaudio.m +++ b/audio/coreaudio.m @@ -673,7 +673,6 @@ static void coreaudio_audio_fini (void *opaque) .init =3D coreaudio_audio_init, .fini =3D coreaudio_audio_fini, .pcm_ops =3D &coreaudio_pcm_ops, - .can_be_default =3D 1, .max_voices_out =3D 1, .max_voices_in =3D 0, .voice_size_out =3D sizeof (coreaudioVoiceOut), diff --git a/audio/dbusaudio.c b/audio/dbusaudio.c index 7a11fbfb420..df81e6d9f0b 100644 --- a/audio/dbusaudio.c +++ b/audio/dbusaudio.c @@ -676,7 +676,6 @@ static struct audio_driver dbus_audio_driver =3D { .fini =3D dbus_audio_fini, .set_dbus_server =3D dbus_audio_set_server, .pcm_ops =3D &dbus_pcm_ops, - .can_be_default =3D 1, .max_voices_out =3D INT_MAX, .max_voices_in =3D INT_MAX, .voice_size_out =3D sizeof(DBusVoiceOut), diff --git a/audio/dsoundaudio.c b/audio/dsoundaudio.c index 3fb67ec3eed..311e3421846 100644 --- a/audio/dsoundaudio.c +++ b/audio/dsoundaudio.c @@ -721,7 +721,6 @@ static struct audio_driver dsound_audio_driver =3D { .init =3D dsound_audio_init, .fini =3D dsound_audio_fini, .pcm_ops =3D &dsound_pcm_ops, - .can_be_default =3D 1, .max_voices_out =3D INT_MAX, .max_voices_in =3D 1, .voice_size_out =3D sizeof (DSoundVoiceOut), diff --git a/audio/jackaudio.c b/audio/jackaudio.c index 5bdf3d7a78d..fd2d2fd5acb 100644 --- a/audio/jackaudio.c +++ b/audio/jackaudio.c @@ -669,7 +669,6 @@ static struct audio_driver jack_driver =3D { .init =3D qjack_init, .fini =3D qjack_fini, .pcm_ops =3D &jack_pcm_ops, - .can_be_default =3D 1, .max_voices_out =3D INT_MAX, .max_voices_in =3D INT_MAX, .voice_size_out =3D sizeof(QJackOut), diff --git a/audio/meson.build b/audio/meson.build index df4d968c0fe..c8f658611f4 100644 --- a/audio/meson.build +++ b/audio/meson.build @@ -1,7 +1,6 @@ system_ss.add([spice_headers, files('audio.c')]) system_ss.add(files( 'audio-hmp-cmds.c', - 'audio_legacy.c', 'mixeng.c', 'noaudio.c', 'wavaudio.c', diff --git a/audio/noaudio.c b/audio/noaudio.c index 4fdee5adecf..81570bfa962 100644 --- a/audio/noaudio.c +++ b/audio/noaudio.c @@ -135,7 +135,6 @@ static struct audio_driver no_audio_driver =3D { .init =3D no_audio_init, .fini =3D no_audio_fini, .pcm_ops =3D &no_pcm_ops, - .can_be_default =3D 1, .max_voices_out =3D INT_MAX, .max_voices_in =3D INT_MAX, .voice_size_out =3D sizeof (NoVoiceOut), diff --git a/audio/ossaudio.c b/audio/ossaudio.c index e8d732b612c..5a4094af707 100644 --- a/audio/ossaudio.c +++ b/audio/ossaudio.c @@ -779,7 +779,6 @@ static struct audio_driver oss_audio_driver =3D { .init =3D oss_audio_init, .fini =3D oss_audio_fini, .pcm_ops =3D &oss_pcm_ops, - .can_be_default =3D 1, .max_voices_out =3D INT_MAX, .max_voices_in =3D INT_MAX, .voice_size_out =3D sizeof (OSSVoiceOut), diff --git a/audio/paaudio.c b/audio/paaudio.c index 529b39daacc..02d18eabf50 100644 --- a/audio/paaudio.c +++ b/audio/paaudio.c @@ -928,7 +928,6 @@ static struct audio_driver pa_audio_driver =3D { .init =3D qpa_audio_init, .fini =3D qpa_audio_fini, .pcm_ops =3D &qpa_pcm_ops, - .can_be_default =3D 1, .max_voices_out =3D INT_MAX, .max_voices_in =3D INT_MAX, .voice_size_out =3D sizeof (PAVoiceOut), diff --git a/audio/pwaudio.c b/audio/pwaudio.c index b6a38738ee9..6044c9ebe50 100644 --- a/audio/pwaudio.c +++ b/audio/pwaudio.c @@ -841,7 +841,6 @@ static struct audio_driver pw_audio_driver =3D { .init =3D qpw_audio_init, .fini =3D qpw_audio_fini, .pcm_ops =3D &qpw_pcm_ops, - .can_be_default =3D 1, .max_voices_out =3D INT_MAX, .max_voices_in =3D INT_MAX, .voice_size_out =3D sizeof(PWVoiceOut), diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c index 68a237b76b4..5177e31d9b4 100644 --- a/audio/sdlaudio.c +++ b/audio/sdlaudio.c @@ -493,7 +493,6 @@ static struct audio_driver sdl_audio_driver =3D { .init =3D sdl_audio_init, .fini =3D sdl_audio_fini, .pcm_ops =3D &sdl_pcm_ops, - .can_be_default =3D 1, .max_voices_out =3D INT_MAX, .max_voices_in =3D INT_MAX, .voice_size_out =3D sizeof(SDLVoiceOut), diff --git a/audio/sndioaudio.c b/audio/sndioaudio.c index 3fde01fdbd5..61260361ad6 100644 --- a/audio/sndioaudio.c +++ b/audio/sndioaudio.c @@ -550,7 +550,6 @@ static struct audio_driver sndio_audio_driver =3D { .init =3D sndio_audio_init, .fini =3D sndio_audio_fini, .pcm_ops =3D &sndio_pcm_ops, - .can_be_default =3D 1, .max_voices_out =3D INT_MAX, .max_voices_in =3D INT_MAX, .voice_size_out =3D sizeof(SndioVoice), diff --git a/audio/wavaudio.c b/audio/wavaudio.c index 6445a2cb90c..57435c23e58 100644 --- a/audio/wavaudio.c +++ b/audio/wavaudio.c @@ -208,7 +208,6 @@ static struct audio_driver wav_audio_driver =3D { .init =3D wav_audio_init, .fini =3D wav_audio_fini, .pcm_ops =3D &wav_pcm_ops, - .can_be_default =3D 0, .max_voices_out =3D 1, .max_voices_in =3D 0, .voice_size_out =3D sizeof (WAVVoiceOut), diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index dc4da95329e..b9cdd2dd03b 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -37,14 +37,6 @@ coverage. System emulator command line arguments -------------------------------------- =20 -``QEMU_AUDIO_`` environment variables and ``-audio-help`` (since 4.0) -''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - -The ``-audiodev`` argument is now the preferred way to specify audio -backend settings instead of environment variables. To ease migration to -the new format, the ``-audiodev-help`` option can be used to convert -the current values of the environment variables to ``-audiodev`` options. - Creating sound card devices and vnc without ``audiodev=3D`` property (sinc= e 4.2) ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''= '''' =20 diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.= rst index c2043fd415d..63458736ee1 100644 --- a/docs/about/removed-features.rst +++ b/docs/about/removed-features.rst @@ -436,6 +436,12 @@ the process listing. This was replaced by the new ``pa= ssword-secret`` option which lets the password be securely provided on the command line using a ``secret`` object instance. =20 +``QEMU_AUDIO_`` environment variables and ``-audio-help`` (removed in 8.2) +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +The ``-audiodev`` and ``-audio`` command line options are now the only +way to specify audio backend settings. + QEMU Machine Protocol (QMP) commands ------------------------------------ =20 diff --git a/qemu-options.hx b/qemu-options.hx index 6be621c2324..c0c5304474c 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -727,16 +727,6 @@ SRST ERST =20 =20 -HXCOMM Deprecated by -audiodev -DEF("audio-help", 0, QEMU_OPTION_audio_help, - "-audio-help show -audiodev equivalent of the currently specified = audio settings\n", - QEMU_ARCH_ALL) -SRST -``-audio-help`` - Will show the -audiodev equivalent of the currently specified - (deprecated) environment variables. -ERST - DEF("audio", HAS_ARG, QEMU_OPTION_audio, "-audio [driver=3D]driver,model=3Dvalue[,prop[=3Dvalue][,...]]\n" " specifies the audio backend and device to use;\n" diff --git a/softmmu/vl.c b/softmmu/vl.c index 3db4fd26808..5a1413da2aa 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -2916,10 +2916,6 @@ void qemu_init(int argc, char **argv) } break; #endif - case QEMU_OPTION_audio_help: - audio_legacy_help(); - exit (0); - break; case QEMU_OPTION_audiodev: audio_parse_option(optarg); break; --=20 2.41.0 From nobody Wed May 15 06:24:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695375184; cv=none; d=zohomail.com; s=zohoarc; b=Kx/6ZmGvOgiCJYDMrhC9FjEw/UmNQY1GaiGiPr/OZIS39Y2j4nd5uXRrvXpUAsCs2XZVnUTdQnnyPTMfevXhuYSkq56H4KM2ykz3oK/tAG9KnQbbnTVuksY461HJnLdR7R2TUsBB4RHQhzqiFmqnzXwFDhHGGfc5lDcKbgs7RqU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695375184; 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=rS1CupBJrFupvgmVw9AdBeqh97yjhKlttsdxSozUwO8=; b=S+/gps25RxZ92e3TpNTeyKg+Ym7JJon0uRZPihR1VHN17PPcphpc/p6MyMbpJm719fQRjhGOohotVLAxfHeF5SlNp0NAz2/y+0B8OzekikWxFBSbcT4C+d1fe+bmW2yCdeLVY9+HfWd7sPJOIPzewXlnibaM0NG4LZGMt5vt3Ts= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 169537518481450.27880838129818; Fri, 22 Sep 2023 02:33:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qjcVz-0004oE-4g; Fri, 22 Sep 2023 05:31:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjcVi-0004iq-08 for qemu-devel@nongnu.org; Fri, 22 Sep 2023 05:31:43 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjcVg-0003N2-Gs for qemu-devel@nongnu.org; Fri, 22 Sep 2023 05:31:41 -0400 Received: from mail-lf1-f72.google.com (mail-lf1-f72.google.com [209.85.167.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-653-rlh1Ib8NOg2P1CJOya55vA-1; Fri, 22 Sep 2023 05:31:38 -0400 Received: by mail-lf1-f72.google.com with SMTP id 2adb3069b0e04-503555a717fso2350624e87.3 for ; Fri, 22 Sep 2023 02:31:38 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e]) by smtp.gmail.com with ESMTPSA id c23-20020a7bc857000000b003fefca26c72sm4160670wml.23.2023.09.22.02.31.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 02:31:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695375099; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rS1CupBJrFupvgmVw9AdBeqh97yjhKlttsdxSozUwO8=; b=AdylmApO93cso2m0Pl35sdEWq1AD1aFxFMD5+nEUKG7cO5Rv1Ed3B+8GX1DPTfYj3aPdgK tQmxQGD4iZiMER9HH7+0pLICFA5DEAZO4YooZCp79h8ka6/fwiXTB+YVlzc4jVS43P1+dC TzayAV2l/Y8CYS0lru1naZ2T32pot38= X-MC-Unique: rlh1Ib8NOg2P1CJOya55vA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695375096; x=1695979896; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rS1CupBJrFupvgmVw9AdBeqh97yjhKlttsdxSozUwO8=; b=ikXq4H1oXOqxvH2CE/hz1BtOGdu55uePTw+ExYFY5o4ELOfinLyfjRr7paPEybuxrF 4RjHWTMYKW9fMBX5vd42SYUGUk0xrLbt/oTcWIsp8NnGb3GwGm26AqRt1aZ+3KpNd6m+ //0muahx1GMKuMOYNFRRHs7971pgCa4zk1eWG9IWwHsFT8XFajKrPd6Bx64qs5e6sd1D mG5EkvGHC+ROzrUAytGrDrILsz7Nq2NIb8u3/MDI8LF1BNM+kIFB6hbwVDQ3BJmJL2bX TJb0ihg50wV4nkcG9MvRMKf8KugS02S6iRActYPLgyZPqBheJhQdCsnM5YW6rGGkik+p XTew== X-Gm-Message-State: AOJu0YzbRo9SPr1aLQEkuyYSsl12SVDMPbFg39l6OzF0Qw66oTdIVvLZ KlN8D5cUrz+gIaEdcigvhk37vclb5swAhd+NB3TDfIxtdI+jYjP6CpQGLiCcGbha8pD9rNcURgA lZZnghc0bz8yrrZLSGdS7jdnYk3+30o9Uw3Xe2c2pgLBZ+FDcuC/50AUZ/DueDnJvqz7VZ8V0u4 E= X-Received: by 2002:a05:6512:360a:b0:503:385c:4319 with SMTP id f10-20020a056512360a00b00503385c4319mr7388948lfs.19.1695375095967; Fri, 22 Sep 2023 02:31:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFJoDhGrq6QIjhXA0ZbpSvui1ZKAHRX3LFqgR1bpEGAc+VLFiHFYhEkapEm1pNpusXgoaKPGQ== X-Received: by 2002:a05:6512:360a:b0:503:385c:4319 with SMTP id f10-20020a056512360a00b00503385c4319mr7388930lfs.19.1695375095567; Fri, 22 Sep 2023 02:31:35 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Martin Kletzander , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Subject: [PULL 05/12] hw/input/tsc210x: Extract common init code into new function Date: Fri, 22 Sep 2023 11:31:18 +0200 Message-ID: <20230922093126.264016-6-pbonzini@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230922093126.264016-1-pbonzini@redhat.com> References: <20230922093126.264016-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1695375185083100003 From: Martin Kletzander This deduplicates several lines and will make future changes more concise. Signed-off-by: Martin Kletzander Reviewed-by: Daniel P. Berrang=C3=A9 Message-ID: <1d75877cf4cc2a38f87633ff16f9fea3e1bb0c03.1650874791.git.mkletz= an@redhat.com> Signed-off-by: Paolo Bonzini --- hw/input/tsc210x.c | 68 ++++++++++++++++------------------------------ 1 file changed, 24 insertions(+), 44 deletions(-) diff --git a/hw/input/tsc210x.c b/hw/input/tsc210x.c index 7eae5989f76..f568759e05a 100644 --- a/hw/input/tsc210x.c +++ b/hw/input/tsc210x.c @@ -30,6 +30,7 @@ #include "hw/input/tsc2xxx.h" #include "hw/irq.h" #include "migration/vmstate.h" +#include "qapi/error.h" =20 #define TSC_DATA_REGISTERS_PAGE 0x0 #define TSC_CONTROL_REGISTERS_PAGE 0x1 @@ -1069,20 +1070,10 @@ static const VMStateDescription vmstate_tsc2301 =3D= { .fields =3D vmstatefields_tsc210x, }; =20 -uWireSlave *tsc2102_init(qemu_irq pint) +static void tsc210x_init(TSC210xState *s, + const char *name, + const VMStateDescription *vmsd) { - TSC210xState *s; - - s =3D g_new0(TSC210xState, 1); - s->x =3D 160; - s->y =3D 160; - s->pressure =3D 0; - s->precision =3D s->nextprecision =3D 0; - s->timer =3D timer_new_ns(QEMU_CLOCK_VIRTUAL, tsc210x_timer_tick, s); - s->pint =3D pint; - s->model =3D 0x2102; - s->name =3D "tsc2102"; - s->tr[0] =3D 0; s->tr[1] =3D 1; s->tr[2] =3D 1; @@ -1104,13 +1095,29 @@ uWireSlave *tsc2102_init(qemu_irq pint) =20 tsc210x_reset(s); =20 - qemu_add_mouse_event_handler(tsc210x_touchscreen_event, s, 1, - "QEMU TSC2102-driven Touchscreen"); + qemu_add_mouse_event_handler(tsc210x_touchscreen_event, s, 1, name); =20 AUD_register_card(s->name, &s->card); =20 qemu_register_reset((void *) tsc210x_reset, s); - vmstate_register(NULL, 0, &vmstate_tsc2102, s); + vmstate_register(NULL, 0, vmsd, s); +} + +uWireSlave *tsc2102_init(qemu_irq pint) +{ + TSC210xState *s; + + s =3D g_new0(TSC210xState, 1); + s->x =3D 160; + s->y =3D 160; + s->pressure =3D 0; + s->precision =3D s->nextprecision =3D 0; + s->timer =3D timer_new_ns(QEMU_CLOCK_VIRTUAL, tsc210x_timer_tick, s); + s->pint =3D pint; + s->model =3D 0x2102; + s->name =3D "tsc2102"; + + tsc210x_init(s, "QEMU TSC2102-driven Touchscreen", &vmstate_tsc2102); =20 return &s->chip; } @@ -1131,34 +1138,7 @@ uWireSlave *tsc2301_init(qemu_irq penirq, qemu_irq k= birq, qemu_irq dav) s->model =3D 0x2301; s->name =3D "tsc2301"; =20 - s->tr[0] =3D 0; - s->tr[1] =3D 1; - s->tr[2] =3D 1; - s->tr[3] =3D 0; - s->tr[4] =3D 1; - s->tr[5] =3D 0; - s->tr[6] =3D 1; - s->tr[7] =3D 0; - - s->chip.opaque =3D s; - s->chip.send =3D (void *) tsc210x_write; - s->chip.receive =3D (void *) tsc210x_read; - - s->codec.opaque =3D s; - s->codec.tx_swallow =3D (void *) tsc210x_i2s_swallow; - s->codec.set_rate =3D (void *) tsc210x_i2s_set_rate; - s->codec.in.fifo =3D s->in_fifo; - s->codec.out.fifo =3D s->out_fifo; - - tsc210x_reset(s); - - qemu_add_mouse_event_handler(tsc210x_touchscreen_event, s, 1, - "QEMU TSC2301-driven Touchscreen"); - - AUD_register_card(s->name, &s->card); - - qemu_register_reset((void *) tsc210x_reset, s); - vmstate_register(NULL, 0, &vmstate_tsc2301, s); + tsc210x_init(s, "QEMU TSC2301-driven Touchscreen", &vmstate_tsc2301); =20 return &s->chip; } --=20 2.41.0 From nobody Wed May 15 06:24:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695375183; cv=none; d=zohomail.com; s=zohoarc; b=YB5NUlYjeV3G3fUPUvdSi+AuUPRLyDhbMZL8WkPJMLBxTjOQxMJQQXbLbCbKN2DeIzncdNr8CnhVMojsUxj7c4hqMcu3ioC1bzaZ3Z4JdmTk/Vg7jRLUdDG334PgHElIIbXUdrEBLx5ip6zcp/athKSzlWwws4B8V56XT5duCJc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695375183; 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=oCqi2uuZUZBw1/6wR9LkzHBSEz7KGdquiO19QA3ceY4=; b=KlRCoZPGb8M8zHahk4dR/SEK+gYaefb8MBFtVhqRsT23eNSZqTZNRAlCoqKzMcdD/5GgFjhxCFQF4BYqc44qEjx7pbt0yxb9nh95z5pRYQ4eiQxG+TY7yglKekq7MbcTfC/Jaf8oxr5GqfsostdpLgoA3PQPZma2F8rUlAAwUYQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695375183554574.0140709235762; Fri, 22 Sep 2023 02:33:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qjcVx-0004n5-O1; Fri, 22 Sep 2023 05:31:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjcVk-0004j9-Mp for qemu-devel@nongnu.org; Fri, 22 Sep 2023 05:31:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjcVj-0003NL-40 for qemu-devel@nongnu.org; Fri, 22 Sep 2023 05:31:44 -0400 Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-453-RC_G-nciO5a968FdfXRGiw-1; Fri, 22 Sep 2023 05:31:40 -0400 Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-50335ee6011so2459811e87.0 for ; Fri, 22 Sep 2023 02:31:40 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e]) by smtp.gmail.com with ESMTPSA id n3-20020a05600c3b8300b004053a6b8c41sm2296672wms.12.2023.09.22.02.31.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 02:31:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695375102; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oCqi2uuZUZBw1/6wR9LkzHBSEz7KGdquiO19QA3ceY4=; b=Av1MLUI1GHSFVzQoJ/xjsg3fwjcXz0Xv1iws0+eansYkucsLztoeFUGB6xq2Q/lRRzeOSW VRrMs2ckfnGd2MF81YgmXc+9FmS07JrCJ0lPDI198oJkdGUtP5hQY1p5tBAx//GX0jNEjf FK024AjvyfyeTJd45uCBwN6EOti4EIU= X-MC-Unique: RC_G-nciO5a968FdfXRGiw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695375098; x=1695979898; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oCqi2uuZUZBw1/6wR9LkzHBSEz7KGdquiO19QA3ceY4=; b=ln/d/I1QUG7mCgibFBpaNYLZqbc9BAcap2f4e+iSxmyDbRcJKEiJcOiMXjh3wMqwzU 5vpqKaQpCtt20B0fQ9l4CEHmArs7ymKeIvXaBNfpVEZe8qy2FxYeJZrMZn4ogVgFjWnl NJimm0eE1PA6AlwoJpcX7+BNwrNzsYb2ywl6Lqb60EPAe0rCk8BFE9tzie/5JEGRj1pS JixOtF5J4aW02HObDrWSO8s1iR22DGUt2RpjkAdyZ+vzCFkgieKQT2/RlW8sqVuVEdwV vWkTY5ts3maNo9hYrJsTSeCWhGcRnK/gdvxmQGFf/cTuozpz7QOqrvFwPogJmdK78ZkW 9ycQ== X-Gm-Message-State: AOJu0YxTegZQSRecxrCBDFJ2H90koWcQ7Q+XDvXyduj+QWZOOgUy18vw 5I7VbBU6xfHT6xaAWvu9AJ6Mkfu2UsvyFhTIOfLRcMAmVOIDkczWn1e+ISqE302NLV4wQNqQckF iZm6HpPfXDmIg51b3dwHgsuWVWhKqtkO8WOTKHUeFk4X/ONcqulOWfUcBR3o90ns/XSpEZJhaPB M= X-Received: by 2002:a19:7009:0:b0:503:264b:efc9 with SMTP id h9-20020a197009000000b00503264befc9mr6844876lfc.18.1695375098326; Fri, 22 Sep 2023 02:31:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGS6i44BYmyiaCRl1AKme9uQoW8Y4AVvBIednpB1OnC4J7WLmz3HZexozFQHkTWue/AkaFrmA== X-Received: by 2002:a19:7009:0:b0:503:264b:efc9 with SMTP id h9-20020a197009000000b00503264befc9mr6844856lfc.18.1695375097823; Fri, 22 Sep 2023 02:31:37 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Martin Kletzander , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Subject: [PULL 06/12] hw/audio: Simplify hda audio init Date: Fri, 22 Sep 2023 11:31:19 +0200 Message-ID: <20230922093126.264016-7-pbonzini@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230922093126.264016-1-pbonzini@redhat.com> References: <20230922093126.264016-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1695375185516100006 From: Martin Kletzander No return values are used anywhere, so switch the functions to be void and add support for error reporting using errp for use in next patches. Signed-off-by: Martin Kletzander Reviewed-by: Daniel P. Berrang=C3=A9 Message-ID: Signed-off-by: Paolo Bonzini --- hw/audio/hda-codec.c | 32 ++++++++++++++++++-------------- hw/audio/intel-hda.c | 4 +--- hw/audio/intel-hda.h | 2 +- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c index c51d8ba6177..a26048cf15e 100644 --- a/hw/audio/hda-codec.c +++ b/hw/audio/hda-codec.c @@ -675,7 +675,9 @@ static void hda_audio_stream(HDACodecDevice *hda, uint3= 2_t stnr, bool running, b } } =20 -static int hda_audio_init(HDACodecDevice *hda, const struct desc_codec *de= sc) +static void hda_audio_init(HDACodecDevice *hda, + const struct desc_codec *desc, + Error **errp) { HDAAudioState *a =3D HDA_AUDIO(hda); HDAAudioStream *st; @@ -718,7 +720,6 @@ static int hda_audio_init(HDACodecDevice *hda, const st= ruct desc_codec *desc) break; } } - return 0; } =20 static void hda_audio_exit(HDACodecDevice *hda) @@ -848,37 +849,40 @@ static Property hda_audio_properties[] =3D { DEFINE_PROP_END_OF_LIST(), }; =20 -static int hda_audio_init_output(HDACodecDevice *hda) +static void hda_audio_init_output(HDACodecDevice *hda, Error **errp) { HDAAudioState *a =3D HDA_AUDIO(hda); + const struct desc_codec *desc =3D &output_nomixemu; =20 if (!a->mixer) { - return hda_audio_init(hda, &output_nomixemu); - } else { - return hda_audio_init(hda, &output_mixemu); + desc =3D &output_mixemu; } + + hda_audio_init(hda, desc, errp); } =20 -static int hda_audio_init_duplex(HDACodecDevice *hda) +static void hda_audio_init_duplex(HDACodecDevice *hda, Error **errp) { HDAAudioState *a =3D HDA_AUDIO(hda); + const struct desc_codec *desc =3D &duplex_nomixemu; =20 if (!a->mixer) { - return hda_audio_init(hda, &duplex_nomixemu); - } else { - return hda_audio_init(hda, &duplex_mixemu); + desc =3D &duplex_mixemu; } + + hda_audio_init(hda, desc, errp); } =20 -static int hda_audio_init_micro(HDACodecDevice *hda) +static void hda_audio_init_micro(HDACodecDevice *hda, Error **errp) { HDAAudioState *a =3D HDA_AUDIO(hda); + const struct desc_codec *desc =3D µ_nomixemu; =20 if (!a->mixer) { - return hda_audio_init(hda, µ_nomixemu); - } else { - return hda_audio_init(hda, µ_mixemu); + desc =3D µ_mixemu; } + + hda_audio_init(hda, desc, errp); } =20 static void hda_audio_base_class_init(ObjectClass *klass, void *data) diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c index b9ed231fe84..78ff9f9a680 100644 --- a/hw/audio/intel-hda.c +++ b/hw/audio/intel-hda.c @@ -71,9 +71,7 @@ static void hda_codec_dev_realize(DeviceState *qdev, Erro= r **errp) return; } bus->next_cad =3D dev->cad + 1; - if (cdc->init(dev) !=3D 0) { - error_setg(errp, "HDA audio init failed"); - } + cdc->init(dev, errp); } =20 static void hda_codec_dev_unrealize(DeviceState *qdev) diff --git a/hw/audio/intel-hda.h b/hw/audio/intel-hda.h index f78c1833e34..8d710eee5d6 100644 --- a/hw/audio/intel-hda.h +++ b/hw/audio/intel-hda.h @@ -31,7 +31,7 @@ struct HDACodecBus { struct HDACodecDeviceClass { DeviceClass parent_class; =20 - int (*init)(HDACodecDevice *dev); + void (*init)(HDACodecDevice *dev, Error **errp); void (*exit)(HDACodecDevice *dev); void (*command)(HDACodecDevice *dev, uint32_t nid, uint32_t data); void (*stream)(HDACodecDevice *dev, uint32_t stnr, bool running, bool = output); --=20 2.41.0 From nobody Wed May 15 06:24:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695375177; cv=none; d=zohomail.com; s=zohoarc; b=bWci5bItoxGUkhpbn+9VZbIuqMGEvAmnrz9zubvdK6vA4xrakusZMg6u3zEqj20ospgJ96exskUl+aB8vBJui23UZBKomrTMpKlMfz27cn2Uo8lVJ6J8OwXKoYShKFnMx9vKkjo93BtUXkQuv6dT/1rFvzW4B56oaPu6fOFyCTU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695375177; 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=IqGt2fPfgTyHEp6DMIYvMCh4gKwvp12ld6099wBQ+mY=; b=RQDxUusOzVNqtfUNlcnIfgnLkI/crEmx/le5sClK6tYv/R6vU+unLGToCMsc3bmVqCRaMU834a7kkFod6oJ2QDeCc/0QBBuxNomluOOkyDepuUrjIYHMkIlegISacTy93HgtUf/00/aMEahjbKdjLdp23D2s33m719fNy3Z62Js= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695375177611137.72072805899109; Fri, 22 Sep 2023 02:32:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qjcVw-0004mx-UQ; Fri, 22 Sep 2023 05:31:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjcVn-0004jW-GE for qemu-devel@nongnu.org; Fri, 22 Sep 2023 05:31:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjcVk-0003NZ-F2 for qemu-devel@nongnu.org; Fri, 22 Sep 2023 05:31:46 -0400 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-574-1bb12S-INJCXMb8wv-agUA-1; Fri, 22 Sep 2023 05:31:42 -0400 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-3f5df65f9f4so15137625e9.2 for ; Fri, 22 Sep 2023 02:31:42 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e]) by smtp.gmail.com with ESMTPSA id f15-20020adff98f000000b0031ae8d86af4sm3935079wrr.103.2023.09.22.02.31.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 02:31:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695375103; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IqGt2fPfgTyHEp6DMIYvMCh4gKwvp12ld6099wBQ+mY=; b=bl9Hg6q0tIcSZYaGIS0mEJwyOAbgWSkk2CRViPP9GGwPwdW+TAJJLi55NFfpLoxKVDoCuI 2IQWR3SFegqh+PqqIrjKZ4wy0F2RNw3zr1XQbtZqiUqAjOwbZ/jmRz2KSC1Ox+MNKkcTv0 mGs+WR6Qs0RfwX6M9Nuk+JeJBd/93JY= X-MC-Unique: 1bb12S-INJCXMb8wv-agUA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695375100; x=1695979900; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IqGt2fPfgTyHEp6DMIYvMCh4gKwvp12ld6099wBQ+mY=; b=ImaAA7QaeSCtWRjnTmX1Cu16EoiHYBM8tdtednr8Ei32FmEZGU1+Vp7NWJ4oFUhvqF xcK8r50OaKFqKaDYHN+8IRMOIFmaFY/hgLtfho9OLUi3qvL3NZxfHxuuQtfvNk7jg29N HuN+6MzSeq9YiV4qNHFpSeLp8VtZUKxApT2bn2jJCK67HJlIQFkIBrEDqvzsWc3BITI+ bCHaOdSMQVAafy75C9xUz9a2RLOGF+EajQnPHZwpSxepUU7WRzxDHVwh4bJegSTVzk/q guUyYf8X6w6nBaPvTsatWeg/+w+j4xdRgyWQQFXr3Aw8Xyd4BTVGiW1we6SXivyJf1b5 RGsA== X-Gm-Message-State: AOJu0YziZbOYd//MBo8WMEz3ILkh0SQuz24ceVJdHWqcu2VbqGJ+1HBQ OZFOYke0k2+9qzNZ4Qz9YZUYlpS8fS3d2TlEbNiWfkdgCbXHwRcIXXXcc7s0ASxNG2rw0I0IY7T EWyJSxPhkKVpwcKRnCYnPIZ76uEQLJIfLJ05HxuEPEq2T87aTTzGfCAEo3LaFwAN8l3dzt3RO75 s= X-Received: by 2002:a05:600c:b46:b0:3fe:dcd0:2e32 with SMTP id k6-20020a05600c0b4600b003fedcd02e32mr8377991wmr.19.1695375100344; Fri, 22 Sep 2023 02:31:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHIVAi7tQwrTEgWXUrHuDYRrTBkQ7r11xeQPtIL95FGD0ojNhmsoed0AB0hSgpg6a9CTjRGgQ== X-Received: by 2002:a05:600c:b46:b0:3fe:dcd0:2e32 with SMTP id k6-20020a05600c0b4600b003fedcd02e32mr8377980wmr.19.1695375100085; Fri, 22 Sep 2023 02:31:40 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Martin Kletzander , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Subject: [PULL 07/12] hw/audio/lm4549: Add errp error reporting to init function Date: Fri, 22 Sep 2023 11:31:20 +0200 Message-ID: <20230922093126.264016-8-pbonzini@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230922093126.264016-1-pbonzini@redhat.com> References: <20230922093126.264016-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1695375179245100004 From: Martin Kletzander This will be used in future commit. Signed-off-by: Martin Kletzander Reviewed-by: Daniel P. Berrang=C3=A9 Message-ID: Signed-off-by: Paolo Bonzini --- hw/audio/lm4549.c | 3 ++- hw/audio/lm4549.h | 3 ++- hw/audio/pl041.c | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/audio/lm4549.c b/hw/audio/lm4549.c index 32b1481b561..418041bc9c6 100644 --- a/hw/audio/lm4549.c +++ b/hw/audio/lm4549.c @@ -276,7 +276,8 @@ static int lm4549_post_load(void *opaque, int version_i= d) return 0; } =20 -void lm4549_init(lm4549_state *s, lm4549_callback data_req_cb, void* opaqu= e) +void lm4549_init(lm4549_state *s, lm4549_callback data_req_cb, void* opaqu= e, + Error **errp) { struct audsettings as; =20 diff --git a/hw/audio/lm4549.h b/hw/audio/lm4549.h index aba9bb5b077..61c3ab12dd3 100644 --- a/hw/audio/lm4549.h +++ b/hw/audio/lm4549.h @@ -36,7 +36,8 @@ typedef struct { extern const VMStateDescription vmstate_lm4549_state; =20 =20 -void lm4549_init(lm4549_state *s, lm4549_callback data_req, void *opaque); +void lm4549_init(lm4549_state *s, lm4549_callback data_req, void *opaque, + Error **errp); uint32_t lm4549_read(lm4549_state *s, hwaddr offset); void lm4549_write(lm4549_state *s, hwaddr offset, uint32_t value); uint32_t lm4549_write_samples(lm4549_state *s, uint32_t left, uint32_t rig= ht); diff --git a/hw/audio/pl041.c b/hw/audio/pl041.c index 03acd4fe344..868dffbfd32 100644 --- a/hw/audio/pl041.c +++ b/hw/audio/pl041.c @@ -564,7 +564,7 @@ static void pl041_realize(DeviceState *dev, Error **err= p) } =20 /* Init the codec */ - lm4549_init(&s->codec, &pl041_request_data, (void *)s); + lm4549_init(&s->codec, &pl041_request_data, (void *)s, errp); } =20 static const VMStateDescription vmstate_pl041_regfile =3D { --=20 2.41.0 From nobody Wed May 15 06:24:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695375197; cv=none; d=zohomail.com; s=zohoarc; b=QzngJWTo66SdVznJ579a8in2z1Gws3SuVmlS+H/pVzL4H6e62V4dxbeGokKjeNnPE3eXHpqLpB1KY4ba/j4/4cSBUWt2+y1XQrUZE0vv6QeOShEZk+Zxl/e1zTuYPIrlXZRtmd2xCcC2zFznUJed3JdhtfZgmziMn5pYWr1fqS8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695375197; 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=g4aZIa2PSQ4iemAt8feI7jH/a2bDufHqmAyu5oMZZBw=; b=atshXMwB6AJX2cqXEUF27aEdR5ZNgtgY+oZskyjx2Xo4Cpo5zqcmyCiStHbeNMVXJPo7O6FVrjxclfN4WVEkfrITJjaAkg0mL5b6gmOxKCDvWGmvvNpAU2D4ntdieQkBxNiVQ2CBaYV2ZL7FwGNfaznhSREeOXqiKe3QV2rcyjM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695375197424720.466489520962; Fri, 22 Sep 2023 02:33:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qjcVy-0004nw-Iq; Fri, 22 Sep 2023 05:31:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjcVp-0004lk-Ct for qemu-devel@nongnu.org; Fri, 22 Sep 2023 05:31:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjcVn-0003Nq-92 for qemu-devel@nongnu.org; Fri, 22 Sep 2023 05:31:48 -0400 Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-3-Ow_j-ZOqPxqhUHwnNZN7yA-1; Fri, 22 Sep 2023 05:31:44 -0400 Received: by mail-lf1-f69.google.com with SMTP id 2adb3069b0e04-5033420dd31so2367058e87.1 for ; Fri, 22 Sep 2023 02:31:43 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e]) by smtp.gmail.com with ESMTPSA id n3-20020a05600c464300b0040536dcec17sm3394150wmo.27.2023.09.22.02.31.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 02:31:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695375106; h=from:from: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; bh=g4aZIa2PSQ4iemAt8feI7jH/a2bDufHqmAyu5oMZZBw=; b=VGZPgvpMlB9CVraeRPqfV6ZfWIAmyswUMSm4HEpmY6pDZO9LfdLMp7FHjrJefMulda31J1 fFnAX4lUdy2AfFEjQgUqm8SVueSz87VCl3HEkkRHX3plG/J2pIIfIJ5YvJAy2IiQwCcYOa 0ue3mIlil1cuk3h67sDWeKRCDeVsB0w= X-MC-Unique: Ow_j-ZOqPxqhUHwnNZN7yA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695375102; x=1695979902; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=g4aZIa2PSQ4iemAt8feI7jH/a2bDufHqmAyu5oMZZBw=; b=aNKrAixbVaPfBPVvMr7kHUB6A8fuXrQJnOObS4AKeOZX2niMZSUs9UC7k1/FXj4a9S h2VkEaTIrmaTOEYCKh3t1MmNkHj+0KQs7+Bop0XLrcm6ozw2h+V1Cq/b/MZQ+TGWyDd2 BdssIWkdAF8T9sz6au9N4xobwn6HxiOUIhUqDqnDyjSJMdS04uK4THX8KQ8rP/HKLaHk kh9vBOpkcnoKpM4fLLMI6jgjOtTM64wN/VBfMB9pDhwHAzBeML8jMl4hwn0PIMyJOTdm F4V7qA1U+hG0iuHK/7VNPEpGOuHsAoqaALZheQ/dpE9Xa8LOoz1JLhnmBVOLke2bshHB oj7Q== X-Gm-Message-State: AOJu0YxXeq4VwE/6UCkVb5SV3U4H11sWlW3WJyg+Yw5BzVnWOlSUxN18 1/1BYyA22jJWEvwPErdkP0u4fTt0/HKRLQH4VXDlPnphg2n5iHaf8qMZLNK6kjLI+bWEZQeq4we NbckpEXavdZPyZMdVe54Q5qJ///7V/STIlXiZwNh5Hw2W4alOtmzIosmLqlxqmvObM8saJZ6NlG o= X-Received: by 2002:a05:6512:ea1:b0:501:c3ee:62ec with SMTP id bi33-20020a0565120ea100b00501c3ee62ecmr8732246lfb.12.1695375102350; Fri, 22 Sep 2023 02:31:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGwa6TBXl2hxb4RJX8wd/lxTZYttPGiqdahERbG2RZn8rFz8ObTJxBXGny7+YremHhOlfAZcw== X-Received: by 2002:a05:6512:ea1:b0:501:c3ee:62ec with SMTP id bi33-20020a0565120ea100b00501c3ee62ecmr8732225lfb.12.1695375101955; Fri, 22 Sep 2023 02:31:41 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Martin Kletzander Subject: [PULL 08/12] hw/display/xlnx_dp.c: Add audiodev property Date: Fri, 22 Sep 2023 11:31:21 +0200 Message-ID: <20230922093126.264016-9-pbonzini@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230922093126.264016-1-pbonzini@redhat.com> References: <20230922093126.264016-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1695375199538100003 Content-Type: text/plain; charset="utf-8" From: Martin Kletzander There was no way to set this and we need that for it to be able to properly initialise. Signed-off-by: Martin Kletzander Message-ID: <16963256573fcbfa7720aa2fd000ba74a4055222.1650874791.git.mkletz= an@redhat.com> Signed-off-by: Paolo Bonzini --- hw/display/xlnx_dp.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/display/xlnx_dp.c b/hw/display/xlnx_dp.c index 43c7dd8e9cd..341e91e886f 100644 --- a/hw/display/xlnx_dp.c +++ b/hw/display/xlnx_dp.c @@ -1385,6 +1385,11 @@ static void xlnx_dp_reset(DeviceState *dev) xlnx_dp_update_irq(s); } =20 +static Property xlnx_dp_device_properties[] =3D { + DEFINE_AUDIO_PROPERTIES(XlnxDPState, aud_card), + DEFINE_PROP_END_OF_LIST(), +}; + static void xlnx_dp_class_init(ObjectClass *oc, void *data) { DeviceClass *dc =3D DEVICE_CLASS(oc); @@ -1392,6 +1397,7 @@ static void xlnx_dp_class_init(ObjectClass *oc, void = *data) dc->realize =3D xlnx_dp_realize; dc->vmsd =3D &vmstate_dp; dc->reset =3D xlnx_dp_reset; + device_class_set_props(dc, xlnx_dp_device_properties); } =20 static const TypeInfo xlnx_dp_info =3D { --=20 2.41.0 From nobody Wed May 15 06:24:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695375155; cv=none; d=zohomail.com; s=zohoarc; b=O4SXWLdBIkHIKxj3d5j6RUZJiAHDivulnZHW9hUakr9n00MHhdRA+TYmxjwwe5Dyq6AakfyT/nV9JOYXF3f4LrU9gRafYEY8hkjxx52YczHLMPwHjyFQou1s5HQtVHqawG0LcjdYp6vwopWZAu8MCAXXBOBAliCiQ2iWBYI+PKo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695375155; 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=eEsKc+d0fnRtLJHbjHGMBYA2mr0CMr95bGIl3yAmm50=; b=c0gwldcP/zGjJU7sciSAoMm6zqQ3yhmB3n70KHJP4HnLLrzi2hFvIemDSUsvMU+He7ueUscowVI2Rl+i64wgbpVcv0bztwJcinv5LtfIcjwsw8ckP6UIEKK4ENY0q8oPuftBbKME6panWwX6Qog/0jivvjJHPkORICv4mCccgME= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695375155580470.7769084592817; Fri, 22 Sep 2023 02:32:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qjcW0-0004oT-MC; Fri, 22 Sep 2023 05:32:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjcVq-0004lo-O6 for qemu-devel@nongnu.org; Fri, 22 Sep 2023 05:31:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjcVo-0003O4-FC for qemu-devel@nongnu.org; Fri, 22 Sep 2023 05:31:50 -0400 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-220-MhcBZzHbOOGKQXsfeG7RRQ-1; Fri, 22 Sep 2023 05:31:46 -0400 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-317d5b38194so229018f8f.0 for ; Fri, 22 Sep 2023 02:31:45 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e]) by smtp.gmail.com with ESMTPSA id z16-20020a056000111000b003176eab8868sm3934201wrw.82.2023.09.22.02.31.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 02:31:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695375108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eEsKc+d0fnRtLJHbjHGMBYA2mr0CMr95bGIl3yAmm50=; b=FBRD/UYElHClsQ6PyMm5QGf3uf1ZGBwz8crASAjdzPo9OtVws8OgY18xhIo11R6IbA87up Ll2f2gIYhzW0kw+9T9t47SJ9W8m2zD2dCE/LU3yhd7IuirORaPdJlIkVIPsmEaehdOyhBY YrBEmlpJKrlCif1Y8iShzdFe2oIoDD4= X-MC-Unique: MhcBZzHbOOGKQXsfeG7RRQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695375104; x=1695979904; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eEsKc+d0fnRtLJHbjHGMBYA2mr0CMr95bGIl3yAmm50=; b=PqSOU5wWTxVvfaMcWv0E+cQa26Jr1Kd02oXDf8lHTexVfuLAER61JZps95wKX3Vmkf EwizNB2ty0DnKk5CmeuwPq7UIVS/MFC7wK1dpF5Zq4pdjkNx+Zvts1VhFvIkQdyKxxKj 9/dwXhmda3edVplnLYo+l1gncgBJ1x1ybnhdMWbi0bcAtba2tVI9HkC8OhKnBZfDnwv1 hZ3deLR5eBDLYcuQsxKvrhmchUJU38WuKDmPGMcZYaoioIurCEqGiJVXQl+5msA0AO93 tix6IXgn1zn7Uzc2nnv+Rh3ZDSx7cyzOtGiza1uLjKOGeJHVcy8PL98iDZvk8+T0Uf6x duFg== X-Gm-Message-State: AOJu0YzvPXCN8kxXluL38IurYae5oiMU0uUBKiInCB/s3rs25MEV12Dp VVhr336voS33rE5Jr9EvS0BYqcCv+AegOFOhdiMQjOr+BNeRJr0UoCT/NU11k1IJ2ax+1s4e8gp XOCNEwz+ozb8AbKzKV2aF/y+0xPcICZiT1emKvYBWi3MG03vK016fT+F88jTfFTNvoISAi2vwKk o= X-Received: by 2002:adf:ef52:0:b0:31f:eb45:462e with SMTP id c18-20020adfef52000000b0031feb45462emr1400995wrp.28.1695375104292; Fri, 22 Sep 2023 02:31:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHeR5jrXWhnsMPOOKXW1BLxagC+Zy/yE9FSUT+O38G8GpLtw//HKsZGVFKKevpeUr7oZLh3+g== X-Received: by 2002:adf:ef52:0:b0:31f:eb45:462e with SMTP id c18-20020adfef52000000b0031feb45462emr1400979wrp.28.1695375103953; Fri, 22 Sep 2023 02:31:43 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Martin Kletzander , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Subject: [PULL 09/12] tests/qtest: Specify audiodev= and -audiodev Date: Fri, 22 Sep 2023 11:31:22 +0200 Message-ID: <20230922093126.264016-10-pbonzini@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230922093126.264016-1-pbonzini@redhat.com> References: <20230922093126.264016-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1695375157525100003 From: Martin Kletzander This will enable removing deprecated default audiodev support. I did not figure out how to make the audiodev represented as an interface node, so this is a workaround. I am not sure what would be the proper way. Signed-off-by: Martin Kletzander Reviewed-by: Daniel P. Berrang=C3=A9 Message-ID: <6e7f2808dd40679a415812767b88f2a411fc137f.1650874791.git.mkletz= an@redhat.com> Signed-off-by: Paolo Bonzini --- tests/qtest/es1370-test.c | 3 ++- tests/qtest/fuzz/generic_fuzz_configs.h | 6 ++++-- tests/qtest/intel-hda-test.c | 15 ++++++++++----- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/tests/qtest/es1370-test.c b/tests/qtest/es1370-test.c index 97ab65c4357..8387e74193b 100644 --- a/tests/qtest/es1370-test.c +++ b/tests/qtest/es1370-test.c @@ -46,7 +46,8 @@ static void *es1370_create(void *pci_bus, QGuestAllocator= *alloc, void *addr) static void es1370_register_nodes(void) { QOSGraphEdgeOptions opts =3D { - .extra_device_opts =3D "addr=3D04.0", + .extra_device_opts =3D "addr=3D04.0,audiodev=3Daudio0", + .before_cmd_line =3D "-audiodev driver=3Dnone,id=3Daudio0", }; add_qpci_address(&opts, &(QPCIAddress) { .devfn =3D QPCI_DEVFN(4, 0) }= ); =20 diff --git a/tests/qtest/fuzz/generic_fuzz_configs.h b/tests/qtest/fuzz/gen= eric_fuzz_configs.h index 50689da6539..4d7c8ca4ece 100644 --- a/tests/qtest/fuzz/generic_fuzz_configs.h +++ b/tests/qtest/fuzz/generic_fuzz_configs.h @@ -106,8 +106,10 @@ const generic_fuzz_config predefined_configs[] =3D { },{ .name =3D "intel-hda", .args =3D "-machine q35 -nodefaults -device intel-hda,id=3Dhda0 " - "-device hda-output,bus=3Dhda0.0 -device hda-micro,bus=3Dhda0.0 " - "-device hda-duplex,bus=3Dhda0.0", + "-audiodev driver=3Dnone,id=3Daudio0", + "-device hda-output,bus=3Dhda0.0,audiodev=3Daudio0 " + "-device hda-micro,bus=3Dhda0.0,audiodev=3Daudio0 " + "-device hda-duplex,bus=3Dhda0.0,audiodev=3Daudio0", .objects =3D "intel-hda", },{ .name =3D "ide-hd", diff --git a/tests/qtest/intel-hda-test.c b/tests/qtest/intel-hda-test.c index d4a8db6fd60..663bb6c4854 100644 --- a/tests/qtest/intel-hda-test.c +++ b/tests/qtest/intel-hda-test.c @@ -11,20 +11,24 @@ #include "libqtest-single.h" =20 #define HDA_ID "hda0" -#define CODEC_DEVICES " -device hda-output,bus=3D" HDA_ID ".0" \ - " -device hda-micro,bus=3D" HDA_ID ".0" \ - " -device hda-duplex,bus=3D" HDA_ID ".0" +#define AUDIODEV " -audiodev driver=3Dnone,id=3Daudio0 " +#define AUDIODEV_REF "audiodev=3Daudio0" +#define CODEC_DEVICES " -device hda-output,bus=3D" HDA_ID ".0," AUDIODEV_R= EF \ + " -device hda-micro,bus=3D" HDA_ID ".0," AUDIODEV_RE= F \ + " -device hda-duplex,bus=3D" HDA_ID ".0," AUDIODEV_R= EF =20 /* Tests only initialization so far. TODO: Replace with functional tests */ static void ich6_test(void) { - qtest_start("-machine pc -device intel-hda,id=3D" HDA_ID CODEC_DEVICES= ); + qtest_start(AUDIODEV "-machine pc -device intel-hda,id=3D" HDA_ID CODE= C_DEVICES); qtest_end(); } =20 static void ich9_test(void) { - qtest_start("-machine q35 -device ich9-intel-hda,bus=3Dpcie.0,addr=3D1= b.0,id=3D" + qtest_start("-machine q35" + AUDIODEV + "-device ich9-intel-hda,bus=3Dpcie.0,addr=3D1b.0,id=3D" HDA_ID CODEC_DEVICES); qtest_end(); } @@ -39,6 +43,7 @@ static void test_issue542_ich6(void) QTestState *s; =20 s =3D qtest_init("-nographic -nodefaults -M pc-q35-6.2 " + AUDIODEV "-device intel-hda,id=3D" HDA_ID CODEC_DEVICES); =20 qtest_outl(s, 0xcf8, 0x80000804); --=20 2.41.0 From nobody Wed May 15 06:24:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695375245; cv=none; d=zohomail.com; s=zohoarc; b=S7JY7Mc0ESvnM53o1UnSfueX+HumkRRBx9gHmdvnJnFcmddb9enOGZ0YbHq5Gd1AnUyF5qfnIglZLtuXDCsE1quyv+F//6Sx3Byj/j63bTYOTbF0uTYBJeSxISRoHM95vewpocaGYhQkkyUHfZ6WXTAPTcFZx3hxGWroFt30+JI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695375245; 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=ar0m0LYk0/QKhifyFZnoChpcwJhKJrH0sWIs/crkluE=; b=Kk9xA6wHohnffzGrbbR7FOj+wxy1WQAcyRpJuA1fKf3tHJcQb1OKtwnwRX2TSH6ShmqyzPFxfujnhLdr1RLM8fHI0+NnhGhaXu7zxRvB4aawx3wsV8b6HngwNCy2I3kcpYzoCWZoQN+IIRGj9ifILaC0VuqunjRPd2/S7IQWqr8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695375245742607.3894465333726; Fri, 22 Sep 2023 02:34:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qjcVx-0004n7-Oc; Fri, 22 Sep 2023 05:31:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjcVr-0004lq-Ue for qemu-devel@nongnu.org; Fri, 22 Sep 2023 05:31:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjcVp-0003OP-Rq for qemu-devel@nongnu.org; Fri, 22 Sep 2023 05:31:51 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-664-oDDbCxEyOPaCNaiGirX8tg-1; Fri, 22 Sep 2023 05:31:48 -0400 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-3f41a04a297so13969455e9.3 for ; Fri, 22 Sep 2023 02:31:47 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e]) by smtp.gmail.com with ESMTPSA id p2-20020a5d68c2000000b0031431fb40fasm3976378wrw.89.2023.09.22.02.31.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 02:31:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695375109; h=from:from: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; bh=ar0m0LYk0/QKhifyFZnoChpcwJhKJrH0sWIs/crkluE=; b=eykTbD5tqla0SVga2wtyjLpGPd6fhd3YMhryzjwyITVQuDnFQ7oKHKYXT9zNXELxbK6IPz N7AcsE+xHWn6m8zADD+/A0CwZCsCVgItQeuvVjcfUZ8X4upMBx4ereHsMifhxoLJtxPlGL KPixXPLWxLfETpOrARDp0ZcJcZnL2eU= X-MC-Unique: oDDbCxEyOPaCNaiGirX8tg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695375106; x=1695979906; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ar0m0LYk0/QKhifyFZnoChpcwJhKJrH0sWIs/crkluE=; b=gpneGQs3wUdkAjmnTNKTVKaxraSbDXvzZYLyYrSctDI8pNIgda1/Qrcftm5lz33c6A LvVZO4JK7AwXIUV7q5s4LSD+CoIuu20nEq5nKYS8zOPS8KRj52XgKvcLajFDs5EsuhnX CXWV4LRx2XxkPG4326RPnDV3gREuIKbfQVvordbK9BnIqC+neXDFfbKLlsFLE+pqcPId xTAz0nxy2w2QUARm1/IP9EU9YQZHq8Z5tVm5xn02mQmB1YNlmkWLbg0zDEZ8rtODoGb1 O1e0Q0rKRgsY4PwHQb7SYxjLV2qXsuN2uyaW+mNtWstX91sdi4HkLPqyWe2OdiOPk/6C 4whg== X-Gm-Message-State: AOJu0Yy5awM292kaHH1zQnJmlpwQUpC9YqYJcSZXNiUZORi4eZPvFgIb W675GCoabIAOarrKLNAvlP41kQRKfRX6uWVZArGzllkmWJ8K3lR/VPPRRICEQgB0SdueJBSSqXs Fnc5pVLneklf9FimHUa8hXubRo9yvACFPUMwRRwOihhtEewex0ZLialTggXhQs0IUVvEsAM51hP 0= X-Received: by 2002:a05:6000:224:b0:322:da1f:60d9 with SMTP id l4-20020a056000022400b00322da1f60d9mr1693332wrz.47.1695375106276; Fri, 22 Sep 2023 02:31:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGd8osFA3j/Z8aGy1b6/HOQ/j7iFYl3opu8OAEcF4n3rzi6JrQ+tlJGZwc8yOOf0WzJEBScGg== X-Received: by 2002:a05:6000:224:b0:322:da1f:60d9 with SMTP id l4-20020a056000022400b00322da1f60d9mr1693318wrz.47.1695375105953; Fri, 22 Sep 2023 02:31:45 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Martin Kletzander Subject: [PULL 10/12] audio/spiceaudio: Fail initialisation when not using spice Date: Fri, 22 Sep 2023 11:31:23 +0200 Message-ID: <20230922093126.264016-11-pbonzini@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230922093126.264016-1-pbonzini@redhat.com> References: <20230922093126.264016-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1695375246503100001 Content-Type: text/plain; charset="utf-8" From: Martin Kletzander The caller would already fail, but this way the message can better express the reason for the failure. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D2043498 Signed-off-by: Martin Kletzander Message-ID: <5db1fdef0330f20ed6ae306b5a71dad1b5e9b44c.1650874791.git.mkletz= an@redhat.com> Signed-off-by: Paolo Bonzini --- audio/spiceaudio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/audio/spiceaudio.c b/audio/spiceaudio.c index d17ef1a25ef..af9bd7d54c9 100644 --- a/audio/spiceaudio.c +++ b/audio/spiceaudio.c @@ -74,8 +74,9 @@ static const SpiceRecordInterface record_sif =3D { static void *spice_audio_init(Audiodev *dev) { if (!using_spice) { - return NULL; + error_setg(&error_fatal, "Cannot use spice audio without -spice"); } + return &spice_audio_init; } =20 --=20 2.41.0 From nobody Wed May 15 06:24:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695375159; cv=none; d=zohomail.com; s=zohoarc; b=VB8rxYgGgwAAmaybs7Y25jblUhb6qFyVYWOr+jpAMp9Y2oNh4hm8L1cTUdoPtD+pUvtX1TUAAeKBs9XtuksaG6AphJIlKAcXdkpJ9++uxQR2zvXDH/rW5kjYONNE+b8WMSZ2xWZ0dqD60UbaZ3iYgIHmhgsHOkQG222fiHq8Bqw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695375159; 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=wHGnTNyq5XgSc0eYIq2gK8em2cLFaeZOxfGizLjP/Ko=; b=Hc3pxZI0hV4tZGa0idRFIlyShmOUXBdMemKjDM3yV1JfSRUpqnldygaAUim43SzUumL8m7xjo15TBeI7JbzwCegjJRe/LLXuUF4g/CS1byc61HXLDp4HMAA4jBe18UHSNklJ9hJ3Ou9K7sezrim4apW8nPhNfImrnv2QDHSIWfI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695375159945718.5795258023703; Fri, 22 Sep 2023 02:32:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qjcVx-0004nA-Uw; Fri, 22 Sep 2023 05:31:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjcVv-0004lx-2w for qemu-devel@nongnu.org; Fri, 22 Sep 2023 05:31:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjcVr-0003Oj-SB for qemu-devel@nongnu.org; Fri, 22 Sep 2023 05:31:53 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-107-Np_830xuMv-pL90EwqzXAw-1; Fri, 22 Sep 2023 05:31:49 -0400 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-401c19fc097so14914425e9.1 for ; Fri, 22 Sep 2023 02:31:49 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e]) by smtp.gmail.com with ESMTPSA id d8-20020a056000114800b0031fe0576460sm3981624wrx.11.2023.09.22.02.31.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 02:31:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695375111; h=from:from: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; bh=wHGnTNyq5XgSc0eYIq2gK8em2cLFaeZOxfGizLjP/Ko=; b=GzOPjlQVAJsZymTsFW3jjSXK30rRE5p5Zw0pybzJ0XES9NT+BTszJGf+ZfDrxSeBqdOlD/ cg2FiWLx/iaUk5XjoK6Qj6SR7ZYwhYpw6dBwfC8Y+ejM7VNUqF5EnJD1KkAQIT7DrtF3Km ceTTfXUkgbA2m7/2Il2mW2Yu6GjulXM= X-MC-Unique: Np_830xuMv-pL90EwqzXAw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695375108; x=1695979908; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wHGnTNyq5XgSc0eYIq2gK8em2cLFaeZOxfGizLjP/Ko=; b=BYXO+4rop/aUcmAAf5WXxGdkKohw7AziJugOsC3T3jtKDqss1yckzlrTs8uuoQPjFM +Mzsf4aifSIyQsm+e08BA7FYhoZiHsKcDJgL8D04qGK1AWm2Cvbp/SCPkDfmm+yrW0UO 0Fi/YVQTIU2687fnxmUSxMmQBNmEA8Ve5Zis3bgnSCY5kDDXsp5tHbEPIysyhY/VgTa0 Q7d0hSWa+Ca20wzWNhz0w7Y2/uNStZcU1KN02AbSPxH4eT3q6ZUT7kJGCy4oLia0/hn2 g4erjzmBONLFhGo2ocOEd436rhoqHc6FSaPcwZS8IFf8kpABasqDuYfPKZ8Cuax1q8Tu ZXDA== X-Gm-Message-State: AOJu0YzhvgXCDffP3qN6nYzmCLuTw3tvlnRCKdMUH2qrbFsta+jG7FvO FeNW/+DC6OWWbJeaJZj9hP74+3l/dS3AksgUpw67027jV/7Rkv125dY0uQeUjfgQ4Yr0Rg0B/El G3kSks6pfVi4pbPZHecQFMhQdpI+Pl0cHqx4upJtNF9Rv5PNCfBGtFke91Ythom4hgues4pjAQd Q= X-Received: by 2002:a1c:7404:0:b0:3fe:1b4e:c484 with SMTP id p4-20020a1c7404000000b003fe1b4ec484mr7533553wmc.5.1695375108119; Fri, 22 Sep 2023 02:31:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFlUZQRmF3a2AeX+5yqmH/TvV9/HPl4enjNxqA8PBzZVYBwhm6espJ+WsxHu8WstlFji/go9A== X-Received: by 2002:a1c:7404:0:b0:3fe:1b4e:c484 with SMTP id p4-20020a1c7404000000b003fe1b4ec484mr7533539wmc.5.1695375107749; Fri, 22 Sep 2023 02:31:47 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Martin Kletzander Subject: [PULL 11/12] ui/vnc: Require audiodev= to enable audio Date: Fri, 22 Sep 2023 11:31:24 +0200 Message-ID: <20230922093126.264016-12-pbonzini@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230922093126.264016-1-pbonzini@redhat.com> References: <20230922093126.264016-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1695375161723100003 Content-Type: text/plain; charset="utf-8" From: Martin Kletzander Signed-off-by: Martin Kletzander Message-ID: Signed-off-by: Paolo Bonzini --- docs/about/deprecated.rst | 8 +++----- docs/about/removed-features.rst | 6 ++++++ ui/vnc.c | 10 ++++++++-- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index b9cdd2dd03b..40845b3fcb7 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -37,13 +37,11 @@ coverage. System emulator command line arguments -------------------------------------- =20 -Creating sound card devices and vnc without ``audiodev=3D`` property (sinc= e 4.2) -''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''= '''' +Creating sound card devices without ``audiodev=3D`` property (since 4.2) +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' =20 When not using the deprecated legacy audio config, each sound card -should specify an ``audiodev=3D`` property. Additionally, when using -vnc, you should specify an ``audiodev=3D`` property if you plan to -transmit audio through the VNC protocol. +should specify an ``audiodev=3D`` property. =20 Short-form boolean options (since 6.0) '''''''''''''''''''''''''''''''''''''' diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.= rst index 63458736ee1..7668ddef178 100644 --- a/docs/about/removed-features.rst +++ b/docs/about/removed-features.rst @@ -442,6 +442,12 @@ line using a ``secret`` object instance. The ``-audiodev`` and ``-audio`` command line options are now the only way to specify audio backend settings. =20 +Creating vnc without ``audiodev=3D`` property (removed in 8.2) +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +When using vnc, you should specify an ``audiodev=3D`` property if +you plan to transmit audio through the VNC protocol. + QEMU Machine Protocol (QMP) commands ------------------------------------ =20 diff --git a/ui/vnc.c b/ui/vnc.c index 6fd86996a54..cfa18bbd3e1 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -2508,11 +2508,17 @@ static int protocol_client_msg(VncState *vs, uint8_= t *data, size_t len) switch (read_u16 (data, 2)) { case VNC_MSG_CLIENT_QEMU_AUDIO_ENABLE: trace_vnc_msg_client_audio_enable(vs, vs->ioc); - audio_add(vs); + if (vs->vd->audio_state) { + audio_add(vs); + } else { + error_report("audio not available, use audiodev=3D opt= ion for vnc"); + } break; case VNC_MSG_CLIENT_QEMU_AUDIO_DISABLE: trace_vnc_msg_client_audio_disable(vs, vs->ioc); - audio_del(vs); + if (vs->vd->audio_state) { + audio_del(vs); + } break; case VNC_MSG_CLIENT_QEMU_AUDIO_SET_FORMAT: if (len =3D=3D 4) --=20 2.41.0 From nobody Wed May 15 06:24:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695375177; cv=none; d=zohomail.com; s=zohoarc; b=mkkqvE71HQmOU7ByBsfaJBUNaZGmkaosblahWC+l2zb0pgCR8VP+kA9IQ4XuOBD9PU1Vb8aikGpQHsm0To5aw3PCmWgmYnOF49AhtrQgUFYVaHhWjm6mtsR/E5UmRKpILKCYucYW9d6/nK3SIwKWAmz/qFNk2aIkEzVXazSsJ3o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695375177; 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=tqWqPvdI3aBX8tuEyTlgIJpIs01Oj1UkJ9BJ8gznLeI=; b=DOeZ0q0DWnf2ocDnxeEOiRMQtpH3BDxjQ05puFArmh7VpZIYkK9dcvkNDiUk+zHxY0d+AnqLKTovZFve+Lobe/nWtwjdArOdkYhte5PB6EOBfLnTx6XqbqW93eqMs2vq84ZmPfSod2+x9FzLmQMBZJxP9NnV3wpntA4RPf3SI4w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695375177471857.0424866343644; Fri, 22 Sep 2023 02:32:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qjcW2-0004pS-8I; Fri, 22 Sep 2023 05:32:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjcVw-0004mw-N2 for qemu-devel@nongnu.org; Fri, 22 Sep 2023 05:31:56 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjcVu-0003Oy-SC for qemu-devel@nongnu.org; Fri, 22 Sep 2023 05:31:56 -0400 Received: from mail-lf1-f72.google.com (mail-lf1-f72.google.com [209.85.167.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-338-QR9u-pfSPhSw4OLLT_oF0g-1; Fri, 22 Sep 2023 05:31:52 -0400 Received: by mail-lf1-f72.google.com with SMTP id 2adb3069b0e04-5042bc93273so2011342e87.1 for ; Fri, 22 Sep 2023 02:31:51 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e]) by smtp.gmail.com with ESMTPSA id c24-20020a7bc858000000b004030c778396sm6987870wml.4.2023.09.22.02.31.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 02:31:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695375113; h=from:from: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; bh=tqWqPvdI3aBX8tuEyTlgIJpIs01Oj1UkJ9BJ8gznLeI=; b=XfpdeKYwe9VCEFEIMVUBQWenEE5imRh3UvHgVfxl0U4wAmUOuMmfLeQKR2HQCEzvRxyGn4 u4hkboRb8xuQIX6xD2Sb/saPXYA9y1E0tg7VaYSme38eDRo0UuLVPcx653500Xq3DBI10R 3NTC/P45njXK3PoDciNbYt366e/btIA= X-MC-Unique: QR9u-pfSPhSw4OLLT_oF0g-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695375109; x=1695979909; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tqWqPvdI3aBX8tuEyTlgIJpIs01Oj1UkJ9BJ8gznLeI=; b=sdG8Fnd7joLHUKy5WUfO076e4NtgJGBYurx+QCuCxwUEFpNE8NoveDNkO5XOh4OQS9 fqP+X4Dy2PYqMevXt5WHAJNGEFallfqNWuTAbn3iYg+UlhGNH/U4c8JEwEx3Haluj9TM nxCzu3WFGHZU1J5yi6KnTwsBylRtMJlXsUZKno9WFlDasZo9f6CmaHscc4Nxi6sd0tZL rSrPhx9fc8SqFzJGS+b0Bgx2qpLmnWbPv6pByqYejVDc/dUyVdCBRqm7C+fZWyOR85Tj WXRa6GihBw7mUyYiMdFhI7D35ABZ24zssXHVBTAoMQcnUDe6w4exkcewoLyFxKMNkA5L 8pxA== X-Gm-Message-State: AOJu0YyY15LWz5C4uRuQOFLLM/goAgB8g2YfjwKbqvT8rP6Di71hGp8m vcqcQWI1MQyHU42OzeCY6qMaI4ajFhMRun7rVziN7ofonK9KP7KUs9kPfAxnoEps16zmGcliRCm iScu4Hv54CCbk5I6ykST608wA2oUN9NJf2tA5/MWwcVmEksbODrNxueF5aOyS8+TicMXxvuI5ix s= X-Received: by 2002:a05:6512:b8b:b0:500:7cab:efc3 with SMTP id b11-20020a0565120b8b00b005007cabefc3mr9008240lfv.11.1695375109747; Fri, 22 Sep 2023 02:31:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGHhvMQH/EMxF0hwyu4snhpCDhMbV5VCVf3FhIe42uSy1LohB8IFNDXpIMiCJsnby2dtzhzCA== X-Received: by 2002:a05:6512:b8b:b0:500:7cab:efc3 with SMTP id b11-20020a0565120b8b00b005007cabefc3mr9008222lfv.11.1695375109493; Fri, 22 Sep 2023 02:31:49 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Martin Kletzander Subject: [PULL 12/12] audio: Require AudioState in AUD_add_capture Date: Fri, 22 Sep 2023 11:31:25 +0200 Message-ID: <20230922093126.264016-13-pbonzini@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230922093126.264016-1-pbonzini@redhat.com> References: <20230922093126.264016-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1695375179228100003 Content-Type: text/plain; charset="utf-8" From: Martin Kletzander Since all callers require a valid audiodev this function can now safely abort in case of missing AudioState. Signed-off-by: Martin Kletzander Message-ID: Signed-off-by: Paolo Bonzini --- audio/audio.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/audio/audio.c b/audio/audio.c index 666ef4237dd..d72e7db7fb9 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -1854,8 +1854,9 @@ CaptureVoiceOut *AUD_add_capture( struct capture_callback *cb; =20 if (!s) { - dolog("Capturing without setting an audiodev is deprecated\n"); - s =3D audio_init(NULL, NULL); + error_setg(&error_abort, + "Capturing without setting an audiodev is not supported= "); + abort(); } =20 if (!audio_get_pdo_out(s->dev)->mixing_engine) { --=20 2.41.0