From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 30B0FC433F5 for ; Mon, 25 Apr 2022 14:38:29 +0000 (UTC) Received: from localhost ([::1]:35592 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nizr9-0000dK-Qp for qemu-devel@archiver.kernel.org; Mon, 25 Apr 2022 10:38:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33274) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nizRy-0004Vv-HD for qemu-devel@nongnu.org; Mon, 25 Apr 2022 10:12:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:50036) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nizRv-0002e3-4H for qemu-devel@nongnu.org; Mon, 25 Apr 2022 10:12:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650895940; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=Ru2I3/P1gvBJV04NM5tGtTOmd4SFv46f3qyNEWE3AaY=; b=S9ATNetsYMacL2y2OVAk/zr7VHXju1BF5G2XKo8xrkS8wNviHMBOGEOhxeLZSAo+mN703B SQ9nUSItI/z95As6q7mKgV8b/z14jAVFGVi/4Z6tBSK1v8EYpDK9XD6pM5DdFH6mrbT8Eh zclz8HwxtdDHKoVTdC1aAFE6GG8qZ5g= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-453-YCANpG3gNjuVbqzhOX-gAw-1; Mon, 25 Apr 2022 10:12:16 -0400 X-MC-Unique: YCANpG3gNjuVbqzhOX-gAw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EA7768117B0; Mon, 25 Apr 2022 14:12:14 +0000 (UTC) Received: from redhat.com (unknown [10.33.36.152]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E443D40C1241; Mon, 25 Apr 2022 14:12:07 +0000 (UTC) Date: Mon, 25 Apr 2022 15:11:53 +0100 From: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= To: Martin Kletzander Subject: Re: [PATCH 14/18] audio: Require AudioState in AUD_add_capture Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.1.5 (2021-12-30) X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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: , Reply-To: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= Cc: Peter Maydell , Pavel Dovgalyuk , libvir-list@redhat.com, Christian Schoenebeck , qemu-devel@nongnu.org, Yanan Wang , Gerd Hoffmann , "Edgar E. Iglesias" , Qiuhao Li , =?utf-8?B?SGVydsOp?= Poussineau , =?utf-8?Q?Marc-Andr=C3=A9?= Lureau , Laurent Vivier , Thomas Huth , Alistair Francis , Alexander Bulekov , Bandan Das , qemu-arm@nongnu.org, Jan Kiszka , Stefan Hajnoczi , Eduardo Habkost , Darren Kenny , Thomas Huth , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Mon, Apr 25, 2022 at 10:21:57AM +0200, Martin Kletzander wrote: > Since all callers require a valid audiodev this function can now safely > abort in case of missing AudioState. > > Signed-off-by: Martin Kletzander > --- > audio/audio.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/audio/audio.c b/audio/audio.c > index b95aca444382..97eb645764c1 100644 > --- a/audio/audio.c > +++ b/audio/audio.c > @@ -1855,10 +1855,8 @@ 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"); Preferrable to do: error_report("Capturing ..."); abort(); Or pass in an 'Error **errp' parameter and let the caller decide what todo > } > > if (!audio_get_pdo_out(s->dev)->mixing_engine) { > -- > 2.35.1 > With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|