summaryrefslogtreecommitdiffstats
path: root/utils/utils.c
Commit message (Collapse)AuthorAgeFilesLines
* gluster-block: use targetcli interactive modePrasanna Kumar Kalever2017-08-281-0/+23
| | | | | | | | | | | | | | | | | | Currently, on each targetcli create call, rtslib will rebuild its bs_cache, so as the /sys/kernel/config/target/core dir gets more entries this takes longer and longer to scan. Hence using repetitive targetcli in the block create for creating iqn, backend, setting acls, setting globals will induce too much delay in block create. As the number of blocks on the node increases, the delay will be too longer. This does not happen if we open targetcli in interactive mode and just do multiple create commands form it, since the bs_cache is build once. Read More: https://goo.gl/8aYT38 Change-Id: I2be78a748e013f253ce8f99746989a1cf735a56f Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* logger: support logdir choosing via Environment variablePrasanna Kumar Kalever2017-08-171-1/+62
| | | | | | | | | | | | Currently the default logdir is DATADIR /log/gluster-block/ This patch will provide a way to change this default logdir via Env variable $ export GB_LOGDIR=/var/log/gluster-block-new-path/ Note: make sure to restart the processes (cli & daemon) after you set GB_LOGDIR Change-Id: Id142e4a4dfe7b6ebc9cf8296b8ceb8bff37691b8 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* utils: fix trivial compile warningNiels de Vos2017-07-041-1/+1
| | | | | | | | | | | | The following warning is reported with Fedora Rawhide (F-27) that comes with an updated gcc version (7.1.1): utils.c:217:21: warning: '*' in boolean context, suggest '&&' instead [-Wint-in-bool-context] if (!tmp && (size * count)) { ~~~~~~^~~~~~~~ Change-Id: If1645e0e1cc1eaa1d8261914918c5a5be13d6dd8 Signed-off-by: Niels de Vos <ndevos@redhat.com>
* Fix compiler warningsPranith Kumar K2017-06-061-1/+1
| | | | | Change-Id: I9dd396737a6719fe3828ec3e9c26bfd8aa1da238 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
* log: print human readable timestampPrasanna Kumar Kalever2017-06-051-0/+24
| | | | | | | | | | | | | Before: ------- Epoch number, eg: [1496312036] Now: ---- Human readable, eg: [2017-06-01 18:37:46.834377] Change-Id: Ibcb3de512086f6fa36ad7169f0d9189636361331 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* logger: filter log messages based on severity levelPrasanna Kumar Kalever2017-06-051-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds '--log-level' options supported log levels: { "NONE", "ERROR", "WARNING", "INFO", "DEBUG", "TRACE" } TRACE being max logging $ gluster-blockd --help [...] --log-level <LOGLEVEL> Logging severity. Valid options are, TRACE, DEBUG, INFO, WARNING, ERROR and NONE [default: INFO] [...] Change-Id: I5a387eea3e7e7be10a0b56102a61eb81b4ebf2fa Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* daemon: make glfs lru cache capacity configurablePrasanna Kumar Kalever2017-06-051-1/+36
| | | | | | | | | | | | | | | | | | $ gluster-blockd --help gluster-blockd (0.2) usage: gluster-blockd [--glfs-lru-count <count>] commands: --glfs-lru-count <count> glfs objects cache capacity [max: 512] (default: 5) --help show this message and exit. --version show version info and exit. Change-Id: I00a9277690a1c5ace51e223e9e4ed9ce61ae2428 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* gluster-blockd: parse create and delete outputsPrasanna Kumar Kalever2017-02-271-0/+18
| | | | | | | | | | | | | | | | The new parsed output of create and delete command will look like: $ gluster-block create sample/sample-block ha 2 ${HOST1} ${HOST2} 1GiB IQN: iqn.2016-12.org.gluster-block:aafea465-9167-4880-b37c-2c36db8562ea PORTAL(S): ${HOST1}:3260 ${HOST2}:3260 RESULT: SUCCESS $ gluster-block delete sample/sample-block SUCCESSFUL ON: ${HOST1} ${HOST2} RESULT: SUCCESS Change-Id: Id98e643c62a898a1f7298b6cfeb6ddfa10397b7f Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* cli: change in synopsis for gluster-block commandsPrasanna Kumar Kalever2017-02-241-42/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from now we will have fixed formats for commands. The new outfit will look like: $ gluster-block help gluster-block (3ba7ec5) usage: gluster-block <command> <volname[/blockname]> [<args>] commands: create <volname/blockname> [ha <count>] <host1[,host2,...]> <size> create block device. list <volname> list available block devices. info <volname/blockname> details about block device. delete <volname/blockname> delete block device. help show this message and exit. version show version info and exit. Example usage: $ gluster-block create volume/blockname 192.168.0.1 1GiB $ gluster-block create volume/blockname ha 2 192.168.0.1,192.168.0.2 1GiB $ gluster-block list volume $ gluster-block info volume/blockname $ gluster-block delete volume/blockname Change-Id: Idc6b55c26432ed1ac3f002c2a2b3dbb81b180ec2 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* build: fix minor warningsPrasanna Kumar Kalever2017-02-081-0/+22
| | | | | | | mostly uninitialized use of variables. check return values from function calls. Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* gluster-block: migrate build to libtoolz and create rpmPrasanna Kumar Kalever2017-02-071-0/+179
Till now we had simple makefile for checking dependencies and building. Using libtoolz will give more control on dependency checks and flexibility. This patch also introduce rpm build feature. Compiling: $ ./autogen.sh $ ./configure $ make -j $ make install Building RPMS: $ make rpms Running: $ systemctl start gluster-blockd.service Using CLI: $ gluster-block help Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>