]> git.proxmox.com Git - pve-qemu.git/blame - debian/patches/pve/0007-PVE-Config-glusterfs-no-default-logfile-if-daemonize.patch
update qemu submodule to v4.0.0
[pve-qemu.git] / debian / patches / pve / 0007-PVE-Config-glusterfs-no-default-logfile-if-daemonize.patch
CommitLineData
23102ed6 1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
a544966d
WB
2From: Wolfgang Bumiller <w.bumiller@proxmox.com>
3Date: Mon, 24 Oct 2016 09:32:36 +0200
53e83913 4Subject: [PATCH] PVE: [Config] glusterfs: no default logfile if daemonized
a544966d
WB
5
6---
7 block/gluster.c | 15 +++++++++++----
8 1 file changed, 11 insertions(+), 4 deletions(-)
9
10diff --git a/block/gluster.c b/block/gluster.c
53e83913 11index 4fd55a9cc5..20d99aa1c3 100644
a544966d
WB
12--- a/block/gluster.c
13+++ b/block/gluster.c
53e83913 14@@ -36,7 +36,7 @@
a544966d
WB
15 #define GLUSTER_DEBUG_DEFAULT 4
16 #define GLUSTER_DEBUG_MAX 9
17 #define GLUSTER_OPT_LOGFILE "logfile"
18-#define GLUSTER_LOGFILE_DEFAULT "-" /* handled in libgfapi as /dev/stderr */
19+#define GLUSTER_LOGFILE_DEFAULT NULL
20
21 #define GERR_INDEX_HINT "hint: check in 'server' array index '%d'\n"
22
53e83913 23@@ -405,6 +405,7 @@ static struct glfs *qemu_gluster_glfs_init(BlockdevOptionsGluster *gconf,
a544966d 24 int old_errno;
6838f038 25 SocketAddressList *server;
a544966d
WB
26 unsigned long long port;
27+ const char *logfile;
28
29 glfs = glfs_find_preopened(gconf->volume);
30 if (glfs) {
53e83913 31@@ -447,9 +448,15 @@ static struct glfs *qemu_gluster_glfs_init(BlockdevOptionsGluster *gconf,
a544966d
WB
32 }
33 }
34
35- ret = glfs_set_logging(glfs, gconf->logfile, gconf->debug);
36- if (ret < 0) {
37- goto out;
38+ logfile = gconf->logfile;
39+ if (!logfile && !is_daemonized()) {
40+ logfile = "-";
41+ }
42+ if (logfile) {
43+ ret = glfs_set_logging(glfs, logfile, gconf->debug);
44+ if (ret < 0) {
45+ goto out;
46+ }
47 }
48
49 ret = glfs_init(glfs);
50--
45169293 512.11.0
a544966d 52