From patchwork Thu Nov 10 10:06:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1702071 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20210112.gappssmtp.com header.i=@daynix-com.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=GO8WB5ka; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4N7HbH6qBCz23lT for ; Thu, 10 Nov 2022 21:08:11 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ot4SX-0002wH-Eb; Thu, 10 Nov 2022 05:07:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ot4SK-0002su-Np for qemu-devel@nongnu.org; Thu, 10 Nov 2022 05:06:44 -0500 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ot4SJ-0006Sj-0C for qemu-devel@nongnu.org; Thu, 10 Nov 2022 05:06:44 -0500 Received: by mail-pg1-x52e.google.com with SMTP id s196so1348694pgs.3 for ; Thu, 10 Nov 2022 02:06:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=S71uA1qqGC/6TbeUsoWwC8+Ke/IgKE6MHXg9S63X/NM=; b=GO8WB5ka6tue1ww5t9EDi25pnB8BMHJzfN5Ib9bNU4FCiwYIQuZJy63ZzDqvmc+u+w 4OowzgYlQxV/kHLv9AoLd38HfFV8bWESXF0RYyw1vq35/j/DaqNEMBT+C63zg4baRvqy FPJm6AS3v89MwbGwRWe+/LavDZFId/eG03Vwr+RAL5/VxjbtvVSbwRjqnnjdcz3Ofss8 HWER7E9ImD/h2mb/+dTCZcpWCbfquKpFj63iYFgMD94C3rf+NZlziNIHVQUSpcPK5oZM odBb6AatY+CqaFbAuZhnksJC68RgRdPXakeCfQmXBnT++Nfip/Byz1YgpPX3aWj/w0Hh XyXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=S71uA1qqGC/6TbeUsoWwC8+Ke/IgKE6MHXg9S63X/NM=; b=3iZ7svIeRv30OYde5GcuAfprZ1jud3hfnzM6IjEJCVRd3tZt1jHPkQOByp6eQoQKP2 tFS852cyz05Rd8LVET79vtUQ0L1K05EHu+V/y6haKGq1nl7HFk5bCfCoW0hkfvTE0ywg d0bFueX17FhIBW45Yza2dHsTzmnU3NogFahlUS04RHMBJjtW0KBRK0AzYQCVjEnDmwpd dS5sVRpUVAde//+V1r3EW6vnvemDI6NQVaXTVUGXLCPHplPZvY+qJyeKzcorlWZftp0Z 6Ic/gTlKDP4dnIkl+6PScA+ZaWihu17CehdNmVo2WPzS5okfg8VPr9H+la69zPPhpWM4 woQw== X-Gm-Message-State: ACrzQf2ld/Fkrles9Kig30mBOmhOnfB71G0UZizwQ3QtXgh5GWdtNAU+ D4i9nl9u5DSPQ9xr//74eXK1iuoVr10FdVAj X-Google-Smtp-Source: AMsMyM7SSJAfF/ZuaLKWWtabtMQhI6q32tc93XKuqPP9L4ykDCeo2f70l2GCbxFct+YIYNf4K+PbJw== X-Received: by 2002:a05:6a00:1988:b0:56d:315d:e371 with SMTP id d8-20020a056a00198800b0056d315de371mr60017823pfl.20.1668074800147; Thu, 10 Nov 2022 02:06:40 -0800 (PST) Received: from fedora.flets-east.jp ([2400:4050:c360:8200:8ae8:3c4:c0da:7419]) by smtp.gmail.com with ESMTPSA id a9-20020a1709027e4900b001714e7608fdsm10730780pln.256.2022.11.10.02.06.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 02:06:39 -0800 (PST) From: Akihiko Odaki To: Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, virtio-fs@redhat.com, Yuval Shaia , Marcel Apfelbaum , Konstantin Kostiuk , Michael Roth , Paolo Bonzini , Fam Zheng , "Dr. David Alan Gilbert" , Stefan Hajnoczi , Gerd Hoffmann , Stefan Weil , Yan Vugenfirer , Akihiko Odaki Subject: [PATCH v2 01/10] qga: Remove platform GUID definitions Date: Thu, 10 Nov 2022 19:06:20 +0900 Message-Id: <20221110100629.61496-2-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221110100629.61496-1-akihiko.odaki@daynix.com> References: <20221110100629.61496-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::52e; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x52e.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org GUID_DEVINTERFACE_DISK and GUID_DEVINTERFACE_STORAGEPORT are already defined by MinGW-w64. They are not only unnecessary, but can lead to duplicate definition errors at link time with some unknown condition. Signed-off-by: Akihiko Odaki Reviewed-by: Konstantin Kostiuk --- qga/commands-win32.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/qga/commands-win32.c b/qga/commands-win32.c index ec9f55b453..dde5d401bb 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win32.c @@ -506,13 +506,6 @@ static GuestDiskBusType find_bus_type(STORAGE_BUS_TYPE bus) return win2qemu[(int)bus]; } -DEFINE_GUID(GUID_DEVINTERFACE_DISK, - 0x53f56307L, 0xb6bf, 0x11d0, 0x94, 0xf2, - 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b); -DEFINE_GUID(GUID_DEVINTERFACE_STORAGEPORT, - 0x2accfe60L, 0xc130, 0x11d2, 0xb0, 0x82, - 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b); - static void get_pci_address_for_device(GuestPCIAddress *pci, HDEVINFO dev_info) { From patchwork Thu Nov 10 10:06:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1702077 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20210112.gappssmtp.com header.i=@daynix-com.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=7bvJA0Ou; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4N7HcN6zqrz23lT for ; Thu, 10 Nov 2022 21:09:08 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ot4Sa-0002wV-Q2; Thu, 10 Nov 2022 05:07:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ot4SN-0002tb-Td for qemu-devel@nongnu.org; Thu, 10 Nov 2022 05:06:47 -0500 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ot4SL-0006TJ-Jx for qemu-devel@nongnu.org; Thu, 10 Nov 2022 05:06:47 -0500 Received: by mail-pg1-x536.google.com with SMTP id e129so1329570pgc.9 for ; Thu, 10 Nov 2022 02:06:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=h/PRPd3/ZtVJ1S8SSoZJFlAuYT2tdPLmqj6DRdoumUU=; b=7bvJA0OukW2dWCprznDWPIOmoKWoESefn8tdQeqNWMaThdav2wgnq6iyj5e4tXCNSE 91yDj6vG0Yon6hlqw/VEoOWGCgKsCljKFBVqlXqq6cextPgxbX5ZXB8uDZ9WZyIAtdV2 rijbRFq+6GJ5+ebvKocYc0P70fQ+yaq5Iklf7wSKPCLauMGcbznJtpVjVqHto1Oi1P5N xNhx+vlivfWUWCoGWzFVSXRAxCzr0i4aXQzocU7q8ci9NmfNHbYJo1vjErriYmLzMJmW /T9MZDAOeOtlylWjlzItzUUbhedYY8UBj/VUCQz8JtWgrmiYRyD3pn8xZncjVWbDkkQ9 T6rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=h/PRPd3/ZtVJ1S8SSoZJFlAuYT2tdPLmqj6DRdoumUU=; b=fFD/FNOLQNCWnqDicBu/aNcjP26Q960I46CDbf8IfdWJoSpA7uWmgPYsJn8X+tkqQh 6/gPg03yMKHgZR9llRdZd1IqRJqCu0+x+lRF+dWcQaGH+HwVBotajMT34mPnLiIYV6al K55M8hUvMaXgzutqUo9VMV7MEHxI+hDDKhJL4dOrULXpzNRyiKjLujPThmAqGSNck1Li j7lLQkyfK2vJE/Yq5V2pL0plbK1mxw1L4bQ1ZyBrbHEtoFJsK9gfWztsqMcMzpyCrK2u jlXPfByOANFh9KbeB0FHZC3gNG8bLBL5LibRqbqJLOLe2lr+b33OTh3s4FSmIuzXTRjP 4Eaw== X-Gm-Message-State: ACrzQf3F0mcGhrlh71GKlNH5eIVrSQDYi+/VuEl2RA5VWtgsyX+GI3ho r2A+IBuAeafhscJuRpyVgoHJsACn1rR0xInr X-Google-Smtp-Source: AMsMyM6arShkxKnwDugGCo+PGq33ZnmDF5FZLMXIc7+7DrLciC7MaZXrFXvAqO6Lq9X54dLD8KsK+w== X-Received: by 2002:a63:5412:0:b0:470:1a94:4c0 with SMTP id i18-20020a635412000000b004701a9404c0mr2057273pgb.555.1668074803620; Thu, 10 Nov 2022 02:06:43 -0800 (PST) Received: from fedora.flets-east.jp ([2400:4050:c360:8200:8ae8:3c4:c0da:7419]) by smtp.gmail.com with ESMTPSA id a9-20020a1709027e4900b001714e7608fdsm10730780pln.256.2022.11.10.02.06.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 02:06:43 -0800 (PST) From: Akihiko Odaki To: Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, virtio-fs@redhat.com, Yuval Shaia , Marcel Apfelbaum , Konstantin Kostiuk , Michael Roth , Paolo Bonzini , Fam Zheng , "Dr. David Alan Gilbert" , Stefan Hajnoczi , Gerd Hoffmann , Stefan Weil , Yan Vugenfirer , Akihiko Odaki Subject: [PATCH v2 02/10] util: Introduce qemu_get_runtime_dir() Date: Thu, 10 Nov 2022 19:06:21 +0900 Message-Id: <20221110100629.61496-3-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221110100629.61496-1-akihiko.odaki@daynix.com> References: <20221110100629.61496-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::536; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x536.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 utlity function. A notable feature of qemu_get_runtime_dir() is that it uses $XDG_RUNTIME_DIR if available. While the function is often called by executables which requires root privileges, it is still possible that they are called from a user without privilege to write the system runtime directory. In fact, I decided to write this patch when I ran virtiofsd in a Linux namespace created by a normal user and realized it tries to write the system runtime directory, not writable in this case. $XDG_RUNTIME_DIR should provide a writable directory in such cases. 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 refers to $XDG_DATA_DIRS. In Unix terminology, it is basically "/usr/share", not "/var", which qemu_get_local_state_dir() is intended to provide. Instead, this function try to use the following in order: - $XDG_RUNTIME_DIR - LocalAppData folder - get_relocated_path(CONFIG_QEMU_LOCALSTATEDIR "/run") This function does not use g_get_user_runtime_dir() either as it falls back to g_get_user_cache_dir() when $XDG_DATA_DIRS is not available. In the case, we rather use: get_relocated_path(CONFIG_QEMU_LOCALSTATEDIR "/run") Signed-off-by: Akihiko Odaki --- include/qemu/osdep.h | 12 ++++++++++++ util/oslib-posix.c | 11 +++++++++++ util/oslib-win32.c | 26 ++++++++++++++++++++++++++ 3 files changed, 49 insertions(+) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index b9c4307779..86445aad25 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -565,6 +565,18 @@ void qemu_set_cloexec(int fd); */ char *qemu_get_local_state_dir(void); +/** + * qemu_get_runtime_dir: + * + * Return a dynamically allocated directory path that is appropriate for storing + * 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 59a891b6a8..9a0b3913ff 100644 --- a/util/oslib-posix.c +++ b/util/oslib-posix.c @@ -279,6 +279,17 @@ qemu_get_local_state_dir(void) return get_relocated_path(CONFIG_QEMU_LOCALSTATEDIR); } +char * +qemu_get_runtime_dir(void) +{ + char *env = 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 a67cb3822e..6ad1bb4bac 100644 --- a/util/oslib-win32.c +++ b/util/oslib-win32.c @@ -31,6 +31,8 @@ */ #include "qemu/osdep.h" +#include +#include #include #include "qapi/error.h" #include "qemu/main-loop.h" @@ -241,6 +243,30 @@ qemu_get_local_state_dir(void) return g_strdup(data_dirs[0]); } +char * +qemu_get_runtime_dir(void) +{ + size_t size = GetEnvironmentVariableA("XDG_RUNTIME_DIR", NULL, 0); + if (size) { + char *env = g_malloc(size); + GetEnvironmentVariableA("XDG_RUNTIME_DIR", env, size); + return env; + } + + PWSTR wpath; + const wchar_t *cwpath; + if (!SHGetKnownFolderPath(&FOLDERID_LocalAppData, KF_FLAG_DEFAULT, NULL, &wpath)) { + cwpath = wpath; + size = wcsrtombs(NULL, &cwpath, 0, &(mbstate_t){0}) + 1; + char *path = 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 = (HANDLE)_get_osfhandle(fd); From patchwork Thu Nov 10 10:06:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1702070 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20210112.gappssmtp.com header.i=@daynix-com.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=E1eH7mWx; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4N7Hb426bLz23lT for ; Thu, 10 Nov 2022 21:08:00 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ot4Sn-00033Y-Kb; Thu, 10 Nov 2022 05:07:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ot4SR-0002uT-FQ for qemu-devel@nongnu.org; Thu, 10 Nov 2022 05:06:51 -0500 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ot4SP-0006Tx-Ki for qemu-devel@nongnu.org; Thu, 10 Nov 2022 05:06:50 -0500 Received: by mail-pj1-x1035.google.com with SMTP id h14so1167374pjv.4 for ; Thu, 10 Nov 2022 02:06:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=imXo2IRrILpkxUDOjeir+V07IKls1TLJKB9c8zb1QFc=; b=E1eH7mWxHxGtrAi+1MZK3g1NO4ryWeGfM6vWfMWFL+lnclWVy9kzheOHbv7btPtHVJ orfS8OJ9GTqNF9VJswuGFpYebB1KXmdOKVdz4RETBKGQO6XIbP9vAUyN2tGT2e93vPqO UoliTi1DUwqTZFGWYxLvZnWGY079P2MIxrO8ktv8qGuR7Te/eTRuY71Q8cgw3GApQ4pa 1BFFmqawK6q7hPmCLK3XwW4E1ltPdD4mL/CIFa3Z7cNOwBlH35zP1OK5H5AACYcmXU3b 0oCK5NeDjhZRhWKAbrwIbqa+6cHeH3NaDfk6B+DWqIwPlflpNGzZ/u1+Q9Mzjj4w2EAR MYgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=imXo2IRrILpkxUDOjeir+V07IKls1TLJKB9c8zb1QFc=; b=BOnZ5VPtOpS2qM+MTaj8BfE014Moua2xd4OqHRU0DZlBZubocRgHGAg1BJye7UER5d JNkEVzS2DkldV6QPXbHNV4svsTEjiPD9XuLiok6hDjSPqvP8dsBjeHZm6R/ndmRkHtlP 82q2bDjQF66Z/PHGlQZUSvqzxJgDupL7I69/PhNjpZtOTuLIY9qGwK1MPmqYXK9SkpB0 2VPCYoeY9XqGa84uAe7IrVkgVBJH7sq06eC+J+KkRsd7LJQon6lWmC1ZIIDZUIrXT6bq qV2RaUVRuUhhbTmfnFacNAz0P7outcd2EUVf4PEuCAE95m+JlqK+0dhqqk+j3yJXPhSd tKmw== X-Gm-Message-State: ACrzQf2I7TmTEw9Cd/PzN6o5ts1yoNfjuyFaj817gXoaHb8g9UnSYLXZ ifhmhQfOfpOOzGzuz2kEyZCArfqxWeoJYNZi X-Google-Smtp-Source: AMsMyM6b8+nO/lNb+MDQrUo1CQYcZsxEQPMP81P5QnjmevF2XfIM2KvlKByg5LA2r8trtdjHJu8H7g== X-Received: by 2002:a17:90b:3ec2:b0:215:db2e:b23d with SMTP id rm2-20020a17090b3ec200b00215db2eb23dmr40132374pjb.187.1668074807148; Thu, 10 Nov 2022 02:06:47 -0800 (PST) Received: from fedora.flets-east.jp ([2400:4050:c360:8200:8ae8:3c4:c0da:7419]) by smtp.gmail.com with ESMTPSA id a9-20020a1709027e4900b001714e7608fdsm10730780pln.256.2022.11.10.02.06.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 02:06:46 -0800 (PST) From: Akihiko Odaki To: Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, virtio-fs@redhat.com, Yuval Shaia , Marcel Apfelbaum , Konstantin Kostiuk , Michael Roth , Paolo Bonzini , Fam Zheng , "Dr. David Alan Gilbert" , Stefan Hajnoczi , Gerd Hoffmann , Stefan Weil , Yan Vugenfirer , Akihiko Odaki Subject: [PATCH v2 03/10] ivshmem-server: Use qemu_get_runtime_dir() Date: Thu, 10 Nov 2022 19:06:22 +0900 Message-Id: <20221110100629.61496-4-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221110100629.61496-1-akihiko.odaki@daynix.com> References: <20221110100629.61496-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::1035; envelope-from=akihiko.odaki@daynix.com; helo=mail-pj1-x1035.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 224dbeb547..16abbe2f5a 100644 --- a/contrib/ivshmem-server/main.c +++ b/contrib/ivshmem-server/main.c @@ -14,7 +14,6 @@ #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; +static char *ivshmem_server_get_default_pid_file(void) +{ + g_autofree char *run = 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 = 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 only)\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); } @@ -189,10 +196,10 @@ main(int argc, char *argv[]) { IvshmemServer server; struct sigaction sa, sa_quit; + g_autofree char *default_pid_file = NULL; IvshmemServerArgs args = { .verbose = IVSHMEM_SERVER_DEFAULT_VERBOSE, .foreground = IVSHMEM_SERVER_DEFAULT_FOREGROUND, - .pid_file = IVSHMEM_SERVER_DEFAULT_PID_FILE, .unix_socket_path = IVSHMEM_SERVER_DEFAULT_UNIX_SOCK_PATH, .shm_path = IVSHMEM_SERVER_DEFAULT_SHM_PATH, .use_shm_open = true, @@ -207,6 +214,11 @@ main(int argc, char *argv[]) */ printf("*** Example code, do not use in production ***\n"); + qemu_init_exec_dir(argv[0]); + + default_pid_file = ivshmem_server_get_default_pid_file(); + args.pid_file = default_pid_file; + /* parse arguments, will exit on error */ ivshmem_server_parse_args(&args, argc, argv); From patchwork Thu Nov 10 10:06:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1702069 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20210112.gappssmtp.com header.i=@daynix-com.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=qTJRLTkH; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4N7HZb4z9Xz23lT for ; Thu, 10 Nov 2022 21:07:35 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ot4Sq-000378-2K; Thu, 10 Nov 2022 05:07:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ot4SV-0002vR-6K for qemu-devel@nongnu.org; Thu, 10 Nov 2022 05:06:55 -0500 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ot4ST-0006Ua-Fr for qemu-devel@nongnu.org; Thu, 10 Nov 2022 05:06:54 -0500 Received: by mail-pf1-x430.google.com with SMTP id g62so1519313pfb.10 for ; Thu, 10 Nov 2022 02:06:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dOiLOlAfXAvpXv8rTJ4eJkIEKy86OcSDloeAyKUiv/M=; b=qTJRLTkHpKkZGuXif/Gqxuva0enYUvkIRnxWDdf/c/GWti7/xcH7ZQaSQRtk/cJ6y0 4WjLmalR7AUJRoFkAazSCuYQUMpEv298dVgLNowKIXGWmNaX2G8W5r1z5t63MMjIvvsJ xF+Of+G9VN8f2sdd+BB0e8VPC7sUvPF0v/Zyr/OjjGmZuI1CsaMxQIb88TQcUDJD7nu8 enpPgyJd7rA2xDRCIOsLhA1miMsLP0uLugu0PEsx3FYZ0TQM2sSBgEL4tAMaOKUmCrOM 7MyMwHuGaIRtq8l5qBYENIlvgSYMbR7+NV6d8+kflYbg3M6gXYKqwFeQvdxf6IJWmK2I kDSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dOiLOlAfXAvpXv8rTJ4eJkIEKy86OcSDloeAyKUiv/M=; b=1HtXw/istzZO3fcT+h34YMlDz3yLpCrLVXTRh8nZtJtmQQnRIfiaZoSXy5cmiB0Mok uRrtXjFhQhgDelAu1bD6GKf04gRTVzBUiVb3uWANTmAym/JAvT7D8jkD2WSg6RaZHDzV Ygj/KIkNtCEKSORrZdCPNzlE44DxFhaOaSu+26z1FbltXO6LaWfH6QiKk619qBHAjR3V dRJNqEQtQdu5Apsiv2ZzSXzYLfr2CU1ZOSvuiKSnt6XwOlVbSNiBEUCT22zFHUQpb3Ia VQO553VmsAODyNRcffk0wmhOmjO1Vruc6S4P9KmmNvwfHjBuPP7bkPXs3YyEKeBNqdN6 PMlg== X-Gm-Message-State: ACrzQf1e9F055w2ervDc+4uZ3SP2OtG0qIOWVZm+eoOd1y+kVI8ayMCq r5ufWFiBZoj5gDD4Hpz2gI4UNLe0rAgL+Vrx X-Google-Smtp-Source: AMsMyM7ifZ2ni8hXBhmAqF4AllqhOXtTdBvxyJ3U4/RfwZA4ZTaESRvyDU0Kyv0eCIY4/iz4WbORrA== X-Received: by 2002:a63:cf11:0:b0:44a:2a6a:bb90 with SMTP id j17-20020a63cf11000000b0044a2a6abb90mr2240798pgg.314.1668074810612; Thu, 10 Nov 2022 02:06:50 -0800 (PST) Received: from fedora.flets-east.jp ([2400:4050:c360:8200:8ae8:3c4:c0da:7419]) by smtp.gmail.com with ESMTPSA id a9-20020a1709027e4900b001714e7608fdsm10730780pln.256.2022.11.10.02.06.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 02:06:50 -0800 (PST) From: Akihiko Odaki To: Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, virtio-fs@redhat.com, Yuval Shaia , Marcel Apfelbaum , Konstantin Kostiuk , Michael Roth , Paolo Bonzini , Fam Zheng , "Dr. David Alan Gilbert" , Stefan Hajnoczi , Gerd Hoffmann , Stefan Weil , Yan Vugenfirer , Akihiko Odaki Subject: [PATCH v2 04/10] contrib/rdmacm-mux: Use qemu_get_runtime_dir() Date: Thu, 10 Nov 2022 19:06:23 +0900 Message-Id: <20221110100629.61496-5-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221110100629.61496-1-akihiko.odaki@daynix.com> References: <20221110100629.61496-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::430; envelope-from=akihiko.odaki@daynix.com; helo=mail-pf1-x430.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org qemu_get_runtime_dir() is used to construct the default Unix socket path. Signed-off-by: Akihiko Odaki --- contrib/rdmacm-mux/main.c | 22 ++++++++++++++-------- contrib/rdmacm-mux/meson.build | 2 +- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/contrib/rdmacm-mux/main.c b/contrib/rdmacm-mux/main.c index 771ca01e03..00c14031ca 100644 --- a/contrib/rdmacm-mux/main.c +++ b/contrib/rdmacm-mux/main.c @@ -14,6 +14,7 @@ */ #include "qemu/osdep.h" +#include "qemu/cutils.h" #include #include #include @@ -40,8 +41,6 @@ #define CM_REQ_DGID_POS 80 #define CM_SIDR_REQ_DGID_POS 44 -/* The below can be override by command line parameter */ -#define UNIX_SOCKET_PATH "/var/run/rdmacm-mux" /* Has format %s-%s-%d" -- */ #define SOCKET_PATH_MAX (PATH_MAX - NAME_MAX - sizeof(int) - 2) #define RDMA_PORT_NUM 1 @@ -77,7 +76,13 @@ typedef struct RdmaCmServer { static RdmaCMServer server = {0}; -static void usage(const char *progname) +static char *get_default_unix_socket_path(void) +{ + g_autofree char *run = qemu_get_runtime_dir(); + return g_build_filename(run, "rdmacm-mux", NULL); +} + +static void usage(const char *progname, const char *default_unix_socket_path) { printf("Usage: %s [OPTION]...\n" "Start a RDMA-CM multiplexer\n" @@ -86,7 +91,7 @@ static void usage(const char *progname) "\t-d rdma-device-name Name of RDMA device to register with\n" "\t-s unix-socket-path Path to unix socket to listen on (default %s)\n" "\t-p rdma-device-port Port number of RDMA device to register with (default %d)\n", - progname, UNIX_SOCKET_PATH, RDMA_PORT_NUM); + progname, default_unix_socket_path, RDMA_PORT_NUM); } static void help(const char *progname) @@ -97,16 +102,16 @@ static void help(const char *progname) static void parse_args(int argc, char *argv[]) { int c; - char unix_socket_path[SOCKET_PATH_MAX]; + g_autofree char *default_unix_socket_path = get_default_unix_socket_path(); + char *unix_socket_path = default_unix_socket_path; strcpy(server.args.rdma_dev_name, ""); - strcpy(unix_socket_path, UNIX_SOCKET_PATH); server.args.rdma_port_num = RDMA_PORT_NUM; while ((c = getopt(argc, argv, "hs:d:p:")) != -1) { switch (c) { case 'h': - usage(argv[0]); + usage(argv[0], default_unix_socket_path); exit(0); case 'd': @@ -115,7 +120,7 @@ static void parse_args(int argc, char *argv[]) case 's': /* This is temporary, final name will build below */ - strncpy(unix_socket_path, optarg, SOCKET_PATH_MAX - 1); + unix_socket_path = optarg; break; case 'p': @@ -811,6 +816,7 @@ int main(int argc, char *argv[]) { int rc; + qemu_init_exec_dir(argv[0]); memset(&server, 0, sizeof(server)); parse_args(argc, argv); diff --git a/contrib/rdmacm-mux/meson.build b/contrib/rdmacm-mux/meson.build index 36c9c89630..59f60f9cac 100644 --- a/contrib/rdmacm-mux/meson.build +++ b/contrib/rdmacm-mux/meson.build @@ -1,7 +1,7 @@ if have_pvrdma # FIXME: broken on big endian architectures executable('rdmacm-mux', files('main.c'), genh, - dependencies: [glib, libumad], + dependencies: [glib, libumad, qemuutil], build_by_default: false, install: false) endif From patchwork Thu Nov 10 10:06:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1702079 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20210112.gappssmtp.com header.i=@daynix-com.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=NcGBjK6i; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4N7Hgq2LKyz23mS for ; Thu, 10 Nov 2022 21:12:07 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ot4St-0003Ft-Tf; Thu, 10 Nov 2022 05:07:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ot4Sk-00032b-Lw for qemu-devel@nongnu.org; Thu, 10 Nov 2022 05:07:11 -0500 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ot4SV-0006Ve-OH for qemu-devel@nongnu.org; Thu, 10 Nov 2022 05:07:10 -0500 Received: by mail-pf1-x429.google.com with SMTP id v28so1513576pfi.12 for ; Thu, 10 Nov 2022 02:06:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=X2AW9NaqdulAEV6U7rG6cnfGeNB8asIOOIZhmyN9/Ug=; b=NcGBjK6iyNz8mbLlRATavsp9N4j1RA3RBjfTN13/JrJUxwt328n79tCMhlcuniDvdB JmBniN7GU93gW+iaZJmfHpyjMHqZEJ0ZClGF/5W6qQTpl2aDnSytsncv/kJw6+mXHZ2d /wESlJ0Gjk/dtM44Y3BPKZSJvvylMBwRF664QNIYqPKw/U+/6vFY96ph/vy4BEh907Oy pKEZssVaxoFkme2tBnhUhiEx5RuHNMQzbBvdwPVK/xmnv42QuVVThv+5m+tnYTqa7Obv q3sFezr3WVr+Kh/LiWvJcOjxz28iE7/nnYgf8NI+hKn/xashnSinZhg8aJ5cy7DtPdpX zRLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=X2AW9NaqdulAEV6U7rG6cnfGeNB8asIOOIZhmyN9/Ug=; b=W4MEm6HKbkPc7f6+fglMVK6VCb9UkY/BphPpFlDNxXE3TkDgHPNo6Ftt4RYETdLjxJ DMHntcbw7hNL/tTvLRYs1MiJNd1UyO5Bkpm9MgOwHnly+Lx0zbcOgBtLUZLzW7q2UQGY WdZOvyVFeQp3yoWFx9G3cAXzELx4eCzjiTeMw+tWwfuoW0U/ELg5DIFD6Y1RtQvT9nhw 8guztoVul3/b5mls9gBlO7rMizduNsFq0Snh8+X8sdL+v1jLgbHCmg5qkObdtgChKSJO PZPiZfamPur9DQX3vDFt9aUMs9xXhvBh/PhqRi4SlMZRwaJtJzSOz5HTaS5Uqhyx414G AAFw== X-Gm-Message-State: ACrzQf1EZqHAeojo4g1hAXNUjvsgZTjlz+62M2F8iQdyTqw3oc9yHKZb 8UDAnTec8SZ/LeSOz4SW60E5mSgtustA62Oh X-Google-Smtp-Source: AMsMyM53XSkdl44VjYOWRWfIwMQy8WZJPXtEnRAqRzfSFc56Fi7/4dJsCe2Cd6r+sjBXwz6DWQiBYQ== X-Received: by 2002:aa7:8bc9:0:b0:56d:3de3:c401 with SMTP id s9-20020aa78bc9000000b0056d3de3c401mr2301211pfd.6.1668074814111; Thu, 10 Nov 2022 02:06:54 -0800 (PST) Received: from fedora.flets-east.jp ([2400:4050:c360:8200:8ae8:3c4:c0da:7419]) by smtp.gmail.com with ESMTPSA id a9-20020a1709027e4900b001714e7608fdsm10730780pln.256.2022.11.10.02.06.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 02:06:53 -0800 (PST) From: Akihiko Odaki To: Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, virtio-fs@redhat.com, Yuval Shaia , Marcel Apfelbaum , Konstantin Kostiuk , Michael Roth , Paolo Bonzini , Fam Zheng , "Dr. David Alan Gilbert" , Stefan Hajnoczi , Gerd Hoffmann , Stefan Weil , Yan Vugenfirer , Akihiko Odaki Subject: [PATCH v2 05/10] qga: Use qemu_get_runtime_dir() Date: Thu, 10 Nov 2022 19:06:24 +0900 Message-Id: <20221110100629.61496-6-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221110100629.61496-1-akihiko.odaki@daynix.com> References: <20221110100629.61496-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::429; envelope-from=akihiko.odaki@daynix.com; helo=mail-pf1-x429.google.com 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_NONE=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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org qemu_get_runtime_dir() is used to construct the default state directory. Signed-off-by: Akihiko Odaki --- qga/main.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/qga/main.c b/qga/main.c index b3580508fa..dc875079f0 100644 --- a/qga/main.c +++ b/qga/main.c @@ -46,12 +46,11 @@ #define QGA_VIRTIO_PATH_DEFAULT "/dev/virtio-ports/org.qemu.guest_agent.0" #endif /* __FreeBSD__ */ #define QGA_SERIAL_PATH_DEFAULT "/dev/ttyS0" -#define QGA_STATE_RELATIVE_DIR "run" #else #define QGA_VIRTIO_PATH_DEFAULT "\\\\.\\Global\\org.qemu.guest_agent.0" -#define QGA_STATE_RELATIVE_DIR "qemu-ga" #define QGA_SERIAL_PATH_DEFAULT "COM1" #endif +#define QGA_STATE_RELATIVE_DIR "qemu-ga" #ifdef CONFIG_FSFREEZE #define QGA_FSFREEZE_HOOK_DEFAULT CONFIG_QEMU_CONFDIR "/fsfreeze-hook" #endif @@ -128,12 +127,12 @@ static void stop_agent(GAState *s, bool requested); static void init_dfl_pathnames(void) { - g_autofree char *state = qemu_get_local_state_dir(); + g_autofree char *run = qemu_get_runtime_dir(); g_assert(dfl_pathnames.state_dir == NULL); g_assert(dfl_pathnames.pidfile == NULL); - dfl_pathnames.state_dir = g_build_filename(state, QGA_STATE_RELATIVE_DIR, NULL); - dfl_pathnames.pidfile = g_build_filename(state, QGA_STATE_RELATIVE_DIR, "qemu-ga.pid", NULL); + dfl_pathnames.state_dir = g_build_filename(run, QGA_STATE_RELATIVE_DIR, NULL); + dfl_pathnames.pidfile = g_build_filename(run, QGA_STATE_RELATIVE_DIR, "qemu-ga.pid", NULL); } static void quit_handler(int sig) From patchwork Thu Nov 10 10:06:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1702076 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20210112.gappssmtp.com header.i=@daynix-com.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=wGAjvNz1; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4N7Hc21n3Hz23lT for ; Thu, 10 Nov 2022 21:08:50 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ot4Sp-00036I-N5; Thu, 10 Nov 2022 05:07:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ot4Sb-0002xU-BU for qemu-devel@nongnu.org; Thu, 10 Nov 2022 05:07:09 -0500 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ot4SZ-0006WE-KV for qemu-devel@nongnu.org; Thu, 10 Nov 2022 05:07:01 -0500 Received: by mail-pf1-x435.google.com with SMTP id b29so1508491pfp.13 for ; Thu, 10 Nov 2022 02:06:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=23qHkaFNj9aYRMMJ3RksdGA2UgOinYhFW/VeC2eRFU4=; b=wGAjvNz1Ybx65GNezzdNcfC8V9vD0cReHNxRKrc/z0FB/yisCuwU5aTnEPaF94nEc4 OLW4wIZc5LrDd6So17Lmg0hhbEepNTyQnVjUV2H6zL1ARqqQkRHeF5dgDeeEUre8Kc9l K5og5SgviKNlfjwMoJA5OXzrO/w4iIQuaIooWD6XCUiCXs+ZKLainB0ovH32PIDDPJ5q gahHSPm/cWEMTxpRzn+N5ql41oQPjnfCQtaKw7Z29cwyCb2Q7nqywlfSk0x/pdJmpL2a nIup9xPmJ8LaOdipFkLzR2Sp9tpBao3bE8RhCOaUy5D0tiMxIN/N/5JPm/wKf+OWtd4z elNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=23qHkaFNj9aYRMMJ3RksdGA2UgOinYhFW/VeC2eRFU4=; b=5LziTFD5ZraOfD87tsh8YV0gk0kLL8uovnBXs63mEZpn0BaSFPF/YbbEBnxwrYMG7j wP/dEpKWjSZ7kGt1ph/J4dGvPCudXVE3b/DBV2X/r3VTgH718w8ZLhHxcc1+SDTgwkua 9RD74VxTX/l3IHXd7HjMqeR3seUASMGmA8/iN77UmBjBsvEpxSoOfzGAmmCY/iWH/7ax NcbbJN4Qzi+zIcipOoVi1PQuWKsQhzx8yQXsnev7YYfKVBKao3lhTf12zn0NzJMp999H z1m3Tv31VEr9YK/oWcCc/bvpePQe+oaNr4t9T/AedRN7C26DsBc9p+gHGIE+yJU3BMae m9/A== X-Gm-Message-State: ACrzQf1gJWXGVw4Kii+NJHtyCe5M6kU3HpzdrKhCsA9doh5b5yU/G2aE Qap1AI++NQjG/aO4POXyCY58rFeKQFqtEXgb X-Google-Smtp-Source: AMsMyM7tmK5TXzCK9EKFO1I+/THv6firtjH1Cv5SqSsQJ4j85niHuHSOhayfq9ObFpbkrOlYBPc5rA== X-Received: by 2002:a63:1145:0:b0:46a:e00c:579c with SMTP id 5-20020a631145000000b0046ae00c579cmr55806640pgr.279.1668074817581; Thu, 10 Nov 2022 02:06:57 -0800 (PST) Received: from fedora.flets-east.jp ([2400:4050:c360:8200:8ae8:3c4:c0da:7419]) by smtp.gmail.com with ESMTPSA id a9-20020a1709027e4900b001714e7608fdsm10730780pln.256.2022.11.10.02.06.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 02:06:57 -0800 (PST) From: Akihiko Odaki To: Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, virtio-fs@redhat.com, Yuval Shaia , Marcel Apfelbaum , Konstantin Kostiuk , Michael Roth , Paolo Bonzini , Fam Zheng , "Dr. David Alan Gilbert" , Stefan Hajnoczi , Gerd Hoffmann , Stefan Weil , Yan Vugenfirer , Akihiko Odaki Subject: [PATCH v2 06/10] scsi: Use qemu_get_runtime_dir() Date: Thu, 10 Nov 2022 19:06:25 +0900 Message-Id: <20221110100629.61496-7-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221110100629.61496-1-akihiko.odaki@daynix.com> References: <20221110100629.61496-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::435; envelope-from=akihiko.odaki@daynix.com; helo=mail-pf1-x435.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org qemu_get_runtime_dir() is used to construct the default paths. Signed-off-by: Akihiko Odaki --- scsi/qemu-pr-helper.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scsi/qemu-pr-helper.c b/scsi/qemu-pr-helper.c index 196b78c00d..adb7baecaa 100644 --- a/scsi/qemu-pr-helper.c +++ b/scsi/qemu-pr-helper.c @@ -77,10 +77,10 @@ static int gid = -1; static void compute_default_paths(void) { - g_autofree char *state = qemu_get_local_state_dir(); + g_autofree char *run = qemu_get_runtime_dir(); - socket_path = g_build_filename(state, "run", "qemu-pr-helper.sock", NULL); - pidfile = g_build_filename(state, "run", "qemu-pr-helper.pid", NULL); + socket_path = g_build_filename(run, "qemu-pr-helper.sock", NULL); + pidfile = g_build_filename(run, "qemu-pr-helper.pid", NULL); } static void usage(const char *name) From patchwork Thu Nov 10 10:06:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1702074 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20210112.gappssmtp.com header.i=@daynix-com.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=FzX5sSAo; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4N7Hbp5Dylz23lT for ; Thu, 10 Nov 2022 21:08:38 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ot4Sv-0003Lm-3i; Thu, 10 Nov 2022 05:07:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ot4Sg-0002xt-0U for qemu-devel@nongnu.org; Thu, 10 Nov 2022 05:07:09 -0500 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ot4Sd-0006Wo-Kp for qemu-devel@nongnu.org; Thu, 10 Nov 2022 05:07:05 -0500 Received: by mail-pg1-x52d.google.com with SMTP id h193so1325716pgc.10 for ; Thu, 10 Nov 2022 02:07:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yAOm4xAwUIMS3nIWuITf2mBCrb5XaCIFaM5bi4ZPZPo=; b=FzX5sSAo1Yghg/9iJmCKRz6A0J0oBZyMFd7GIvtQkSc0AtS+KpbwVYSKQ0JviepakQ dSCZ1fwzZvpS/VyYyQtQBe37/PW7POcjekM7H2TK+YpEpxCpGspq1RwJVwTGQxZ6Z/Im GhWOPYgQbGPIf5Oq/Asbc3faa4temdUQpuUARn5A7CXA0Xio6L6nmI+HJBdtocy5+rMS 5navhqpgfZpgapSPGqmknLkhvDH01TZV6hxW93pfT3vYD3yx/I9e7Khrq9GaRV+0SB1S e+jBx3++sqv8HcX+vta9efK+01F6sMPI8L29yK3U6JNPf8t+BUC2blqIXnDQrz0rtzSC 9lBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yAOm4xAwUIMS3nIWuITf2mBCrb5XaCIFaM5bi4ZPZPo=; b=wyt3sN31jd+eVtLOZ3L2yf6GePwZG77QQ2wawhja+3txifOf0EdZafA8PbHG6mJePq p/rUj2r+mJJGWvbTkwEeS0WIKkSundAkLSBexH3KJ7CaOuy4zavMiNXzl+I4DWS11PKu tKndXds3aRXPj7s3GKXn86TQgDIETmDGYiKkU5UvnYBLOG5zkVSrSPvlE1Qn51BAiMX1 K18j36d7iqhkb9V8/Q3YHB1hFY4nh8HORho/XwkJN+bqcDPo53IaWpg8blMNvnUIFQmR 7EwhUGgHfPg9CUU2M9LAD0MSzZdggYUWl0QZGOtF2mAQLwnLLsLQib0Fc+M28PImu8oa dGVA== X-Gm-Message-State: ACrzQf2a8Gr3onsJJ8GAZFs1odesoLBuvR4yunJFN3DAB2iWmifwJISf xfNBK9WooMTlnzU7rjma17paPi57u/qfmiPQ X-Google-Smtp-Source: AMsMyM4TyVnAG+CPyw3qO98UboKFICZ+4vOHPJM+KKopATlB/0WjzWFE2sc/56gzt73n49DaQFQwJQ== X-Received: by 2002:a63:e348:0:b0:46f:25cc:d554 with SMTP id o8-20020a63e348000000b0046f25ccd554mr55884639pgj.598.1668074821018; Thu, 10 Nov 2022 02:07:01 -0800 (PST) Received: from fedora.flets-east.jp ([2400:4050:c360:8200:8ae8:3c4:c0da:7419]) by smtp.gmail.com with ESMTPSA id a9-20020a1709027e4900b001714e7608fdsm10730780pln.256.2022.11.10.02.06.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 02:07:00 -0800 (PST) From: Akihiko Odaki To: Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, virtio-fs@redhat.com, Yuval Shaia , Marcel Apfelbaum , Konstantin Kostiuk , Michael Roth , Paolo Bonzini , Fam Zheng , "Dr. David Alan Gilbert" , Stefan Hajnoczi , Gerd Hoffmann , Stefan Weil , Yan Vugenfirer , Akihiko Odaki Subject: [PATCH v2 07/10] virtiofsd: Use qemu_get_runtime_dir() Date: Thu, 10 Nov 2022 19:06:26 +0900 Message-Id: <20221110100629.61496-8-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221110100629.61496-1-akihiko.odaki@daynix.com> References: <20221110100629.61496-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::52d; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x52d.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org qemu_get_runtime_dir() is used to construct the path to a lock file. Signed-off-by: Akihiko Odaki --- tools/virtiofsd/fuse_virtio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/virtiofsd/fuse_virtio.c b/tools/virtiofsd/fuse_virtio.c index 9368e292e4..b9eeed85e6 100644 --- a/tools/virtiofsd/fuse_virtio.c +++ b/tools/virtiofsd/fuse_virtio.c @@ -901,12 +901,12 @@ static bool fv_socket_lock(struct fuse_session *se) { g_autofree gchar *sk_name = NULL; g_autofree gchar *pidfile = NULL; - g_autofree gchar *state = NULL; + g_autofree gchar *run = NULL; g_autofree gchar *dir = NULL; Error *local_err = NULL; - state = qemu_get_local_state_dir(); - dir = g_build_filename(state, "run", "virtiofsd", NULL); + run = qemu_get_runtime_dir(); + dir = g_build_filename(run, "virtiofsd", NULL); if (g_mkdir_with_parents(dir, S_IRWXU) < 0) { fuse_log(FUSE_LOG_ERR, "%s: Failed to create directory %s: %s\n", From patchwork Thu Nov 10 10:06:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1702067 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20210112.gappssmtp.com header.i=@daynix-com.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=EXLxVaqB; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4N7HZS6Ztcz23mT for ; Thu, 10 Nov 2022 21:07:28 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ot4Su-0003Iq-FS; Thu, 10 Nov 2022 05:07:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ot4Sl-00032c-7S for qemu-devel@nongnu.org; Thu, 10 Nov 2022 05:07:11 -0500 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ot4Si-0006Xl-Ee for qemu-devel@nongnu.org; Thu, 10 Nov 2022 05:07:10 -0500 Received: by mail-pg1-x532.google.com with SMTP id 6so1341669pgm.6 for ; Thu, 10 Nov 2022 02:07:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BJn5Gpsfix8eR37iFYW0tYNid+vOro5KOtMhRy0rf4c=; b=EXLxVaqBSxFla3mrNQ0uCKB4AVKP5YbOPNhdR37wmBcgLqpmrG95sOnnaDp79D9NvT gtCBOIrQ/u5D7BEg87qNA0ZdDnNdRla2UXj/BXAldgviwIm484QxC8uOsIEMBAp7N+bO tExqdyK5VLHC9Cvv2DZULt/F8KiBFTmxVsT13D4zSAws/o5z+QYQojZSTSIwSMRsB1+P l1O6p+RmS3Jhxqrv4y0T/1NK4cCPUtOi6MSIZE9899SZZTbTLb2yRJPZHZU89sOF2TtC lRASyQpeNEu070oW6wOYwcQkEE+LbxMOul2y2DnEfGbW/dIbSoXuyN618OC28TscBWv5 uRyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BJn5Gpsfix8eR37iFYW0tYNid+vOro5KOtMhRy0rf4c=; b=kNkeKI1Iq5rqra3z0hhozJTzWQc73Rl50+UXRKsG0HDcsLgaxYO3Y798OC8zf1UkwA L8lh1lOv3ZsULG4Whf3z6aCHKJH/HSHkX0yMivpKkzR8a87V3t7Ange1zD+YCSaOMYxE MS3DbcIAuhgFGdrpvEoQ7Y9gJ0suv+a88w17nPt4nnJLx3hbneVO19188h3YVKsUdoNc GpAI+P+ks1BNt4hDSnZxxKuq5Q70tO/PY0/2HKe+lWzIUhIJV/2eQpWKTvLBAJnm7wKr DzDymWMN4CieZur2EfXpCA2SDqgWoQ+vXygrz1s709eYV/xaLY2DlO6G29LfUADOg8iB B9fA== X-Gm-Message-State: ACrzQf33pBpfs6o2fftD+MEDpZdWQMwMpOEuQBCM8sozzGRkx6+x7VuG +KmBuuEp5+MhnzA/CY+stbxFRqmZ53ft160q X-Google-Smtp-Source: AMsMyM75nyWTRspZhix8ZHtmIBtV6N5dp8WlK05WmRPucObIO3mEIkCprl9RBOft3Oyp+Czhe202XQ== X-Received: by 2002:a63:560c:0:b0:46e:c390:17b4 with SMTP id k12-20020a63560c000000b0046ec39017b4mr2167642pgb.482.1668074824510; Thu, 10 Nov 2022 02:07:04 -0800 (PST) Received: from fedora.flets-east.jp ([2400:4050:c360:8200:8ae8:3c4:c0da:7419]) by smtp.gmail.com with ESMTPSA id a9-20020a1709027e4900b001714e7608fdsm10730780pln.256.2022.11.10.02.07.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 02:07:04 -0800 (PST) From: Akihiko Odaki To: Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, virtio-fs@redhat.com, Yuval Shaia , Marcel Apfelbaum , Konstantin Kostiuk , Michael Roth , Paolo Bonzini , Fam Zheng , "Dr. David Alan Gilbert" , Stefan Hajnoczi , Gerd Hoffmann , Stefan Weil , Yan Vugenfirer , Akihiko Odaki Subject: [PATCH v2 08/10] module: Use qemu_get_runtime_dir() Date: Thu, 10 Nov 2022 19:06:27 +0900 Message-Id: <20221110100629.61496-9-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221110100629.61496-1-akihiko.odaki@daynix.com> References: <20221110100629.61496-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::532; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x532.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org qemu_get_runtime_dir() is used to construct the path to module upgrades. Signed-off-by: Akihiko Odaki --- util/module.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/module.c b/util/module.c index 32e263163c..580658edf4 100644 --- a/util/module.c +++ b/util/module.c @@ -242,7 +242,8 @@ int module_load(const char *prefix, const char *name, Error **errp) version_dir = g_strcanon(g_strdup(QEMU_PKGVERSION), G_CSET_A_2_Z G_CSET_a_2_z G_CSET_DIGITS "+-.~", '_'); - dirs[n_dirs++] = g_strdup_printf("/var/run/qemu/%s", version_dir); + g_autofree char *run = qemu_get_runtime_dir(); + dirs[n_dirs++] = g_build_filename(run, "qemu", version_dir, NULL); #endif assert(n_dirs <= ARRAY_SIZE(dirs)); From patchwork Thu Nov 10 10:06:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1702075 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20210112.gappssmtp.com header.i=@daynix-com.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=X7619O6+; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4N7Hbt4lBfz23lT for ; Thu, 10 Nov 2022 21:08:42 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ot4St-00039x-6g; Thu, 10 Nov 2022 05:07:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ot4Sn-000351-Qm for qemu-devel@nongnu.org; Thu, 10 Nov 2022 05:07:13 -0500 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ot4Sj-0006YG-Gn for qemu-devel@nongnu.org; Thu, 10 Nov 2022 05:07:11 -0500 Received: by mail-pg1-x529.google.com with SMTP id 6so1341730pgm.6 for ; Thu, 10 Nov 2022 02:07:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=djQvtbI+5ceah01/E9QXrKDRfdUAtdLN189JgwjzOBQ=; b=X7619O6+AdiYwxaT+Q0YWH3poE/y/5bmr5FbkZZd/9sZtKl7M659hX3aOJebhv1yTg H24CA6PMegkFkfvXIwXlHtTpNP8NvBiWrUgupsUQHROjhWIqwIKofkIvFdxZh70Blvb1 YWiHSdSUYGoF3Bmy0h0ajrO4vFrCoaA2KdAj4GWdhiiv8UUmjE74DZ1D59Ky1DnOEZ1L jmoBy5AgGa5mu5ZXXi1UuIDb2Cb6zoLaaR7c8O+dJxsb1uBqRnr6Ov+oWigM6Gy9o7wV AEV7MG1l1f0FyGRkWf1XFzlpaUhwZ1c9fW4z83U9B8MGTHOIahkADiJBqA19/WsUn2sT 3/qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=djQvtbI+5ceah01/E9QXrKDRfdUAtdLN189JgwjzOBQ=; b=3/1OKOKD1K2Kii/BLNSqy8V4+7DyjUywEzvJ3E2B5JV+ZGSyXWY1piNZJI94S4J4CL eQ7csYwJaKXAXWeTFH0JLzFOgqCLcFu0JRSZC1xFarnlrWcKpK60NRs+1ZqpMTj0PuXd Mhckg0h8F33FzMU5wP3TGpYP9MnwRWhw8j8Lm2deJQAFjdP3lmd8hOEDiS6AgUDEz3aX 9FXHPTcVQf5y0awU1HiEGa31i9dnYTDF+luxW8k81yarQGihxDPD4p2mz8wj4EoazQfu 1tyD5bt5BfrUH4I5M1bQO5xQ2RM0QoZfY63dFPyyK+egN+/G7hLCu4B7ZKs8+vp3pmhO wS4g== X-Gm-Message-State: ACrzQf3ZrvTSCGajQEQsDkOf6JhMZxMrotz3NDchqZ5oid1H3/YOlo4g M7hAmhOh5CmWrhjyYZgqkOKU+QTe5Ox1X/yC X-Google-Smtp-Source: AMsMyM6mFNpylu2jXfj/RIX/HLoFNk0MpSwVAUx3FMHlQBea78m2DuOoZgFBAIuh9EGaVelUE23IgQ== X-Received: by 2002:a05:6a00:420f:b0:56d:a89e:19e2 with SMTP id cd15-20020a056a00420f00b0056da89e19e2mr50249716pfb.85.1668074827944; Thu, 10 Nov 2022 02:07:07 -0800 (PST) Received: from fedora.flets-east.jp ([2400:4050:c360:8200:8ae8:3c4:c0da:7419]) by smtp.gmail.com with ESMTPSA id a9-20020a1709027e4900b001714e7608fdsm10730780pln.256.2022.11.10.02.07.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 02:07:07 -0800 (PST) From: Akihiko Odaki To: Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, virtio-fs@redhat.com, Yuval Shaia , Marcel Apfelbaum , Konstantin Kostiuk , Michael Roth , Paolo Bonzini , Fam Zheng , "Dr. David Alan Gilbert" , Stefan Hajnoczi , Gerd Hoffmann , Stefan Weil , Yan Vugenfirer , Akihiko Odaki Subject: [PATCH v2 09/10] util: Remove qemu_get_local_state_dir() Date: Thu, 10 Nov 2022 19:06:28 +0900 Message-Id: <20221110100629.61496-10-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221110100629.61496-1-akihiko.odaki@daynix.com> References: <20221110100629.61496-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::529; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x529.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 86445aad25..f21ebf2b27 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -557,14 +557,6 @@ ssize_t qemu_write_full(int fd, const void *buf, size_t count) void qemu_set_cloexec(int fd); -/* Return a dynamically allocated directory path that is appropriate for storing - * 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 9a0b3913ff..b8d79876b2 100644 --- a/util/oslib-posix.c +++ b/util/oslib-posix.c @@ -273,12 +273,6 @@ int qemu_socketpair(int domain, int type, int protocol, int sv[2]) return ret; } -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 6ad1bb4bac..a32cc5b1be 100644 --- a/util/oslib-win32.c +++ b/util/oslib-win32.c @@ -233,16 +233,6 @@ int qemu_get_thread_id(void) return GetCurrentThreadId(); } -char * -qemu_get_local_state_dir(void) -{ - const char * const *data_dirs = g_get_system_data_dirs(); - - g_assert(data_dirs && data_dirs[0]); - - return g_strdup(data_dirs[0]); -} - char * qemu_get_runtime_dir(void) { From patchwork Thu Nov 10 10:06:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1702078 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20210112.gappssmtp.com header.i=@daynix-com.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=Rg2YfPcH; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4N7Hfm42Lvz23mS for ; Thu, 10 Nov 2022 21:11:11 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ot4Sv-0003LT-0v; Thu, 10 Nov 2022 05:07:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ot4Sq-00037R-58 for qemu-devel@nongnu.org; Thu, 10 Nov 2022 05:07:16 -0500 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ot4So-0006Zp-5x for qemu-devel@nongnu.org; Thu, 10 Nov 2022 05:07:15 -0500 Received: by mail-pf1-x42a.google.com with SMTP id q9so1539652pfg.5 for ; Thu, 10 Nov 2022 02:07:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AC+ag6DjlMRVYIRoMVgQ7eyLCeIppVPRSyLkAkRwpvs=; b=Rg2YfPcHB9D9stGXkj+2qQcpiHgjKDmcb3ss4c6FOkou+38XkDHiFgJFCky6oztAEP t1dHuEGNlAwA9GZV6wru04vjq5kAFU+zqdMrL/UUG3JFptzRX3uhc1RUNewgc8NH7QcO ZL+JEzsP5bMu149evctM+f9NszU+6Dt/0xi45LTD34VhdXQgdqWoBXTHxzq/kEdYevZH qZv7nryajoDvjRGTsJlEsOfZ2RozmWjERANZ0xW1Zmn5qwmxSBbBFsuYWBooVapJTebS 0W0QvqPQ0bjWO9CuyRBQxuw94/fBy4fKfkTM1IqizZXghSe30mXMD+pOSvo6KzpJ0UZP H3MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AC+ag6DjlMRVYIRoMVgQ7eyLCeIppVPRSyLkAkRwpvs=; b=vd9yt0uFtpmISsnv98ovbOFZSrUXAR3yFXiQDa2gQyJVX8750iIkiNaNiEOhIQRWtn 3wcB2jIkybrZorxokF73Q54Kl4uz8CEA8xYIW9V47ClCREF2I+o/WRon8iAKp9SjYMzl DSX1I8JtGHszypH5OIQ2ien0R8Tc+DPv9NRq1SI/WiIFP/A4k77GwxndM46ZCgizY1Y6 UKcgPeIKSYlOQ3boi3+Pr5fULGI9AZYUADAsh/a9ILtMi6acO2GzTnQDR1CDy2IHMpFU BlX8TZ3CCjKfpiKv6mYAWrrFOTilAeTJG4N5CJGwCCth/XWeDNXK9DHkVNa6cA0A9caS 7tvg== X-Gm-Message-State: ACrzQf0SaHymgwp8LdTkuXfMEXxBH710Q2YKXkEHzdsYn4jlZWKmsqYw y5mp2ZkqIs13vgBw4FmOVSobgqWF/KEAI0TA X-Google-Smtp-Source: AMsMyM5pBZrZ5K3eStDgapu/lg9PW8UzxvfKaGomPOEfHXFEvcNCotFHUglP/f2Q9UI74kKc0UEgsA== X-Received: by 2002:a05:6a00:4c16:b0:56d:2634:c28e with SMTP id ea22-20020a056a004c1600b0056d2634c28emr61140475pfb.8.1668074831409; Thu, 10 Nov 2022 02:07:11 -0800 (PST) Received: from fedora.flets-east.jp ([2400:4050:c360:8200:8ae8:3c4:c0da:7419]) by smtp.gmail.com with ESMTPSA id a9-20020a1709027e4900b001714e7608fdsm10730780pln.256.2022.11.10.02.07.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 02:07:11 -0800 (PST) From: Akihiko Odaki To: Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, virtio-fs@redhat.com, Yuval Shaia , Marcel Apfelbaum , Konstantin Kostiuk , Michael Roth , Paolo Bonzini , Fam Zheng , "Dr. David Alan Gilbert" , Stefan Hajnoczi , Gerd Hoffmann , Stefan Weil , Yan Vugenfirer , Akihiko Odaki Subject: [PATCH v2 10/10] spice-app: Use qemu_get_runtime_dir() Date: Thu, 10 Nov 2022 19:06:29 +0900 Message-Id: <20221110100629.61496-11-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221110100629.61496-1-akihiko.odaki@daynix.com> References: <20221110100629.61496-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::42a; envelope-from=akihiko.odaki@daynix.com; helo=mail-pf1-x42a.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 7e71e18da9..feb162baa7 100644 --- a/ui/spice-app.c +++ b/ui/spice-app.c @@ -145,8 +145,8 @@ static void spice_app_display_early_init(DisplayOptions *opts) atexit(spice_app_atexit); if (qemu_name) { - app_dir = g_build_filename(g_get_user_runtime_dir(), - "qemu", qemu_name, NULL); + g_autofree char *run = qemu_get_runtime_dir(); + app_dir = g_build_filename(run, "qemu", qemu_name, NULL); if (g_mkdir_with_parents(app_dir, S_IRWXU) < -1) { error_report("Failed to create directory %s: %s", app_dir, strerror(errno));