From patchwork Thu Sep 28 07:36:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1840600 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=dpFBZR6d; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Rx51q3VhHz1yp0 for ; Thu, 28 Sep 2023 17:38:23 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qllaM-0004eK-Vv; Thu, 28 Sep 2023 03:37:23 -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 1qllaI-0004Zl-CH for qemu-devel@nongnu.org; Thu, 28 Sep 2023 03:37:19 -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 1qllaG-00064s-4p for qemu-devel@nongnu.org; Thu, 28 Sep 2023 03:37:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695886634; 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=JMRKISlM1zzvlrL63i/7up7pyLzmuYdCsyEbrLNbyC0=; b=dpFBZR6dJ0V4AiUfQgaQRDmtH0OMGu6MVUbvM4FWcHiwjV4vu3Hq2HrzEeE0MAvhqwHnBB uGJMTVZLXdX0sz9AjCFVB+bM5oYM0lEP1bISy6VhaAi1Po8lnRhXKHgJrV9hw78gHlH855 B1xjie7jQmOzfYg+6JFLDHOK3i330k0= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-487-uNH-8KLUPjKCFMiyxW__wA-1; Thu, 28 Sep 2023 03:37:12 -0400 X-MC-Unique: uNH-8KLUPjKCFMiyxW__wA-1 Received: by mail-ed1-f69.google.com with SMTP id 4fb4d7f45d1cf-5362b33e8ffso221418a12.3 for ; Thu, 28 Sep 2023 00:37:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695886631; x=1696491431; 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=JMRKISlM1zzvlrL63i/7up7pyLzmuYdCsyEbrLNbyC0=; b=L3itafzbV2SBBYxM6zcwtiDgCBKtH/Jw0irJR7NTRbFKYt+YV0DLSWPeFsJ5Em6ANf yV6zzvmE0GSxNH2ekgAqCVu/zGTkWc1gXCo2OwI0+KZQ+vPivgYzNlRta/ZfeBrJpRqK euloNH1EOzRFjSTgq95AtEO3CrIow89ZHJciRbD/kLIjxjqs9d+clJNuq+iEVdqc55z2 cCT+VdUKq9n3Uo86/1u/lpGd/jwpPmuD8rPhVfWMiGb3lNA+VtIlRb9WpOkYCsHw1ZZ3 +6Jyu6DFESbYWA9pxYVwl0ZGUmBdxtdWYwmIVIgQk2f7Yhn5J9SLM0LyxjGB8DFpN5Fr 73mw== X-Gm-Message-State: AOJu0YwqFqLh1d5+AqsKdWyhOAWNkA445YfjxRQXvGZu9FXLdUlBFydr q889Bh+VwYS8sf1A06QuaXN8VCaa/lBnlKNouwYyO/pLDinpe0K27jMOwt4B8Tmch4ncrStN7+x yCbLL0rlBecB00yQDhijz12NzOitgHh5Yy20ZTbz1Qo3FROBuIq15iZIGxqs16gFTl2zkkkffWd g= X-Received: by 2002:a05:6402:b15:b0:51b:d567:cfed with SMTP id bm21-20020a0564020b1500b0051bd567cfedmr367458edb.5.1695886631404; Thu, 28 Sep 2023 00:37:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGCxHjehWEuLhiPYDRVI18gkKgF0Wfx4nj/RbjfIs0N8TW7OBZewQP6mJ2NR6iSAhuXmU6sog== X-Received: by 2002:a05:6402:b15:b0:51b:d567:cfed with SMTP id bm21-20020a0564020b1500b0051bd567cfedmr367449edb.5.1695886631147; Thu, 28 Sep 2023 00:37:11 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:9af8:e5f5:7516:fa89]) by smtp.gmail.com with ESMTPSA id b10-20020a056402278a00b0053447d022f9sm3864211ede.18.2023.09.28.00.37.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 00:37:10 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: berrange@redhat.com, balaton@eik.bme.hu, Martin Kletzander Subject: [PATCH 02/13] audio: Require AudioState in AUD_add_capture Date: Thu, 28 Sep 2023 09:36:46 +0200 Message-ID: <20230928073705.871327-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928073705.871327-1-pbonzini@redhat.com> References: <20230928073705.871327-1-pbonzini@redhat.com> MIME-Version: 1.0 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/audio/audio.c b/audio/audio.c index 2f479657117..4332c4c6ce8 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -1876,10 +1876,9 @@ CaptureVoiceOut *AUD_add_capture( struct capture_callback *cb; if (!s) { - if (!legacy_config) { - dolog("Capturing without setting an audiodev is deprecated\n"); - } - s = audio_init(NULL, NULL); + error_setg(&error_abort, + "Capturing without setting an audiodev is not supported"); + abort(); } if (!audio_get_pdo_out(s->dev)->mixing_engine) {