Darshan N has uploaded a new change for review.
Change subject: gluster: Added logging for libgfapi related operations. ......................................................................
gluster: Added logging for libgfapi related operations.
This patch adds logging for libgfapi related operations in gfapi.py. It makes use of the glfs_set_logging() method provided by libgfapi.
Change-Id: I1cbb7199d740b54def5e9180875757d7c13c2634 Signed-off-by: ndarshan dnarayan@redhat.com --- M vdsm/gluster/gfapi.py 1 file changed, 14 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/80/35280/1
diff --git a/vdsm/gluster/gfapi.py b/vdsm/gluster/gfapi.py index 2aee49b..efd2e42 100644 --- a/vdsm/gluster/gfapi.py +++ b/vdsm/gluster/gfapi.py @@ -23,12 +23,14 @@
import exception as ge from . import makePublic +from vdsm import constants
GLUSTER_VOL_PROTOCAL = 'tcp' GLUSTER_VOL_HOST = 'localhost' GLUSTER_VOL_PORT = 24007 GLUSTER_VOL_PATH = "/" +LIBGFAPI_LOG_LEVAL = 7
class StatVfsStruct(ctypes.Structure): @@ -50,6 +52,11 @@
def glfsInit(volumeId, host, port, protocol): fs = _glfs_new(volumeId) + + logfile = constants.P_VDSM_LOG + "/vdsm.log" + rc = _glfs_set_logging(fs, logfile, LIBGFAPI_LOG_LEVAL) + if rc != 0: + raise ge.GlfsInitException(rc=rc, err=["Glfs loging failed"])
rc = _glfs_set_volfile_server(fs, protocol, @@ -117,6 +124,13 @@ _glfs_new = ctypes.CFUNCTYPE( ctypes.c_void_p, ctypes.c_char_p)(('glfs_new', _lib))
+_glfs_set_logging = ctypes.CFUNCTYPE( + ctypes.c_int, + ctypes.c_void_p, + ctypes.c_char_p, + ctypes.c_int)(('glfs_set_logging', _lib)) + + _glfs_set_volfile_server = ctypes.CFUNCTYPE( ctypes.c_int, ctypes.c_void_p, @@ -147,7 +161,6 @@ import json import argparse
-from vdsm import constants from vdsm import utils