<feed xmlns='http://www.w3.org/2005/Atom'>
<title>glusterfs.git/cli/src/cli.c, branch v3.3.2qa1</title>
<subtitle></subtitle>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/'/>
<entry>
<title>localtime and ctime are not MT-SAFE</title>
<updated>2013-02-08T20:04:42+00:00</updated>
<author>
<name>Kaleb S. KEITHLEY</name>
<email>kkeithle@redhat.com</email>
</author>
<published>2012-06-22T15:25:32+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=988460a9f597a489f22d39cd259fdb17fe2e5de6'/>
<id>988460a9f597a489f22d39cd259fdb17fe2e5de6</id>
<content type='text'>
There are a number of nit-level issues throughout the source with
the use of localtime and ctime. While they apparently aren't causing
too many problems, apart from the one in bz 828058, they ought to be
fixed. Among the "real" problems that are fixed in this patch:
1) general localtime and ctime not MT-SAFE. There's a non-zero chance
   that another thread calling localtime (or ctime) will over-write
   the static data about to be used in another thread
2) localtime(&amp; &lt;64-bit-type&gt;) or ctime(&amp; &lt;64-bit-type&gt;) generally
   not a problem on 64-bit or little-endian 32-bit. But even though
   we probably have zero users on big-ending 32-bit platforms, it's
   still incorrect.
3) multiple nested calls passed as params. Last one wins, i.e. over-
   writes result of prior calls.
4) Inconsistent error handling. Most of these calls are for logging,
   tracing, or dumping. I submit that if an error somehow occurs in
   the call to localtime or ctime, the log/trace/dump still should
   still occur.
5) Appliances should all have their clocks set to UTC, and all log
   entries, traces, and dumps should use GMT.
6) fix strtok(), change to strtok_r()

Other things this patch fixes/changes (that aren't bugs per se):
1) Change "%Y-%m-%d %H:%M:%S" and similar to their equivalent shorthand,
   e.g. "%F %T"
2) change sizeof(timestr) to sizeof timestr. sizeof is an operator,
   not a function. You don't use i +(32), why use sizeof(&lt;var&gt;).
   (And yes, you do use parens with sizeof(&lt;type&gt;).)
3) change 'char timestr[256]' to 'char timestr[32]' where appropriate.
   Per-thread stack is limited. Time strings are never longer than ~20
   characters, so why waste 220+ bytes on the stack?

Things this patch doesn't fix:
1) hodgepodge of %Y-%m-%d %H:%M:%S versus %Y/%m/%d-%H%M%S and other
   variations. It's not clear to me whether this ever matters, not to
   mention 3rd party log filtering tools may already rely on a
   particular format. Still it would be nice to have a single manifest
   constant and have every call to localtime/strftime consistently use
   the same format.

BUG: 832173

Change-Id: Iee9719db4576eacc6c75694d9107954d0912cba8
Signed-off-by: Kaleb S. KEITHLEY &lt;kkeithle@redhat.com&gt;
Reviewed-on: http://review.gluster.org/3613
Reviewed-by: Anand Avati &lt;avati@redhat.com&gt;
Tested-by: Anand Avati &lt;avati@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There are a number of nit-level issues throughout the source with
the use of localtime and ctime. While they apparently aren't causing
too many problems, apart from the one in bz 828058, they ought to be
fixed. Among the "real" problems that are fixed in this patch:
1) general localtime and ctime not MT-SAFE. There's a non-zero chance
   that another thread calling localtime (or ctime) will over-write
   the static data about to be used in another thread
2) localtime(&amp; &lt;64-bit-type&gt;) or ctime(&amp; &lt;64-bit-type&gt;) generally
   not a problem on 64-bit or little-endian 32-bit. But even though
   we probably have zero users on big-ending 32-bit platforms, it's
   still incorrect.
3) multiple nested calls passed as params. Last one wins, i.e. over-
   writes result of prior calls.
4) Inconsistent error handling. Most of these calls are for logging,
   tracing, or dumping. I submit that if an error somehow occurs in
   the call to localtime or ctime, the log/trace/dump still should
   still occur.
5) Appliances should all have their clocks set to UTC, and all log
   entries, traces, and dumps should use GMT.
6) fix strtok(), change to strtok_r()

Other things this patch fixes/changes (that aren't bugs per se):
1) Change "%Y-%m-%d %H:%M:%S" and similar to their equivalent shorthand,
   e.g. "%F %T"
2) change sizeof(timestr) to sizeof timestr. sizeof is an operator,
   not a function. You don't use i +(32), why use sizeof(&lt;var&gt;).
   (And yes, you do use parens with sizeof(&lt;type&gt;).)
3) change 'char timestr[256]' to 'char timestr[32]' where appropriate.
   Per-thread stack is limited. Time strings are never longer than ~20
   characters, so why waste 220+ bytes on the stack?

Things this patch doesn't fix:
1) hodgepodge of %Y-%m-%d %H:%M:%S versus %Y/%m/%d-%H%M%S and other
   variations. It's not clear to me whether this ever matters, not to
   mention 3rd party log filtering tools may already rely on a
   particular format. Still it would be nice to have a single manifest
   constant and have every call to localtime/strftime consistently use
   the same format.

BUG: 832173

Change-Id: Iee9719db4576eacc6c75694d9107954d0912cba8
Signed-off-by: Kaleb S. KEITHLEY &lt;kkeithle@redhat.com&gt;
Reviewed-on: http://review.gluster.org/3613
Reviewed-by: Anand Avati &lt;avati@redhat.com&gt;
Tested-by: Anand Avati &lt;avati@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Use inet as default listene</title>
<updated>2012-07-13T21:09:14+00:00</updated>
<author>
<name>Emmanuel Dreyfus</name>
<email>manu@netbsd.org</email>
</author>
<published>2012-06-15T07:47:29+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=1d1639019284f9baaee9d8f4b7d617c6edb52eec'/>
<id>1d1639019284f9baaee9d8f4b7d617c6edb52eec</id>
<content type='text'>
This is backport of Change-Id: I172570aa58ea08c4c74cfd28f121d3d4e02a55e0

BUG: 764655
Change-Id: I60232b73c303d296e34871ed317925c9af0d322e
Signed-off-by: Emmanuel Dreyfus &lt;manu@netbsd.org&gt;
Reviewed-on: http://review.gluster.com/3575
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Anand Avati &lt;avati@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is backport of Change-Id: I172570aa58ea08c4c74cfd28f121d3d4e02a55e0

BUG: 764655
Change-Id: I60232b73c303d296e34871ed317925c9af0d322e
Signed-off-by: Emmanuel Dreyfus &lt;manu@netbsd.org&gt;
Reviewed-on: http://review.gluster.com/3575
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Anand Avati &lt;avati@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cli: implement a fn 'cli_err()' to send error messages to 'stderr'</title>
<updated>2012-04-25T07:45:51+00:00</updated>
<author>
<name>Amar Tumballi</name>
<email>amarts@redhat.com</email>
</author>
<published>2012-04-23T05:41:43+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=3f35280a364bd35293d3e5804eb2a659a7f174b1'/>
<id>3f35280a364bd35293d3e5804eb2a659a7f174b1</id>
<content type='text'>
we were using 'cli_out()' to send all the possible msgs, which is not
very friendly with scripts, because if one want to get only valid
output with "&lt;command&gt; 2&gt;/error.log 1&gt;/proper-info.log"

Change-Id: I008ebcbd90935c41dbfc1bd2adeb094ed21116cb
Signed-off-by: Amar Tumballi &lt;amarts@redhat.com&gt;
BUG: 815194
Reviewed-on: http://review.gluster.com/3208
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Kaushal M &lt;kaushal@redhat.com&gt;
Reviewed-by: Vijay Bellur &lt;vijay@gluster.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
we were using 'cli_out()' to send all the possible msgs, which is not
very friendly with scripts, because if one want to get only valid
output with "&lt;command&gt; 2&gt;/error.log 1&gt;/proper-info.log"

Change-Id: I008ebcbd90935c41dbfc1bd2adeb094ed21116cb
Signed-off-by: Amar Tumballi &lt;amarts@redhat.com&gt;
BUG: 815194
Reviewed-on: http://review.gluster.com/3208
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Kaushal M &lt;kaushal@redhat.com&gt;
Reviewed-by: Vijay Bellur &lt;vijay@gluster.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cli: do not put the frame-&gt;local to mempool since its a calloced structure</title>
<updated>2012-04-19T06:53:51+00:00</updated>
<author>
<name>Raghavendra Bhat</name>
<email>raghavendrabhat@gluster.com</email>
</author>
<published>2012-04-16T09:20:16+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=f8bbf1cef9da21ea55649f5a05a88479853cd8eb'/>
<id>f8bbf1cef9da21ea55649f5a05a88479853cd8eb</id>
<content type='text'>
In cli, frame-&gt;local is not allocated from the internal mempool, rather its
calloced. So while destroying the stack, we have to set frame-&gt;local to NULL.
Otherwise if frame-&gt;local is not NULL, STACK_DESTROY will try to put it back
to the mempool and thus segfault.

Change-Id: I5bd17d099e16fb8e73f3250cc022008e26e28f50
BUG: 812735
Signed-off-by: Raghavendra Bhat &lt;raghavendrabhat@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3167
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Amar Tumballi &lt;amarts@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In cli, frame-&gt;local is not allocated from the internal mempool, rather its
calloced. So while destroying the stack, we have to set frame-&gt;local to NULL.
Otherwise if frame-&gt;local is not NULL, STACK_DESTROY will try to put it back
to the mempool and thus segfault.

Change-Id: I5bd17d099e16fb8e73f3250cc022008e26e28f50
BUG: 812735
Signed-off-by: Raghavendra Bhat &lt;raghavendrabhat@gluster.com&gt;
Reviewed-on: http://review.gluster.com/3167
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Amar Tumballi &lt;amarts@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>core: dict allocations through mem-pool</title>
<updated>2012-03-15T05:15:25+00:00</updated>
<author>
<name>Amar Tumballi</name>
<email>amarts@redhat.com</email>
</author>
<published>2012-03-01T11:55:12+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=eb8a9aae19755bc21afe2d8ed4893b788c4e84ff'/>
<id>eb8a9aae19755bc21afe2d8ed4893b788c4e84ff</id>
<content type='text'>
Change-Id: I7401639060957d437808779745a1e46c3f9f4585
Signed-off-by: Amar Tumballi &lt;amarts@redhat.com&gt;
BUG: 798503
Reviewed-on: http://review.gluster.com/2851
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Vijay Bellur &lt;vijay@gluster.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: I7401639060957d437808779745a1e46c3f9f4585
Signed-off-by: Amar Tumballi &lt;amarts@redhat.com&gt;
BUG: 798503
Reviewed-on: http://review.gluster.com/2851
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Vijay Bellur &lt;vijay@gluster.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>glusterfsd: Unref iobuf after using it</title>
<updated>2012-03-05T15:51:27+00:00</updated>
<author>
<name>Pranith Kumar K</name>
<email>pranithk@gluster.com</email>
</author>
<published>2012-03-04T18:15:26+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=eb3bab1c6d391131cdff48a458fbfec2f53d7c6c'/>
<id>eb3bab1c6d391131cdff48a458fbfec2f53d7c6c</id>
<content type='text'>
Change-Id: Ieefc08d9af2125fabc2a86e5ff3a933aec539da0
BUG: 799882
Signed-off-by: Pranith Kumar K &lt;pranithk@gluster.com&gt;
Reviewed-on: http://review.gluster.com/2866
Reviewed-by: Raghavendra G &lt;raghavendra@gluster.com&gt;
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: Ieefc08d9af2125fabc2a86e5ff3a933aec539da0
BUG: 799882
Signed-off-by: Pranith Kumar K &lt;pranithk@gluster.com&gt;
Reviewed-on: http://review.gluster.com/2866
Reviewed-by: Raghavendra G &lt;raghavendra@gluster.com&gt;
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mempool: adjustments in pool sizes</title>
<updated>2012-02-22T12:23:48+00:00</updated>
<author>
<name>Amar Tumballi</name>
<email>amarts@redhat.com</email>
</author>
<published>2012-02-21T11:25:28+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=67104b716a93520d66c6e572b5f94aa808645e56'/>
<id>67104b716a93520d66c6e572b5f94aa808645e56</id>
<content type='text'>
* while creating 'rpc_clnt', the caller knows what would be the ideal
  load on it, so an extra argument to set some pool sizes

* while creating 'rpcsvc', the caller knows what would be the ideal
  load of it, so an extra argument to set request pool size

* cli memory footprint is reduced

Change-Id: Ie245216525b450e3373ef55b654b4cd30741347f
Signed-off-by: Amar Tumballi &lt;amarts@redhat.com&gt;
BUG: 765336
Reviewed-on: http://review.gluster.com/2784
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Vijay Bellur &lt;vijay@gluster.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* while creating 'rpc_clnt', the caller knows what would be the ideal
  load on it, so an extra argument to set some pool sizes

* while creating 'rpcsvc', the caller knows what would be the ideal
  load of it, so an extra argument to set request pool size

* cli memory footprint is reduced

Change-Id: Ie245216525b450e3373ef55b654b4cd30741347f
Signed-off-by: Amar Tumballi &lt;amarts@redhat.com&gt;
BUG: 765336
Reviewed-on: http://review.gluster.com/2784
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Vijay Bellur &lt;vijay@gluster.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cli: Enable output in XML</title>
<updated>2012-02-16T05:45:27+00:00</updated>
<author>
<name>Kaushal M</name>
<email>kaushal@redhat.com</email>
</author>
<published>2012-02-15T10:48:25+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=26800453aacd76e6edc36c078aaacbe7c16aa75e'/>
<id>26800453aacd76e6edc36c078aaacbe7c16aa75e</id>
<content type='text'>
This patch enables gluster cli to output data in xml format. XML output can be
obtained by passing "--xml" as an argument.

A new "volume list" command, which lists the volumes present in a cluster, has
been added. This can be used for obtaining a quick list of volumes.

Several commands, including "volume top", "volume profile", "volume status" and
"volume info", "volume list", have custom XML output routines. Other commands
use either one of the 2 generic output routines, cli_xml_output_str() &amp;
cli_xml_output_dict().
NOTE: When using "all" for "volume status" and "volume info" the XML output will
have multiple roots.

Change-Id: I6117baa02ec06fda116177dbd401f66521263ac6
BUG: 790713
Signed-off-by: Kaushal M &lt;kaushal@redhat.com&gt;
Reviewed-on: http://review.gluster.com/2753
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Amar Tumballi &lt;amarts@redhat.com&gt;
Reviewed-by: Vijay Bellur &lt;vijay@gluster.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch enables gluster cli to output data in xml format. XML output can be
obtained by passing "--xml" as an argument.

A new "volume list" command, which lists the volumes present in a cluster, has
been added. This can be used for obtaining a quick list of volumes.

Several commands, including "volume top", "volume profile", "volume status" and
"volume info", "volume list", have custom XML output routines. Other commands
use either one of the 2 generic output routines, cli_xml_output_str() &amp;
cli_xml_output_dict().
NOTE: When using "all" for "volume status" and "volume info" the XML output will
have multiple roots.

Change-Id: I6117baa02ec06fda116177dbd401f66521263ac6
BUG: 790713
Signed-off-by: Kaushal M &lt;kaushal@redhat.com&gt;
Reviewed-on: http://review.gluster.com/2753
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Amar Tumballi &lt;amarts@redhat.com&gt;
Reviewed-by: Vijay Bellur &lt;vijay@gluster.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libglusterfs/iobuf: have fixed number of arenas</title>
<updated>2011-12-07T13:01:52+00:00</updated>
<author>
<name>Amar Tumballi</name>
<email>amar@gluster.com</email>
</author>
<published>2011-09-27T12:31:29+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=017344be59fbbd4cf6d29d3f5a6581b468dc29c9'/>
<id>017344be59fbbd4cf6d29d3f5a6581b468dc29c9</id>
<content type='text'>
* so overall memory usage will be in limit.
* the array is hard-coded, need to improve upon this.
* need more benchmarking to tune the proper values to the array
* fixed the issue of pruning of arenas.

Change-Id: I38a8ffab37378c25d78f77a2d412b1b8935c67d3
BUG: 3474
Signed-off-by: Amar Tumballi &lt;amar@gluster.com&gt;
Reviewed-on: http://review.gluster.com/543
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Anand Avati &lt;avati@gluster.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* so overall memory usage will be in limit.
* the array is hard-coded, need to improve upon this.
* need more benchmarking to tune the proper values to the array
* fixed the issue of pruning of arenas.

Change-Id: I38a8ffab37378c25d78f77a2d412b1b8935c67d3
BUG: 3474
Signed-off-by: Amar Tumballi &lt;amar@gluster.com&gt;
Reviewed-on: http://review.gluster.com/543
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Anand Avati &lt;avati@gluster.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cli: add --log-{file,level} options</title>
<updated>2011-09-12T13:22:32+00:00</updated>
<author>
<name>Csaba Henk</name>
<email>csaba@gluster.com</email>
</author>
<published>2011-07-23T10:16:07+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=32b96d66890a16fd23c8ae065297c7a98097d340'/>
<id>32b96d66890a16fd23c8ae065297c7a98097d340</id>
<content type='text'>
Apart from diagnostic purposes, it's needed when cli is ran by
unprivileged user who most likely has no write access to the
canonical log file.

Change-Id: Ib9d1a31711966ff1efe2592fbc0a911820cf8ee3
BUG: 3242
Reviewed-on: http://review.gluster.com/95
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Vijay Bellur &lt;vijay@gluster.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Apart from diagnostic purposes, it's needed when cli is ran by
unprivileged user who most likely has no write access to the
canonical log file.

Change-Id: Ib9d1a31711966ff1efe2592fbc0a911820cf8ee3
BUG: 3242
Reviewed-on: http://review.gluster.com/95
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Vijay Bellur &lt;vijay@gluster.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
