]> git.proxmox.com Git - pve-qemu.git/blob - debian/patches/pve/0006-PVE-Config-glusterfs-no-default-logfile-if-daemonize.patch
update sources for v4.0.1
[pve-qemu.git] / debian / patches / pve / 0006-PVE-Config-glusterfs-no-default-logfile-if-daemonize.patch
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 Date: Mon, 24 Oct 2016 09:32:36 +0200
4 Subject: [PATCH] PVE: [Config] glusterfs: no default logfile if daemonized
5
6 Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 ---
8 block/gluster.c | 15 +++++++++++----
9 1 file changed, 11 insertions(+), 4 deletions(-)
10
11 diff --git a/block/gluster.c b/block/gluster.c
12 index e664ca4462..70c59db107 100644
13 --- a/block/gluster.c
14 +++ b/block/gluster.c
15 @@ -41,7 +41,7 @@
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
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
24 @@ -416,6 +416,7 @@ static struct glfs *qemu_gluster_glfs_init(BlockdevOptionsGluster *gconf,
25 int old_errno;
26 SocketAddressList *server;
27 unsigned long long port;
28 + const char *logfile;
29
30 glfs = glfs_find_preopened(gconf->volume);
31 if (glfs) {
32 @@ -458,9 +459,15 @@ static struct glfs *qemu_gluster_glfs_init(BlockdevOptionsGluster *gconf,
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);