From nobody Mon Feb 9 20:35:30 2026 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1664444977; cv=none; d=zohomail.com; s=zohoarc; b=F+3CfWSPtkd5NplAbLnPV26m3u0hKMp4PGbN7y4QNAgk2HadlBrg1czInIEMGiC9X1srmpfdud4U5lf4QYhyE08nsQOc694jDU73K77rR2SQU1Z9Cq67YznPDViUR2WqOXOMfwID5TCzLl4yJ7lVf5djnPnuhiKPZGuIGKLSmUo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664444977; 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=R6T8kiXEFNJEHznxsn2jM0RB4ZpVuiVkxLuwnThSOgo=; b=LdBgg9q7WZhhgqyCMxrdsZcBeMskao3jyk4eFBC+q5WOxEbaJtPLAD3qIr2UKufKU70EXEPYCYCIDJgtl5c2PBnYqXpxxWR+ZdkKOovqq7Ov7q8jY3yhUQjqvkWFSR2szi8L3Wyzeg3AzNwLppBLnQF9uLGdy11UMl7nSdMNq58= 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 1664444977874978.570519259741; Thu, 29 Sep 2022 02:49:37 -0700 (PDT) Received: from localhost ([::1]:36248 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odqAi-00015K-PE for importer@patchew.org; Thu, 29 Sep 2022 05:49:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53430) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odpsV-0006vs-0p for qemu-devel@nongnu.org; Thu, 29 Sep 2022 05:30:49 -0400 Received: from smtp-out2.suse.de ([2001:67c:2178:6::1d]:44684) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1odpsS-0001NE-8K for qemu-devel@nongnu.org; Thu, 29 Sep 2022 05:30:45 -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-out2.suse.de (Postfix) with ESMTPS id 318C91F8D3; Thu, 29 Sep 2022 09:30:43 +0000 (UTC) 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 D3B431348E; Thu, 29 Sep 2022 09:30:42 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id WPg7MsJlNWMEOAAAMHmgww (envelope-from ); Thu, 29 Sep 2022 09:30:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1664443843; 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=R6T8kiXEFNJEHznxsn2jM0RB4ZpVuiVkxLuwnThSOgo=; b=s7bYYJFodK0cBFvSuiqbwMTkGlT9m4UTDt2deDA145sjeO4Q9uxZ1tn1NPhbsIa7gvc4MF S0R4kBqEwdbuReCcOqvV1mPe2/RdRmRRlHPI4430xAV5ge2n8hPbPubpSXIihYesjXwcb5 P3peAywb3y4jtGeoLHvJ62zbypvq/IY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1664443843; 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=R6T8kiXEFNJEHznxsn2jM0RB4ZpVuiVkxLuwnThSOgo=; b=3GjI+44NAErsS86aHMv0oUGvxjB8eKzEkX0nHC0sEHnywhC1KiutGrkYF1JkTS4kDEiQLw 6MMp7j+dKe8YYqBA== From: Claudio Fontana To: Paolo Bonzini , Richard Henderson , Markus Armbruster , Kevin Wolf 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 v9 5/5] accel: abort if we fail to load the accelerator plugin Date: Thu, 29 Sep 2022 11:30:35 +0200 Message-Id: <20220929093035.4231-6-cfontana@suse.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20220929093035.4231-1-cfontana@suse.de> References: <20220929093035.4231-1-cfontana@suse.de> 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=2001:67c:2178:6::1d; envelope-from=cfontana@suse.de; helo=smtp-out2.suse.de 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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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" X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1664444979902100001 if QEMU is configured with modules enabled, it is possible that the load of an accelerator module will fail. Exit in this case, relying on module_object_class_by_name to report the specific load error if any. Signed-off-by: Claudio Fontana Reviewed-by: Richard Henderson [claudio: changed abort() to exit(1)] Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Markus Armbruster --- accel/accel-softmmu.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/accel/accel-softmmu.c b/accel/accel-softmmu.c index 67276e4f52..f9cdafb148 100644 --- a/accel/accel-softmmu.c +++ b/accel/accel-softmmu.c @@ -66,6 +66,7 @@ void accel_init_ops_interfaces(AccelClass *ac) { const char *ac_name; char *ops_name; + ObjectClass *oc; AccelOpsClass *ops; =20 ac_name =3D object_class_get_name(OBJECT_CLASS(ac)); @@ -73,8 +74,13 @@ void accel_init_ops_interfaces(AccelClass *ac) =20 ops_name =3D g_strdup_printf("%s" ACCEL_OPS_SUFFIX, ac_name); ops =3D ACCEL_OPS_CLASS(module_object_class_by_name(ops_name)); + oc =3D module_object_class_by_name(ops_name); + if (!oc) { + error_report("fatal: could not load module for type '%s'", ops_nam= e); + exit(1); + } g_free(ops_name); - + ops =3D ACCEL_OPS_CLASS(oc); /* * all accelerators need to define ops, providing at least a mandatory * non-NULL create_vcpu_thread operation. --=20 2.26.2