block/gluster: add support to choose libgfapi logfile
commite9db8ff38e539260a2cb5a7918d1155b7d92a264
authorPrasanna Kumar Kalever <prasanna.kalever@redhat.com>
Fri, 22 Jul 2016 14:56:48 +0000 (22 20:26 +0530)
committerJeff Cody <jcody@redhat.com>
Tue, 13 Sep 2016 05:34:47 +0000 (13 01:34 -0400)
tree6a27c80f4411bb1b5f7dca8439b37e97d1dfab32
parent7263da78045dc91cc207f350911efe4259e99b3c
block/gluster: add support to choose libgfapi logfile

currently all the libgfapi logs defaults to '/dev/stderr' as it was hardcoded
in a call to glfs logging api. When the debug level is chosen to DEBUG/TRACE,
gfapi logs will be huge and fill/overflow the console view.

This patch provides a commandline option to mention log file path which helps
in logging to the specified file and also help in persisting the gfapi logs.

Usage:
-----
 *URI Style:
  ---------
  -drive file=gluster://hostname/volname/image.qcow2,file.debug=9,\
                      file.logfile=/var/log/qemu/qemu-gfapi.log

 *JSON Style:
  ----------
  'json:{
           "driver":"qcow2",
           "file":{
              "driver":"gluster",
              "volume":"volname",
              "path":"image.qcow2",
              "debug":"9",
              "logfile":"/var/log/qemu/qemu-gfapi.log",
              "server":[
                 {
                    "type":"tcp",
                    "host":"1.2.3.4",
                    "port":24007
                 },
                 {
                    "type":"unix",
                    "socket":"/var/run/glusterd.socket"
                 }
              ]
           }
        }'

Reviewed-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
Signed-off-by: Jeff Cody <jcody@redhat.com>
block/gluster.c
qapi/block-core.json