From nobody Sat Jul 4 20:10:51 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=reject dis=none) header.from=rsg.ci.i.u-tokyo.ac.jp Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1783057722384398.869491452387; Thu, 2 Jul 2026 22:48:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wfWkr-0004pf-3p; Fri, 03 Jul 2026 01:48:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wfWje-0004T3-M9; Fri, 03 Jul 2026 01:46:49 -0400 Received: from www3579.sakura.ne.jp ([49.212.243.89]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wfWjW-0003RH-9b; Fri, 03 Jul 2026 01:46:43 -0400 Received: from h183.csg.ci.i.u-tokyo.ac.jp (h183.csg.ci.i.u-tokyo.ac.jp [133.11.54.183]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 6635jova036784 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 3 Jul 2026 14:46:04 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=QKsWJTVxPAFdG2x8XAo/TkAAjK3FW3F4furqsjUadh8=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Message-Id:To:Subject:Date; s=rs20250326; t=1783057564; v=1; b=GsmHVyj4XiMOUDAKs17CAxbJ9g86xmyL7iJxzsEDWgyi2h7VpuoNwKVYK2eJyvtT nwLRWX0PKvuX3VXmNkYQQXsUuDb11+znK8y6DLNJzwP/XhOsnLzLampS9t+S1C1B CRivdrjNyuK6ZQj73valPteBJC+XznAWaF9SvxPlFIzZ1ogUUSD1gEiB5NhJwnoU WxNM4TINHPpGZul2SsGEhktOrbCjGs6/GXF5nS/JDf3J6/MSX9xMSQNadLQZzuT6 FKok0CJgNFsHUpOHS8Tv4zbR48US6grdpgqx7x1PLcOgZj1s2nmSyiwkuH6Xkanx IPI6+WLOlQEOGdwn/kkoiA== From: Akihiko Odaki Date: Fri, 03 Jul 2026 14:45:32 +0900 Subject: [PATCH v5 1/8] util: Introduce qemu_get_runtime_dir() MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260703-run-v5-1-4521ac5a149e@rsg.ci.i.u-tokyo.ac.jp> References: <20260703-run-v5-0-4521ac5a149e@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20260703-run-v5-0-4521ac5a149e@rsg.ci.i.u-tokyo.ac.jp> To: qemu-devel@nongnu.org, qemu-block@nongnu.org, Yuval Shaia , Marcel Apfelbaum , Konstantin Kostiuk , Michael Roth , Paolo Bonzini , Fam Zheng , "Dr . David Alan Gilbert" , Stefan Hajnoczi , Gerd Hoffmann , Stefan Weil , Yan Vugenfirer , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Marcelo Tosatti , Zhao Liu , kvm@vger.kernel.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Akihiko Odaki X-Mailer: b4 0.16-dev-925f5 X-Developer-Signature: v=1; a=openpgp-sha256; l=4378; i=odaki@rsg.ci.i.u-tokyo.ac.jp; h=from:subject:message-id; bh=4d8cXS9YftrwQFC8xCGeMmjDzLSKcWSgalJtbZonIDA=; b=owGbwMvMwCWmMbc20y1CyJDxtFoSQ5a7z6RzVgrrSqSz42/FbViv+z9iXWTCVV9RQUGV37dOR p7nuKPTUcrCIMbFICumyJJStJtbI7r2U2FCfAvMHFYmkCEMXJwCMJHdfIwMW8sVi+PX35o2zYVZ Y/4Z5g1XZbKO7b0q+cZ8MTvnVqlMAYY//JWzzuZX7z360K0oad38kmdbPKda7G/50Hf0YviH4Nz njAA= X-Developer-Key: i=odaki@rsg.ci.i.u-tokyo.ac.jp; a=openpgp; fpr=AEDC03C9AF734F2EC26A7BFFA4BAEAA73536753C 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=lists1p.gnu.org; Received-SPF: pass client-ip=49.212.243.89; envelope-from=odaki@rsg.ci.i.u-tokyo.ac.jp; helo=www3579.sakura.ne.jp X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1783057722975158500 qemu_get_runtime_dir() returns a dynamically allocated directory path that is appropriate for storing runtime files. It corresponds to "run" directory in Unix. With a tree-wide search, it was found that there are several cases where such a functionality is implemented so let's have one as a common utility function. This function tries to resolve the following in order: - $XDG_RUNTIME_DIR - The "LocalAppData" folder on Windows - get_relocated_path(CONFIG_QEMU_LOCALSTATEDIR "/run") $XDG_RUNTIME_DIR may be useful even for executables that require root privileges since they may run in a Linux namespace created by a normal user who cannot write the system runtime directory. This function does not use qemu_get_local_state_dir() or its logic for Windows. Actually the implementation of qemu_get_local_state_dir() for Windows seems not right as it calls g_get_system_data_dirs(), which checks $XDG_DATA_DIRS. In Unix terminology, it is basically "/usr/share", not "/var", which qemu_get_local_state_dir() is intended to provide. This function does not use g_get_user_runtime_dir() either. g_get_user_runtime_dir() falls back to g_get_user_cache_dir(), which has different semantics. Instead of silently using a cache directory, qemu_get_runtime_dir() eventually falls back to the system runtime directory. This also naturally lets system users use the system runtime directory. A user who wants to use a user-specific directory has to set $XDG_RUNTIME_DIR or continue to supply application-specific command line options. Signed-off-by: Akihiko Odaki --- include/qemu/osdep.h | 12 ++++++++++++ util/oslib-posix.c | 11 +++++++++++ util/oslib-win32.c | 28 ++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 1ec5b42230be..d64cebdf5ec5 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -717,6 +717,18 @@ void qemu_clear_cloexec(int fd); */ char *qemu_get_local_state_dir(void); =20 +/** + * qemu_get_runtime_dir: + * + * Return a dynamically allocated directory path that is appropriate for s= toring + * runtime files. It corresponds to "run" directory in Unix, and uses + * $XDG_RUNTIME_DIR if available. + * + * The caller is responsible for releasing the value returned with g_free() + * after use. + */ +char *qemu_get_runtime_dir(void); + /** * qemu_getauxval: * @type: the auxiliary vector key to lookup diff --git a/util/oslib-posix.c b/util/oslib-posix.c index dc001da66dd4..d03399063999 100644 --- a/util/oslib-posix.c +++ b/util/oslib-posix.c @@ -320,6 +320,17 @@ qemu_get_local_state_dir(void) return get_relocated_path(CONFIG_QEMU_LOCALSTATEDIR); } =20 +char * +qemu_get_runtime_dir(void) +{ + char *env =3D getenv("XDG_RUNTIME_DIR"); + if (env) { + return g_strdup(env); + } + + return get_relocated_path(CONFIG_QEMU_LOCALSTATEDIR "/run"); +} + void qemu_set_tty_echo(int fd, bool echo) { struct termios tty; diff --git a/util/oslib-win32.c b/util/oslib-win32.c index 5f3e8f4d9801..5887cea12aec 100644 --- a/util/oslib-win32.c +++ b/util/oslib-win32.c @@ -27,6 +27,8 @@ */ =20 #include "qemu/osdep.h" +#include +#include #include #include "qapi/error.h" #include "qemu/main-loop.h" @@ -238,6 +240,32 @@ qemu_get_local_state_dir(void) return g_strdup(data_dirs[0]); } =20 +char * +qemu_get_runtime_dir(void) +{ + PWSTR wpath; + const wchar_t *cwpath; + size_t size =3D GetEnvironmentVariableA("XDG_RUNTIME_DIR", NULL, 0); + + if (size) { + char *env =3D g_malloc(size); + GetEnvironmentVariableA("XDG_RUNTIME_DIR", env, size); + return env; + } + + if (!SHGetKnownFolderPath(&FOLDERID_LocalAppData, KF_FLAG_DEFAULT, NUL= L, + &wpath)) { + cwpath =3D wpath; + size =3D wcsrtombs(NULL, &cwpath, 0, &(mbstate_t){0}) + 1; + char *path =3D g_malloc(size); + wcsrtombs(path, &cwpath, size, &(mbstate_t){0}); + CoTaskMemFree(wpath); + return path; + } + + return get_relocated_path(CONFIG_QEMU_LOCALSTATEDIR "/run"); +} + void qemu_set_tty_echo(int fd, bool echo) { HANDLE handle =3D (HANDLE)_get_osfhandle(fd); --=20 2.54.0 From nobody Sat Jul 4 20:10:51 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=reject dis=none) header.from=rsg.ci.i.u-tokyo.ac.jp Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1783057697312231.03115510206464; Thu, 2 Jul 2026 22:48:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wfWkM-0004Yo-1m; Fri, 03 Jul 2026 01:47:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wfWje-0004Sx-H2; Fri, 03 Jul 2026 01:46:49 -0400 Received: from www3579.sakura.ne.jp ([49.212.243.89]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wfWjW-0003RU-9G; Fri, 03 Jul 2026 01:46:41 -0400 Received: from h183.csg.ci.i.u-tokyo.ac.jp (h183.csg.ci.i.u-tokyo.ac.jp [133.11.54.183]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 6635jovb036784 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 3 Jul 2026 14:46:04 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=a5pX8GSQLfvXAGNcBH7Jek/cIEJQlGFUi9gglmnzbXs=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Message-Id:To:Subject:Date; s=rs20250326; t=1783057565; v=1; b=L11PWrTwQZGVmFeAItVm73mPTJFkRlawTeml8mm9ydsJ3N0AVX/ubpRfSykfpHwe 9L3t8vN5HJavQ30joij+tT20Y08J2riJVfzwgU+iMQDA6H0496ZAibim/og9ft/Y 9O59YSTmF3ULIRZCFSSXX+fEc5ahZWj46x1K8vWfl5JE/IjjCy7I4R5Nz8/HG9Ar B9E2I0TGYvO10L7pGVFxb/CAFvEXMz6bGOzLdxWDNrOrV6Emq2B5VTp6MRgU70Xx OHBjadgp4TP7UN1+Vb1kG0ZUeSsqb9FTfhELUw/+V5/eQUtLhy3ROa6BOGoGpL1D zGYSs2McY9XeSnXmGNznYw== From: Akihiko Odaki Date: Fri, 03 Jul 2026 14:45:33 +0900 Subject: [PATCH v5 2/8] ivshmem-server: Use qemu_get_runtime_dir() MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260703-run-v5-2-4521ac5a149e@rsg.ci.i.u-tokyo.ac.jp> References: <20260703-run-v5-0-4521ac5a149e@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20260703-run-v5-0-4521ac5a149e@rsg.ci.i.u-tokyo.ac.jp> To: qemu-devel@nongnu.org, qemu-block@nongnu.org, Yuval Shaia , Marcel Apfelbaum , Konstantin Kostiuk , Michael Roth , Paolo Bonzini , Fam Zheng , "Dr . David Alan Gilbert" , Stefan Hajnoczi , Gerd Hoffmann , Stefan Weil , Yan Vugenfirer , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Marcelo Tosatti , Zhao Liu , kvm@vger.kernel.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Akihiko Odaki X-Mailer: b4 0.16-dev-925f5 X-Developer-Signature: v=1; a=openpgp-sha256; l=3121; i=odaki@rsg.ci.i.u-tokyo.ac.jp; h=from:subject:message-id; bh=bk67rDms6n/fkiVYMEK4YCup/zBeBbWYRVMUGEZOa5U=; b=owGbwMvMwCWmMbc20y1CyJDxtFoSQ5a7z+TA1f+sXxZPWqElkXJp8qo/DBP+l/PGzT/q4HJ89 nE79djKjlIWBjEuBlkxRZaUot3cGtG1nwoT4ltg5rAygQxh4OIUgInwT2JkePDx18VbH56odXhz 8B86eZPpj7S+8LHgac+ls5gfN3JaRzP8d0xS3vI1QlbBzM+xcKLp1dKKg/UbYu/q+reltT8NWX+ ACwA= X-Developer-Key: i=odaki@rsg.ci.i.u-tokyo.ac.jp; a=openpgp; fpr=AEDC03C9AF734F2EC26A7BFFA4BAEAA73536753C 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=lists1p.gnu.org; Received-SPF: pass client-ip=49.212.243.89; envelope-from=odaki@rsg.ci.i.u-tokyo.ac.jp; helo=www3579.sakura.ne.jp X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1783057698885158500 qemu_get_runtime_dir() is used to construct the default PID file path. Signed-off-by: Akihiko Odaki --- contrib/ivshmem-server/main.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/contrib/ivshmem-server/main.c b/contrib/ivshmem-server/main.c index 5901f17707e0..313124dd4520 100644 --- a/contrib/ivshmem-server/main.c +++ b/contrib/ivshmem-server/main.c @@ -14,7 +14,6 @@ =20 #define IVSHMEM_SERVER_DEFAULT_VERBOSE 0 #define IVSHMEM_SERVER_DEFAULT_FOREGROUND 0 -#define IVSHMEM_SERVER_DEFAULT_PID_FILE "/var/run/ivshmem-server.pid" #define IVSHMEM_SERVER_DEFAULT_UNIX_SOCK_PATH "/tmp/ivshmem_socket" #define IVSHMEM_SERVER_DEFAULT_SHM_PATH "ivshmem" #define IVSHMEM_SERVER_DEFAULT_SHM_SIZE (4 * 1024 * 1024) @@ -35,15 +34,23 @@ typedef struct IvshmemServerArgs { unsigned n_vectors; } IvshmemServerArgs; =20 +static char *ivshmem_server_get_default_pid_file(void) +{ + g_autofree char *run =3D qemu_get_runtime_dir(); + return g_build_filename(run, "ivshmem-server.pid", NULL); +} + static void ivshmem_server_usage(const char *progname) { + g_autofree char *pid_file =3D ivshmem_server_get_default_pid_file(); + printf("Usage: %s [OPTION]...\n" " -h: show this help\n" " -v: verbose mode\n" " -F: foreground mode (default is to daemonize)\n" " -p : path to the PID file (used in daemon mode onl= y)\n" - " default " IVSHMEM_SERVER_DEFAULT_PID_FILE "\n" + " default %s\n" " -S : path to the unix socket to listen to\= n" " default " IVSHMEM_SERVER_DEFAULT_UNIX_SOCK_PATH "\n" " -M : POSIX shared memory object to use\n" @@ -54,7 +61,7 @@ ivshmem_server_usage(const char *progname) " default %u\n" " -n : number of vectors\n" " default %u\n", - progname, IVSHMEM_SERVER_DEFAULT_SHM_SIZE, + progname, pid_file, IVSHMEM_SERVER_DEFAULT_SHM_SIZE, IVSHMEM_SERVER_DEFAULT_N_VECTORS); } =20 @@ -189,10 +196,10 @@ main(int argc, char *argv[]) { IvshmemServer server; struct sigaction sa, sa_quit; + g_autofree char *default_pid_file =3D NULL; IvshmemServerArgs args =3D { .verbose =3D IVSHMEM_SERVER_DEFAULT_VERBOSE, .foreground =3D IVSHMEM_SERVER_DEFAULT_FOREGROUND, - .pid_file =3D IVSHMEM_SERVER_DEFAULT_PID_FILE, .unix_socket_path =3D IVSHMEM_SERVER_DEFAULT_UNIX_SOCK_PATH, .shm_path =3D IVSHMEM_SERVER_DEFAULT_SHM_PATH, .use_shm_open =3D true, @@ -207,6 +214,11 @@ main(int argc, char *argv[]) */ printf("*** Example code, do not use in production ***\n"); =20 + qemu_init_exec_dir(argv[0]); + + default_pid_file =3D ivshmem_server_get_default_pid_file(); + args.pid_file =3D default_pid_file; + /* parse arguments, will exit on error */ ivshmem_server_parse_args(&args, argc, argv); =20 --=20 2.54.0 From nobody Sat Jul 4 20:10:51 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=reject dis=none) header.from=rsg.ci.i.u-tokyo.ac.jp Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1783057743484420.6974076886214; Thu, 2 Jul 2026 22:49:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wfWki-0004mk-Qc; Fri, 03 Jul 2026 01:47:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wfWje-0004T5-Mi; Fri, 03 Jul 2026 01:46:51 -0400 Received: from www3579.sakura.ne.jp ([49.212.243.89]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wfWjW-0003RI-9i; Fri, 03 Jul 2026 01:46:43 -0400 Received: from h183.csg.ci.i.u-tokyo.ac.jp (h183.csg.ci.i.u-tokyo.ac.jp [133.11.54.183]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 6635jovc036784 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 3 Jul 2026 14:46:05 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=AHPqD+tIyvCHf3qXm6SUnzMux+ljEiTqoyGn4fIigmE=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Message-Id:To:Subject:Date; s=rs20250326; t=1783057565; v=1; b=EaQ5rD4QME4Y6T4PNn79HZe6/AMCFKkVexl82lrxW/xH2oIhzVEPuLDKsit3dfNA 8NjNuVJN0G1CQXByhQqECRsnq6HjqrQ9N34bs146NLtyC7Q416tujnB6zlN1vpxS E6cZHoa1udTptlZyDTcDHHNbzkQWaHI+BXWXg/owslV4pWpLey43q202FCkwqn+6 5GOVCyrHXHvr+PxqsYUahPc81bC8/8YkqQlEU4xuyam/8JCh+u/JrYuu/Orz63gg Oycn1yTbf1NwenkRjOcGNxHh715g/8/fKmyVDYRYalCQbBN6JClWnaxwa0VeYqOr aNC5THDiD/aKG9NFfOQsMw== From: Akihiko Odaki Date: Fri, 03 Jul 2026 14:45:34 +0900 Subject: [PATCH v5 3/8] qga: Use qemu_get_runtime_dir() MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260703-run-v5-3-4521ac5a149e@rsg.ci.i.u-tokyo.ac.jp> References: <20260703-run-v5-0-4521ac5a149e@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20260703-run-v5-0-4521ac5a149e@rsg.ci.i.u-tokyo.ac.jp> To: qemu-devel@nongnu.org, qemu-block@nongnu.org, Yuval Shaia , Marcel Apfelbaum , Konstantin Kostiuk , Michael Roth , Paolo Bonzini , Fam Zheng , "Dr . David Alan Gilbert" , Stefan Hajnoczi , Gerd Hoffmann , Stefan Weil , Yan Vugenfirer , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Marcelo Tosatti , Zhao Liu , kvm@vger.kernel.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Akihiko Odaki X-Mailer: b4 0.16-dev-925f5 X-Developer-Signature: v=1; a=openpgp-sha256; l=3665; i=odaki@rsg.ci.i.u-tokyo.ac.jp; h=from:subject:message-id; bh=0QIwFy8bP77AKijAc2rWm/vQXhRd9FL/+60FhfkdcVY=; b=owGbwMvMwCWmMbc20y1CyJDxtFoSQ5a7z5SraqZHZnpsvdvj9zrCZl+udcEWPQ/OjAO85SWyr R6WW6d0lLIwiHExyIopsqQU7ebWiK79VJgQ3wIzh5UJZAgDF6cATIT5D8P/3F/sL01XPAoKtu5f 8D/hkXJorOzf2L1JWz9OuydbsFZVkeGf6hlPj8yF6stvVITfX2Wc8IalI/2D1CXlU3d9TgR/Pfi RDwA= X-Developer-Key: i=odaki@rsg.ci.i.u-tokyo.ac.jp; a=openpgp; fpr=AEDC03C9AF734F2EC26A7BFFA4BAEAA73536753C 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=lists1p.gnu.org; Received-SPF: pass client-ip=49.212.243.89; envelope-from=odaki@rsg.ci.i.u-tokyo.ac.jp; helo=www3579.sakura.ne.jp X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1783057745077158500 qemu_get_runtime_dir() is used to construct the default state directory. Signed-off-by: Akihiko Odaki --- docs/conf.py | 2 ++ docs/interop/qemu-ga.rst | 5 +++-- docs/meson.build | 6 +++++- qga/main.c | 8 ++++---- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 7e35d2158d30..cafe8fd37b59 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -169,9 +169,11 @@ # environment variable is not set is for the benefit of readthedocs # style document building; our Makefile always sets the variable. confdir =3D os.getenv('CONFDIR', "/etc/qemu") +localstatedir =3D os.getenv('LOCALSTATEDIR', "/var/local") =20 vars =3D { "CONFDIR": confdir, + "LOCALSTATEDIR": localstatedir, "VER_MACHINE_DEPRECATION_VERSION": ver_machine_deprecation_version, "VER_MACHINE_DELETION_VERSION": ver_machine_deletion_version, } diff --git a/docs/interop/qemu-ga.rst b/docs/interop/qemu-ga.rst index d16cc1b9f078..c9b0a7b387f2 100644 --- a/docs/interop/qemu-ga.rst +++ b/docs/interop/qemu-ga.rst @@ -72,7 +72,8 @@ Options =20 .. option:: -f, --pidfile=3DPATH =20 - Specify pid file (default is ``/var/run/qemu-ga.pid``). + Specify pid file (default is ``$XDG_RUNTIME_DIR/qemu-ga.pid`` or + |LOCALSTATEDIR|\ ``/run/qemu-ga.pid``). =20 .. option:: -F, --fsfreeze-hook=3DPATH =20 @@ -86,7 +87,7 @@ Options .. option:: -t, --statedir=3DPATH =20 Specify the directory to store state information (absolute paths only, - default is ``/var/run``). + default is ``$XDG_RUNTIME_DIR`` or |LOCALSTATEDIR|\ ``/run``). =20 .. option:: -v, --verbose =20 diff --git a/docs/meson.build b/docs/meson.build index a8d893681ecd..89a707a77b8a 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -4,7 +4,11 @@ sphinx_build =3D find_program(fs.parent(python.full_path()= ) / 'sphinx-build', # Check if tools are available to build documentation. build_docs =3D false if sphinx_build.found() - SPHINX_ARGS =3D ['env', 'CONFDIR=3D' + qemu_confdir, sphinx_build, '-q',= '-j', 'auto'] + SPHINX_ARGS =3D [ + 'env', + 'CONFDIR=3D' + qemu_confdir, 'LOCALSTATEDIR=3D' + get_option('localsta= tedir'), + sphinx_build, '-q', '-j', 'auto' + ] # If we're making warnings fatal, apply this to Sphinx runs as well if get_option('werror') SPHINX_ARGS +=3D [ '-W', '-Dkerneldoc_werror=3D1' ] diff --git a/qga/main.c b/qga/main.c index fd19c7037db1..215541ee86c9 100644 --- a/qga/main.c +++ b/qga/main.c @@ -48,7 +48,7 @@ #define QGA_VIRTIO_PATH_DEFAULT "/dev/virtio-ports/org.qemu.guest_agent.0" #endif /* CONFIG_BSD */ #define QGA_SERIAL_PATH_DEFAULT "/dev/ttyS0" -#define QGA_STATE_RELATIVE_DIR "run" +#define QGA_STATE_RELATIVE_DIR "" #else #define QGA_VIRTIO_PATH_DEFAULT "\\\\.\\Global\\org.qemu.guest_agent.0" #define QGA_STATE_RELATIVE_DIR "qemu-ga" @@ -157,12 +157,12 @@ static void stop_agent(GAState *s, bool requested); static void init_dfl_pathnames(void) { - g_autofree char *state =3D qemu_get_local_state_dir(); + g_autofree char *run =3D qemu_get_runtime_dir(); =20 g_assert(dfl_pathnames.state_dir =3D=3D NULL); g_assert(dfl_pathnames.pidfile =3D=3D NULL); - dfl_pathnames.state_dir =3D g_build_filename(state, QGA_STATE_RELATIVE= _DIR, NULL); - dfl_pathnames.pidfile =3D g_build_filename(state, QGA_STATE_RELATIVE_D= IR, "qemu-ga.pid", NULL); + dfl_pathnames.state_dir =3D g_build_filename(run, QGA_STATE_RELATIVE_D= IR, NULL); + dfl_pathnames.pidfile =3D g_build_filename(run, QGA_STATE_RELATIVE_DIR= , "qemu-ga.pid", NULL); } =20 static void quit_handler(int sig) --=20 2.54.0 From nobody Sat Jul 4 20:10:51 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=reject dis=none) header.from=rsg.ci.i.u-tokyo.ac.jp Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1783057661791195.09414530688161; Thu, 2 Jul 2026 22:47:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wfWk0-0004Uc-8I; Fri, 03 Jul 2026 01:47:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wfWja-0004Sh-2k; Fri, 03 Jul 2026 01:46:42 -0400 Received: from www3579.sakura.ne.jp ([49.212.243.89]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wfWjW-0003RT-Al; Fri, 03 Jul 2026 01:46:40 -0400 Received: from h183.csg.ci.i.u-tokyo.ac.jp (h183.csg.ci.i.u-tokyo.ac.jp [133.11.54.183]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 6635jovd036784 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 3 Jul 2026 14:46:05 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=gyPlnHk7ZCfzpCSpANopo+J6AuVgQP9h8XedmCtcNnQ=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Message-Id:To:Subject:Date; s=rs20250326; t=1783057565; v=1; b=LX3PEIsr3BpeOS3RXHyKoiPGOLqfD6NBpPCiVuR31XcFWWCbW5uUQpdegBKFqtgp lvEAjqiX/yyoOGl43Wr/ef/BXRsyUSvcOmKJi76P1iUgBbEMPquZRiYQLwUde2/K njBzVf2YWXqUMh7ZPiYpLN1Io6XCeC9PuVTVE0Po+qGzZqT/W8ExKjlE1WR7Zi30 CrNTLqSj8fPXxzL6Fw4zj7Y5qp8jtgmRSwAWWnQdJTBlQeJH+FG97zyAPynMs74i QCd91hL3faEA00kzrNSo34GsbFAV5sYtZWDEEoaRv8AUGbrhMj6Wl+LbQu879mhK 8NKEI9NsgPQGPFhGyIdtOA== From: Akihiko Odaki Date: Fri, 03 Jul 2026 14:45:35 +0900 Subject: [PATCH v5 4/8] scsi: Use qemu_get_runtime_dir() MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260703-run-v5-4-4521ac5a149e@rsg.ci.i.u-tokyo.ac.jp> References: <20260703-run-v5-0-4521ac5a149e@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20260703-run-v5-0-4521ac5a149e@rsg.ci.i.u-tokyo.ac.jp> To: qemu-devel@nongnu.org, qemu-block@nongnu.org, Yuval Shaia , Marcel Apfelbaum , Konstantin Kostiuk , Michael Roth , Paolo Bonzini , Fam Zheng , "Dr . David Alan Gilbert" , Stefan Hajnoczi , Gerd Hoffmann , Stefan Weil , Yan Vugenfirer , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Marcelo Tosatti , Zhao Liu , kvm@vger.kernel.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Akihiko Odaki X-Mailer: b4 0.16-dev-925f5 X-Developer-Signature: v=1; a=openpgp-sha256; l=1899; i=odaki@rsg.ci.i.u-tokyo.ac.jp; h=from:subject:message-id; bh=dMm50xffZzydEvZmAnq95wWWm43dv6hh+L1xlYY2L7U=; b=owGbwMvMwCWmMbc20y1CyJDxtFoSQ5a7z7T8BKva8CT/QL2ot1OWhn/mty3qt6nkm91ju61Aq XPj+tSOUhYGMS4GWTFFlpSi3dwa0bWfChPiW2DmsDKBDGHg4hSAibzVZWS4PGGxJc9TrXvmgduX i/6Yvefjy8m8d2ddvX3hrpqziKDzc0aGDme7LxsUNs6U3sHWWpzI/vJld29uFefplIPvDl7K9T/ IAwA= X-Developer-Key: i=odaki@rsg.ci.i.u-tokyo.ac.jp; a=openpgp; fpr=AEDC03C9AF734F2EC26A7BFFA4BAEAA73536753C 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=lists1p.gnu.org; Received-SPF: pass client-ip=49.212.243.89; envelope-from=odaki@rsg.ci.i.u-tokyo.ac.jp; helo=www3579.sakura.ne.jp X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1783057663052158500 qemu_get_runtime_dir() is used to construct the default paths. Signed-off-by: Akihiko Odaki --- docs/tools/qemu-pr-helper.rst | 8 ++++---- scsi/qemu-pr-helper.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/tools/qemu-pr-helper.rst b/docs/tools/qemu-pr-helper.rst index c32867cfc611..f92e2463f10f 100644 --- a/docs/tools/qemu-pr-helper.rst +++ b/docs/tools/qemu-pr-helper.rst @@ -61,14 +61,14 @@ Options .. option:: -f, --pidfile=3DPATH =20 PID file when running as a daemon. By default the PID file - is created in the system runtime state directory, for example - :file:`/var/run/qemu-pr-helper.pid`. + is created in ``$XDG_RUNTIME_DIR/qemu-pr-helper.pid`` or + |LOCALSTATEDIR|\ ``/run/qemu-pr-helper.pid``. =20 .. option:: -k, --socket=3DPATH =20 path to the socket. By default the socket is created in - the system runtime state directory, for example - :file:`/var/run/qemu-pr-helper.sock`. + ``$XDG_RUNTIME_DIR/qemu-pr-helper.sock`` or + |LOCALSTATEDIR|\ ``/run/qemu-pr-helper.sock``. =20 .. option:: -T, --trace [[enable=3D]PATTERN][,events=3DFILE][,file=3DFILE] =20 diff --git a/scsi/qemu-pr-helper.c b/scsi/qemu-pr-helper.c index 9dcd3ec7111e..3412fa3abbd2 100644 --- a/scsi/qemu-pr-helper.c +++ b/scsi/qemu-pr-helper.c @@ -76,10 +76,10 @@ static int gid =3D -1; =20 static void compute_default_paths(void) { - g_autofree char *state =3D qemu_get_local_state_dir(); + g_autofree char *run =3D qemu_get_runtime_dir(); =20 - socket_path =3D g_build_filename(state, "run", "qemu-pr-helper.sock", = NULL); - pidfile =3D g_build_filename(state, "run", "qemu-pr-helper.pid", NULL); + socket_path =3D g_build_filename(run, "qemu-pr-helper.sock", NULL); + pidfile =3D g_build_filename(run, "qemu-pr-helper.pid", NULL); } =20 static void usage(const char *name) --=20 2.54.0 From nobody Sat Jul 4 20:10:51 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=reject dis=none) header.from=rsg.ci.i.u-tokyo.ac.jp Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1783057690094944.6000516904464; Thu, 2 Jul 2026 22:48:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wfWkb-0004e4-96; Fri, 03 Jul 2026 01:47:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wfWje-0004T4-MP; Fri, 03 Jul 2026 01:46:51 -0400 Received: from www3579.sakura.ne.jp ([49.212.243.89]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wfWjW-0003RV-98; Fri, 03 Jul 2026 01:46:42 -0400 Received: from h183.csg.ci.i.u-tokyo.ac.jp (h183.csg.ci.i.u-tokyo.ac.jp [133.11.54.183]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 6635jove036784 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 3 Jul 2026 14:46:05 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=851A/JXMMn6GwDOP12xrolOCWBX0QezLyRGo803/850=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Message-Id:To:Subject:Date; s=rs20250326; t=1783057565; v=1; b=i78UPtYwoS8Yl2fhpzn5PGis683FaDaDFL+PekDANPIsFDBXeNKmJm3CiVouZctI G8kU/47ZeUOzatPzTDiHrlTeuynTeg4teCLQ7+IoksB68eJYyY/yj0tbnXwMQwjZ CqjktQeTrrw1oqaWFmhOsYMRQaJIWuoFcxAprCNtF4RW3/x6dul+SLbvm+m0zvh8 U4JOAax+WHaJ5ysagNzNRfq0/ky6RXiGo3kL0XaZFcKoasQw1RC+korUrf7eLb6A NmSo+EONd2Ir5jk+NaQXY2P25tPw5wL6rB0pzgI00l/xKOLv2OtPLw04KIv4JqCv vp4pTUj4Y0e9+TW0ArdieA== From: Akihiko Odaki Date: Fri, 03 Jul 2026 14:45:36 +0900 Subject: [PATCH v5 5/8] i386/vmsr: Stop using qemu_get_local_state_dir() MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260703-run-v5-5-4521ac5a149e@rsg.ci.i.u-tokyo.ac.jp> References: <20260703-run-v5-0-4521ac5a149e@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20260703-run-v5-0-4521ac5a149e@rsg.ci.i.u-tokyo.ac.jp> To: qemu-devel@nongnu.org, qemu-block@nongnu.org, Yuval Shaia , Marcel Apfelbaum , Konstantin Kostiuk , Michael Roth , Paolo Bonzini , Fam Zheng , "Dr . David Alan Gilbert" , Stefan Hajnoczi , Gerd Hoffmann , Stefan Weil , Yan Vugenfirer , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Marcelo Tosatti , Zhao Liu , kvm@vger.kernel.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Akihiko Odaki X-Mailer: b4 0.16-dev-925f5 X-Developer-Signature: v=1; a=openpgp-sha256; l=3018; i=odaki@rsg.ci.i.u-tokyo.ac.jp; h=from:subject:message-id; bh=oeQZYiyhgFq2eVkoVeT1tGWrYZPG4NXl4cvC4qX3el8=; b=owGbwMvMwCWmMbc20y1CyJDxtFoSQ5a7z/SPswPmTuRUqrTceF/M1s37Tp3cx/XFCndf+P/wm MWg01HZUcrCIMbFICumyJJStJtbI7r2U2FCfAvMHFYmkCEMXJwCMJGiSEaG3Yfnq8bqXVumcPF6 5+WFdWtvfL9+8ujy1148yv6Fb+uP6zMyrNpm1Lzr4ZPp70Us9VY1CD/vsOVg2P5324aZ0w3+n1h 9mAkA X-Developer-Key: i=odaki@rsg.ci.i.u-tokyo.ac.jp; a=openpgp; fpr=AEDC03C9AF734F2EC26A7BFFA4BAEAA73536753C 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=lists1p.gnu.org; Received-SPF: pass client-ip=49.212.243.89; envelope-from=odaki@rsg.ci.i.u-tokyo.ac.jp; helo=www3579.sakura.ne.jp X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1783057690976158500 The qemu_get_local_state_dir() users only need the QEMU "run" directory, but the Windows implementation is not suitable for that. It calls g_get_system_data_dirs(), which in turn is documented as follows: > On Windows it follows XDG Base Directory Specification if > `XDG_DATA_DIRS` is defined. > If `XDG_DATA_DIRS` is undefined, > the first elements in the list are the Application Data > and Documents folders for All Users. (These can be determined only > on Windows 2000 or later and are not present in the list on other > Windows versions.) See documentation for FOLDERID_ProgramData and > FOLDERID_PublicDocuments. > > Then follows the "share" subfolder in the installation folder for > the package containing the DLL that calls this function, if it can > be determined. > > Finally the list contains the "share" subfolder in the installation > folder for GLib, and in the installation folder for the package the > application's .exe file belongs to. Use get_relocated_path(CONFIG_QEMU_LOCALSTATEDIR "/run") for the vmsr helper paths to allow removing it. qemu_get_runtime_dir() is not appropriate here because it points to a user-specific runtime directory, while the vmsr helper and QEMU are typically run by different users and need to agree on the socket path. Signed-off-by: Akihiko Odaki --- target/i386/kvm/vmsr_energy.c | 6 +++--- tools/i386/qemu-vmsr-helper.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/target/i386/kvm/vmsr_energy.c b/target/i386/kvm/vmsr_energy.c index d24e827a214a..77f39ed12b98 100644 --- a/target/i386/kvm/vmsr_energy.c +++ b/target/i386/kvm/vmsr_energy.c @@ -12,6 +12,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/cutils.h" #include "qemu/error-report.h" #include "vmsr_energy.h" #include "io/channel.h" @@ -22,9 +23,8 @@ =20 char *vmsr_compute_default_paths(void) { - g_autofree char *state =3D qemu_get_local_state_dir(); - - return g_build_filename(state, "run", "qemu-vmsr-helper.sock", NULL); + return get_relocated_path(CONFIG_QEMU_LOCALSTATEDIR + "/run/qemu-vmsr-helper.sock"); } =20 int is_rapl_enabled(void) diff --git a/tools/i386/qemu-vmsr-helper.c b/tools/i386/qemu-vmsr-helper.c index f12fd3c3e816..7c507695f571 100644 --- a/tools/i386/qemu-vmsr-helper.c +++ b/tools/i386/qemu-vmsr-helper.c @@ -62,10 +62,10 @@ static int gid =3D -1; =20 static void compute_default_paths(void) { - g_autofree char *state =3D qemu_get_local_state_dir(); + g_autofree char *run =3D get_relocated_path(CONFIG_QEMU_LOCALSTATEDIR = "/run"); =20 - socket_path =3D g_build_filename(state, "run", "qemu-vmsr-helper.sock"= , NULL); - pidfile =3D g_build_filename(state, "run", "qemu-vmsr-helper.pid", NUL= L); + socket_path =3D g_build_filename(run, "qemu-vmsr-helper.sock", NULL); + pidfile =3D g_build_filename(run, "qemu-vmsr-helper.pid", NULL); } =20 static int is_intel_processor(void) --=20 2.54.0 From nobody Sat Jul 4 20:10:51 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=reject dis=none) header.from=rsg.ci.i.u-tokyo.ac.jp Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1783057710471561.5478545914016; Thu, 2 Jul 2026 22:48:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wfWkg-0004kV-34; Fri, 03 Jul 2026 01:47:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wfWje-0004Sy-HN; Fri, 03 Jul 2026 01:46:49 -0400 Received: from www3579.sakura.ne.jp ([49.212.243.89]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wfWjW-0003RM-BA; Fri, 03 Jul 2026 01:46:41 -0400 Received: from h183.csg.ci.i.u-tokyo.ac.jp (h183.csg.ci.i.u-tokyo.ac.jp [133.11.54.183]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 6635jovf036784 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 3 Jul 2026 14:46:06 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=8TGlRMXNgJkY6XRsWpl74qtD3NJg9sImsPCOCPuebGs=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Message-Id:To:Subject:Date; s=rs20250326; t=1783057566; v=1; b=ENHPtltnRWQYbx7zoo3CzMmmOph0ygdocL8AZsLvd0IU6BW/+KxVQpF4qcjnWrVs oR8/sZeb4rcXR3sXpTIHjuW9J45pNc46V8mbrDqPYXcz/s7CTqpadn41OBOoDAUS yjo/StrN5DmYKJiQURcLupGbBqaNQrRVmxi1mfVHUJPhZGnP2vkAGQM8D1VpfdCg 8fp+ZpfoUoUapZ2sFS+MqeMn/ijX9m7RiUYgV5aV8lg+xRyOXpqNFmD0+fHLc2ja bmowknJ398HSySysooyHB5UTO5jtfvpSEkEWKlsmM6aWFClLBmQc3Rr0j0CSUTA2 FK3lTezkfrW3IpB4qgY46Q== From: Akihiko Odaki Date: Fri, 03 Jul 2026 14:45:37 +0900 Subject: [PATCH v5 6/8] module: Use qemu_get_runtime_dir() MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260703-run-v5-6-4521ac5a149e@rsg.ci.i.u-tokyo.ac.jp> References: <20260703-run-v5-0-4521ac5a149e@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20260703-run-v5-0-4521ac5a149e@rsg.ci.i.u-tokyo.ac.jp> To: qemu-devel@nongnu.org, qemu-block@nongnu.org, Yuval Shaia , Marcel Apfelbaum , Konstantin Kostiuk , Michael Roth , Paolo Bonzini , Fam Zheng , "Dr . David Alan Gilbert" , Stefan Hajnoczi , Gerd Hoffmann , Stefan Weil , Yan Vugenfirer , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Marcelo Tosatti , Zhao Liu , kvm@vger.kernel.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Akihiko Odaki X-Mailer: b4 0.16-dev-925f5 X-Developer-Signature: v=1; a=openpgp-sha256; l=1463; i=odaki@rsg.ci.i.u-tokyo.ac.jp; h=from:subject:message-id; bh=4PXnR6ZdLkaqz4pRFi//hI5Zh2wnip4Hz54KkyfWdsk=; b=owGbwMvMwCWmMbc20y1CyJDxtFoSQ5a7zwzpir8bLjUYX5R8L/pYrzBw6+mFnALODF997DsSd Pq+3YnvKGVhEONikBVTZEkp2s2tEV37qTAhvgVmDisTyBAGLk4BmMjiDob/JUcN5I9KS2alVt7Y u+O768nMxk8mAZFXGWPmFDNKbw+sZGQ4Fz5h5nr9hP7V66+WCMZWrCzfuG3yn6xtwsLfFd+z+qj zAwA= X-Developer-Key: i=odaki@rsg.ci.i.u-tokyo.ac.jp; a=openpgp; fpr=AEDC03C9AF734F2EC26A7BFFA4BAEAA73536753C 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=lists1p.gnu.org; Received-SPF: pass client-ip=49.212.243.89; envelope-from=odaki@rsg.ci.i.u-tokyo.ac.jp; helo=www3579.sakura.ne.jp X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1783057710774158500 qemu_get_runtime_dir() is used to construct the path to module upgrades. Signed-off-by: Akihiko Odaki --- include/qemu/module.h | 2 +- util/module.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/qemu/module.h b/include/qemu/module.h index fccf017bf9e8..a22755c6f026 100644 --- a/include/qemu/module.h +++ b/include/qemu/module.h @@ -76,7 +76,7 @@ void module_call_init(module_init_type type); * directories searched are: * - getenv("QEMU_MODULE_DIR") * - get_relocated_path(CONFIG_QEMU_MODDIR); - * - /var/run/qemu/${version_dir} + * - ${qemu_get_runtime_dir()}/qemu/${version_dir} * * prefix: a subsystem prefix, or the empty string ("ui-", ..., "") * name: name of the module diff --git a/util/module.c b/util/module.c index 09dc43f51eb3..eff64fa7ab0a 100644 --- a/util/module.c +++ b/util/module.c @@ -242,7 +242,8 @@ int module_load(const char *prefix, const char *name, E= rror **errp) version_dir =3D g_strcanon(g_strdup(QEMU_PKGVERSION), G_CSET_A_2_Z G_CSET_a_2_z G_CSET_DIGITS "+-.~= ", '_'); - dirs[n_dirs++] =3D g_strdup_printf("/var/run/qemu/%s", version_dir); + g_autofree char *run =3D qemu_get_runtime_dir(); + dirs[n_dirs++] =3D g_build_filename(run, "qemu", version_dir, NULL); #endif assert(n_dirs <=3D ARRAY_SIZE(dirs)); =20 --=20 2.54.0 From nobody Sat Jul 4 20:10:51 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=reject dis=none) header.from=rsg.ci.i.u-tokyo.ac.jp Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1783057724077235.09030235287673; Thu, 2 Jul 2026 22:48:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wfWkf-0004gI-0k; Fri, 03 Jul 2026 01:47:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wfWje-0004T2-Ll; Fri, 03 Jul 2026 01:46:49 -0400 Received: from www3579.sakura.ne.jp ([49.212.243.89]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wfWjW-0003RC-9B; Fri, 03 Jul 2026 01:46:42 -0400 Received: from h183.csg.ci.i.u-tokyo.ac.jp (h183.csg.ci.i.u-tokyo.ac.jp [133.11.54.183]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 6635jovg036784 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 3 Jul 2026 14:46:06 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=EqLrzd0wk4wQt8kZtdYvKx4Ux02VoKxLULvtV8vK5iI=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Message-Id:To:Subject:Date; s=rs20250326; t=1783057566; v=1; b=ol/yOEFXkLqxZKT138XTi0RPqzGWeSdUAsXKXdg8GCzTlVKDN3rng6sex4AqrqaQ 2hGk/cB8ScfhVDWi8QjLiRJWzcgWwEuxlrR3hKRwMFt6L1/4/2ZjB/I4ZXn2QjiY 6QPwojJ/sPvsiByGAg2GaR1lQ5RekGPd1CDMwjvhJ2ngkwg0EHVkALJoLa3IO77a kzXNrLz1qD9FIqHTCFiiLa0hVhwS9FokETKVTp7RcRDjh2mH8JV3wvyfea2jMsrx EYjZ7xkgB5kKv1rQH6xrav7C7ecgmNPwna30gYBfR+Zon9p1whnmos6+9DTFJXnF tMKfokQ55sJGCH7ayy09FQ== From: Akihiko Odaki Date: Fri, 03 Jul 2026 14:45:38 +0900 Subject: [PATCH v5 7/8] util: Remove qemu_get_local_state_dir() MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260703-run-v5-7-4521ac5a149e@rsg.ci.i.u-tokyo.ac.jp> References: <20260703-run-v5-0-4521ac5a149e@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20260703-run-v5-0-4521ac5a149e@rsg.ci.i.u-tokyo.ac.jp> To: qemu-devel@nongnu.org, qemu-block@nongnu.org, Yuval Shaia , Marcel Apfelbaum , Konstantin Kostiuk , Michael Roth , Paolo Bonzini , Fam Zheng , "Dr . David Alan Gilbert" , Stefan Hajnoczi , Gerd Hoffmann , Stefan Weil , Yan Vugenfirer , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Marcelo Tosatti , Zhao Liu , kvm@vger.kernel.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Akihiko Odaki X-Mailer: b4 0.16-dev-925f5 X-Developer-Signature: v=1; a=openpgp-sha256; l=1713; i=odaki@rsg.ci.i.u-tokyo.ac.jp; h=from:subject:message-id; bh=K0UJNUosHhV8leUj3w42aWRtcOxU75tjw8UPDyAhTPQ=; b=owGbwMvMwCWmMbc20y1CyJDxtFoSQ5a7z8xXT0L25769+ybs1lPvbx9nKl9pe3m8+sPfo5Vnv u7icUnL7ihlYRDjYpAVU2RJKdrNrRFd+6kwIb4FZg4rE8gQBi5OAZhI7TJGhoeNouIlgTc25R8q zph9K4jt9BIJXqbdYWK9ai9jz5U942FkmPQnM5jvFudNnecWPsamYXe4NpUfnyrFPft4w5zLsnE m7AA= X-Developer-Key: i=odaki@rsg.ci.i.u-tokyo.ac.jp; a=openpgp; fpr=AEDC03C9AF734F2EC26A7BFFA4BAEAA73536753C 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=lists1p.gnu.org; Received-SPF: pass client-ip=49.212.243.89; envelope-from=odaki@rsg.ci.i.u-tokyo.ac.jp; helo=www3579.sakura.ne.jp X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1783057725059158500 There are no users of the function anymore. Signed-off-by: Akihiko Odaki --- include/qemu/osdep.h | 8 -------- util/oslib-posix.c | 6 ------ util/oslib-win32.c | 10 ---------- 3 files changed, 24 deletions(-) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index d64cebdf5ec5..47436e0e027f 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -709,14 +709,6 @@ bool qemu_set_blocking(int fd, bool block, Error **err= p); */ void qemu_clear_cloexec(int fd); =20 -/* Return a dynamically allocated directory path that is appropriate for s= toring - * local state. - * - * The caller is responsible for releasing the value returned with g_free() - * after use. - */ -char *qemu_get_local_state_dir(void); - /** * qemu_get_runtime_dir: * diff --git a/util/oslib-posix.c b/util/oslib-posix.c index d03399063999..69db96ab9556 100644 --- a/util/oslib-posix.c +++ b/util/oslib-posix.c @@ -314,12 +314,6 @@ void qemu_clear_cloexec(int fd) assert(f !=3D -1); } =20 -char * -qemu_get_local_state_dir(void) -{ - return get_relocated_path(CONFIG_QEMU_LOCALSTATEDIR); -} - char * qemu_get_runtime_dir(void) { diff --git a/util/oslib-win32.c b/util/oslib-win32.c index 5887cea12aec..e052f3a9deb1 100644 --- a/util/oslib-win32.c +++ b/util/oslib-win32.c @@ -230,16 +230,6 @@ int qemu_get_thread_id(void) return GetCurrentThreadId(); } =20 -char * -qemu_get_local_state_dir(void) -{ - const char * const *data_dirs =3D g_get_system_data_dirs(); - - g_assert(data_dirs && data_dirs[0]); - - return g_strdup(data_dirs[0]); -} - char * qemu_get_runtime_dir(void) { --=20 2.54.0 From nobody Sat Jul 4 20:10:51 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=reject dis=none) header.from=rsg.ci.i.u-tokyo.ac.jp Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1783057747080255.8678340815096; Thu, 2 Jul 2026 22:49:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wfWkf-0004kK-V7; Fri, 03 Jul 2026 01:47:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wfWja-0004Sg-1q; Fri, 03 Jul 2026 01:46:44 -0400 Received: from www3579.sakura.ne.jp ([49.212.243.89]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wfWjW-0003RL-63; Fri, 03 Jul 2026 01:46:40 -0400 Received: from h183.csg.ci.i.u-tokyo.ac.jp (h183.csg.ci.i.u-tokyo.ac.jp [133.11.54.183]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 6635jovh036784 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 3 Jul 2026 14:46:06 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=pf6Se3sLDfz0Xq2tO+kn72qyQWuqHruYyof/nnnUeQs=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Message-Id:To:Subject:Date; s=rs20250326; t=1783057566; v=1; b=jtxf5DgEI/nrPr6cez8FWXdAApcO9poYnBW/XsCEeYbbrawyBgHmzEtk+b5Oa21Y lenWwZkqJ1HNBoJTyNAyaUn9CgUEcz9NPVBcKxZ0YhP0Ofh0YIZmv2OvbVaUrw3R 4eo5wqXIm9Vwy5RgXwluxM5wBD5m5xFV7KUAwkXO1j2NvZXDqVp2nLD855RZuOK1 RPdHKlXOdyihq/PthUaLPKYzGA0GRR2bXb/G6x5ursdAPyn9+iMdDhXnzsTw74RH QqsuTk7hMkldrFZaVZ0pFccHEsDIYkeUq4h39C1RcCEary0koMslZ6wWXu2NypQb 469UyCEyVXGAiMqgW2L2cA== From: Akihiko Odaki Date: Fri, 03 Jul 2026 14:45:39 +0900 Subject: [PATCH v5 8/8] spice-app: Use qemu_get_runtime_dir() MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260703-run-v5-8-4521ac5a149e@rsg.ci.i.u-tokyo.ac.jp> References: <20260703-run-v5-0-4521ac5a149e@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20260703-run-v5-0-4521ac5a149e@rsg.ci.i.u-tokyo.ac.jp> To: qemu-devel@nongnu.org, qemu-block@nongnu.org, Yuval Shaia , Marcel Apfelbaum , Konstantin Kostiuk , Michael Roth , Paolo Bonzini , Fam Zheng , "Dr . David Alan Gilbert" , Stefan Hajnoczi , Gerd Hoffmann , Stefan Weil , Yan Vugenfirer , John Snow , Peter Maydell , Mauro Carvalho Chehab , Pierrick Bouvier , Marcelo Tosatti , Zhao Liu , kvm@vger.kernel.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Akihiko Odaki X-Mailer: b4 0.16-dev-925f5 X-Developer-Signature: v=1; a=openpgp-sha256; l=942; i=odaki@rsg.ci.i.u-tokyo.ac.jp; h=from:subject:message-id; bh=yO+U2c7zRXebZJzvW3yCcCzOsc5WOosru64nAuxYfww=; b=owGbwMvMwCWmMbc20y1CyJDxtFoSQ5a7z6wdZ66r2joYpOz7xnuLqa1cPH+R5MUfh77e/Lz05 YpLkitPdZSyMIhxMciKKbKkFO3m1oiu/VSYEN8CM4eVCWQIAxenAExk01dGhpkNG79NW5p3aq7G S075KCMe/eK3h2ddFtyu8PjMeqUrU3Yz/I/+zHaM2Uh8yeqE2XPzl5suMdHn7b51X9/swdHp71S 3p3ECAA== X-Developer-Key: i=odaki@rsg.ci.i.u-tokyo.ac.jp; a=openpgp; fpr=AEDC03C9AF734F2EC26A7BFFA4BAEAA73536753C 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=lists1p.gnu.org; Received-SPF: pass client-ip=49.212.243.89; envelope-from=odaki@rsg.ci.i.u-tokyo.ac.jp; helo=www3579.sakura.ne.jp X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1783057749005158500 qemu_get_runtime_dir() provides QEMU-specific fallback of runtime directory. Signed-off-by: Akihiko Odaki --- ui/spice-app.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/spice-app.c b/ui/spice-app.c index 0df7325e6792..4bc00961b58f 100644 --- a/ui/spice-app.c +++ b/ui/spice-app.c @@ -149,8 +149,8 @@ static void spice_app_display_early_init(DisplayOptions= *opts) atexit(spice_app_atexit); =20 if (qemu_name) { - app_dir =3D g_build_filename(g_get_user_runtime_dir(), - "qemu", qemu_name, NULL); + g_autofree char *run =3D qemu_get_runtime_dir(); + app_dir =3D g_build_filename(run, "qemu", qemu_name, NULL); if (g_mkdir_with_parents(app_dir, S_IRWXU) < 0) { error_report("Failed to create directory %s: %s", app_dir, strerror(errno)); --=20 2.54.0