From nobody Mon Feb 9 02:42:48 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=1655315080; cv=none; d=zohomail.com; s=zohoarc; b=Qm4RWaTTVzsooh4c1qrrRHIc1IH3Bkccns19sC8FtDMty0DfNwijddF5UZgcz0/v4Z+xJbvBjKkUvctTN+BUld66fkRdCfhhAfGSu8yeXKG0JM96fYDEgTkx1hmjscQDRr0nvnxAIwW8RQHHyGcPiT1VcHgRm6RIHYfZ87Ra7mw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1655315080; 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=AGXhLgiYStX8YIxK/g8Iu9Mh5vHUGsKkMw45cA/Dbw2rkauo2CEOfO/sVD3ByRWXME9zzsDyassClr4WtVF1bILlnS1bK1++T2fUfeTLfEFwIFqknhcTZg18CaQFPNHsA46DYjZ/rCULD6pjpCcBj3DGNUz28Lhku/2bJLy7ggg= 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 1655315080689565.105663581676; Wed, 15 Jun 2022 10:44:40 -0700 (PDT) Received: from localhost ([::1]:39428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o1X4J-0008U3-FC for importer@patchew.org; Wed, 15 Jun 2022 13:44:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39734) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1Wu6-0007T9-O3 for qemu-devel@nongnu.org; Wed, 15 Jun 2022 13:34:06 -0400 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]:35446) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o1Wty-0006q0-U9 for qemu-devel@nongnu.org; Wed, 15 Jun 2022 13:34:05 -0400 Received: by mail-pj1-x1030.google.com with SMTP id v17-20020a17090a899100b001ead067eaf9so2816584pjn.0 for ; Wed, 15 Jun 2022 10:33:58 -0700 (PDT) Received: from localhost.localdomain ([2400:4050:c360:8200:4126:b1a8:8fce:1a8]) by smtp.gmail.com with ESMTPSA id i13-20020a633c4d000000b003fcf1279c84sm10171451pgn.33.2022.06.15.10.33.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Jun 2022 10:33:56 -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=U7sG9P6iRj6juV0lA30RoY9dHE2zMfacgls5pCYPQa6IZT501hrg2TQq0/MTD35Yz0 lHfVGJMok0xJ8OBEXMW94qTfmyXGcCCoKtj/Z5I3IRyXzFRedJoGVnHDnX+RnsDQga2r l6VW1sv0jpzGqkhJ1idblC9J1Ev5a84cSRBMwu2tohI0DOhSLXlMYcOYimImeDhSu3oE m3fM0zRvZ7+sAdbH0YU3YygO9mvWhT5fxL23So6sv8KA85MbHgElw5GhFfZH08clqrhO HFNo4W1Y3eM2TrykkwYZ2e7E5CZ1hKZLH3Glvi7fikJAjt4IXZa6E78vCBfiXfubQurz g1gQ== 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=SWRC6emJscQsx5OpiSH/8nT6KbWT1DCkbNbaacrSyQ/OVkRL93cgtwODU8pys0Zv6C Pz4MWlglqmLyz2/WivW6Je5CSAS1FyK2sfX0cSom0zv4/RUz+Z9PDeuuDGLtzshIMCrm WuKBqge6/EZY6/svt7ZP6RVyKKnF0Spo0qHU7PNfMEa3on4jY5ebPFtDdFdPDHStLs53 biRRW6C4M8BuijeHiRYqTvLDkQjq1qrZlAeIyc1ZAGyuZ6KKJYXauUSFeimlm4jwgqRU YawQdPecI+/MArGQvSR8uLYn4WuFafpx0CoeQh6cbqAIVc2/oGFsLH++9kBsOObchhtc sHow== X-Gm-Message-State: AJIora97LcWWMIzeN7tEuxmiGtomP5NpoOvxowynlQqiqr7jtPh9kz1i 8dzDjbG/mgquvq3irw9TCYE= X-Google-Smtp-Source: AGRyM1tkW7Xa9CUlUHilDSZjSoQWrh58nr7ASVwQBJXeFUadVgRKftXJHRMd4NthIKAV77F2IWt0eA== X-Received: by 2002:a17:90b:1d08:b0:1e4:dad9:64e5 with SMTP id on8-20020a17090b1d0800b001e4dad964e5mr11339843pjb.200.1655314437559; Wed, 15 Jun 2022 10:33:57 -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 v7 1/6] qga: Relocate a path emitted in the help text Date: Thu, 16 Jun 2022 02:33:40 +0900 Message-Id: <20220615173345.32456-2-akihiko.odaki@gmail.com> X-Mailer: git-send-email 2.32.1 (Apple Git-133) In-Reply-To: <20220615173345.32456-1-akihiko.odaki@gmail.com> References: <20220615173345.32456-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::1030; envelope-from=akihiko.odaki@gmail.com; helo=mail-pj1-x1030.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: 1655315082017100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Akihiko Odaki Reviewed-by: Konstantin Kostiuk Reviewed-by: Marc-Andr=C3=A9 Lureau --- 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 02:42:48 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=1655314796; cv=none; d=zohomail.com; s=zohoarc; b=EwCh56CK+/NT7Vdjb/8AvqF6TEDJiaQHcAoCiqUo2x5mVslNaYwGqFpmKzgFtovMTRiIegR8wnWEVhDJST+HbkcPqvio8tmEBSvf6ZQMFsec1gfys5QkRT+Xbi9OJBHnCuhTg8prZ/B1TxAKClwmTMUbMey/F1lW+kTE+2ZzfE0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1655314796; 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=h6MIJ4t4BwlRaze8TB5KKl1+J/3+nprDtRLJ3HVVNbE=; b=MVGIYr1WSDh59K1xmxRV+VMQRQI8MO+Mx0Sswnn9z46oobO48TQTVUXq19CnaXOeAoHnj7LyAZFaULRf5h36s4dotNTutIXC+ZNpT85AFDq49gwAZ47UEFI8nnSRLm5TNWY3jRIy67nDBX3C1pBxGFvKSbkNPz7GXpbyRk/QASc= 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 1655314796805177.4172378356477; Wed, 15 Jun 2022 10:39:56 -0700 (PDT) Received: from localhost ([::1]:60816 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o1Wzj-0002qj-1d for importer@patchew.org; Wed, 15 Jun 2022 13:39:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39710) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1Wu3-0007Rt-Sk for qemu-devel@nongnu.org; Wed, 15 Jun 2022 13:34:03 -0400 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]:38723) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o1Wu1-0006qO-TK for qemu-devel@nongnu.org; Wed, 15 Jun 2022 13:34:03 -0400 Received: by mail-pj1-x102b.google.com with SMTP id v11-20020a17090a4ecb00b001e2c5b837ccso2773732pjl.3 for ; Wed, 15 Jun 2022 10:34:01 -0700 (PDT) Received: from localhost.localdomain ([2400:4050:c360:8200:4126:b1a8:8fce:1a8]) by smtp.gmail.com with ESMTPSA id i13-20020a633c4d000000b003fcf1279c84sm10171451pgn.33.2022.06.15.10.33.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Jun 2022 10:33:59 -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=h6MIJ4t4BwlRaze8TB5KKl1+J/3+nprDtRLJ3HVVNbE=; b=o4BhCRTH0An1Zh4frOfA/KJknmxwWcaWp4UxyuK1YyLPK5dnOCJjsrJ0/alU2+JkW+ EwBbHYkNOY2A/mmQZyHZs3fxkbisaJNk+fQ9fi3KgiU52lG34k1//HadQ2s7aiwXntE2 b3/27DN/xs7CZrbHQbBz/I82jA1ds78jOxF1cX71o9Tdh9XYGBQYDkoFqCC78bfnKZVi ot/o476i+AxYZIOJf9Eqy7QiJ4O4F7q1Pyv/fs7+MyiPuqbpZNB4FXqEJGvyOKS8eDrH 2Aao6ZsUFtlvU+ejWeHnDLWvEOOyfRTA0do/A+W6Iw8cKm1/GeH8R2/AKaHhkQAzfwKs c8Vw== 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=h6MIJ4t4BwlRaze8TB5KKl1+J/3+nprDtRLJ3HVVNbE=; b=Zr+KZKmD+yH2Yws8NsICFUCsz8tS1LLTtlKJdaV7KyKM2ptK6eKV1TBQw0HKX1ydkH qHZH1TnAP3bDR7M4ZFFO2TIAm/Gh45S5jGaOY8nPChgyD0pMC3psWoxU5CyYUH/pjCcJ cmSR7mCXGx3dg5IZZL444i0klTEgzmsY3i2gBYfyjo36A5PDgOCp1QlyS2omw3cnQrNc QfGeq/lu3ug9IKm3VacFJK9AIn7muN3/sUddSciWZRdCqWzXxmEa4Si7dasi99P36bjb ORXRedEDkSu1sQKEknF7vZ/gIaBxm5auI/2bmpuFqP8MetofN8xLkq44lsxxJxggCL31 Pn8w== X-Gm-Message-State: AJIora94bSkcVJeXhQr9oJeRsqnm37JMGjPiKwYEIQa/kZOAVWmUGXcF KjoRfYhCgRKcgDAN5rfEdq8= X-Google-Smtp-Source: AGRyM1vr67x6KVJ2agomXVmtAV0HTKLcsMvQ40Cw6/XQB+2iDtkAGeW3eZ1HnsG/c1TBjWI2HOMR6A== X-Received: by 2002:a17:902:7e84:b0:166:395c:4b68 with SMTP id z4-20020a1709027e8400b00166395c4b68mr687660pla.8.1655314440590; Wed, 15 Jun 2022 10:34:00 -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 v7 2/6] Remove prefixes from path configuration macros Date: Thu, 16 Jun 2022 02:33:41 +0900 Message-Id: <20220615173345.32456-3-akihiko.odaki@gmail.com> X-Mailer: git-send-email 2.32.1 (Apple Git-133) In-Reply-To: <20220615173345.32456-1-akihiko.odaki@gmail.com> References: <20220615173345.32456-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::102b; envelope-from=akihiko.odaki@gmail.com; helo=mail-pj1-x102b.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: 1655314798027100001 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. This also fixes --firmwarepath configuration option. The old implementation naively added the prefix to the given option although it is a list of paths. Now an absolute path in --firmwarepath will be used as-is. A relative path in --firmwarepath will be relocated with get_relocated_path(). Signed-off-by: Akihiko Odaki --- include/qemu/cutils.h | 2 +- meson.build | 23 +++++++++++------------ qemu-options.hx | 11 +++++------ softmmu/datadir.c | 9 +++++++-- util/cutils.c | 34 +++++++--------------------------- 5 files changed, 31 insertions(+), 48 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..b982bfd5d07 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( @@ -3622,7 +3621,7 @@ endif summary_info =3D {} summary_info +=3D {'Install prefix': get_option('prefix')} summary_info +=3D {'BIOS directory': qemu_datadir} -summary_info +=3D {'firmware path': get_option('prefix') / get_option(= 'qemu_firmwarepath')} +summary_info +=3D {'firmware path': get_option('qemu_firmwarepath')} summary_info +=3D {'binary directory': get_option('prefix') / get_option(= 'bindir')} summary_info +=3D {'library directory': get_option('prefix') / get_option(= 'libdir')} summary_info +=3D {'module directory': qemu_moddir} 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/softmmu/datadir.c b/softmmu/datadir.c index 160cac999a6..3da42cb8ed7 100644 --- a/softmmu/datadir.c +++ b/softmmu/datadir.c @@ -111,9 +111,14 @@ void qemu_add_default_firmwarepath(void) /* 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])); + if (g_path_is_absolute(dirs[i])) { + qemu_add_data_dir(dirs[i]); + } else { + qemu_add_data_dir(get_relocated_path(dirs[i])); + g_free(dirs[i]); + } } - g_strfreev(dirs); + g_free(dirs); =20 /* try to find datadir relative to the executable path */ qemu_add_data_dir(find_datadir()); 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 02:42:48 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=1655314910; cv=none; d=zohomail.com; s=zohoarc; b=ZzHaIqyBh8S5u3OCaoGTtzWeCaLll8Vecbtk05921tlEWdvnUqaPDPn/9GFneoSggbDc4WI11NBiG+1kEVRmDsvaZxTq7bWnzJy1wgRhfc3CvwKS4LiEMmxJDsJC2eQYZPKZIovU6PFQQ7ULi3xgjSXCz+HGUN7RJGf7oiLpT/E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1655314910; 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=XGyUx6WJ7IuooXOQfMo8XNwBte4ZcmmFehFpTIjffJ8=; b=Npzr2SGtmmUYkKm3WtBUpz9cXhqcAz4pbOa91GgsBm5THSzuC7kBEGkHeWVWid2Bkqvtm3dmiyLcdzCgc1iTH7/r+Y+leZDIl5csVHTCqQFCZM+O8yQbTEod9kQQ+QxFEXm54qSYXXxSTtzK2pRUSNugrnsBZXCmX44TTxkSZz0= 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 1655314910608876.9976245427168; Wed, 15 Jun 2022 10:41:50 -0700 (PDT) Received: from localhost ([::1]:35300 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o1X1Z-0004iY-Bm for importer@patchew.org; Wed, 15 Jun 2022 13:41:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39744) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1Wu8-0007Uc-LR for qemu-devel@nongnu.org; Wed, 15 Jun 2022 13:34:08 -0400 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]:36807) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o1Wu5-0006qe-02 for qemu-devel@nongnu.org; Wed, 15 Jun 2022 13:34:07 -0400 Received: by mail-pj1-x102c.google.com with SMTP id k12-20020a17090a404c00b001eaabc1fe5dso2793749pjg.1 for ; Wed, 15 Jun 2022 10:34:04 -0700 (PDT) Received: from localhost.localdomain ([2400:4050:c360:8200:4126:b1a8:8fce:1a8]) by smtp.gmail.com with ESMTPSA id i13-20020a633c4d000000b003fcf1279c84sm10171451pgn.33.2022.06.15.10.34.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Jun 2022 10:34:02 -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=XGyUx6WJ7IuooXOQfMo8XNwBte4ZcmmFehFpTIjffJ8=; b=kAs3TfftCCbiE1zU+HTwmID+N2QAU5p6ES98IXMxh02FxGozF8SZIwQ3LeHtwE/dzl jjqwsxxRhLIJDnYZYv+yswEWXmbId208WpIB8blfhequoIn6grZYqxNObeNfqIj0iZv3 SdbIhKYKUeFH/IVyXsgJGwBZsGuIwGUd/nIS/0foZLYZ/jvovWFVTqxmdCc5AjYIuKbJ gW4vzvFPij3A4eROnNuAVX+LPrV1boz2tj7R5Gj1rDngr94axjZQQN5r7OE1pz4VIq22 dJ76bEkyxRAOSMATCQOf89xkpzyyT+vvNJ1rjS9SmRz4v1CG+8670+pz9YTB2r6AOm4j CnnQ== 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=XGyUx6WJ7IuooXOQfMo8XNwBte4ZcmmFehFpTIjffJ8=; b=Or/l/RZncDX8xjf2Cq2KwdlBWTZJ9zbQXCw4o8NOK+5vtfLFzL35poMiOeu39FRQtn Bhis4qGfu1QANqTw17y48Ys9DaIxpwsvmY0G9BtG0PPRWlV+ZYE+DlgbE3m4tPCrrFio CzqqreUMDoOYj7XVWITR4JNxpeha45dn3ErEOhlog3Jg7YsAmznpb+bZENZkqiobBFNj AlRT9Kxn7w6J6sqIafI00upVJyTADnpf0EU8Pzqwt3DwCwlblAYiWxrQAF65mQF0tmcN 7I3euC2i4rRrwP3HsgC6WXrGdC8RovpzBUJzM2XJmTIgpVIAJiE2PFOGzCbc6BrvIHEX gMTw== X-Gm-Message-State: AJIora9pz66SbMORSvApjRiBwT92QbFSdFYXVHZb78Y799oDTj4TUj09 7JcFbOT/3CbIhrtNf2RxS74= X-Google-Smtp-Source: AGRyM1tdaZHjX1jZZAVftcEUirfYO/+8zyhRxFOmsO98tC3wWyTXC1lWwJu0zhaQqaZkuQNa3Zcfag== X-Received: by 2002:a17:902:8ec9:b0:168:c341:847e with SMTP id x9-20020a1709028ec900b00168c341847emr621515plo.170.1655314443565; Wed, 15 Jun 2022 10:34:03 -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 v7 3/6] cutils: Introduce bundle mechanism Date: Thu, 16 Jun 2022 02:33:42 +0900 Message-Id: <20220615173345.32456-4-akihiko.odaki@gmail.com> X-Mailer: git-send-email 2.32.1 (Apple Git-133) In-Reply-To: <20220615173345.32456-1-akihiko.odaki@gmail.com> References: <20220615173345.32456-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::102c; envelope-from=akihiko.odaki@gmail.com; helo=mail-pj1-x102c.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: 1655314912719100001 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 b982bfd5d07..8961df266d1 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 02:42:48 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=1655314802; cv=none; d=zohomail.com; s=zohoarc; b=Hci/ZhW8eG49IBmcoba6XAdcxf1D4M1ZJFc5VmeRxOVSiUWLGTTOj1H9yVfuUkuDCvCSZvzvFoelu2ym+rc8WaHbJTBEfiUReuq/00tenyCmSPOk/SjxYfyL/ci/Nkr4AoWyh7KvIaFsGTqIf0moottP96XQV5QlXBH/OVSSmus= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1655314802; 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=4lUwJLH6QrMNsunN4juhxrwbgSakrwPCEZ9+P5oo1FM=; b=nYYmO1ZxsFgKSBmtmKIsFDlXAm5iqtpQBQ3msVT9v3lnh8sV98O2NLS76ychWD0OHOJCNsFEMRKRg7M73AEVv4CG6n5HvbPh/uN6vzm68HvKXuFHrSHkbNZgEB8unQR+F+vwOPYbp4f9/0/v33nFt8cszBLLjhkDJmvkG4Go5mI= 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 165531480212978.13677925124716; Wed, 15 Jun 2022 10:40:02 -0700 (PDT) Received: from localhost ([::1]:60984 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o1Wzo-0002we-Uh for importer@patchew.org; Wed, 15 Jun 2022 13:40:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39762) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1WuA-0007Wc-Sz for qemu-devel@nongnu.org; Wed, 15 Jun 2022 13:34:11 -0400 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]:43798) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o1Wu7-0006r9-UP for qemu-devel@nongnu.org; Wed, 15 Jun 2022 13:34:10 -0400 Received: by mail-pf1-x429.google.com with SMTP id x4so12038946pfj.10 for ; Wed, 15 Jun 2022 10:34:07 -0700 (PDT) Received: from localhost.localdomain ([2400:4050:c360:8200:4126:b1a8:8fce:1a8]) by smtp.gmail.com with ESMTPSA id i13-20020a633c4d000000b003fcf1279c84sm10171451pgn.33.2022.06.15.10.34.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Jun 2022 10:34:05 -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=4lUwJLH6QrMNsunN4juhxrwbgSakrwPCEZ9+P5oo1FM=; b=IZhw7vugr3SsmYtHQbAsS7UXQRJ+9KwgcGSePEvCMdQd1uAHEj3Jo5EnyaxKp8Mvap 5iewPz5oe+SKJ67Q/gAU00/HWC6aFrPkYaKqzu91g/ZRWZjGYVoULShNiKDFCiB7whjb 2/2gX794txrfSPr9wL/qDW315KGY+fWQ89oA69FFk42f1DKLFpxNTOG34ltP5i2ghXK9 isC7BhKmLIEj7JSVxvt0JGI8LaaPMjbAo5cZBE7zeOi+XeBpn3HoeEQIApKkuSAiAiQ+ d7SpadMrLr81/uiLNQ/wIJvIocc2ru8BI3A2ktcGzasTYRuqKuOw0cRV9TzPARRClJMz fCjQ== 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=4lUwJLH6QrMNsunN4juhxrwbgSakrwPCEZ9+P5oo1FM=; b=GY7c6IwQE6VNP3e0SvziK1rwbhG2eQg5hNP4ggILonWeEDhXwr91SJwzaymG0cFIGh MSUqU+x+kOk7VSVToc96l2dDeqBzdW9/Q8JifuzRvXHc1/I0TxxXrhLvqasZZlP3bNEQ wi3xM44bhyqTHiuy76qOhwabum5ZUVrZ8dGP5tFPBNixVFnnci7/rdEbCH5j01b3CEvJ EgowVpeHgX3XJPchjKhzrp5wHWsjEALGex/2DNshfes074Bycw+m31iKlk6bP4z/0rdP rc4IMWx92/Y23xwMFGZq63fjG/VC1gdwztwJqsVxxrgBqSfodxvcdlA1Olf2ezC33/2Y 6CPg== X-Gm-Message-State: AJIora9R/eGRfzKj/j+XjZ5N1u1K4dB9RhvzV3a5YYjmOG7D5z34MF+t F0nw7MIzP7At86ttpcAj0X4= X-Google-Smtp-Source: AGRyM1uW8R8YiROFS+JznktsHCZ78lrJjaMSO0LzesUcLwNsCSLt+PSLtJBELlr68/xYHVvftN9fZA== X-Received: by 2002:a05:6a00:1344:b0:51b:e3b5:54e2 with SMTP id k4-20020a056a00134400b0051be3b554e2mr713695pfu.6.1655314446515; Wed, 15 Jun 2022 10:34:06 -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 v7 4/6] datadir: Use bundle mechanism Date: Thu, 16 Jun 2022 02:33:43 +0900 Message-Id: <20220615173345.32456-5-akihiko.odaki@gmail.com> X-Mailer: git-send-email 2.32.1 (Apple Git-133) In-Reply-To: <20220615173345.32456-1-akihiko.odaki@gmail.com> References: <20220615173345.32456-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::429; envelope-from=akihiko.odaki@gmail.com; helo=mail-pf1-x429.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: 1655314804195100001 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 3da42cb8ed7..b52c8dacd64 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,26 +89,6 @@ 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) { char **dirs; @@ -119,9 +105,6 @@ void qemu_add_default_firmwarepath(void) } } g_free(dirs); - - /* try to find datadir relative to the executable path */ - qemu_add_data_dir(find_datadir()); } =20 void qemu_list_data_dirs(void) @@ -130,4 +113,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 02:42:48 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=1655315156; cv=none; d=zohomail.com; s=zohoarc; b=XW+Q/Wsmx7PhlU+RwCTxSLF6+tJzCIl/qBjAG8WSxn3/eKX9mhduiynGZv1wBoHsXTbIJ4l3kwbDgIjFfOhPmo4tnnlHcBXDp/VAsF/ZWF3aECEGv2wMKO8pbHNxp/IXAVCwajug6wioWZPyyhRogO0DKqpa9TiXneglWzjtU+I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1655315156; 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=PmdVsWXgGQQEpzd4lwDiLovDm+wEP7yFzT1nQvZE/GDpn4clbfCwDcxMqohG4cf6VZrD2MCl1bIPKlsHlfdB8sJ0IFGrGkjuS6xM2GMwQjJymW233nY8aD84APWZh62IMWPSb54y0jKVl7MjqThZlnlHt2bIS4UI4JnYBCgncSs= 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 1655315155867907.589442765242; Wed, 15 Jun 2022 10:45:55 -0700 (PDT) Received: from localhost ([::1]:41044 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o1X5W-0001AN-16 for importer@patchew.org; Wed, 15 Jun 2022 13:45:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39784) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1WuC-0007X1-BB for qemu-devel@nongnu.org; Wed, 15 Jun 2022 13:34:12 -0400 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]:38439) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o1WuA-0006rK-Qv for qemu-devel@nongnu.org; Wed, 15 Jun 2022 13:34:12 -0400 Received: by mail-pl1-x62a.google.com with SMTP id m14so596858plg.5 for ; Wed, 15 Jun 2022 10:34:10 -0700 (PDT) Received: from localhost.localdomain ([2400:4050:c360:8200:4126:b1a8:8fce:1a8]) by smtp.gmail.com with ESMTPSA id i13-20020a633c4d000000b003fcf1279c84sm10171451pgn.33.2022.06.15.10.34.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Jun 2022 10:34:08 -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=muNjtjQ4ULT08aZJ57j0hH2r7+mR4kfCOOAWnHkSaqf6V6ALuecv+wbM7DDCyoWPMf xCu06KxaCCtTVGwOLRd71Z2vYNPfTE1WAq1Z0DVk2FDV4MSIFl/FPYft4o+5pALsxb37 kWzdHEvBMl9uS0snExRSncbtW5nP+IB/GK1qM/u/QC0sm+cbVNhZez6sJgkw32FPV3y3 q7o6wbPRJNy8h2REf+T7AuAgCI1Amz1HhLv65q+SCR3dwL08M0erixGdgBJGcmnZFwSU 1jXrrrUMziqLHdu8vw02zV5BPIoRwX4iqywoM434Mm/8S9CMIZTDG3blWdVHi5pQkD5G s26A== 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=A5HNVBXieyqYX5zP5J7MlD8++xM4+fzcXC2NuC+aGEc+xFU0LZ+ceWDGlU74Qs8xNp pSJHAQhY8NOYyBSHUJ1f+5/wJPK2zy91m/6fQF78QcKmrPvDWSP5Lj93pQ6XfHxK/E3u niPXKcbS7Fa+nX0ZbTrukRgCssmRRPa3HvHTuTKQ0WDmBno6l0Q4KGFNU6ucXuefaJOB 99eIslJgm7hqDqmqrX/BILfNhEYdQVvVuOzNUhBocBwzd0JDqBq25WFVEYZDqqPQOmYU 3XYwX3plakx/NxJHXxOA2AHN6RgY49jC0ZPpE39W2ScDG9iyll5b9wEPFwnt+cZTzpu0 AQtw== X-Gm-Message-State: AJIora+5BY71TrvCwn9ug01kkZZUZhYZL4O4X/D4D3yk0WfByziFRZyn APIQ2sDhjfyN86Dzwlv8O2I= X-Google-Smtp-Source: AGRyM1utmXnuvvWx1T1DGyyKsXQbuYVu4yIsr1S9jlq6jekjBXW6py10XIw4FyC5Jqh+v1E+he6LYw== X-Received: by 2002:a17:902:74c8:b0:167:93c0:c30d with SMTP id f8-20020a17090274c800b0016793c0c30dmr695493plt.109.1655314449568; Wed, 15 Jun 2022 10:34:09 -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 v7 5/6] ui/icons: Use bundle mechanism Date: Thu, 16 Jun 2022 02:33:44 +0900 Message-Id: <20220615173345.32456-6-akihiko.odaki@gmail.com> X-Mailer: git-send-email 2.32.1 (Apple Git-133) In-Reply-To: <20220615173345.32456-1-akihiko.odaki@gmail.com> References: <20220615173345.32456-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::62a; envelope-from=akihiko.odaki@gmail.com; helo=mail-pl1-x62a.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: 1655315156388100001 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 02:42:48 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=1655315334; cv=none; d=zohomail.com; s=zohoarc; b=DB2TBlXYwof/nHmAKqxe7k6acUH2VfjB16dV2Dvy2CJjH6GPMulH2fx49I7UrdXJjCFDaFELFe+4L3m/aMS1p+pXivtaqRlciYjuI8dQqnUpPBEg98dHRS1xF9+u/Rj9OohcezJiY7122+rPsCvxZ0zvnNRTD4bDQGkYkAV760U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1655315334; 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=DY3QQ6VqXL3BswDg4+4GS0rzUG4ZftaMTDWMXVlycIA=; b=PyXx8u1JcCLpn5VfMmpCoEP1zZPLlKZiu4/SayFC4hZRwU8FzlSQd/9U16yC8XkLXxIyZ8P3crqiR+gs6R7KK9wnafXyLNfckjoXyw3HzGwq927dFGHo5pv8ewT7+RaGEOVNpvMON12fOMY1WyibFKtWHcjgO+zw0fqSAmRuQpw= 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 1655315334837109.03286896484485; Wed, 15 Jun 2022 10:48:54 -0700 (PDT) Received: from localhost ([::1]:44072 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o1X8P-0003aP-Ml for importer@patchew.org; Wed, 15 Jun 2022 13:48:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1WuF-0007Zz-AV for qemu-devel@nongnu.org; Wed, 15 Jun 2022 13:34:15 -0400 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]:53923) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o1WuD-0006rj-Mk for qemu-devel@nongnu.org; Wed, 15 Jun 2022 13:34:14 -0400 Received: by mail-pj1-x1035.google.com with SMTP id a10so11843240pju.3 for ; Wed, 15 Jun 2022 10:34:13 -0700 (PDT) Received: from localhost.localdomain ([2400:4050:c360:8200:4126:b1a8:8fce:1a8]) by smtp.gmail.com with ESMTPSA id i13-20020a633c4d000000b003fcf1279c84sm10171451pgn.33.2022.06.15.10.34.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Jun 2022 10:34:11 -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=DY3QQ6VqXL3BswDg4+4GS0rzUG4ZftaMTDWMXVlycIA=; b=PzW9ehoV30XskywUjb4Hlk09Ru7ty2uZKNyK3RjXLE+Rs2NWY1fZzWqzhgSgmBTE9L ccYoy+n5r/0VmqVogsxnwnCzScqkA06JwpWBSzO26j+Utj2HfPzlOFQUvQ6i1iTAYb97 M3AB5Ugi8A4FrhUw9h/arLtCN9Of9ZE9D2NtaTxxG6uaJL4FqHy5Wes4e+kunE/Putaj 5xlFZkDN9/vcBVfhKeNAzA31kh6Y6S63cRI/gJv4QpOT3/rN2VbuolkdNN7RW7d3p2Oc rlm8Y5DXRSQpKnm5XTpoFVDFwpUiJ+zsxLvbBhLqWX/iWEih2/Noemaj8jPfjZYWYeWJ Z4og== 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=DY3QQ6VqXL3BswDg4+4GS0rzUG4ZftaMTDWMXVlycIA=; b=x0SvAT9FV4PrePhHlD8zf0ADoQJ8Ph8SOhtHyQW7Xii9JUQVEJBr8g7NABZ94LBpf2 7R20qWikOdvJWOmR5Q+rMNo7Fgb299li9DZd0OJOsPFxTW3JJgBp9335C4xDtZViV2Qi SqVXrj+d3zuEK2ezrHPNMZMFvXZiVxyDdZ6YqR+lCsiTFDxIvtZgmfvXPGb6AQ6QFVWS 3dbEydcQ73GcsinmAKL5UKPR9tNlnSE/B9g0R6Dj/V0CPnbAArZsJReNJBaTQP0aGslC iKmoSrPs8vw2DUwEKndinf3wlAD68oCvtpBqC/Z/e/Ks798ZxKzLR3u6g3WB3NUDcRDZ jf7g== X-Gm-Message-State: AJIora/fFpiLbMHQLhkHZxtD/Fz0LWz1xzYkmchjQwWUlt5sKORSX2yA N2IVuKU82BYsQqQ9hIUWG5k= X-Google-Smtp-Source: AGRyM1sm8EDuf0P4t3drdcXlPjlnzrir4VhC088vtes3Cx1RIPgKwH4gE5yOf4ZGZOGF9Ghg2MPBBw== X-Received: by 2002:a17:903:3091:b0:167:885c:a15 with SMTP id u17-20020a170903309100b00167885c0a15mr424405plc.173.1655314452453; Wed, 15 Jun 2022 10:34:12 -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 v7 6/6] net: Use bundle mechanism Date: Thu, 16 Jun 2022 02:33:45 +0900 Message-Id: <20220615173345.32456-7-akihiko.odaki@gmail.com> X-Mailer: git-send-email 2.32.1 (Apple Git-133) In-Reply-To: <20220615173345.32456-1-akihiko.odaki@gmail.com> References: <20220615173345.32456-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::1035; envelope-from=akihiko.odaki@gmail.com; helo=mail-pj1-x1035.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: 1655315335872100001 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 8961df266d1..5e0e08801c9 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)