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 548E7ECAAD5 for ; Tue, 6 Sep 2022 13:29:45 +0000 (UTC) Received: from localhost ([::1]:55676 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oVYe8-0005Ok-FM for qemu-devel@archiver.kernel.org; Tue, 06 Sep 2022 09:29:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34802) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oVXTX-0007jX-RJ for qemu-devel@nongnu.org; Tue, 06 Sep 2022 08:14:43 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:44232) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oVXTW-0001c2-71 for qemu-devel@nongnu.org; Tue, 06 Sep 2022 08:14:43 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 9468833858; Tue, 6 Sep 2022 12:14:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1662466480; h=from:from:reply-to: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=t3grlbFwwmEmfM1QXsCLxKVQpMntnZi45WFVZtm1yzQ=; b=ptivwlFR/Prj6or0j2SnE/i6janqI/0uTAvT8aL/MOVbwMsPEThP6q+QOtcyMf4kFMMYwv D4KMxfx2i79ReJTClW1l1XRZ086RKNCi7AD7KtFO2rPxtGlbw58AllOip3sVcZh5dKSThX iNCQLYZrHrQyggRM2oFyGC06pVSKq1o= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1662466480; h=from:from:reply-to: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=t3grlbFwwmEmfM1QXsCLxKVQpMntnZi45WFVZtm1yzQ=; b=RIKL3Hirm2IvPb5EA7JdGx7Zef22462iY1v6NZzTaF6cv06GMLkPXe71Uj7AuK4G9Lqu5i nprOt0LXTYK3AhDQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 4093F13A7A; Tue, 6 Sep 2022 12:14:40 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id KGG+DbA5F2N/PAAAMHmgww (envelope-from ); Tue, 06 Sep 2022 12:14:40 +0000 Message-ID: <90ec64fb-24fa-aee9-da77-32fc56d3e51e@suse.de> Date: Tue, 6 Sep 2022 14:14:39 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: [PATCH] accel: print an error message and exit if plugin not loaded Content-Language: en-US From: Claudio Fontana To: Gerd Hoffmann Cc: Richard Henderson , Paolo Bonzini , qemu-devel@nongnu.org, =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , =?UTF-8?Q?Daniel_P=2e_Berrang=c3=a9?= , =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , dinechin@redhat.com References: <20220905101332.1986-1-cfontana@suse.de> <5d922305-a559-bfdc-7038-ec1560ae0e00@linaro.org> <9bb31e44-e43d-b51a-712a-87e46279a0b5@suse.de> <879a973a-c5b0-2a23-bb24-92bf5500f63f@suse.de> <20220906095325.5rhnqjyvckjebnmp@sirius.home.kraxel.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=195.135.220.28; envelope-from=cfontana@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -61 X-Spam_score: -6.2 X-Spam_bar: ------ X-Spam_report: (-6.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-1.752, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 9/6/22 13:59, Claudio Fontana wrote: > On 9/6/22 11:53, Gerd Hoffmann wrote: >>> In any case, the only thing that "mayfail" seems to control, is in module_load_file, and is a single printf: >>> >>> g_module = g_module_open(fname, flags); >>> if (!g_module) { >>> if (!mayfail) { >>> fprintf(stderr, "Failed to open module: %s\n", >>> g_module_error()); >>> } >>> ret = -EINVAL; >>> goto out; >>> } >>> >>> >>> Weird.. Is someone building proprietary modules on top of QEMU? >> >> Nope. >> >> But modules have dependencies to stuff like pci bus, usb bus, vga which >> might not be satisfied by some system emulators, and trying to load >> those modules will fail then because of unresolved symbols. If you drop >> that 'make check' will log a pile of errors ... >> >> Dropping mayfail and return an 'Error' instead makes sense, then it is >> up to the caller to report or not report the failure. When calling down >> from module_load_qom_all() you might want ignore errors for the reasons >> outlined above, in most other caes it probably makes sense to report >> them. >> >> take care, >> Gerd >> >> > > Ah I noticed only now... I just sent a series, the module_load_qom_all() then is maybe something to discuss further. > > Thanks, > > Claudio > I noticed however that module_load_qom_all() does _not_ pass true for mayfail. You changed this behavior in: commit 9f4a0f0978cde9d8e27453b3f2d3679b53623c47 Author: Gerd Hoffmann Date: Thu Jun 24 12:38:17 2021 +0200 modules: use modinfo for qom load Use module database to figure which module implements a given QOM type. Drop hard-coded object list. Signed-off-by: Gerd Hoffmann Reviewed-by: Paolo Bonzini Reviewed-by: Jose R. Ziviani Message-Id: <20210624103836.2382472-16-kraxel@redhat.com> Signed-off-by: Paolo Bonzini and from the patch I understand that this made the mayfail argument completely unnecessary, is that correct? Thanks, Claudio