]> git.proxmox.com Git - pve-qemu.git/blame - debian/patches/pve/0005-PVE-Config-glusterfs-no-default-logfile-if-daemonize.patch
backup: improve error when copy-before-write fails for fleecing
[pve-qemu.git] / debian / patches / pve / 0005-PVE-Config-glusterfs-no-default-logfile-if-daemonize.patch
CommitLineData
23102ed6 1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
a544966d 2From: Wolfgang Bumiller <w.bumiller@proxmox.com>
83faa3fe
TL
3Date: Mon, 6 Apr 2020 12:16:35 +0200
4Subject: [PATCH] PVE: [Config] glusterfs: no default logfile if daemonized
a544966d 5
b855dce7 6Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
a544966d
WB
7---
8 block/gluster.c | 15 +++++++++++----
9 1 file changed, 11 insertions(+), 4 deletions(-)
10
11diff --git a/block/gluster.c b/block/gluster.c
f1eed34a 12index cc74af06dc..3ba9bbfa5e 100644
a544966d
WB
13--- a/block/gluster.c
14+++ b/block/gluster.c
bf251437 15@@ -43,7 +43,7 @@
a544966d
WB
16 #define GLUSTER_DEBUG_DEFAULT 4
17 #define GLUSTER_DEBUG_MAX 9
18 #define GLUSTER_OPT_LOGFILE "logfile"
19-#define GLUSTER_LOGFILE_DEFAULT "-" /* handled in libgfapi as /dev/stderr */
20+#define GLUSTER_LOGFILE_DEFAULT NULL
b855dce7
TL
21 /*
22 * Several versions of GlusterFS (3.12? -> 6.0.1) fail when the transfer size
23 * is greater or equal to 1024 MiB, so we are limiting the transfer size to 512
bf251437 24@@ -425,6 +425,7 @@ static struct glfs *qemu_gluster_glfs_init(BlockdevOptionsGluster *gconf,
a544966d 25 int old_errno;
6838f038 26 SocketAddressList *server;
10e10933 27 uint64_t port;
a544966d
WB
28+ const char *logfile;
29
30 glfs = glfs_find_preopened(gconf->volume);
31 if (glfs) {
bf251437 32@@ -467,9 +468,15 @@ static struct glfs *qemu_gluster_glfs_init(BlockdevOptionsGluster *gconf,
a544966d
WB
33 }
34 }
35
36- ret = glfs_set_logging(glfs, gconf->logfile, gconf->debug);
37- if (ret < 0) {
38- goto out;
39+ logfile = gconf->logfile;
40+ if (!logfile && !is_daemonized()) {
41+ logfile = "-";
42+ }
43+ if (logfile) {
44+ ret = glfs_set_logging(glfs, logfile, gconf->debug);
45+ if (ret < 0) {
46+ goto out;
47+ }
48 }
49
50 ret = glfs_init(glfs);