From nobody Sun Feb 8 11:36:37 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1655290588; cv=none; d=zohomail.com; s=zohoarc; b=O3D1OC/aqvY7x8uh+Yb80LIVAzwGlRiq+/WdRUxwUYH3/YrdI06qfk0ZHxG6mnM7tI52/T0/53PSAbnWLbhuAZSvnDJEOJPZtljHm9xAktQhG9O1SlYqvBUozdNg9GVcLMy3LAXaSHH+vYLmjSkfucaTFkYkbUfXhtznq1va4V8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1655290588; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Rw02dKiEcdwmKxBhwRuwk1oX8MAqRXqcUQ/XBHdkB0w=; b=aTyK95v1Mnz/6kBvDZX3hOIHO1d46AdX4VwLbNR4wBLfYb10+SSyzfjWYcMpW6BphkECnvO3+4jc4Sjbgw+ZbElPTdN60KTCBRhZWy8TRmtedQMHPqeZYGDMmEDUuE916cKG1ApzyQliRlOkf1RKL+W1GmmYRNdQDJY0Tap4PXc= 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 1655290588956634.6498532654741; Wed, 15 Jun 2022 03:56:28 -0700 (PDT) Received: from localhost ([::1]:60308 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o1QhH-00066R-8G for importer@patchew.org; Wed, 15 Jun 2022 06:56:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58068) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1QdQ-0003BR-Pf for qemu-devel@nongnu.org; Wed, 15 Jun 2022 06:52:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:58602) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1QdM-0001yD-7l for qemu-devel@nongnu.org; Wed, 15 Jun 2022 06:52:26 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-138-D3qcS68aNqeDmHpHDMHUBw-1; Wed, 15 Jun 2022 06:52:20 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 03899811E75; Wed, 15 Jun 2022 10:52:20 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.65]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5CE1E111F5; Wed, 15 Jun 2022 10:52:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655290343; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Rw02dKiEcdwmKxBhwRuwk1oX8MAqRXqcUQ/XBHdkB0w=; b=eO0iO4OJX+Jl1Ov3IZYINSyMgQGNlSXHyoSjXFUfxnnGfvBLrVVeg924bY8MoONFO1vE1j cgloJNGpVIzhc5Q7Q0zv+cyTzgiZS3VBtwEwHyGNknVKfz5FPIZ8aqRx9uozXzWbuQtVl2 bE0Mq2MWomHAwpuETZvSoJx0J/9y/SM= X-MC-Unique: D3qcS68aNqeDmHpHDMHUBw-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Alexander Bulekov , Bandan Das , Thomas Huth , =?UTF-8?q?Volker=20R=C3=BCmelin?= , Darren Kenny , Qiuhao Li , Jason Wang , Peter Maydell , Akihiko Odaki , Stefan Hajnoczi , Laurent Vivier , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v3 1/4] softmmu: rewrite handling of qemu_find_file Date: Wed, 15 Jun 2022 11:52:09 +0100 Message-Id: <20220615105212.780256-2-berrange@redhat.com> In-Reply-To: <20220615105212.780256-1-berrange@redhat.com> References: <20220615105212.780256-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 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=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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 @redhat.com) X-ZM-MESSAGEID: 1655290590742100001 The qemu_find_file method has a couple of flaws in its current implementation: * The configure time 'qemu-firmware' search path is mistakenly also used to find keymaps * The configure time 'qemu-firmware' search path is mistakenly relocated even when running from build dir resulting in non-sensical paths that won't resolve * When searching for files it has the assumption that the in-build-tree layout will match the installed root layout The latter problem has forced us to keep the keymap files under a sub-dir of the pc-bios/ instead of ui/. This all stems from the way qemu_find_file tries to use a single list of data directory locations, appending a type specific subdir. This can be addressed by refactoring the logic as follows For each type of file to be found identify * Optional: any user specified dir (non-relocated) * Path relative to build dir * Path relative to install dir * Optional: extra configure time install dirs (bios only, relocated) * The default install directory (relocated) We can then search through: * User specified dir * If running from build dir - Path relative to build dir else - Extra configure time dirs - Path relative to default install dir This is now flexible enough to extend to find any type of file, by plugging in different input values, regardless of what layout might be used in build dir vs install dir. Signed-off-by: Daniel P. Berrang=C3=A9 --- include/qemu/datadir.h | 5 +- softmmu/datadir.c | 145 +++++++++++++++++++++++----------------- softmmu/trace-events | 5 +- softmmu/vl.c | 2 +- tests/qtest/fuzz/fuzz.c | 2 +- 5 files changed, 92 insertions(+), 67 deletions(-) diff --git a/include/qemu/datadir.h b/include/qemu/datadir.h index 21f9097f58..a333cd9b0d 100644 --- a/include/qemu/datadir.h +++ b/include/qemu/datadir.h @@ -15,6 +15,9 @@ * configured at build time (DATADIR) or registered with the -L command * line option. * + * @name may be NULL to indicate the caller just wants the + * first search directory that is found. + * * The caller must use g_free() to free the returned data when it is * no longer required. * @@ -22,7 +25,7 @@ */ char *qemu_find_file(int type, const char *name); void qemu_add_default_firmwarepath(void); -void qemu_add_data_dir(char *path); +void qemu_set_user_data_dir(const char *path); void qemu_list_data_dirs(void); =20 #endif diff --git a/softmmu/datadir.c b/softmmu/datadir.c index 160cac999a..7457717542 100644 --- a/softmmu/datadir.c +++ b/softmmu/datadir.c @@ -27,102 +27,121 @@ #include "qemu/cutils.h" #include "trace.h" =20 -static const char *data_dir[16]; -static int data_dir_idx; +/* User specified data directory */ +static char *user_data_dir; + +/* Extra build time defined search locations for firmware (NULL terminated= ) */ +static char **extra_firmware_dirs; + +/* Default built-in directories */ +static char *default_data_dir; + +/* Whether we're known to be executing from a build tree */ +static bool in_build_dir; =20 char *qemu_find_file(int type, const char *name) { - int i; - const char *subdir; - char *buf; - - /* Try the name as a straight path first */ - if (access(name, R_OK) =3D=3D 0) { - trace_load_file(name, name); - return g_strdup(name); - } + const char *user_install_dir =3D NULL; + char **extra_install_dirs =3D NULL; + const char *rel_build_dir; + const char *rel_install_dir; + const char *default_install_dir; + char *maybepath =3D NULL; + size_t i; + int ret; =20 switch (type) { case QEMU_FILE_TYPE_BIOS: - subdir =3D ""; + user_install_dir =3D user_data_dir; + extra_install_dirs =3D extra_firmware_dirs; + rel_install_dir =3D ""; + rel_build_dir =3D "pc-bios"; + default_install_dir =3D default_data_dir; break; + case QEMU_FILE_TYPE_KEYMAP: - subdir =3D "keymaps/"; + user_install_dir =3D user_data_dir; + rel_install_dir =3D "keymaps"; + rel_build_dir =3D "pc-bios/keymaps"; + default_install_dir =3D default_data_dir; break; + default: abort(); } =20 - for (i =3D 0; i < data_dir_idx; i++) { - buf =3D g_strdup_printf("%s/%s%s", data_dir[i], subdir, name); - if (access(buf, R_OK) =3D=3D 0) { - trace_load_file(name, buf); - return buf; - } - g_free(buf); - } - return NULL; -} - -void qemu_add_data_dir(char *path) -{ - int i; +#define TRY_LOAD(path) \ + do { \ + ret =3D access(path, R_OK); \ + trace_datadir_load_file(name, path, ret =3D=3D 0 ? 0 : errno); = \ + if (ret =3D=3D 0) { = \ + return maybepath; \ + } \ + g_clear_pointer(&path, g_free); \ + } while (0) =20 - if (path =3D=3D NULL) { - return; + if (user_install_dir) { + maybepath =3D g_build_filename(user_install_dir, rel_install_dir, + name, NULL); + TRY_LOAD(maybepath); } - if (data_dir_idx =3D=3D ARRAY_SIZE(data_dir)) { - return; - } - for (i =3D 0; i < data_dir_idx; i++) { - if (strcmp(data_dir[i], path) =3D=3D 0) { - g_free(path); /* duplicate */ - return; + + if (in_build_dir) { + maybepath =3D g_build_filename(qemu_get_exec_dir(), rel_build_dir, + name, NULL); + } else { + if (extra_install_dirs) { + for (i =3D 0; extra_install_dirs[i] !=3D NULL; i++) { + maybepath =3D g_build_filename(extra_install_dirs[i], + name, NULL); + TRY_LOAD(maybepath); + } } + + maybepath =3D g_build_filename(default_install_dir, rel_install_di= r, + name, NULL); } - data_dir[data_dir_idx++] =3D path; + TRY_LOAD(maybepath); + + return NULL; } =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) +void qemu_set_user_data_dir(const char *path) { - 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); + g_free(user_data_dir); + user_data_dir =3D g_strdup(path); } =20 void qemu_add_default_firmwarepath(void) { - char **dirs; size_t i; + g_autofree char *builddir =3D NULL; + + builddir =3D g_build_filename(qemu_get_exec_dir(), "pc-bios", NULL); + if (access(builddir, R_OK) =3D=3D 0) { + in_build_dir =3D true; + } =20 /* 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])); + extra_firmware_dirs =3D g_strsplit(CONFIG_QEMU_FIRMWAREPATH, + G_SEARCHPATH_SEPARATOR_S, 0); + for (i =3D 0; extra_firmware_dirs[i] !=3D NULL ; i++) { + g_autofree char *path =3D extra_firmware_dirs[i]; + extra_firmware_dirs[i] =3D get_relocated_path(path); } - g_strfreev(dirs); =20 - /* try to find datadir relative to the executable path */ - qemu_add_data_dir(find_datadir()); + /* Add default dirs relative to the executable path */ + default_data_dir =3D get_relocated_path(CONFIG_QEMU_DATADIR); + + trace_datadir_init(default_data_dir, in_build_dir); } =20 void qemu_list_data_dirs(void) { int i; - for (i =3D 0; i < data_dir_idx; i++) { - printf("%s\n", data_dir[i]); + for (i =3D 0; extra_firmware_dirs[i] !=3D NULL; i++) { + printf("%s\n", extra_firmware_dirs[i]); } + + printf("%s\n", default_data_dir); } diff --git a/softmmu/trace-events b/softmmu/trace-events index 9c88887b3c..a9ba53f50d 100644 --- a/softmmu/trace-events +++ b/softmmu/trace-events @@ -4,6 +4,10 @@ # Since requests are raised via monitor, not many tracepoints are needed. balloon_event(void *opaque, unsigned long addr) "opaque %p addr %lu" =20 +# datadir.c +datadir_load_file(const char *name, const char *path, int err) "name %s lo= cation %s errno %d" +datadir_init(const char *defdatadir, bool inbuilddir) "default data dir %s= in build dir %d" + # ioport.c cpu_in(unsigned int addr, char size, unsigned int val) "addr 0x%x(%c) valu= e %u" cpu_out(unsigned int addr, char size, unsigned int val) "addr 0x%x(%c) val= ue %u" @@ -26,7 +30,6 @@ vm_stop_flush_all(int ret) "ret %d" =20 # vl.c vm_state_notify(int running, int reason, const char *reason_str) "running = %d reason %d (%s)" -load_file(const char *name, const char *path) "name %s location %s" runstate_set(int current_state, const char *current_state_str, int new_sta= te, const char *new_state_str) "current_run_state %d (%s) new_state %d (%s)" system_wakeup_request(int reason) "reason=3D%d" qemu_system_shutdown_request(int reason) "reason=3D%d" diff --git a/softmmu/vl.c b/softmmu/vl.c index 54e920ada1..0a578255c7 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -2898,7 +2898,7 @@ void qemu_init(int argc, char **argv, char **envp) if (is_help_option(optarg)) { list_data_dirs =3D true; } else { - qemu_add_data_dir(g_strdup(optarg)); + qemu_set_user_data_dir(optarg); } break; case QEMU_OPTION_bios: diff --git a/tests/qtest/fuzz/fuzz.c b/tests/qtest/fuzz/fuzz.c index 0ad4ba9e94..4438c7f141 100644 --- a/tests/qtest/fuzz/fuzz.c +++ b/tests/qtest/fuzz/fuzz.c @@ -186,7 +186,7 @@ int LLVMFuzzerInitialize(int *argc, char ***argv, char = ***envp) 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); + qemu_set_data_dir(datadir); } else { g_free(datadir); } --=20 2.36.1 From nobody Sun Feb 8 11:36:37 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1655290852; cv=none; d=zohomail.com; s=zohoarc; b=DfSHX+C0wagVi7IY6vtR2rUGuX4An1q4U7311McQePDmZRsVYLBS90epdSS8oThxjxGT1HAGJwOgqBrhRWYLYgeessw5HtK52KRd4ZtIRunMLL/PFU6ou6l50ZWT3VpCmwD5VLt4JaO1yDE6MeI22WXJHae1YS5+r8uIDxUCeaA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1655290852; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3VB12SowWEnpyzRh7lCxDweNPSJqPeMYKzBHyF0Drog=; b=Fev3v7V7MtK7VjjQEg919wxczyhsIlENgZ+9A00zyO1Vmk3R/nSp7d2pH47KSPWmCvDQNcwCJg/IMzBmDpFXzF3PATepS7lmpziWoUBpACMwFa2D0SbsjVnUEzM5ENdctOXoM7enlC4dhWk6oP4Cb15mGtmpg2VNYcS9YJ1pEyc= 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 1655290852242146.05091172077198; Wed, 15 Jun 2022 04:00:52 -0700 (PDT) Received: from localhost ([::1]:39634 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o1QlX-00034P-4S for importer@patchew.org; Wed, 15 Jun 2022 07:00:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58092) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1QdR-0003CY-Pq for qemu-devel@nongnu.org; Wed, 15 Jun 2022 06:52:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:36931) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1QdP-0001yq-C0 for qemu-devel@nongnu.org; Wed, 15 Jun 2022 06:52:29 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-131-1A1Nc-qKNjaviNS2seLMKA-1; Wed, 15 Jun 2022 06:52:23 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 099163C025C9; Wed, 15 Jun 2022 10:52:23 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.65]) by smtp.corp.redhat.com (Postfix) with ESMTP id 47C9A18EA9; Wed, 15 Jun 2022 10:52:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655290346; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3VB12SowWEnpyzRh7lCxDweNPSJqPeMYKzBHyF0Drog=; b=TxXZ4LEfUDq3E265Z/lT68WdYYtunF/zUjY/P4MJRzAeWwZi2LmvSExgnrz/VzJZzMY/52 rm6w0alHUwWvr8QGyup91DyxW8bAyh8PKjMpcCOahKirlY3+YXuNngp/8auszSBdMdrAP4 n07/TdxcpcO2qFN9vaWn78IiwAEbagM= X-MC-Unique: 1A1Nc-qKNjaviNS2seLMKA-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Alexander Bulekov , Bandan Das , Thomas Huth , =?UTF-8?q?Volker=20R=C3=BCmelin?= , Darren Kenny , Qiuhao Li , Jason Wang , Peter Maydell , Akihiko Odaki , Stefan Hajnoczi , Laurent Vivier , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v3 2/4] ui: move 'pc-bios/keymaps' to 'ui/keymaps' Date: Wed, 15 Jun 2022 11:52:10 +0100 Message-Id: <20220615105212.780256-3-berrange@redhat.com> In-Reply-To: <20220615105212.780256-1-berrange@redhat.com> References: <20220615105212.780256-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 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=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1655290853047100001 The 'keymaps' directory contents is nothing to do with the firmware blobs. The 'pc-bios/keymaps' directory appears to have been used previously as a convenience for getting the files installed into a subdir of the firmware install dir, as well as to make it easier to launch QEMU directly from the build tree. These requirements do not need to be reflected in the source tree arrangement. The keymaps logically belong with the UI code, and meson can install them into the right place. For in-tree execution, we merely need a suitable symlink from the source tree to the build tree. Signed-off-by: Daniel P. Berrang=C3=A9 --- pc-bios/meson.build | 1 - softmmu/datadir.c | 2 +- {pc-bios =3D> ui}/keymaps/ar | 0 {pc-bios =3D> ui}/keymaps/bepo | 0 {pc-bios =3D> ui}/keymaps/cz | 0 {pc-bios =3D> ui}/keymaps/da | 0 {pc-bios =3D> ui}/keymaps/de | 0 {pc-bios =3D> ui}/keymaps/de-ch | 0 {pc-bios =3D> ui}/keymaps/en-gb | 0 {pc-bios =3D> ui}/keymaps/en-us | 0 {pc-bios =3D> ui}/keymaps/es | 0 {pc-bios =3D> ui}/keymaps/et | 0 {pc-bios =3D> ui}/keymaps/fi | 0 {pc-bios =3D> ui}/keymaps/fo | 0 {pc-bios =3D> ui}/keymaps/fr | 0 {pc-bios =3D> ui}/keymaps/fr-be | 0 {pc-bios =3D> ui}/keymaps/fr-ca | 0 {pc-bios =3D> ui}/keymaps/fr-ch | 0 {pc-bios =3D> ui}/keymaps/hr | 0 {pc-bios =3D> ui}/keymaps/hu | 0 {pc-bios =3D> ui}/keymaps/is | 0 {pc-bios =3D> ui}/keymaps/it | 0 {pc-bios =3D> ui}/keymaps/ja | 0 {pc-bios =3D> ui}/keymaps/lt | 0 {pc-bios =3D> ui}/keymaps/lv | 0 {pc-bios =3D> ui}/keymaps/meson.build | 0 {pc-bios =3D> ui}/keymaps/mk | 0 {pc-bios =3D> ui}/keymaps/nl | 0 {pc-bios =3D> ui}/keymaps/no | 0 {pc-bios =3D> ui}/keymaps/pl | 0 {pc-bios =3D> ui}/keymaps/pt | 0 {pc-bios =3D> ui}/keymaps/pt-br | 0 {pc-bios =3D> ui}/keymaps/ru | 0 {pc-bios =3D> ui}/keymaps/sl | 0 {pc-bios =3D> ui}/keymaps/sv | 0 {pc-bios =3D> ui}/keymaps/th | 0 {pc-bios =3D> ui}/keymaps/tr | 0 ui/meson.build | 1 + 38 files changed, 2 insertions(+), 2 deletions(-) rename {pc-bios =3D> ui}/keymaps/ar (100%) rename {pc-bios =3D> ui}/keymaps/bepo (100%) rename {pc-bios =3D> ui}/keymaps/cz (100%) rename {pc-bios =3D> ui}/keymaps/da (100%) rename {pc-bios =3D> ui}/keymaps/de (100%) rename {pc-bios =3D> ui}/keymaps/de-ch (100%) rename {pc-bios =3D> ui}/keymaps/en-gb (100%) rename {pc-bios =3D> ui}/keymaps/en-us (100%) rename {pc-bios =3D> ui}/keymaps/es (100%) rename {pc-bios =3D> ui}/keymaps/et (100%) rename {pc-bios =3D> ui}/keymaps/fi (100%) rename {pc-bios =3D> ui}/keymaps/fo (100%) rename {pc-bios =3D> ui}/keymaps/fr (100%) rename {pc-bios =3D> ui}/keymaps/fr-be (100%) rename {pc-bios =3D> ui}/keymaps/fr-ca (100%) rename {pc-bios =3D> ui}/keymaps/fr-ch (100%) rename {pc-bios =3D> ui}/keymaps/hr (100%) rename {pc-bios =3D> ui}/keymaps/hu (100%) rename {pc-bios =3D> ui}/keymaps/is (100%) rename {pc-bios =3D> ui}/keymaps/it (100%) rename {pc-bios =3D> ui}/keymaps/ja (100%) rename {pc-bios =3D> ui}/keymaps/lt (100%) rename {pc-bios =3D> ui}/keymaps/lv (100%) rename {pc-bios =3D> ui}/keymaps/meson.build (100%) rename {pc-bios =3D> ui}/keymaps/mk (100%) rename {pc-bios =3D> ui}/keymaps/nl (100%) rename {pc-bios =3D> ui}/keymaps/no (100%) rename {pc-bios =3D> ui}/keymaps/pl (100%) rename {pc-bios =3D> ui}/keymaps/pt (100%) rename {pc-bios =3D> ui}/keymaps/pt-br (100%) rename {pc-bios =3D> ui}/keymaps/ru (100%) rename {pc-bios =3D> ui}/keymaps/sl (100%) rename {pc-bios =3D> ui}/keymaps/sv (100%) rename {pc-bios =3D> ui}/keymaps/th (100%) rename {pc-bios =3D> ui}/keymaps/tr (100%) diff --git a/pc-bios/meson.build b/pc-bios/meson.build index 41ba1c0ec7..e49c0e5f56 100644 --- a/pc-bios/meson.build +++ b/pc-bios/meson.build @@ -97,4 +97,3 @@ foreach f : blobs endforeach =20 subdir('descriptors') -subdir('keymaps') diff --git a/softmmu/datadir.c b/softmmu/datadir.c index 7457717542..32c765d228 100644 --- a/softmmu/datadir.c +++ b/softmmu/datadir.c @@ -62,7 +62,7 @@ char *qemu_find_file(int type, const char *name) case QEMU_FILE_TYPE_KEYMAP: user_install_dir =3D user_data_dir; rel_install_dir =3D "keymaps"; - rel_build_dir =3D "pc-bios/keymaps"; + rel_build_dir =3D "ui/keymaps"; default_install_dir =3D default_data_dir; break; =20 diff --git a/pc-bios/keymaps/ar b/ui/keymaps/ar similarity index 100% rename from pc-bios/keymaps/ar rename to ui/keymaps/ar diff --git a/pc-bios/keymaps/bepo b/ui/keymaps/bepo similarity index 100% rename from pc-bios/keymaps/bepo rename to ui/keymaps/bepo diff --git a/pc-bios/keymaps/cz b/ui/keymaps/cz similarity index 100% rename from pc-bios/keymaps/cz rename to ui/keymaps/cz diff --git a/pc-bios/keymaps/da b/ui/keymaps/da similarity index 100% rename from pc-bios/keymaps/da rename to ui/keymaps/da diff --git a/pc-bios/keymaps/de b/ui/keymaps/de similarity index 100% rename from pc-bios/keymaps/de rename to ui/keymaps/de diff --git a/pc-bios/keymaps/de-ch b/ui/keymaps/de-ch similarity index 100% rename from pc-bios/keymaps/de-ch rename to ui/keymaps/de-ch diff --git a/pc-bios/keymaps/en-gb b/ui/keymaps/en-gb similarity index 100% rename from pc-bios/keymaps/en-gb rename to ui/keymaps/en-gb diff --git a/pc-bios/keymaps/en-us b/ui/keymaps/en-us similarity index 100% rename from pc-bios/keymaps/en-us rename to ui/keymaps/en-us diff --git a/pc-bios/keymaps/es b/ui/keymaps/es similarity index 100% rename from pc-bios/keymaps/es rename to ui/keymaps/es diff --git a/pc-bios/keymaps/et b/ui/keymaps/et similarity index 100% rename from pc-bios/keymaps/et rename to ui/keymaps/et diff --git a/pc-bios/keymaps/fi b/ui/keymaps/fi similarity index 100% rename from pc-bios/keymaps/fi rename to ui/keymaps/fi diff --git a/pc-bios/keymaps/fo b/ui/keymaps/fo similarity index 100% rename from pc-bios/keymaps/fo rename to ui/keymaps/fo diff --git a/pc-bios/keymaps/fr b/ui/keymaps/fr similarity index 100% rename from pc-bios/keymaps/fr rename to ui/keymaps/fr diff --git a/pc-bios/keymaps/fr-be b/ui/keymaps/fr-be similarity index 100% rename from pc-bios/keymaps/fr-be rename to ui/keymaps/fr-be diff --git a/pc-bios/keymaps/fr-ca b/ui/keymaps/fr-ca similarity index 100% rename from pc-bios/keymaps/fr-ca rename to ui/keymaps/fr-ca diff --git a/pc-bios/keymaps/fr-ch b/ui/keymaps/fr-ch similarity index 100% rename from pc-bios/keymaps/fr-ch rename to ui/keymaps/fr-ch diff --git a/pc-bios/keymaps/hr b/ui/keymaps/hr similarity index 100% rename from pc-bios/keymaps/hr rename to ui/keymaps/hr diff --git a/pc-bios/keymaps/hu b/ui/keymaps/hu similarity index 100% rename from pc-bios/keymaps/hu rename to ui/keymaps/hu diff --git a/pc-bios/keymaps/is b/ui/keymaps/is similarity index 100% rename from pc-bios/keymaps/is rename to ui/keymaps/is diff --git a/pc-bios/keymaps/it b/ui/keymaps/it similarity index 100% rename from pc-bios/keymaps/it rename to ui/keymaps/it diff --git a/pc-bios/keymaps/ja b/ui/keymaps/ja similarity index 100% rename from pc-bios/keymaps/ja rename to ui/keymaps/ja diff --git a/pc-bios/keymaps/lt b/ui/keymaps/lt similarity index 100% rename from pc-bios/keymaps/lt rename to ui/keymaps/lt diff --git a/pc-bios/keymaps/lv b/ui/keymaps/lv similarity index 100% rename from pc-bios/keymaps/lv rename to ui/keymaps/lv diff --git a/pc-bios/keymaps/meson.build b/ui/keymaps/meson.build similarity index 100% rename from pc-bios/keymaps/meson.build rename to ui/keymaps/meson.build diff --git a/pc-bios/keymaps/mk b/ui/keymaps/mk similarity index 100% rename from pc-bios/keymaps/mk rename to ui/keymaps/mk diff --git a/pc-bios/keymaps/nl b/ui/keymaps/nl similarity index 100% rename from pc-bios/keymaps/nl rename to ui/keymaps/nl diff --git a/pc-bios/keymaps/no b/ui/keymaps/no similarity index 100% rename from pc-bios/keymaps/no rename to ui/keymaps/no diff --git a/pc-bios/keymaps/pl b/ui/keymaps/pl similarity index 100% rename from pc-bios/keymaps/pl rename to ui/keymaps/pl diff --git a/pc-bios/keymaps/pt b/ui/keymaps/pt similarity index 100% rename from pc-bios/keymaps/pt rename to ui/keymaps/pt diff --git a/pc-bios/keymaps/pt-br b/ui/keymaps/pt-br similarity index 100% rename from pc-bios/keymaps/pt-br rename to ui/keymaps/pt-br diff --git a/pc-bios/keymaps/ru b/ui/keymaps/ru similarity index 100% rename from pc-bios/keymaps/ru rename to ui/keymaps/ru diff --git a/pc-bios/keymaps/sl b/ui/keymaps/sl similarity index 100% rename from pc-bios/keymaps/sl rename to ui/keymaps/sl diff --git a/pc-bios/keymaps/sv b/ui/keymaps/sv similarity index 100% rename from pc-bios/keymaps/sv rename to ui/keymaps/sv diff --git a/pc-bios/keymaps/th b/ui/keymaps/th similarity index 100% rename from pc-bios/keymaps/th rename to ui/keymaps/th diff --git a/pc-bios/keymaps/tr b/ui/keymaps/tr similarity index 100% rename from pc-bios/keymaps/tr rename to ui/keymaps/tr diff --git a/ui/meson.build b/ui/meson.build index e9f48c5315..25c9a5ff8c 100644 --- a/ui/meson.build +++ b/ui/meson.build @@ -170,6 +170,7 @@ if have_system or xkbcommon.found() endif =20 subdir('shader') +subdir('keymaps') =20 if have_system subdir('icons') --=20 2.36.1 From nobody Sun Feb 8 11:36:37 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1655290593; cv=none; d=zohomail.com; s=zohoarc; b=OXMG528XAJG1dEyt0i915sOIT0FR5jMKW2aTFgaSi0TnZq8KuT7k6iTY0JdcIGanFAb3auAq/TIP4ZQkPQNesy14e2YbD+/BwAiWOLGbfvuzii9RPZPBOki/9qVG6pJanw6oUJEs8juja+bfNRBRbt6rijbgppk8tUa5Rxx5PT0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1655290593; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=SqACr8XAZqnnni/I56xuXU/IjF4pXbLnsf3r9TfaUPo=; b=iRDmrcHSvWY6YeEQ715Ec0wwBUZKxodrdnvyfRCXYzEiGfcAduFVD1IDBZob4D3tGzfSSm3SWrwYqmVtu85b1w0HebjA5JbboN/4tKSvOR9nBGCJ4W1rPyGb17cziC1fSEZyTBWlzhcrtL03NOXKDkR4XY5Vz94lURVPCuP8Gqs= 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 1655290593495583.1223211079547; Wed, 15 Jun 2022 03:56:33 -0700 (PDT) Received: from localhost ([::1]:60626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o1QhM-0006Mb-Dp for importer@patchew.org; Wed, 15 Jun 2022 06:56:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58122) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1QdV-0003DC-Ad for qemu-devel@nongnu.org; Wed, 15 Jun 2022 06:52:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:60544) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1QdT-0001zP-A6 for qemu-devel@nongnu.org; Wed, 15 Jun 2022 06:52:33 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-329-o_j1E6iHPHekaLchkcSDIw-1; Wed, 15 Jun 2022 06:52:27 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 254613831C46; Wed, 15 Jun 2022 10:52:27 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.65]) by smtp.corp.redhat.com (Postfix) with ESMTP id 653A71131D; Wed, 15 Jun 2022 10:52:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655290350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SqACr8XAZqnnni/I56xuXU/IjF4pXbLnsf3r9TfaUPo=; b=gGgo6P7zQFj80KaRE6d5OSAKl147yG1r0pRR9L52v5t+nJ/SJPpUXrCTmKhIlGRMya0JwV xQGF41EdBP4+Vzw7lTm6hPUX6IEBr4P2AE/TXy+7v/gNBI1KrO4ezuwb3V/rrl2+Mm8DGy 4Hq++dWHy1+rY6v9ot5MpdGFN1mZDAs= X-MC-Unique: o_j1E6iHPHekaLchkcSDIw-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Alexander Bulekov , Bandan Das , Thomas Huth , =?UTF-8?q?Volker=20R=C3=BCmelin?= , Darren Kenny , Qiuhao Li , Jason Wang , Peter Maydell , Akihiko Odaki , Stefan Hajnoczi , Laurent Vivier , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v3 3/4] ui: find icons using qemu_find_file Date: Wed, 15 Jun 2022 11:52:11 +0100 Message-Id: <20220615105212.780256-4-berrange@redhat.com> In-Reply-To: <20220615105212.780256-1-berrange@redhat.com> References: <20220615105212.780256-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 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=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1655290594584100001 The SDL/GTK/Cocoa UIs currently fail to load icons when run from the build directory as get_resource returns a bogus path. To address this we first re-arrange the ui/icons sub-directory so that its layout reflects the contents that will be installed. Then we introduce QEMU_FILE_TYPE_ICON to qemu_find_file such that it can locate icons from the build dir. Signed-off-by: Daniel P. Berrang=C3=A9 --- configure | 1 + docs/conf.py | 4 +-- include/qemu/datadir.h | 2 ++ softmmu/datadir.c | 12 +++++++- softmmu/trace-events | 2 +- ui/cocoa.m | 3 +- ui/gtk.c | 3 +- .../apps/qemu.png} | Bin .../{qemu_16x16.png =3D> 16x16/apps/qemu.png} | Bin .../{qemu_24x24.png =3D> 24x24/apps/qemu.png} | Bin .../apps/qemu.png} | Bin .../{qemu_32x32.bmp =3D> 32x32/apps/qemu.bmp} | Bin .../{qemu_32x32.png =3D> 32x32/apps/qemu.png} | Bin .../{qemu_48x48.png =3D> 48x48/apps/qemu.png} | Bin .../apps/qemu.png} | Bin .../{qemu_64x64.png =3D> 64x64/apps/qemu.png} | Bin ui/icons/meson.build | 27 ++++++++++++------ ui/icons/{ =3D> scalable/apps}/qemu.svg | 0 ui/sdl2.c | 5 ++-- 19 files changed, 43 insertions(+), 16 deletions(-) rename ui/icons/{qemu_128x128.png =3D> 128x128/apps/qemu.png} (100%) rename ui/icons/{qemu_16x16.png =3D> 16x16/apps/qemu.png} (100%) rename ui/icons/{qemu_24x24.png =3D> 24x24/apps/qemu.png} (100%) rename ui/icons/{qemu_256x256.png =3D> 256x256/apps/qemu.png} (100%) rename ui/icons/{qemu_32x32.bmp =3D> 32x32/apps/qemu.bmp} (100%) rename ui/icons/{qemu_32x32.png =3D> 32x32/apps/qemu.png} (100%) rename ui/icons/{qemu_48x48.png =3D> 48x48/apps/qemu.png} (100%) rename ui/icons/{qemu_512x512.png =3D> 512x512/apps/qemu.png} (100%) rename ui/icons/{qemu_64x64.png =3D> 64x64/apps/qemu.png} (100%) rename ui/icons/{ =3D> scalable/apps}/qemu.svg (100%) diff --git a/configure b/configure index 4b12a8094c..fdcbfbc1b1 100755 --- a/configure +++ b/configure @@ -2218,6 +2218,7 @@ LINKS=3D"$LINKS tests/avocado tests/data" LINKS=3D"$LINKS tests/qemu-iotests/check" LINKS=3D"$LINKS python" LINKS=3D"$LINKS contrib/plugins/Makefile " +LINKS=3D"$LINKS ui/icons " for f in $LINKS ; do if [ -e "$source_path/$f" ]; then mkdir -p `dirname ./$f` diff --git a/docs/conf.py b/docs/conf.py index 49dab44cca..16d5d96228 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -180,9 +180,9 @@ "navigation_with_keys": True, } =20 -html_logo =3D os.path.join(qemu_docdir, "../ui/icons/qemu_128x128.png") +html_logo =3D os.path.join(qemu_docdir, "../ui/icons/128x128/apps/qemu.png= ") =20 -html_favicon =3D os.path.join(qemu_docdir, "../ui/icons/qemu_32x32.png") +html_favicon =3D os.path.join(qemu_docdir, "../ui/icons/32x32/apps/qemu.pn= g") =20 # Add any paths that contain custom static files (such as style sheets) he= re, # relative to this directory. They are copied after the builtin static fil= es, diff --git a/include/qemu/datadir.h b/include/qemu/datadir.h index a333cd9b0d..427e90787a 100644 --- a/include/qemu/datadir.h +++ b/include/qemu/datadir.h @@ -3,6 +3,8 @@ =20 #define QEMU_FILE_TYPE_BIOS 0 #define QEMU_FILE_TYPE_KEYMAP 1 +#define QEMU_FILE_TYPE_ICON 2 + /** * qemu_find_file: * @type: QEMU_FILE_TYPE_BIOS (for BIOS, VGA BIOS) diff --git a/softmmu/datadir.c b/softmmu/datadir.c index 32c765d228..e5d1fd0116 100644 --- a/softmmu/datadir.c +++ b/softmmu/datadir.c @@ -35,6 +35,7 @@ static char **extra_firmware_dirs; =20 /* Default built-in directories */ static char *default_data_dir; +static char *default_icon_dir; =20 /* Whether we're known to be executing from a build tree */ static bool in_build_dir; @@ -66,6 +67,12 @@ char *qemu_find_file(int type, const char *name) default_install_dir =3D default_data_dir; break; =20 + case QEMU_FILE_TYPE_ICON: + rel_install_dir =3D "hicolor"; + rel_build_dir =3D "ui/icons"; + default_install_dir =3D default_icon_dir; + break; + default: abort(); } @@ -132,8 +139,11 @@ void qemu_add_default_firmwarepath(void) =20 /* Add default dirs relative to the executable path */ default_data_dir =3D get_relocated_path(CONFIG_QEMU_DATADIR); + default_icon_dir =3D get_relocated_path(CONFIG_QEMU_ICONDIR); =20 - trace_datadir_init(default_data_dir, in_build_dir); + trace_datadir_init(default_data_dir, + default_icon_dir, + in_build_dir); } =20 void qemu_list_data_dirs(void) diff --git a/softmmu/trace-events b/softmmu/trace-events index a9ba53f50d..9c00e9f389 100644 --- a/softmmu/trace-events +++ b/softmmu/trace-events @@ -6,7 +6,7 @@ balloon_event(void *opaque, unsigned long addr) "opaque %p = addr %lu" =20 # datadir.c datadir_load_file(const char *name, const char *path, int err) "name %s lo= cation %s errno %d" -datadir_init(const char *defdatadir, bool inbuilddir) "default data dir %s= in build dir %d" +datadir_init(const char *defdatadir, const char *deficondir, bool inbuildd= ir) "default data dir %s icon dir %s in build dir %d" =20 # ioport.c cpu_in(unsigned int addr, char size, unsigned int val) "addr 0x%x(%c) valu= e %u" diff --git a/ui/cocoa.m b/ui/cocoa.m index 09a62817f2..c906e618f6 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -45,6 +45,7 @@ #include "qemu/cutils.h" #include "qemu/main-loop.h" #include "qemu/module.h" +#include "qemu/datadir.h" #include #include "hw/core/cpu.h" =20 @@ -1558,7 +1559,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 qemu_find_file(QEMU_FILE_TYPE_ICON, "512x512/app= s/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 c57c36749e..7f798a0560 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -31,6 +31,7 @@ #define LOCALEDIR "po" =20 #include "qemu/osdep.h" +#include "qemu/datadir.h" #include "qapi/error.h" #include "qapi/qapi-commands-control.h" #include "qapi/qapi-commands-machine.h" @@ -2314,7 +2315,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 qemu_find_file(QEMU_FILE_TYPE_ICON, NULL); gtk_icon_theme_prepend_search_path(theme, dir); g_free(dir); g_set_prgname("qemu"); diff --git a/ui/icons/qemu_128x128.png b/ui/icons/128x128/apps/qemu.png similarity index 100% rename from ui/icons/qemu_128x128.png rename to ui/icons/128x128/apps/qemu.png diff --git a/ui/icons/qemu_16x16.png b/ui/icons/16x16/apps/qemu.png similarity index 100% rename from ui/icons/qemu_16x16.png rename to ui/icons/16x16/apps/qemu.png diff --git a/ui/icons/qemu_24x24.png b/ui/icons/24x24/apps/qemu.png similarity index 100% rename from ui/icons/qemu_24x24.png rename to ui/icons/24x24/apps/qemu.png diff --git a/ui/icons/qemu_256x256.png b/ui/icons/256x256/apps/qemu.png similarity index 100% rename from ui/icons/qemu_256x256.png rename to ui/icons/256x256/apps/qemu.png diff --git a/ui/icons/qemu_32x32.bmp b/ui/icons/32x32/apps/qemu.bmp similarity index 100% rename from ui/icons/qemu_32x32.bmp rename to ui/icons/32x32/apps/qemu.bmp diff --git a/ui/icons/qemu_32x32.png b/ui/icons/32x32/apps/qemu.png similarity index 100% rename from ui/icons/qemu_32x32.png rename to ui/icons/32x32/apps/qemu.png diff --git a/ui/icons/qemu_48x48.png b/ui/icons/48x48/apps/qemu.png similarity index 100% rename from ui/icons/qemu_48x48.png rename to ui/icons/48x48/apps/qemu.png diff --git a/ui/icons/qemu_512x512.png b/ui/icons/512x512/apps/qemu.png similarity index 100% rename from ui/icons/qemu_512x512.png rename to ui/icons/512x512/apps/qemu.png diff --git a/ui/icons/qemu_64x64.png b/ui/icons/64x64/apps/qemu.png similarity index 100% rename from ui/icons/qemu_64x64.png rename to ui/icons/64x64/apps/qemu.png diff --git a/ui/icons/meson.build b/ui/icons/meson.build index 12c52080eb..ac9111260b 100644 --- a/ui/icons/meson.build +++ b/ui/icons/meson.build @@ -1,13 +1,24 @@ -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') + +png_icon_sizes =3D [ + '16x16', + '24x24', + '32x32', + '48x48', + '64x64', + '128x128', + '256x256', + '512x512', +] + +foreach icon_size: png_icon_sizes + install_data( + join_paths(icon_size, 'apps', 'qemu.png'), + install_dir: join_paths(qemu_icondir, 'hicolor', icon_size, 'apps') + ) endforeach =20 -install_data('qemu_32x32.bmp', - rename: 'qemu.bmp', +install_data('32x32/apps/qemu.bmp', install_dir: qemu_icondir / 'hicolor' / '32x32' / 'apps') =20 -install_data('qemu.svg', +install_data('scalable/apps/qemu.svg', install_dir: qemu_icondir / 'hicolor' / 'scalable' / 'apps') diff --git a/ui/icons/qemu.svg b/ui/icons/scalable/apps/qemu.svg similarity index 100% rename from ui/icons/qemu.svg rename to ui/icons/scalable/apps/qemu.svg diff --git a/ui/sdl2.c b/ui/sdl2.c index 8cb77416af..64435221cd 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -26,6 +26,7 @@ #include "qemu/osdep.h" #include "qemu/module.h" #include "qemu/cutils.h" +#include "qemu/datadir.h" #include "ui/console.h" #include "ui/input.h" #include "ui/sdl2.h" @@ -910,11 +911,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 qemu_find_file(QEMU_FILE_TYPE_ICON, "128x128/apps/qemu.png"); 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 qemu_find_file(QEMU_FILE_TYPE_ICON, "32x32/apps/qemu.bmp"); icon =3D SDL_LoadBMP(dir); if (icon) { uint32_t colorkey =3D SDL_MapRGB(icon->format, 255, 255, 255); --=20 2.36.1 From nobody Sun Feb 8 11:36:37 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1655290862; cv=none; d=zohomail.com; s=zohoarc; b=c86NhY/fBlqIwNIDTWXXT6oV3jcEhxdSv7+aoxr8lJcZ4sZVnGcDRKayymuFdYXPVECmb/mZ3y6XHHXjIn8OlpB2BZTA+ccrBO6BIg0+tVpid4/3JGdR20yCufiKZrbM17+ZjVhML2rwDFKR+nvB8eTpt+RbK4LYkttd6gP8aOM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1655290862; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=AHNoTjNExIE2yfua2XDNSZaph8Iy4XsvHUgF/wj8mNA=; b=R3UdOzk9Mbm9T+BtvWxEbGTPYwNWVojsA+elzlbEjee9CwVnd18BoUolPGNs+kViNGaJN93V2rgo8+mm+MWMSJccDrs+KnDwcgREvDofUDpUJPiEgdkwybju/zKFXQnGuTY8i1LzyNl1lTYDsn6q94W3FkWDBvvfFoesbN2KuiY= 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 165529086228762.00644773531519; Wed, 15 Jun 2022 04:01:02 -0700 (PDT) Received: from localhost ([::1]:39820 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o1Qlb-0003Bk-RI for importer@patchew.org; Wed, 15 Jun 2022 07:01:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58136) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1QdW-0003FZ-Qa for qemu-devel@nongnu.org; Wed, 15 Jun 2022 06:52:34 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:32944) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1QdU-0001zT-P5 for qemu-devel@nongnu.org; Wed, 15 Jun 2022 06:52:34 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-176-IX9o4wLCPZaLD_ZdPNXIWQ-1; Wed, 15 Jun 2022 06:52:30 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 388671C3E984; Wed, 15 Jun 2022 10:52:30 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.65]) by smtp.corp.redhat.com (Postfix) with ESMTP id 730C21131D; Wed, 15 Jun 2022 10:52:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655290352; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AHNoTjNExIE2yfua2XDNSZaph8Iy4XsvHUgF/wj8mNA=; b=K0OwwMcoVH78v8iKQfI23mrKqTkTLZGEdWx0/1nEujE6sm6yv5yxce6xCdelgobrY5N9fT NXuIsdW/JWh1rNX254C3R8KURyZA24AMtnyKr9XRZj5yEmOS76QNTgP6N7Xy8rTChdPFqg 2dv4wO1ZcFA33uaXL6gvJf9CYqy+P6k= X-MC-Unique: IX9o4wLCPZaLD_ZdPNXIWQ-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Alexander Bulekov , Bandan Das , Thomas Huth , =?UTF-8?q?Volker=20R=C3=BCmelin?= , Darren Kenny , Qiuhao Li , Jason Wang , Peter Maydell , Akihiko Odaki , Stefan Hajnoczi , Laurent Vivier , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v3 4/4] net: convert to use qemu_find_file to locate bridge helper Date: Wed, 15 Jun 2022 11:52:12 +0100 Message-Id: <20220615105212.780256-5-berrange@redhat.com> In-Reply-To: <20220615105212.780256-1-berrange@redhat.com> References: <20220615105212.780256-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 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=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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 @redhat.com) X-ZM-MESSAGEID: 1655290863115100001 The TAP device code currently uses get_relocate_path to find the bridge helper, however, this fails when run from the build dir. Adding support to qemu_find_file for helper binaries, allows it to work from both the (relocated) install tree and build dir. Signed-off-by: Daniel P. Berrang=C3=A9 --- include/net/net.h | 3 ++- include/qemu/datadir.h | 1 + net/tap.c | 5 ++++- qemu-options.hx | 4 ++-- softmmu/datadir.c | 9 +++++++++ softmmu/trace-events | 2 +- 6 files changed, 19 insertions(+), 5 deletions(-) diff --git a/include/net/net.h b/include/net/net.h index 523136c7ac..6a853512ac 100644 --- a/include/net/net.h +++ b/include/net/net.h @@ -228,7 +228,8 @@ NetClientState *net_hub_port_find(int hub_id); =20 #define DEFAULT_NETWORK_SCRIPT CONFIG_SYSCONFDIR "/qemu-ifup" #define DEFAULT_NETWORK_DOWN_SCRIPT CONFIG_SYSCONFDIR "/qemu-ifdown" -#define DEFAULT_BRIDGE_HELPER CONFIG_QEMU_HELPERDIR "/qemu-bridge-helper" +#define DEFAULT_BRIDGE_HELPER "qemu-bridge-helper" +#define DEFAULT_BRIDGE_HELPER_PATH CONFIG_QEMU_HELPERDIR "/qemu-bridge-hel= per" #define DEFAULT_BRIDGE_INTERFACE "br0" =20 void qdev_set_nic_properties(DeviceState *dev, NICInfo *nd); diff --git a/include/qemu/datadir.h b/include/qemu/datadir.h index 427e90787a..a211b6b235 100644 --- a/include/qemu/datadir.h +++ b/include/qemu/datadir.h @@ -4,6 +4,7 @@ #define QEMU_FILE_TYPE_BIOS 0 #define QEMU_FILE_TYPE_KEYMAP 1 #define QEMU_FILE_TYPE_ICON 2 +#define QEMU_FILE_TYPE_HELPER 3 =20 /** * qemu_find_file: diff --git a/net/tap.c b/net/tap.c index b3ddfd4a74..161608e34a 100644 --- a/net/tap.c +++ b/net/tap.c @@ -42,6 +42,7 @@ #include "qemu/error-report.h" #include "qemu/main-loop.h" #include "qemu/sockets.h" +#include "qemu/datadir.h" =20 #include "net/tap.h" =20 @@ -507,9 +508,11 @@ static int net_bridge_run_helper(const char *helper, c= onst 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 qemu_find_file(QEMU_FILE_TYPE_HELPER, + DEFAULT_BRIDGE_HELPER); } =20 + g_printerr("Helper %s\n", helper); if (socketpair(PF_UNIX, SOCK_STREAM, 0, sv) =3D=3D -1) { error_setg_errno(errp, errno, "socketpair() failed"); return -1; diff --git a/qemu-options.hx b/qemu-options.hx index 377d22fbd8..b5b7e75048 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -2665,7 +2665,7 @@ DEF("netdev", HAS_ARG, QEMU_OPTION_netdev, " to configure it and 'dfile' (default=3D" DEFAULT_NETW= ORK_DOWN_SCRIPT ")\n" " to deconfigure it\n" " use '[down]script=3Dno' to disable script execution\n" - " use network helper 'helper' (default=3D" DEFAULT_BRID= GE_HELPER ") to\n" + " use network helper 'helper' (default=3D" DEFAULT_BRID= GE_HELPER_PATH ") to\n" " configure it\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" @@ -2684,7 +2684,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 program 'helper (default=3D" DEFAULT_BRIDGE= _HELPER_PATH ")\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 e5d1fd0116..a68fe7167a 100644 --- a/softmmu/datadir.c +++ b/softmmu/datadir.c @@ -36,6 +36,7 @@ static char **extra_firmware_dirs; /* Default built-in directories */ static char *default_data_dir; static char *default_icon_dir; +static char *default_helper_dir; =20 /* Whether we're known to be executing from a build tree */ static bool in_build_dir; @@ -73,6 +74,12 @@ char *qemu_find_file(int type, const char *name) default_install_dir =3D default_icon_dir; break; =20 + case QEMU_FILE_TYPE_HELPER: + rel_install_dir =3D ""; + rel_build_dir =3D ""; + default_install_dir =3D default_helper_dir; + break; + default: abort(); } @@ -140,9 +147,11 @@ void qemu_add_default_firmwarepath(void) /* Add default dirs relative to the executable path */ default_data_dir =3D get_relocated_path(CONFIG_QEMU_DATADIR); default_icon_dir =3D get_relocated_path(CONFIG_QEMU_ICONDIR); + default_helper_dir =3D get_relocated_path(CONFIG_QEMU_HELPERDIR); =20 trace_datadir_init(default_data_dir, default_icon_dir, + default_helper_dir, in_build_dir); } =20 diff --git a/softmmu/trace-events b/softmmu/trace-events index 9c00e9f389..b22d7e7714 100644 --- a/softmmu/trace-events +++ b/softmmu/trace-events @@ -6,7 +6,7 @@ balloon_event(void *opaque, unsigned long addr) "opaque %p = addr %lu" =20 # datadir.c datadir_load_file(const char *name, const char *path, int err) "name %s lo= cation %s errno %d" -datadir_init(const char *defdatadir, const char *deficondir, bool inbuildd= ir) "default data dir %s icon dir %s in build dir %d" +datadir_init(const char *defdatadir, const char *deficondir, const char *d= efhelperdir, bool inbuilddir) "default data dir %s icon dir %s helper dir %= s in build dir %d" =20 # ioport.c cpu_in(unsigned int addr, char size, unsigned int val) "addr 0x%x(%c) valu= e %u" --=20 2.36.1