From nobody Mon Feb 9 07:27:24 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1655309955; cv=none; d=zohomail.com; s=zohoarc; b=Cim9Jo+fB9Z0tGGAtgpbGroUWZBBPgtBcIs4hZSCoQZWyD/z2rmrI+DVC/uKBNdfzP4MlThXVlVvp4yimxKur9Mq5Htz8lkcZEWjKX+9AEz5AKE4J31+y7CAFbdgUM0j5B8S4k5o9I3nGE8jk5cXAChaLIXTip4Vbty+d8Za4oY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1655309955; h=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; bh=RstUhdC3yStpN5pP+KDeayTFcII2tvBMXL7ceshu/m8=; b=TFEd/2kTdCDWBYTwaxjJI1VMbEt2H1LHXnlNaJN4qRZVd/xYbR78nnow4ZsOzGeA6Y/ZFJUnYujpAN1THewMBjCE3oPkvmI5WLAJuswFu6zdfET2qVXevUtoDo9pt2GsDvxyzglXiRVhDZAObSyGcvjdEVxPNlDkh6pHabmmxE4= 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 1655309955040864.4809970698423; Wed, 15 Jun 2022 09:19:15 -0700 (PDT) Received: from localhost ([::1]:50494 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o1Vjd-0007G8-NM for importer@patchew.org; Wed, 15 Jun 2022 12:19:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44880) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1VO3-0007yt-1y for qemu-devel@nongnu.org; Wed, 15 Jun 2022 11:56:55 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]:33664) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o1VNz-00087u-4v for qemu-devel@nongnu.org; Wed, 15 Jun 2022 11:56:54 -0400 Received: by mail-pl1-x62b.google.com with SMTP id f9so10819483plg.0 for ; Wed, 15 Jun 2022 08:56:50 -0700 (PDT) Received: from localhost.localdomain ([2400:4050:c360:8200:4126:b1a8:8fce:1a8]) by smtp.gmail.com with ESMTPSA id a34-20020a056a001d2200b0051874318772sm9860038pfx.201.2022.06.15.08.56.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Jun 2022 08:56:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RstUhdC3yStpN5pP+KDeayTFcII2tvBMXL7ceshu/m8=; b=jkxmwm5qHHaJyYdOyKvxX9agUYm8gmD+4fbP3F0TPMXOIrNT2TDfRjiy2cTmijJ4GY ekP/JOCRjuFqLE5bfzKSvcqofioxzE+SmcGxXLntI9Na2eiuM6h495tpLzNl/xncYBa3 qGEzdX5oKmQgfoIvf3/0I/8AolQBiRY7lGX4hT5WbZ4jrLpwW5ILSjFFwq1h6VnlSMrl G/w28zkNqQBlYOSXwUB3THmKoIqqVQeSK09O6eIA/aOgzuiGATWxAzsIbXgacTAHKQWo PB31Ja/In2xk6AXh7AeQuXqrvuibIBtcWr0C2RXprlfrIgkWAZPombJgX7qmeEsNjVkr 661Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RstUhdC3yStpN5pP+KDeayTFcII2tvBMXL7ceshu/m8=; b=X9rS9gYQeWeZljjuIT45MAO8N/FdSijOnphJdvUi3mJL82xdICh4PO00lkrqZ5iwNR PrOi+Dr355yOuUT257larBCvvQQ5RTH9fZMqkxw1YOZ4nkyNAIaoS5PstrzmeIAcLiZd ykZQyB0Ctu/cY1Tb9NqKthZPokb2F74JGoFlAfQjolv9nk8AYajuHItoauhM08nnDRWg xgirZamsimYiKw+GlyEOBiO176ScRQVSj35ncRt2zgJEsioSgaaAIZASqcyjYlkCZNc9 tUb6e9fYJy+SvLaCxf3zULenGOKztIYNTRvX8crfpo5saV0sEfnu+f6e/zA9oIsoBjnt Q1rA== X-Gm-Message-State: AJIora/xv8FY4ZtKHrZbIPS82Af3iv5KUvbtVVrE1ytCZZjV9ZfTpuIp LwK3g1e7DfViM5M/Wv+tjrY= X-Google-Smtp-Source: AGRyM1tkPvqXbUDUtF5TeJb2PhfLFIBeGal9Xe0w2rBaL2t0cBEv2wQsGK8EMCxscsQtlLmWltknew== X-Received: by 2002:a17:90b:3a90:b0:1e6:a203:c7dd with SMTP id om16-20020a17090b3a9000b001e6a203c7ddmr11200463pjb.144.1655308609556; Wed, 15 Jun 2022 08:56:49 -0700 (PDT) From: Akihiko Odaki To: Cc: Peter Maydell , Jason Wang , qemu-devel@nongnu.org, Programmingkid , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Paolo Bonzini , Akihiko Odaki Subject: [PATCH v6 1/7] datadir: Simplify firmware directory search Date: Thu, 16 Jun 2022 00:56:28 +0900 Message-Id: <20220615155634.578-2-akihiko.odaki@gmail.com> X-Mailer: git-send-email 2.32.1 (Apple Git-133) In-Reply-To: <20220615155634.578-1-akihiko.odaki@gmail.com> References: <20220615155634.578-1-akihiko.odaki@gmail.com> MIME-Version: 1.0 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=2607:f8b0:4864:20::62b; envelope-from=akihiko.odaki@gmail.com; helo=mail-pl1-x62b.google.com 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1655309955465100003 Content-Type: text/plain; charset="utf-8" The old implementation had some code to accept multiple firmware directories, but it is not used. Signed-off-by: Akihiko Odaki --- softmmu/datadir.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/softmmu/datadir.c b/softmmu/datadir.c index 160cac999a6..2a206f2740a 100644 --- a/softmmu/datadir.c +++ b/softmmu/datadir.c @@ -105,15 +105,8 @@ static char *find_datadir(void) =20 void qemu_add_default_firmwarepath(void) { - char **dirs; - size_t i; - - /* add configured firmware directories */ - dirs =3D g_strsplit(CONFIG_QEMU_FIRMWAREPATH, G_SEARCHPATH_SEPARATOR_S= , 0); - for (i =3D 0; dirs[i] !=3D NULL; i++) { - qemu_add_data_dir(get_relocated_path(dirs[i])); - } - g_strfreev(dirs); + /* add the configured firmware directory */ + qemu_add_data_dir(get_relocated_path(CONFIG_QEMU_FIRMWAREPATH)); =20 /* try to find datadir relative to the executable path */ qemu_add_data_dir(find_datadir()); --=20 2.32.1 (Apple Git-133) From nobody Mon Feb 9 07:27:24 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1655310407; cv=none; d=zohomail.com; s=zohoarc; b=ZXrCpuVceo3rt+Svdh2Lc0efSkmDOoZFR3hl4gIvTDxOtkk0kehSkI1Gsn8ILgpovkfEi8Vwp3Fr9gXKRwWVM3OHxuwNDQaqVC3UG0SeL85AXRSj6AH/tQ6mlN5w8TNb9Hnp9t98pSXZo1x5vWyeQ3dOrgznA3mlJ0KT2/KFJUk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1655310407; h=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; bh=OSXg7oPe/KQHELyRK7+vtlzBlLcuc/ord7UoCPX+kn0=; b=egtuP/uKe5z10u0wbTVwpT91I72tHFwaNRusp5ZLXfpEGhGLhgGfF4eGfBt3Zm/LUFUVN63CpvkjKc8soe/xIXBGLSWXYgg/6VQ7mvEu1dPEA5sCM1dvp6P7dvzvRlm876j11iF1E1YYa8RZARMmoZgHiFVTsz1D9yAe+rr+YLk= 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 1655310407054172.41363990150057; Wed, 15 Jun 2022 09:26:47 -0700 (PDT) Received: from localhost ([::1]:40874 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o1Vqw-0003xQ-0L for importer@patchew.org; Wed, 15 Jun 2022 12:26:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44886) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1VO4-00083a-60 for qemu-devel@nongnu.org; Wed, 15 Jun 2022 11:56:56 -0400 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]:34471) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o1VO1-00088P-PI for qemu-devel@nongnu.org; Wed, 15 Jun 2022 11:56:55 -0400 Received: by mail-pj1-x1034.google.com with SMTP id mh16-20020a17090b4ad000b001e8313301f1so3568985pjb.1 for ; Wed, 15 Jun 2022 08:56:53 -0700 (PDT) Received: from localhost.localdomain ([2400:4050:c360:8200:4126:b1a8:8fce:1a8]) by smtp.gmail.com with ESMTPSA id a34-20020a056a001d2200b0051874318772sm9860038pfx.201.2022.06.15.08.56.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Jun 2022 08:56:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OSXg7oPe/KQHELyRK7+vtlzBlLcuc/ord7UoCPX+kn0=; b=T0yU2g1d6lFZ6Eibs2+vHhjHveAGkcILaW83XyZqOUyvbTSgKbTdprZk2SkbYZwfAK TxQeY1Xa4jP3JLVv9ACauH9HPVQzEjsxUr4W2LtqiQnraY6E35ydxkbeyRADRrGEiDqD VOT8S/PnR4XMVddNlHN+N0x05CXs5cGDKAhnzsPqT6NCHAUn3bL0uR+if4ueHBlJlPOp 2pKb8V5817occMXZPyj2qZ7JPy7e/kFpzePrDqe4Zira3uPRbNBop2J7Dud+NnF/0le2 GLFJXVQDsmqrGO8d4Ee/XR4gsWpuK+eCMaHVnYtm23woCsP0uLz8zMGHmuw9q9L/hJ6c oM/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OSXg7oPe/KQHELyRK7+vtlzBlLcuc/ord7UoCPX+kn0=; b=QRslnEI8VBSOH4SiTKjhKPUrp2uWdYg25CEhuFpGaChWgqBW5iNtiHG0x20uf5FSzR P4lJ1xSubB916H0WvY9AzWm6F7lOjw6tOEjkWZuVo343WEsGtuGrxkCMdGNLPlkkt9vH cStMBax3PGVsNa6WgKp5s+7EHIaohRFfkeIaJyxBlfv7/nApWlxR+3rN+JDTTBsHXBFf RO/cDLjOK6y2ENGHxnAUnBLYn3rORgtwv9rNlZD1ez+W9CRAkI6gEGFocjbdKDGz/KyO yadM1tDFtKcNYSIBTlRx+garR96/5a73jzQyEEj4ZdyPlTEKirAcLjIij2suBcKe1nmE XSWQ== X-Gm-Message-State: AJIora9qBk3SxTHuKDSp5HgV8Ug06lvzYCFzD89/3gm7fmKxUFFO1+ZY oP8O05/pxqpKFzDXnnfFbZ7nlAvibZc= X-Google-Smtp-Source: AGRyM1t1KHtAWfmWlEn52acjc3nm9O+L057IcSWxSg0pF5mdW/wmPv5B8MiyQEf8NnUkwLYNQfKyaw== X-Received: by 2002:a17:902:8343:b0:167:8899:2f92 with SMTP id z3-20020a170902834300b0016788992f92mr434086pln.117.1655308612376; Wed, 15 Jun 2022 08:56:52 -0700 (PDT) From: Akihiko Odaki To: Cc: Peter Maydell , Jason Wang , qemu-devel@nongnu.org, Programmingkid , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Paolo Bonzini , Akihiko Odaki Subject: [PATCH v6 2/7] qga: Relocate a path emitted in the help text Date: Thu, 16 Jun 2022 00:56:29 +0900 Message-Id: <20220615155634.578-3-akihiko.odaki@gmail.com> X-Mailer: git-send-email 2.32.1 (Apple Git-133) In-Reply-To: <20220615155634.578-1-akihiko.odaki@gmail.com> References: <20220615155634.578-1-akihiko.odaki@gmail.com> MIME-Version: 1.0 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=2607:f8b0:4864:20::1034; envelope-from=akihiko.odaki@gmail.com; helo=mail-pj1-x1034.google.com 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1655310408664100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Akihiko Odaki --- qga/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qga/main.c b/qga/main.c index c373fec3ee6..06e507b9979 100644 --- a/qga/main.c +++ b/qga/main.c @@ -270,7 +270,7 @@ QEMU_HELP_BOTTOM "\n" , cmd, QGA_VIRTIO_PATH_DEFAULT, QGA_SERIAL_PATH_DEFAULT, dfl_pathnames.pidfile, #ifdef CONFIG_FSFREEZE - QGA_FSFREEZE_HOOK_DEFAULT, + get_relocated_path(QGA_FSFREEZE_HOOK_DEFAULT), #endif dfl_pathnames.state_dir); } --=20 2.32.1 (Apple Git-133) From nobody Mon Feb 9 07:27:24 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1655310164; cv=none; d=zohomail.com; s=zohoarc; b=QTBnmZETpJV9rWJqe6ZmET7KftZlR8/DzdGJf5HdiMn/xdc1AQ0rVN0yvdLMCoSt969AZcAvUAPc48qWNkypvUi31T9GknEdWhShOlkXX2Rpe/tzDTOB331LZFrqlQGvQEuuHgVCu4ooUw0g56svYTSWuoum3L4fGoGzL51cz9g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1655310164; h=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; bh=bqJxgBQjormSo/al6PQl+CqdvjqOY+iZWbpHVrlRF1o=; b=fnuCtyx6/wEq2yKj+bxjDM9ne1AE4Gi54ynlt/vrPf21Oa5U++lgJLbyzjUjcQsg3TG/T+H9GKkpCau8wht2YBuMZE/LrxdArHdBY77ABZAtixtHu5TPHnZ4DGgO69M/QzVeRP9o8YEewJiChZgah8jKVQYWppsJ5fnBIjlB4Dc= 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 165531016498773.9658705078466; Wed, 15 Jun 2022 09:22:44 -0700 (PDT) Received: from localhost ([::1]:59008 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o1Vn1-0005NO-Sr for importer@patchew.org; Wed, 15 Jun 2022 12:22:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44920) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1VO6-0008C9-Iy for qemu-devel@nongnu.org; Wed, 15 Jun 2022 11:56:58 -0400 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]:47024) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o1VO4-00088h-KJ for qemu-devel@nongnu.org; Wed, 15 Jun 2022 11:56:58 -0400 Received: by mail-pl1-x62e.google.com with SMTP id d13so10751353plh.13 for ; Wed, 15 Jun 2022 08:56:56 -0700 (PDT) Received: from localhost.localdomain ([2400:4050:c360:8200:4126:b1a8:8fce:1a8]) by smtp.gmail.com with ESMTPSA id a34-20020a056a001d2200b0051874318772sm9860038pfx.201.2022.06.15.08.56.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Jun 2022 08:56:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bqJxgBQjormSo/al6PQl+CqdvjqOY+iZWbpHVrlRF1o=; b=lxRlgbnDSqE55JEvgOnrg7SWlHktZGKEY8Gaoew0ZIFq6yNjl7jQSWQamrrfjh82gJ aEtmAtrU5FgX9WRvjPoUolqLz5em0im5+9G/0sfQjTttfNlTYuREKS29GehV3qauXu+9 DrSk3hA1Kp3zWLcm3MKberLr/Ct+ZMXl8I9237Zc4072fJT0k7FXKk90sS0YXuF1qYDb +DIT5tcuDyiqmqArItyc/6KMaMBG5xzQWM7MtSjCJesGpugJImpIZ/v8w9gxPnhMjmir HjL9lF9YjOcajayhx/UOc4UucxKc9PTwEY+ZdYfr2Adt1+bYHB3ELk7Npp3utizKmE5q hjew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bqJxgBQjormSo/al6PQl+CqdvjqOY+iZWbpHVrlRF1o=; b=E8u/syfPdbAvrgW9Jh4TrBYHANrDh0yXjaOStBKMPkhP3vQHQi31FFGXmVjZwv30Zs 8INtxq9+snlm5LKcOAOwrx7SftFvm+srE+r9mJ7PKCB1CzkZYCGqtrRRftC03pILbCkl kIqc35Y2GiliJiWVLE51UdFKSw5VTSvhkSyhXLo6mNfL+fHWT3X4Fjqftqrkaxnp0t7O VKSP/tz/TA0/xulxsJNooq/iRpWSVONBhjwa+3YCmlyZxcN4HUa1wD2eglarmBlzt876 FF/WvvwbkLDuPdHsSzg5E1YN9C+O5s1eeb7cAoeT7M7QrRybBlVygOJr00/G8stNTgA6 i5fA== X-Gm-Message-State: AJIora8Be/BYRscVKucVg2dOZo46EkJvTbgeb9dGXZZv5dpIBBeR25zP Ar09mrr8GWsyfK3ZaF1JmvXXaT5ogao= X-Google-Smtp-Source: AGRyM1sNAwn5nP04bSX2AzsFoLOA1Ws1jqDoSDcu4V6yth7of37MAafNNLTGiY9i6H714cEK0Sx1Ng== X-Received: by 2002:a17:903:2291:b0:167:59ad:52e8 with SMTP id b17-20020a170903229100b0016759ad52e8mr232062plh.121.1655308615317; Wed, 15 Jun 2022 08:56:55 -0700 (PDT) From: Akihiko Odaki To: Cc: Peter Maydell , Jason Wang , qemu-devel@nongnu.org, Programmingkid , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Paolo Bonzini , Akihiko Odaki Subject: [PATCH v6 3/7] Remove prefixes from path configuration macros Date: Thu, 16 Jun 2022 00:56:30 +0900 Message-Id: <20220615155634.578-4-akihiko.odaki@gmail.com> X-Mailer: git-send-email 2.32.1 (Apple Git-133) In-Reply-To: <20220615155634.578-1-akihiko.odaki@gmail.com> References: <20220615155634.578-1-akihiko.odaki@gmail.com> MIME-Version: 1.0 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=2607:f8b0:4864:20::62e; envelope-from=akihiko.odaki@gmail.com; helo=mail-pl1-x62e.google.com 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1655310166127100003 Content-Type: text/plain; charset="utf-8" The path configuration macros are often supplied to get_relocated_path(), and the function had some logics to remove the prefixes. With this change, the prefixes are removed from those macros and get_relocated_path() is also simplified. Signed-off-by: Akihiko Odaki --- include/qemu/cutils.h | 2 +- meson.build | 21 ++++++++++----------- qemu-options.hx | 11 +++++------ util/cutils.c | 34 +++++++--------------------------- 4 files changed, 23 insertions(+), 45 deletions(-) diff --git a/include/qemu/cutils.h b/include/qemu/cutils.h index 40e10e19a7e..57de1da5c95 100644 --- a/include/qemu/cutils.h +++ b/include/qemu/cutils.h @@ -207,7 +207,7 @@ const char *qemu_get_exec_dir(void); * * Returns a path for @dir that uses the directory of the running executab= le * as the prefix. For example, if `bindir` is `/usr/bin` and @dir is - * `/usr/share/qemu`, the function will append `../share/qemu` to the + * `share/qemu`, the function will append `../share/qemu` to the * directory that contains the running executable and return the result. * The returned string should be freed by the caller. */ diff --git a/meson.build b/meson.build index 0c2e11ff071..01d5e32615e 100644 --- a/meson.build +++ b/meson.build @@ -1679,18 +1679,17 @@ config_host_data.set_quoted('CONFIG_TLS_PRIORITY', = get_option('tls_priority')) if iasl.found() config_host_data.set_quoted('CONFIG_IASL', iasl.full_path()) endif -config_host_data.set_quoted('CONFIG_BINDIR', get_option('prefix') / get_op= tion('bindir')) +config_host_data.set_quoted('CONFIG_BINDIR', get_option('bindir')) config_host_data.set_quoted('CONFIG_PREFIX', get_option('prefix')) -config_host_data.set_quoted('CONFIG_QEMU_CONFDIR', get_option('prefix') / = qemu_confdir) -config_host_data.set_quoted('CONFIG_QEMU_DATADIR', get_option('prefix') / = qemu_datadir) -config_host_data.set_quoted('CONFIG_QEMU_DESKTOPDIR', get_option('prefix')= / qemu_desktopdir) -config_host_data.set_quoted('CONFIG_QEMU_FIRMWAREPATH', get_option('prefix= ') / get_option('qemu_firmwarepath')) -config_host_data.set_quoted('CONFIG_QEMU_HELPERDIR', get_option('prefix') = / get_option('libexecdir')) -config_host_data.set_quoted('CONFIG_QEMU_ICONDIR', get_option('prefix') / = qemu_icondir) -config_host_data.set_quoted('CONFIG_QEMU_LOCALEDIR', get_option('prefix') = / get_option('localedir')) -config_host_data.set_quoted('CONFIG_QEMU_LOCALSTATEDIR', get_option('prefi= x') / get_option('localstatedir')) -config_host_data.set_quoted('CONFIG_QEMU_MODDIR', get_option('prefix') / q= emu_moddir) -config_host_data.set_quoted('CONFIG_SYSCONFDIR', get_option('prefix') / ge= t_option('sysconfdir')) +config_host_data.set_quoted('CONFIG_QEMU_CONFDIR', qemu_confdir) +config_host_data.set_quoted('CONFIG_QEMU_DATADIR', qemu_datadir) +config_host_data.set_quoted('CONFIG_QEMU_FIRMWAREPATH', get_option('qemu_f= irmwarepath')) +config_host_data.set_quoted('CONFIG_QEMU_HELPERDIR', get_option('libexecdi= r')) +config_host_data.set_quoted('CONFIG_QEMU_ICONDIR', qemu_icondir) +config_host_data.set_quoted('CONFIG_QEMU_LOCALEDIR', get_option('localedir= ')) +config_host_data.set_quoted('CONFIG_QEMU_LOCALSTATEDIR', get_option('local= statedir')) +config_host_data.set_quoted('CONFIG_QEMU_MODDIR', qemu_moddir) +config_host_data.set_quoted('CONFIG_SYSCONFDIR', get_option('sysconfdir')) =20 if config_host.has_key('CONFIG_MODULES') config_host_data.set('CONFIG_STAMP', run_command( diff --git a/qemu-options.hx b/qemu-options.hx index 377d22fbd82..f0ae8f44ff2 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -2661,12 +2661,11 @@ DEF("netdev", HAS_ARG, QEMU_OPTION_netdev, " [,poll-us=3Dn]\n" " configure a host TAP network backend with ID 'str'\n" " connected to a bridge (default=3D" DEFAULT_BRIDGE_INT= ERFACE ")\n" - " use network scripts 'file' (default=3D" DEFAULT_NETWO= RK_SCRIPT ")\n" - " to configure it and 'dfile' (default=3D" DEFAULT_NETW= ORK_DOWN_SCRIPT ")\n" - " to deconfigure it\n" + " use custom network script 'file' to configure it (opt= ional)\n" + " use custom network script 'dfile' to deconfigure it (= optional)\n" " use '[down]script=3Dno' to disable script execution\n" - " use network helper 'helper' (default=3D" DEFAULT_BRID= GE_HELPER ") to\n" - " configure it\n" + " use custom network helper 'helper' to\n" + " configure it (optional)\n" " use 'fd=3Dh' to connect to an already opened TAP inte= rface\n" " use 'fds=3Dx:y:...:z' to connect to already opened mu= ltiqueue capable TAP interfaces\n" " use 'sndbuf=3Dnbytes' to limit the size of the send b= uffer (the\n" @@ -2684,7 +2683,7 @@ DEF("netdev", HAS_ARG, QEMU_OPTION_netdev, "-netdev bridge,id=3Dstr[,br=3Dbridge][,helper=3Dhelper]\n" " configure a host TAP network backend with ID 'str' th= at is\n" " connected to a bridge (default=3D" DEFAULT_BRIDGE_INT= ERFACE ")\n" - " using the program 'helper (default=3D" DEFAULT_BRIDGE= _HELPER ")\n" + " using the custom program 'helper' (optional)\n" #endif #ifdef __linux__ "-netdev l2tpv3,id=3Dstr,src=3Dsrcaddr,dst=3Ddstaddr[,srcport=3Dsrcpor= t][,dstport=3Ddstport]\n" diff --git a/util/cutils.c b/util/cutils.c index a58bcfd80e7..983db97b4df 100644 --- a/util/cutils.c +++ b/util/cutils.c @@ -917,13 +917,6 @@ int qemu_pstrcmp0(const char **str1, const char **str2) return g_strcmp0(*str1, *str2); } =20 -static inline bool starts_with_prefix(const char *dir) -{ - size_t prefix_len =3D strlen(CONFIG_PREFIX); - return !memcmp(dir, CONFIG_PREFIX, prefix_len) && - (!dir[prefix_len] || G_IS_DIR_SEPARATOR(dir[prefix_len])); -} - /* Return the next path component in dir, and store its length in *p_len. = */ static inline const char *next_component(const char *dir, int *p_len) { @@ -967,7 +960,7 @@ void qemu_init_exec_dir(const char *argv0) if (access(buf, R_OK) =3D=3D 0) { exec_dir =3D g_strdup(buf); } else { - exec_dir =3D CONFIG_BINDIR; + exec_dir =3D CONFIG_PREFIX G_DIR_SEPARATOR_S CONFIG_BINDIR; } #else char *p =3D NULL; @@ -1038,7 +1031,7 @@ void qemu_init_exec_dir(const char *argv0) if (p) { exec_dir =3D g_path_get_dirname(p); } else { - exec_dir =3D CONFIG_BINDIR; + exec_dir =3D CONFIG_PREFIX G_DIR_SEPARATOR_S CONFIG_BINDIR; } #endif } @@ -1050,39 +1043,26 @@ const char *qemu_get_exec_dir(void) =20 char *get_relocated_path(const char *dir) { - size_t prefix_len =3D strlen(CONFIG_PREFIX); const char *bindir =3D CONFIG_BINDIR; const char *exec_dir =3D qemu_get_exec_dir(); GString *result; - int len_dir, len_bindir; + int len_bindir; =20 /* Fail if qemu_init_exec_dir was not called. */ assert(exec_dir[0]); - if (!starts_with_prefix(dir) || !starts_with_prefix(bindir)) { - return g_strdup(dir); - } =20 result =3D g_string_new(exec_dir); =20 - /* Advance over common components. */ - len_dir =3D len_bindir =3D prefix_len; - do { - dir +=3D len_dir; - bindir +=3D len_bindir; - dir =3D next_component(dir, &len_dir); - bindir =3D next_component(bindir, &len_bindir); - } while (len_dir && len_dir =3D=3D len_bindir && !memcmp(dir, bindir, = len_dir)); - /* Ascend from bindir to the common prefix with dir. */ + len_bindir =3D 0; while (len_bindir) { bindir +=3D len_bindir; g_string_append(result, "/.."); bindir =3D next_component(bindir, &len_bindir); } =20 - if (*dir) { - assert(G_IS_DIR_SEPARATOR(dir[-1])); - g_string_append(result, dir - 1); - } + g_string_append_c(result, G_DIR_SEPARATOR); + g_string_append(result, dir); + return g_string_free(result, false); } --=20 2.32.1 (Apple Git-133) From nobody Mon Feb 9 07:27:24 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1655310144; cv=none; d=zohomail.com; s=zohoarc; b=VzthBDwZI43f+yEmACW+LeG9Sa+a8Bwu8FDOHMDST2eHp1FW4lxaqTbn4B9GZWyeb9oJBFPSoAVq/H+LDxw/zE9z3vDkYH3RaPSeNz/MvVycfJim6coZIp4UxKOA+uX9eb+tCEkZEfAA/kaZMyJbwVyNWmsOOzIyywCIay1i7Y0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1655310144; h=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; bh=KXc6SQ4/ZT/156FA8Jji8li+LKGk+3eODBLnw943x5o=; b=cBTfRpyuB1iXjJsLaP3GZv8sWpMBENwMZ8np/P28gH7RQg6T+ctPt0AYLnofWzCdEcDjAGPxVnT36h8P+YZSXH6OQSVqw8KEEkuR72+MNHUKChOy+S5dIAglfz7N3sG/H6CBL2zyc0yy3JXfvVIF8Qmu+NDIwiNSiFM3sM7LPBE= 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 1655310144841847.6953515639609; Wed, 15 Jun 2022 09:22:24 -0700 (PDT) Received: from localhost ([::1]:57834 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o1Vmh-0004a7-D7 for importer@patchew.org; Wed, 15 Jun 2022 12:22:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44972) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1VO9-0008Kh-9K for qemu-devel@nongnu.org; Wed, 15 Jun 2022 11:57:01 -0400 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]:42649) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o1VO7-00089G-Ik for qemu-devel@nongnu.org; Wed, 15 Jun 2022 11:57:01 -0400 Received: by mail-pj1-x1031.google.com with SMTP id o33-20020a17090a0a2400b001ea806e48c6so2456212pjo.1 for ; Wed, 15 Jun 2022 08:56:59 -0700 (PDT) Received: from localhost.localdomain ([2400:4050:c360:8200:4126:b1a8:8fce:1a8]) by smtp.gmail.com with ESMTPSA id a34-20020a056a001d2200b0051874318772sm9860038pfx.201.2022.06.15.08.56.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Jun 2022 08:56:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KXc6SQ4/ZT/156FA8Jji8li+LKGk+3eODBLnw943x5o=; b=RYXyKyw52FAh/dKz07E3jhacN+SrjGeqV1Q+zHVYW2+GryK0Nohvhq1Dq50UET4rJR LiAfmwGzZLYHye5ys7fmpMOLckbMOwOxNTVpWta9IkvkVeFxLWttJDYqZpwgo39hWW71 H61N5yYCif/GGSARScoyOe8/OIWujJgsHCx2A41YaqDymCqGGmFsnflNP4ye4oJ/9x21 VjoECpdgZqfN4ZDEwIj6SyDFyj997NqYYdufEOO9QkgkvSaSUX9crBVIzf9QKTZTjebO sKdRJSglr4Hgzc0q7OCRESn5nwPFz1Uc5oB9nQiZVRQB4EmAe+Sd4vLKIQQPXQuwxV8b VqeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KXc6SQ4/ZT/156FA8Jji8li+LKGk+3eODBLnw943x5o=; b=Fjsf3Ojb9w7Dc291uowDaKEVi0BGQM/TkOBNCsGWBuNS8X6q8M0Nn9NJZRPMkhiMZj w0x8U2BvbWg6dcNwzClciA5JJ4FwYxSg/gj5oUZpHuUHXXHHOANf2YIQKqHRdI87ywTG PZV+G4I8X3pOoBhkFtxfd+za1kShM8znHLihAUitqlL+FSQd3jyD8+9SSYPO+LYG7L7L Je6MZRG9gkyyjPjcmjjOGxvNL4vx6J1PMkEHapdugUrVOZQnwyF2w5RU2raykkyROU2s z2lxIjfi87BNnpeBKYYwKdFzge1rbUfO5axAQ5+x+2jtRrA9N0+I7QjO2YZwHInX7YaK NQNw== X-Gm-Message-State: AJIora9Kk04RKu7kKtTj2v/SR1bTID2z6VxvhEfDwxss8Oowjnk9xJJ0 0AsrJIEqsZlXB5KEQUML/as= X-Google-Smtp-Source: AGRyM1vYokWyee8Jzq+tdoAHlW541h+IPfnUNB5Dn3+9kAbYNdscDkLUFv+1fjbdZ0GkzWYRMUW5OQ== X-Received: by 2002:a17:903:186:b0:167:62b0:a556 with SMTP id z6-20020a170903018600b0016762b0a556mr270864plg.122.1655308618253; Wed, 15 Jun 2022 08:56:58 -0700 (PDT) From: Akihiko Odaki To: Cc: Peter Maydell , Jason Wang , qemu-devel@nongnu.org, Programmingkid , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Paolo Bonzini , Akihiko Odaki Subject: [PATCH v6 4/7] cutils: Introduce bundle mechanism Date: Thu, 16 Jun 2022 00:56:31 +0900 Message-Id: <20220615155634.578-5-akihiko.odaki@gmail.com> X-Mailer: git-send-email 2.32.1 (Apple Git-133) In-Reply-To: <20220615155634.578-1-akihiko.odaki@gmail.com> References: <20220615155634.578-1-akihiko.odaki@gmail.com> MIME-Version: 1.0 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=2607:f8b0:4864:20::1031; envelope-from=akihiko.odaki@gmail.com; helo=mail-pj1-x1031.google.com 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1655310145732100001 Content-Type: text/plain; charset="utf-8" Developers often run QEMU without installing. The bundle mechanism allows to look up files which should be present in installation even in such a situation. It is a general mechanism and can find any files located relative to the installation tree. The build tree must have a new directory, qemu-bundle, to represent what files the installation tree would have for reference by the executables. Signed-off-by: Akihiko Odaki --- include/qemu/cutils.h | 19 +++++++++++++++++++ meson.build | 12 ++++++++++++ util/cutils.c | 23 +++++++++++++++++++++++ 3 files changed, 54 insertions(+) diff --git a/include/qemu/cutils.h b/include/qemu/cutils.h index 57de1da5c95..ca5bddb9e1c 100644 --- a/include/qemu/cutils.h +++ b/include/qemu/cutils.h @@ -213,6 +213,25 @@ const char *qemu_get_exec_dir(void); */ char *get_relocated_path(const char *dir); =20 +/** + * find_bundle: + * @path: Relative path + * + * Returns a path for the specified directory or file bundled in QEMU. It = uses + * the directory of the running executable as the prefix first. See + * get_relocated_path() for the details. The next candidate is "qemu-bundl= e" + * directory in the directory of the running executable. "qemu-bundle" + * directory is typically present in the build tree. + * + * The returned string should be freed by the caller. + * + * Returns: a path that can access the bundle, or NULL if no matching bund= le + * exists. + */ +char *find_bundle(const char *path); + +void list_bundle_candidates(const char *path); + static inline const char *yes_no(bool b) { return b ? "yes" : "no"; diff --git a/meson.build b/meson.build index 01d5e32615e..ab5ab85bf4e 100644 --- a/meson.build +++ b/meson.build @@ -32,6 +32,7 @@ if get_option('qemu_suffix').startswith('/') error('qemu_suffix cannot start with a /') endif =20 +qemu_bundledir =3D meson.project_build_root() / 'qemu-bundle' qemu_confdir =3D get_option('sysconfdir') / get_option('qemu_suffix') qemu_datadir =3D get_option('datadir') / get_option('qemu_suffix') qemu_docdir =3D get_option('docdir') / get_option('qemu_suffix') @@ -2843,6 +2844,8 @@ target_arch =3D {} target_softmmu_arch =3D {} target_user_arch =3D {} =20 +bundles =3D {} + ############### # Trace files # ############### @@ -3613,6 +3616,15 @@ if host_machine.system() =3D=3D 'windows' alias_target('installer', nsis) endif =20 +########### +# Bundles # +########### + +foreach dst, src: bundles + run_command('mkdir', '-p', qemu_bundledir / fs.parent(dst), check: true) + run_command('ln', '-sf', src, qemu_bundledir / dst, check: true) +endforeach + ######################### # Configuration summary # ######################### diff --git a/util/cutils.c b/util/cutils.c index 983db97b4df..64cb1616b9c 100644 --- a/util/cutils.c +++ b/util/cutils.c @@ -1066,3 +1066,26 @@ char *get_relocated_path(const char *dir) =20 return g_string_free(result, false); } + +char *find_bundle(const char *path) +{ + char *bundle =3D g_strdup_printf("%s/qemu-bundle/%s", qemu_get_exec_di= r(), path); + if (access(bundle, R_OK) =3D=3D 0) { + return bundle; + } + + g_free(bundle); + + return get_relocated_path(path); +} + +void list_bundle_candidates(const char *path) +{ + const char *dir =3D qemu_get_exec_dir(); + int i; + + for (i =3D 0; i < ARRAY_SIZE(bundle_formats); i++) { + printf(bundle_formats[i], dir, path); + putc('\n', stdout); + } +} --=20 2.32.1 (Apple Git-133) From nobody Mon Feb 9 07:27:24 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1655310338; cv=none; d=zohomail.com; s=zohoarc; b=SGkvHHU1LVMxyvAEFsV8Dzm5DLgGSD5VDm1hHtRmqV2DB6TD3/9aHjMo/xLzOYKT9dREArM76mzvnUh756/1Zexg91qI7ZH5eDRyEteJy+X4EkhuIGt4vUq7fxA7ChoBjAB/qqxpenN2qe1eQTRdFz/e58sh+Ds1qU0qoBh5QGA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1655310338; h=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; bh=O6RR+vLGrAkR3efRVWWWkgKfxWsctyaqZ/GYPqpmAAQ=; b=XcMhzXwmzO8YgN6ndXT/vjNnR67y9dfaaAqA8ESG3Osia8kaYcD7RpXOKUDrGld0mR2SQRX+O8eNiGDyKbbJsEKkdQjtQeCEIWrfPm3r4KlnnJVZU7AAjF3y/Sk0SrOFhQt7GzJMPXEoknOrYad3LT7nN9FfpFUlBIT8iSQtHo8= 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 1655310338091773.0939307016994; Wed, 15 Jun 2022 09:25:38 -0700 (PDT) Received: from localhost ([::1]:38200 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o1Vpo-00020a-MF for importer@patchew.org; Wed, 15 Jun 2022 12:25:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44998) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1VOD-0008UP-1r for qemu-devel@nongnu.org; Wed, 15 Jun 2022 11:57:05 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]:39842) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o1VOB-00089f-11 for qemu-devel@nongnu.org; Wed, 15 Jun 2022 11:57:04 -0400 Received: by mail-pf1-x430.google.com with SMTP id y196so11827902pfb.6 for ; Wed, 15 Jun 2022 08:57:02 -0700 (PDT) Received: from localhost.localdomain ([2400:4050:c360:8200:4126:b1a8:8fce:1a8]) by smtp.gmail.com with ESMTPSA id a34-20020a056a001d2200b0051874318772sm9860038pfx.201.2022.06.15.08.56.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Jun 2022 08:57:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=O6RR+vLGrAkR3efRVWWWkgKfxWsctyaqZ/GYPqpmAAQ=; b=LPplqYN77pBQU8P1Y0652J74a/JKJKxKwjZg3PWaOe2wh7bEGBW/jKC1vv4mUEsQNt Q3cX7z1LgyyKTjIYqFK3KnGOgsfJfnMsT0be9hM9vp72oN6Tm9YgH+Eyw5seQp58YFkf WyT9lgnD7ctIECjbjHwcUpGJLFW1xrC7nYeqCoeK6thnNiEQ/kh85Mmmur7AlcuggboF hIsArj4b+9fJq2Dm5G9hYQgdSGG0BVf27JKs7rMLo34dLI1mUaEQNlfSWqP/2uPEATze UrUrXQiznIB8G6t+Izun1wE7ImG+sE3AwwjjitAy/d9KLLjSPME4wVKg5XRM/h1etltf 1XTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=O6RR+vLGrAkR3efRVWWWkgKfxWsctyaqZ/GYPqpmAAQ=; b=Kw9uDOj37UfCU47yVNOSWPbkUA2nSOF7bksnkVKYp6qFWVnl05cGJGF4a4sfy+ngl8 dJXoUiqiOAYLE9OFBaGsbUVAswLMMmCnPblBIkNbtEIqeBN0TiUgnLi+aEL6y+f9b92N easTKtkKe9PjCkEVOnsZu5xPKt+83Bd4FXb9BfhjFQknd3h2bx2p2hb/hTMnEq448Ggu EuhKSgdj8wW4xm+Iut+vOEytNDI8mQ5b1AhP2lDFeUWfcH2X1YcHhejNGSRnbzatHLvW yQ1aK8WlHDuOQ26SP/vqA/zzUQGFdw4U7+tyx0dvsyyeBHGKLUc4y6psgljY6vTFHLVi 9m/Q== X-Gm-Message-State: AJIora+w56772jNK32LIb6my/74h/7xEscB6dzrtzffL4iOTmWkjv27t FGF2VitIUIDezMLtU/rf7Qk= X-Google-Smtp-Source: AGRyM1uHqBSJPTax8HPZLuuDDY127tfqDlNIgAYX+SfKH+Zy8qeQ5Zlk6nvaRZvNlfUI0XigAZuPbA== X-Received: by 2002:a05:6a02:19c:b0:3aa:1bf8:7388 with SMTP id bj28-20020a056a02019c00b003aa1bf87388mr380240pgb.455.1655308621197; Wed, 15 Jun 2022 08:57:01 -0700 (PDT) From: Akihiko Odaki To: Cc: Peter Maydell , Jason Wang , qemu-devel@nongnu.org, Programmingkid , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Paolo Bonzini , Akihiko Odaki Subject: [PATCH v6 5/7] datadir: Use bundle mechanism Date: Thu, 16 Jun 2022 00:56:32 +0900 Message-Id: <20220615155634.578-6-akihiko.odaki@gmail.com> X-Mailer: git-send-email 2.32.1 (Apple Git-133) In-Reply-To: <20220615155634.578-1-akihiko.odaki@gmail.com> References: <20220615155634.578-1-akihiko.odaki@gmail.com> MIME-Version: 1.0 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=2607:f8b0:4864:20::430; envelope-from=akihiko.odaki@gmail.com; helo=mail-pf1-x430.google.com 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1655310340036100001 Content-Type: text/plain; charset="utf-8" softmmu/datadir.c had its own implementation to find files in the build tree, but now bundle mechanism provides the unified implementation which works for datadir and the other files. Signed-off-by: Akihiko Odaki --- .travis.yml | 2 +- pc-bios/keymaps/meson.build | 2 ++ pc-bios/meson.build | 19 +++++++++---------- scripts/oss-fuzz/build.sh | 2 +- softmmu/datadir.c | 32 ++++++++------------------------ tests/qtest/fuzz/fuzz.c | 15 --------------- tests/vm/fedora | 2 +- tests/vm/freebsd | 2 +- tests/vm/netbsd | 2 +- tests/vm/openbsd | 2 +- util/cutils.c | 10 +++------- 11 files changed, 28 insertions(+), 62 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9afc4a54b8f..9fee2167b95 100644 --- a/.travis.yml +++ b/.travis.yml @@ -223,7 +223,7 @@ jobs: - BUILD_RC=3D0 && make -j${JOBS} || BUILD_RC=3D$? - | if [ "$BUILD_RC" -eq 0 ] ; then - mv pc-bios/s390-ccw/*.img pc-bios/ ; + mv pc-bios/s390-ccw/*.img qemu-bundle/share/qemu ; ${TEST_CMD} ; else $(exit $BUILD_RC); diff --git a/pc-bios/keymaps/meson.build b/pc-bios/keymaps/meson.build index 44247a12b54..dd103092290 100644 --- a/pc-bios/keymaps/meson.build +++ b/pc-bios/keymaps/meson.build @@ -67,3 +67,5 @@ if native_qemu_keymap.found() endif =20 install_data(['sl', 'sv'], install_dir: qemu_datadir / 'keymaps') + +bundles +=3D { qemu_datadir / 'keymaps': '../../../pc-bios/keymaps' } diff --git a/pc-bios/meson.build b/pc-bios/meson.build index 41ba1c0ec7b..0d2119836bd 100644 --- a/pc-bios/meson.build +++ b/pc-bios/meson.build @@ -20,6 +20,8 @@ if unpack_edk2_blobs install: get_option('install_blobs'), install_dir: qemu_datadir, command: [ bzip2, '-dc', '@INPUT0@' ]) + + bundles +=3D { qemu_datadir / f: '../../../pc-bios' / f } endforeach endif =20 @@ -85,16 +87,13 @@ blobs =3D [ 'vof-nvram.bin', ] =20 -ln_s =3D [find_program('ln', required: true), '-sf'] -foreach f : blobs - roms +=3D custom_target(f, - build_by_default: have_system, - output: f, - input: files('meson.build'), # dummy input - install: get_option('install_blobs'), - install_dir: qemu_datadir, - command: [ ln_s, meson.project_source_root() / 'pc-bios' /= f, '@OUTPUT@' ]) -endforeach +if get_option('install_blobs') + install_data(blobs, install_dir: qemu_datadir) + + foreach f : blobs + bundles +=3D { qemu_datadir / f: meson.current_source_dir() / f } + endforeach +endif =20 subdir('descriptors') subdir('keymaps') diff --git a/scripts/oss-fuzz/build.sh b/scripts/oss-fuzz/build.sh index 98b56e05210..cbf8b3080e9 100755 --- a/scripts/oss-fuzz/build.sh +++ b/scripts/oss-fuzz/build.sh @@ -88,7 +88,7 @@ if [ "$GITLAB_CI" !=3D "true" ]; then fi =20 # Copy over the datadir -cp -r ../pc-bios/ "$DEST_DIR/pc-bios" +cp -r ../pc-bios/ "$DEST_DIR/qemu-bundle/share/qemu" =20 targets=3D$(./qemu-fuzz-i386 | awk '$1 ~ /\*/ {print $2}') base_copy=3D"$DEST_DIR/qemu-fuzz-i386-target-$(echo "$targets" | head -n 1= )" diff --git a/softmmu/datadir.c b/softmmu/datadir.c index 2a206f2740a..338479baddd 100644 --- a/softmmu/datadir.c +++ b/softmmu/datadir.c @@ -35,6 +35,7 @@ char *qemu_find_file(int type, const char *name) int i; const char *subdir; char *buf; + char *bundle; =20 /* Try the name as a straight path first */ if (access(name, R_OK) =3D=3D 0) { @@ -61,7 +62,12 @@ char *qemu_find_file(int type, const char *name) } g_free(buf); } - return NULL; + + bundle =3D g_strdup_printf("%s/%s%s", CONFIG_QEMU_DATADIR, subdir, nam= e); + buf =3D find_bundle(bundle); + g_free(bundle); + trace_load_file(name, buf); + return buf; } =20 void qemu_add_data_dir(char *path) @@ -83,33 +89,10 @@ void qemu_add_data_dir(char *path) data_dir[data_dir_idx++] =3D path; } =20 -/* - * Find a likely location for support files using the location of the bina= ry. - * When running from the build tree this will be "$bindir/pc-bios". - * Otherwise, this is CONFIG_QEMU_DATADIR (possibly relocated). - * - * The caller must use g_free() to free the returned data when it is - * no longer required. - */ -static char *find_datadir(void) -{ - g_autofree char *dir =3D NULL; - - dir =3D g_build_filename(qemu_get_exec_dir(), "pc-bios", NULL); - if (g_file_test(dir, G_FILE_TEST_IS_DIR)) { - return g_steal_pointer(&dir); - } - - return get_relocated_path(CONFIG_QEMU_DATADIR); -} - void qemu_add_default_firmwarepath(void) { /* add the configured firmware directory */ qemu_add_data_dir(get_relocated_path(CONFIG_QEMU_FIRMWAREPATH)); - - /* try to find datadir relative to the executable path */ - qemu_add_data_dir(find_datadir()); } =20 void qemu_list_data_dirs(void) @@ -118,4 +101,5 @@ void qemu_list_data_dirs(void) for (i =3D 0; i < data_dir_idx; i++) { printf("%s\n", data_dir[i]); } + list_bundle_candidates(CONFIG_QEMU_DATADIR); } diff --git a/tests/qtest/fuzz/fuzz.c b/tests/qtest/fuzz/fuzz.c index 0ad4ba9e94d..2062b40d82b 100644 --- a/tests/qtest/fuzz/fuzz.c +++ b/tests/qtest/fuzz/fuzz.c @@ -174,21 +174,6 @@ int LLVMFuzzerInitialize(int *argc, char ***argv, char= ***envp) target_name =3D strstr(**argv, "-target-"); if (target_name) { /* The binary name specifies the target */ target_name +=3D strlen("-target-"); - /* - * With oss-fuzz, the executable is kept in the root of a director= y (we - * cannot assume the path). All data (including bios binaries) mus= t be - * in the same dir, or a subdir. Thus, we cannot place the pc-bios= so - * that it would be in exec_dir/../pc-bios. - * As a workaround, oss-fuzz allows us to use argv[0] to get the - * location of the executable. Using this we add exec_dir/pc-bios = to - * the datadirs. - */ - bindir =3D qemu_get_exec_dir(); - datadir =3D g_build_filename(bindir, "pc-bios", NULL); - if (g_file_test(datadir, G_FILE_TEST_IS_DIR)) { - qemu_add_data_dir(datadir); - } else { - g_free(datadir); } } else if (*argc > 1) { /* The target is specified as an argument */ target_name =3D (*argv)[1]; diff --git a/tests/vm/fedora b/tests/vm/fedora index 92b78d6e2c9..4ccd31bba61 100755 --- a/tests/vm/fedora +++ b/tests/vm/fedora @@ -79,7 +79,7 @@ class FedoraVM(basevm.BaseVM): self.exec_qemu_img("create", "-f", "qcow2", img_tmp, self.size) self.print_step("Booting installer") self.boot(img_tmp, extra_args =3D [ - "-bios", "pc-bios/bios-256k.bin", + "-bios", "qemu-bundle/share/qemu/bios-256k.bin", "-machine", "graphics=3Doff", "-device", "VGA", "-cdrom", iso diff --git a/tests/vm/freebsd b/tests/vm/freebsd index 805db759d67..2095d8c5204 100755 --- a/tests/vm/freebsd +++ b/tests/vm/freebsd @@ -95,7 +95,7 @@ class FreeBSDVM(basevm.BaseVM): =20 self.print_step("Booting installer") self.boot(img_tmp, extra_args =3D [ - "-bios", "pc-bios/bios-256k.bin", + "-bios", "qemu-bundle/share/qemu/bios-256k.bin", "-machine", "graphics=3Doff", "-device", "VGA", "-cdrom", iso diff --git a/tests/vm/netbsd b/tests/vm/netbsd index 45aa9a7fda7..d59cfedb83e 100755 --- a/tests/vm/netbsd +++ b/tests/vm/netbsd @@ -86,7 +86,7 @@ class NetBSDVM(basevm.BaseVM): =20 self.print_step("Booting installer") self.boot(img_tmp, extra_args =3D [ - "-bios", "pc-bios/bios-256k.bin", + "-bios", "qemu-bundle/share/qemu/bios-256k.bin", "-machine", "graphics=3Doff", "-cdrom", iso ]) diff --git a/tests/vm/openbsd b/tests/vm/openbsd index 13c82542140..036907c6243 100755 --- a/tests/vm/openbsd +++ b/tests/vm/openbsd @@ -82,7 +82,7 @@ class OpenBSDVM(basevm.BaseVM): =20 self.print_step("Booting installer") self.boot(img_tmp, extra_args =3D [ - "-bios", "pc-bios/bios-256k.bin", + "-bios", "qemu-bundle/share/qemu/bios-256k.bin", "-machine", "graphics=3Doff", "-device", "VGA", "-cdrom", iso diff --git a/util/cutils.c b/util/cutils.c index 64cb1616b9c..c3aea6c6f68 100644 --- a/util/cutils.c +++ b/util/cutils.c @@ -1081,11 +1081,7 @@ char *find_bundle(const char *path) =20 void list_bundle_candidates(const char *path) { - const char *dir =3D qemu_get_exec_dir(); - int i; - - for (i =3D 0; i < ARRAY_SIZE(bundle_formats); i++) { - printf(bundle_formats[i], dir, path); - putc('\n', stdout); - } + char *relocated =3D get_relocated_path(path); + printf("%s/qemu-bundle/%s\n%s\n", qemu_get_exec_dir(), path, relocated= ); + g_free(relocated); } --=20 2.32.1 (Apple Git-133) From nobody Mon Feb 9 07:27:24 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1655310895; cv=none; d=zohomail.com; s=zohoarc; b=UaOuC32VAiOqsuvjG3WLd/rLxuINwA3KPH6l5sBY97yY0eTKaPNITT5eR2fa9zyrGySRP711atQECK4ZRKYRUrio+K+iFqSphtsTG/uwa9yU6KuIq0HBJIRD4YgYA0ZPbfgkxpeXfr/hwuQslkr/SvontpaVU966ZXiwPBZNZIo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1655310895; h=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; bh=DQtJaRgK10AOuN9AFp97oqWrDlmZlm3MK6vebjeI1so=; b=V1UhY6ixCt1oDg75ihMwS2Wgkg2TYKj7kMFLx1atAJE2CJuL4WQx5wx1fLRZox6cyUZZH+H1Rh68nentjcc0WrX3UixCJ2OZq0gP+qnPG6E7Pp5fpd6ZugETimoaS6sW8MZXnm4FATQPHVoYbaQmiDNy96eVauLdRFYhZuPowWo= 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 1655310895334322.8506093514693; Wed, 15 Jun 2022 09:34:55 -0700 (PDT) Received: from localhost ([::1]:54836 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o1Vyn-0005MY-5g for importer@patchew.org; Wed, 15 Jun 2022 12:34:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45008) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1VOE-00008f-GQ for qemu-devel@nongnu.org; Wed, 15 Jun 2022 11:57:06 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]:33664) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o1VOC-00087u-Tl for qemu-devel@nongnu.org; Wed, 15 Jun 2022 11:57:06 -0400 Received: by mail-pl1-x62b.google.com with SMTP id f9so10819483plg.0 for ; Wed, 15 Jun 2022 08:57:04 -0700 (PDT) Received: from localhost.localdomain ([2400:4050:c360:8200:4126:b1a8:8fce:1a8]) by smtp.gmail.com with ESMTPSA id a34-20020a056a001d2200b0051874318772sm9860038pfx.201.2022.06.15.08.57.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Jun 2022 08:57:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DQtJaRgK10AOuN9AFp97oqWrDlmZlm3MK6vebjeI1so=; b=DPQ6dIFnu6Wz34BQAap1dhuD72PkXzZCiVClN6BSKmsVmYdODu915TobJPSwRsdI3t 7kzkM/6Yepkib4VJbpduhZ2eNEkz8jEwyJCPkuzAhhFjaI4HZXcT4UZz+APEfG5wnA9q w9KeIS0hWwiywQt3N49C13zEjEhNR7CLW5Jxw5m1umsi4/wKZ8v2uFCfiVc0x1+dukpV sx/AbX1oKdDySSVFwl9TgkqT8EXCGhmrkVW3D0jeJNO9uuDzpT7wZMYt5ZYC5bNoyFPN OVekeE5a6KhJHs5kN7mno/zHpMJLsMgDmrTWE6dtmhUwJgn0onrSYQ42MBzd0HgH3YNY yDhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DQtJaRgK10AOuN9AFp97oqWrDlmZlm3MK6vebjeI1so=; b=AMqvuG9R0cp4oVvUO/dI+Fj9Yp9ojjkV63vM9EPbgGYP1rqLg/EKRg8CyfopGZCvmw 7pLghvM95Gv2JX/+DiBr78SiERmTauBTt9xmGQDuEtR8/h2kl0PJe7poItD2j3wOkaR0 PXzxRNmA6oUKOBiPwzVpZRRNocyFEn6GxextuBmmAtIfJLM487lC90y7pHVKb0L3cvJb 6F3PjlvmyHjphRMK2gJwXFdtwJakxK6NeJNjZNFwo6T9saMT2E5ZZuuxYBlUou/FYPkz To+OXoTs8Kz6HGIteXgjB8jDpnvLO9pxNN6k2rhd34JeTn3kMvujM2MXkLEnzmwukAjX NXsQ== X-Gm-Message-State: AJIora/J2KayjNYGcqFycG1szInhnxX9pk+0GjSxfZ3vEzTk9THczCRD 9D+ULbyD3LaC2PL2Gxqm0LI= X-Google-Smtp-Source: AGRyM1ti5gJP4STBKlRjs8KANz+ER6clcbEZ80FAyFsiZEw86R4Rh6u2jqwJRdk+t9U47m14Lw4ywQ== X-Received: by 2002:a17:902:ecc2:b0:163:fe60:43cd with SMTP id a2-20020a170902ecc200b00163fe6043cdmr242963plh.43.1655308624163; Wed, 15 Jun 2022 08:57:04 -0700 (PDT) From: Akihiko Odaki To: Cc: Peter Maydell , Jason Wang , qemu-devel@nongnu.org, Programmingkid , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Paolo Bonzini , Akihiko Odaki Subject: [PATCH v6 6/7] ui/icons: Use bundle mechanism Date: Thu, 16 Jun 2022 00:56:33 +0900 Message-Id: <20220615155634.578-7-akihiko.odaki@gmail.com> X-Mailer: git-send-email 2.32.1 (Apple Git-133) In-Reply-To: <20220615155634.578-1-akihiko.odaki@gmail.com> References: <20220615155634.578-1-akihiko.odaki@gmail.com> MIME-Version: 1.0 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=2607:f8b0:4864:20::62b; envelope-from=akihiko.odaki@gmail.com; helo=mail-pl1-x62b.google.com 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1655310896217100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Akihiko Odaki --- ui/cocoa.m | 2 +- ui/gtk.c | 2 +- ui/icons/meson.build | 32 ++++++++++++++++++++++++-------- ui/sdl2.c | 4 ++-- 4 files changed, 28 insertions(+), 12 deletions(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index 84c84e98fc5..25584cc78ce 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -1562,7 +1562,7 @@ - (BOOL)verifyQuit - (IBAction) do_about_menu_item: (id) sender { NSAutoreleasePool *pool =3D [[NSAutoreleasePool alloc] init]; - char *icon_path_c =3D get_relocated_path(CONFIG_QEMU_ICONDIR "/hicolor= /512x512/apps/qemu.png"); + char *icon_path_c =3D find_bundle(CONFIG_QEMU_ICONDIR "/hicolor/512x51= 2/apps/qemu.png"); NSString *icon_path =3D [NSString stringWithUTF8String:icon_path_c]; g_free(icon_path_c); NSImage *icon =3D [[NSImage alloc] initWithContentsOfFile:icon_path]; diff --git a/ui/gtk.c b/ui/gtk.c index 2a791dd2aa0..27d5a3407cf 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -2321,7 +2321,7 @@ static void gtk_display_init(DisplayState *ds, Displa= yOptions *opts) s->opts =3D opts; =20 theme =3D gtk_icon_theme_get_default(); - dir =3D get_relocated_path(CONFIG_QEMU_ICONDIR); + dir =3D find_bundle(CONFIG_QEMU_ICONDIR); gtk_icon_theme_prepend_search_path(theme, dir); g_free(dir); g_set_prgname("qemu"); diff --git a/ui/icons/meson.build b/ui/icons/meson.build index 12c52080ebd..1d99aff10ed 100644 --- a/ui/icons/meson.build +++ b/ui/icons/meson.build @@ -1,13 +1,29 @@ +icons =3D [ + { + 'source': 'qemu_32x32.bmp', + 'install': 'hicolor' / '32x32' / 'apps' / 'qemu.bmp', + }, + { + 'source': 'qemu.svg', + 'install': 'hicolor' / 'scalable' / 'apps' / 'qemu.svg', + }, +] + foreach s: [16, 24, 32, 48, 64, 128, 256, 512] s =3D '@0@x@0@'.format(s.to_string()) - install_data('qemu_@0@.png'.format(s), - rename: 'qemu.png', - install_dir: qemu_icondir / 'hicolor' / s / 'apps') + icons +=3D { + 'source': 'qemu_@0@.png'.format(s), + 'install': 'hicolor' / s / 'apps' / 'qemu.png', + } endforeach =20 -install_data('qemu_32x32.bmp', - rename: 'qemu.bmp', - install_dir: qemu_icondir / 'hicolor' / '32x32' / 'apps') +foreach icon: icons + source =3D icon.get('source') + install =3D icon.get('install') + + install_data(source, + rename: fs.name(install), + install_dir: qemu_icondir / fs.parent(install)) =20 -install_data('qemu.svg', - install_dir: qemu_icondir / 'hicolor' / 'scalable' / 'apps') + bundles +=3D { qemu_bundledir / qemu_icondir / install: meson.current_so= urce_dir() / source } +endforeach diff --git a/ui/sdl2.c b/ui/sdl2.c index 8cb77416af2..916815cc8a2 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -910,11 +910,11 @@ static void sdl2_display_init(DisplayState *ds, Displ= ayOptions *o) } =20 #ifdef CONFIG_SDL_IMAGE - dir =3D get_relocated_path(CONFIG_QEMU_ICONDIR "/hicolor/128x128/apps/= qemu.png"); + dir =3D find_bundle(CONFIG_QEMU_ICONDIR "/hicolor/128x128/apps/qemu.pn= g"); icon =3D IMG_Load(dir); #else /* Load a 32x32x4 image. White pixels are transparent. */ - dir =3D get_relocated_path(CONFIG_QEMU_ICONDIR "/hicolor/32x32/apps/qe= mu.bmp"); + dir =3D find_bundle(CONFIG_QEMU_ICONDIR "/hicolor/32x32/apps/qemu.bmp"= ); icon =3D SDL_LoadBMP(dir); if (icon) { uint32_t colorkey =3D SDL_MapRGB(icon->format, 255, 255, 255); --=20 2.32.1 (Apple Git-133) From nobody Mon Feb 9 07:27:24 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1655310621; cv=none; d=zohomail.com; s=zohoarc; b=DMXICk8gfu61U3X2ZmSYVOHh5F7hO8lceIinKO5YfIX+90oAXOZnC5SPwkmBE7Iw5V4bQ9kRLMwrw4/Ml5zHhSCqtkBK+yyLWMUApyUMSJs2d8XEpcyAJgz+HrdDfqOUBTbGAsZzmRNgvslWyYQQzmWv4qZBo80FpopDuWhoY3g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1655310621; h=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; bh=aG6jWR2ULP2xw6JngYJwBLq712UM8a2hVTANKtklgoI=; b=Jn+LP9bUrC+fC2QisPX08QZJUhSgSNzw4wCYktIG9i78urZVRhKi8sswao1XuVsJEysG1ADC6XghxH2L8pGrxNYV1YHWHSflM2B+kTwG/Hkg3yOlanJF6umjf+BO/IOslCjluPTHYnIgf4+XxIL2cKHwT5peXQnMQVP1UNwNgVM= 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 1655310621004370.0687312852705; Wed, 15 Jun 2022 09:30:21 -0700 (PDT) Received: from localhost ([::1]:47108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o1VuN-0008GC-7P for importer@patchew.org; Wed, 15 Jun 2022 12:30:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45068) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1VOI-0000OP-G5 for qemu-devel@nongnu.org; Wed, 15 Jun 2022 11:57:10 -0400 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]:41672) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o1VOG-0008AZ-92 for qemu-devel@nongnu.org; Wed, 15 Jun 2022 11:57:10 -0400 Received: by mail-pg1-x529.google.com with SMTP id e66so11745019pgc.8 for ; Wed, 15 Jun 2022 08:57:07 -0700 (PDT) Received: from localhost.localdomain ([2400:4050:c360:8200:4126:b1a8:8fce:1a8]) by smtp.gmail.com with ESMTPSA id a34-20020a056a001d2200b0051874318772sm9860038pfx.201.2022.06.15.08.57.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Jun 2022 08:57:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aG6jWR2ULP2xw6JngYJwBLq712UM8a2hVTANKtklgoI=; b=AhiPKTvezwR1nDW7fXaRxBWLMgWaHbXHTSWHvUGvnIjPfXsRjoR34OAwq915QyrtRD Sygd+fEfeEXc86yw+wb13J44yEdggaJz2eVx2luGcINGUIGKGfyznx2uaRBi/qskp2vX PJPLqOT0ZECkYDRpy0VfuKv9E/lGR1lXBG92szYS21GTIMmmUt0W1gYuO2ZzSiKFik2m +GO2Dw7Pgyji1IdGMxv4NlWJBQswFiAmmbT2j43xEhpHMVjVYucMkodtQXcMZF6RuA3C ZIXMxGUjynqXaFmWHxCMwH0ArU0QXK+3r1vnqS3e987+f1wanfTVTJ6tr1qvnQj10Ab/ JHPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aG6jWR2ULP2xw6JngYJwBLq712UM8a2hVTANKtklgoI=; b=Nob7af5Vqp0lVx8odhHKoH9jh2JuJXwS7Q9Kn405pjyzHbKevd60SnHBMHqCf4WzUx 3uEzyjaqFWeqBRgT1vYMFNSFRnLi/ljbcCObcZV3JLhsqmxME4dBn2JnoyNUtsDn0cJQ lbKLw4lveh2s3IdrsbMMnCsYxo04WbZfHkGADf+0X+VZdcwQNblFX0JwJzqvPapCr8MF Nd0pS7Cmx9DvX+uuqzE/omI8mRbGH1HrrztJNRPd5JT3J8GT8mGx64F6eciVVZviY2eG JCASnDx5DL0RHZc8HFjDRZ2PljAK9nVxJsJldMQd48HLUBpCtA4pcAnPw+0n8YXMNP4+ 6wqA== X-Gm-Message-State: AJIora83IiE2LSzXHc1poLb+5u3wXIxA+XJDoy0k4mrpUFm5AhDVGAXe TUNOtLG1O/AEbUdfJ0OftGc= X-Google-Smtp-Source: AGRyM1tXhSt5NlGILA20T/BUDP0DaOb3J6p6LmL+/tahR8sJREpniVtO36TJJTsXcf0HHo4xIqQRRg== X-Received: by 2002:a65:4183:0:b0:3fc:1370:9c37 with SMTP id a3-20020a654183000000b003fc13709c37mr451237pgq.4.1655308627019; Wed, 15 Jun 2022 08:57:07 -0700 (PDT) From: Akihiko Odaki To: Cc: Peter Maydell , Jason Wang , qemu-devel@nongnu.org, Programmingkid , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Paolo Bonzini , Akihiko Odaki Subject: [PATCH v6 7/7] net: Use bundle mechanism Date: Thu, 16 Jun 2022 00:56:34 +0900 Message-Id: <20220615155634.578-8-akihiko.odaki@gmail.com> X-Mailer: git-send-email 2.32.1 (Apple Git-133) In-Reply-To: <20220615155634.578-1-akihiko.odaki@gmail.com> References: <20220615155634.578-1-akihiko.odaki@gmail.com> MIME-Version: 1.0 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=2607:f8b0:4864:20::529; envelope-from=akihiko.odaki@gmail.com; helo=mail-pg1-x529.google.com 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1655310622394100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Akihiko Odaki --- meson.build | 2 ++ net/tap.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index ab5ab85bf4e..72e42048cbe 100644 --- a/meson.build +++ b/meson.build @@ -3574,6 +3574,8 @@ if have_tools dependencies: [authz, crypto, io, qom, qemuutil, libcap_ng, mpathpersist], install: true) + + bundles +=3D { get_option('libexecdir') / 'qemu-bridge-helper': '../..= /qemu-bridge-helper' } endif =20 if have_ivshmem diff --git a/net/tap.c b/net/tap.c index b3ddfd4a74b..5beba85fb22 100644 --- a/net/tap.c +++ b/net/tap.c @@ -507,7 +507,7 @@ static int net_bridge_run_helper(const char *helper, co= nst char *bridge, sigprocmask(SIG_BLOCK, &mask, &oldmask); =20 if (!helper) { - helper =3D default_helper =3D get_relocated_path(DEFAULT_BRIDGE_HE= LPER); + helper =3D default_helper =3D find_bundle(DEFAULT_BRIDGE_HELPER); } =20 if (socketpair(PF_UNIX, SOCK_STREAM, 0, sv) =3D=3D -1) { --=20 2.32.1 (Apple Git-133)