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 5BC70C38145 for ; Wed, 7 Sep 2022 10:48:14 +0000 (UTC) Received: from localhost ([::1]:38132 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oVsbN-0001dS-90 for qemu-devel@archiver.kernel.org; Wed, 07 Sep 2022 06:48:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oVsY2-0007aK-Fu for qemu-devel@nongnu.org; Wed, 07 Sep 2022 06:44:48 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:41162) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oVsY0-0008K5-DI for qemu-devel@nongnu.org; Wed, 07 Sep 2022 06:44:46 -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 1213C33CB1; Wed, 7 Sep 2022 10:44:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1662547483; 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; bh=RMAovqsJCXG5S4H7GVeNZJziuYsT05bKzR1Yd6GLqvI=; b=0uxiZskEFLmnValnYYfYdI3E9F9XqNZa7s6aTsMIiI7NEzq4IWndB0ITbFigPO7izPVsDW 3WF9ZSBWs6HWhbBTpIJKzD1Qs/jN4rNYr1iD0RgT0uM4pIIclafq6vgzWVzUXQDlrBQ3qo AcKWp+p7m+Pure0BE72WOF23hPPhuFg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1662547483; 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; bh=RMAovqsJCXG5S4H7GVeNZJziuYsT05bKzR1Yd6GLqvI=; b=V7WGGvna4E8PxIari00L/MTEA+hY+vrJ7Vh10o2yYBh0e30t5Q16PVccQCwVqwVoIR4Amp MZowogNCniUpB2Cg== 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 C326613A66; Wed, 7 Sep 2022 10:44:42 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 7fVlLhp2GGNBUAAAMHmgww (envelope-from ); Wed, 07 Sep 2022 10:44:42 +0000 From: Claudio Fontana To: Paolo Bonzini , Richard Henderson , Markus Armbruster Cc: qemu-devel@nongnu.org, dinechin@redhat.com, Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Claudio Fontana Subject: [PATCH v2 0/3] improve error handling for module load Date: Wed, 7 Sep 2022 12:44:37 +0200 Message-Id: <20220907104440.22429-1-cfontana@suse.de> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=195.135.220.28; envelope-from=cfontana@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, 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" while investigating a permission issue in accel, where accel-tcg-x86_64.so was not accessible, I noticed that no errors were produced regarding the module load failure. This series attempts to improve module_load_one and module_load_qom_one to handle the error cases better and produce some errors. Patch 1 is already reviewed and is about removing an unused existing argument "mayfail" from the call stack. Patch 2 is the real meat, and that one I would say is RFC. Will follow up with comments on the specific questions I have. Patch 3 finally adds a simple check in accel/, aborting if a module is not found, but relying on the existing error report from module_load_qom_one. v1 -> v2: * do not treat the display help text any differently and do report module load _errors_. If the module does not exist (ENOENT, ENOTDIR), no error will be produced. Claudio Fontana (3): module: removed unused function argument "mayfail" module: add Error arguments to module_load_one and module_load_qom_one accel: abort if we fail to load the accelerator plugin accel/accel-softmmu.c | 8 ++- audio/audio.c | 6 +- block.c | 12 +++- block/dmg.c | 10 ++- hw/core/qdev.c | 10 ++- include/qemu/module.h | 10 +-- qom/object.c | 15 +++- softmmu/qtest.c | 6 +- ui/console.c | 18 ++++- util/module.c | 157 ++++++++++++++++++++++++++++++------------ 10 files changed, 188 insertions(+), 64 deletions(-) -- 2.26.2