From nobody Sun May 19 06:05:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 ARC-Seal: i=1; a=rsa-sha256; t=1598449318; cv=none; d=zohomail.com; s=zohoarc; b=JCfmePhig9xAkwQLoUIrXTa6UNrdX4JyqRqQmF7j0OGCal4QT9ZL96sl9xGJnbPxbgngDEiRLPEY6lTu2nKOUIORUXYUrC6Za54b9yksGF5ATSpfEjh1EilSGI+8i6MYTIHT6SsCrj2tVLViyqGne7GXDpntyxeqVJx1DXB4ztk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598449318; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=uJnVi0Fdix1yfl9u2qyC2LTJpHCkeEdl6KuDaLcxnKU=; b=Lt1eJuRR+nr+TPibe1ny1V3fAM474X0/KR2C2eIbWwNCBEhSzicHRwZFCa2aJpQF15CKbsw5svdTNHELjdWi4YnRwfVlha11gyQt+jrOItlePLG+NjWeZRN4QRbbFBSp4uF2dD/u+DKx6ZwofQ7fGCEJi5G5RIZidoLE+Pvz+bE= ARC-Authentication-Results: i=1; mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1598449318579818.8732137846321; Wed, 26 Aug 2020 06:41:58 -0700 (PDT) Received: from localhost ([::1]:51544 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAvgb-0004i2-7R for importer@patchew.org; Wed, 26 Aug 2020 09:41:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59784) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAqSg-0003AX-5h; Wed, 26 Aug 2020 04:07:14 -0400 Received: from ch-sth2-lb01-mailout-snat1.sth.basefarm.net ([164.40.177.83]:48888 helo=ch-p-mailout02.sth.basefarm.net) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kAqSd-0004l2-Gn; Wed, 26 Aug 2020 04:07:13 -0400 Received: from c83-252-213-239.bredband.comhem.se ([83.252.213.239]:59936 helo=spamfilter.azoff.se) by ch-p-mailout02.sth.basefarm.net with esmtps (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.84) (envelope-from ) id 1kAqL5-000Xcy-90; Wed, 26 Aug 2020 09:59:25 +0200 Received: from localhost (localhost [127.0.0.1]) by smtp.azoff.se (Postfix) with ESMTP id 2A5721C125A; Wed, 26 Aug 2020 09:59:23 +0200 (CEST) Received: from spamfilter.azoff.se ([127.0.0.1]) by localhost (spamfilter.azoff.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JURnplJCQFF9; Wed, 26 Aug 2020 09:59:23 +0200 (CEST) Received: from burk (unknown [192.168.20.5]) by spamfilter.azoff.se (Postfix) with SMTP id B32DB1C1007; Wed, 26 Aug 2020 09:59:04 +0200 (CEST) Received: by burk (sSMTP sendmail emulation); Wed, 26 Aug 2020 09:59:04 +0200 X-Virus-Scanned: amavisd-new at azoff.se From: azoff@azoff.se To: qemu-devel@nongnu.org Subject: [PATCH] os-posix: Restore firmware location ../share/qemu Date: Wed, 26 Aug 2020 09:57:05 +0200 Message-Id: <20200826075705.8961-1-azoff@svenskalinuxforeningen.se> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: 83.252.213.239 X-Scan-Result: No virus found in message 1kAqL5-000Xcy-90. X-Scan-Signature: ch-p-mailout02.sth.basefarm.net 1kAqL5-000Xcy-90 6ff6423ad6e9f3fe3ddb3182d5d6286a 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: none client-ip=164.40.177.83; envelope-from=azoff@azoff.se; helo=ch-p-mailout02.sth.basefarm.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/26 04:00:00 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 26 Aug 2020 09:40:12 -0400 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , qemu-stable@nongnu.org, =?UTF-8?q?Torbj=C3=B6rn=20Svensson?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Prior to commit 6dd2dacedd83d12328afa8559bffb2b9ec5c89ed (v5.0.0), the binary relative path ../share/qemu was searched for firmware, but in that commit, this path got lost. Consider the following use-case: * QEMU is built in a docker image on one system. * QEMU is supposed to be executed on a plethora of distributions/systems * QEMU is not installed system wide on the executors When building QEMU, the --prefix configure flag is used to generate a tree containing all the QEMU resources that needs to be transfered to the executors. The path to the root of the QEMU tree might be different for the different executors, therefore, the path stored in CONFIG_QEMU_DATADIR is likely not the right one. With this use-case, the only likely path is one that is expressed as relative to the root of the QEMU binary tree or the QEMU binary iself. Signed-off-by: Torbj=C3=B6rn Svensson --- os-posix.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/os-posix.c b/os-posix.c index bf98508b6d..f016ac374c 100644 --- a/os-posix.c +++ b/os-posix.c @@ -96,6 +96,11 @@ char *os_find_datadir(void) exec_dir =3D qemu_get_exec_dir(); g_return_val_if_fail(exec_dir !=3D NULL, NULL); =20 + dir =3D g_build_filename(exec_dir, "..", "share", "qemu", NULL); + if (g_file_test(dir, G_FILE_TEST_IS_DIR)) { + return g_steal_pointer(&dir); + } + dir =3D g_build_filename(exec_dir, "pc-bios", NULL); if (g_file_test(dir, G_FILE_TEST_IS_DIR)) { return g_steal_pointer(&dir); --=20 2.26.2