cli, glusterd: Changes to 'peer status' xml output

Glusterd now returns the status of a peer as both a string and a number.
The xml output for peer status has been modified, such that the <status> element
now contains the status number and a new <statusStr> element contains the status
string.

Change-Id: I0d4b74b84a991893d1029b8408d66ff078bbd254
BUG: 847760
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/3868
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
cli: Do not print brick info for non-replicate volume

Change-Id: I5e91df64ededd78371c0cd4d900f93ab4a0298ee
BUG: 852406
Signed-off-by: Venkatesh Somyajulu <vsomyaju@redhat.com>
Reviewed-on: http://review.gluster.org/3867
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pranithk@gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
glusterd: Removed pattern match lookup logic on volume options

In light of the comments received on the following patch,
http://review.gluster.com/#change,3860
this change knocks off the pattern match lookup logic that once
enabled wildcard entries to be used for volume options.

Here's a bit on the history of the macro "pattern_match_options",
coming straight from the author's(Csaba) mouth:

"So, the history of pattern_match_options is as follows:

i. In the volume option table we used to be able to have wildcard
entries like auth.addr.*.allow and there was a special lookup logic
to support that, cf.
http://github.com/gluster/glusterfs/commit/v3.1.0qa40~19

ii. However, later on we stopped using this mechanism:
http://github.com/gluster/glusterfs/commit/v3.1.0qa40~9

iii. Later on we added the code that allowed the usage of option
names both in fully qualified (<domain>.<specifier>) and short
(<specifier>)forms:
http://github.com/gluster/glusterfs/commit/v3.1.0qa41~10.

At this point, maintaining support for wildcard table entries became
more difficult (~ error prone), so that part was placed under the macro
pattern_match_options and -- given that we made no use of the feature
-- a simple direct lookup logic was introduced. I chose to keep the
pattern matching logic in the code because I was not really sure about
the future of it and thought we might want wildcarded table entries
later. ..."

Change-Id: I261735143891931e8150c36fe5b33ae74b1c663d
BUG: 847846
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/3893
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Csaba Henk <csaba@redhat.com>
glusterd: Made volume reset recognize options in <domain>.<specifier> format

PROBLEM:
Volume reset command does not reset options when specified in
<domain>.<specifier> format.

FIX:
Changed glusterd_options_reset to use "key" (as opposed to "key_fixed")
to fetch "value" in a way that ensures "key" ALWAYS holds the option
name in its fully qualified form, irrespective of whether the option
was specified in its fully qualified format or in short form.

Change-Id: Ibc3a87f4d29cb09e34b54c4b5ead564fefade350
BUG: 847846
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/3901
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Csaba Henk <csaba@redhat.com>
Honour configure --localstatedir and --sysconfdir

Makes sure /etc/glusterd to /var/lib/glusterd migration does nonour
configure --localstatedir and --sysconfdir.

BUG: 764655
Change-Id: I65a5f96424d67531e81e75b084265bd4e6e30f29
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/3890
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
build: Don't use python-ctypes on SLES

There is no python-ctypes on SLES 11, so don't require is for building
the RPM.

Change-Id: I3399318c1d2a603bb8d228ed4f1b5cbcb7a3a9c3
BUG: 854503
CC: Jörg Petersen <joerg.h.petersen@googlemail.com>
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/3906
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
License change to 2 additional files.

Change-Id: I4689602cbea0e46498d10b8785bcde86d369e75d
BUG: 852318
Signed-off-by: Varun Shastry <vshastry@redhat.com>
Reviewed-on: http://review.gluster.org/3880
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
rpc/socket: Wrong Log-File Error-Message

Problem:
The port changed in rpc-clnt.c:rpc_clnt_reconfig was not being
updated to the variable peerinfo.identifier before the logging.

Change-Id: Ic56a74738c6f7664e9719b125a014126cea69141
BUG: 847211
Signed-off-by: Varun Shastry <vshastry@redhat.com>
Reviewed-on: http://review.gluster.org/3894
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Shishir Gowda <sgowda@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
libglusterfs/dict: make 'dict_t' a opaque object

* ie, don't dereference dict_t pointer, instead use APIs everywhere
* other than dict_t only 'data_t' should be the valid export from dict.h

* added 'dict_foreach_fnmatch()' API
* changed dict_lookup() to use data_t, instead of data_pair_t

Change-Id: I400bb0dd55519a7c5d2a107e67c8e7a7207228dc
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 850917
Reviewed-on: http://review.gluster.org/3829
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
core/statedump: parse the file and set the path of the statedump files

* As of now "gluster volume set statedump-path" option sets the path of
  the statedump files for brick processes only. If SIGUSR1 is sent directly
  to all the gluster processes instead of using gluster cli command, then
  some of the statedumps will still be in /tmp (such as nfs server, glustershd).

* This patch makes glusterfs processes search for the file
  /tmp/glusterdump.options and consider the options given in it. There if path
  key is set, then all the processes use that path when SIGUSR1 is sent or cli
  statedump command is executed. (Note that after taking statedump, if
  /tmp/glusterdump.options file is removed, then the default way is resumed).

Change-Id: I2e8fbfb4823318512e03b234e90d3a3888724ddc
BUG: 851175
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-on: http://review.gluster.org/3907
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
mount/fuse: If gfid is not present assign gfid

Change-Id: I2fb8c607694eb8bbe5ec0f67d8db794066a89ca4
BUG: 821138
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.org/3854
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
cli: sanitize exit value

The pattern established in http://review.gluster.com/3218
as of which cli exits with negated return value of the
command instrumentation function should be uniformly
followed. (Prior to this commit whether cli exits
with 255 or 1 on failure depended on the way of invocation.)

Change-Id: Icbab1f435042b3321c689fa785109bf87195d86d
BUG: 765214
Signed-off-by: Csaba Henk <csaba@redhat.com>
Reviewed-on: http://review.gluster.org/3913
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
mgmt/glusterd: Typo in the error message of the volume stop

Change-Id: I86e4fdb48d9b29789f3446b8c0925eb81cf220c9
BUG: 852999
Signed-off-by: Varun Shastry <vshastry@redhat.com>
Reviewed-on: http://review.gluster.org/3892
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
cluster/distribute: remove gf_log() from statedump functions

Change-Id: I83cccab6819d6a74e96c2717ca539fa1568cac89
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 843822
Reviewed-on: http://review.gluster.org/3912
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
storage/posix: Add or_array/and_array op for xattrop

Problem:
For set/reset of outcast (ALL changelog bits set per transaction
type i.e. data/mdata/entry) from afr the capability of OR/AND in
xattrop is needed in posix.  Otherwise marking outcast will only
be possible in self-heals where appropriate locks are held so
that no other transaction is in progress, so exact number can be
computed with which when XATTROP_ADD happens all bits will be set
for that changelog.

Fix:
Implemented new xattrop-op OR_ARRAY, AND_ARRAY. Made checks in
__add_array to work well with __or_array.

Tests:
From Afr code made an OR_ARRAY with ALL bits set and it reflected
on the changelog xattrs. changelog incrementing did not have any
effects on the all-set changelog.

From Afr code made an AND_ARRAY with 0 and it reflected in the
changelog xattrs.

Change-Id: Ie89c78a43d05789e3a8fa03d2422b52083ae80b9
BUG: 847671
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.org/3909
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
posix: adjust new xattrops to new dict API

- http://review.gluster.org/3909 introduces new xattrops
- http://review.gluster.org/3829 changes the dict API

The new xattrops has been written against the old dict API,
but been committed after the dict API change, resulting in
a build error.

Change-Id: I10b9acc79927f3505b5e13116653fb9a584ffd31
BUG: 850917
Signed-off-by: Csaba Henk <csaba@redhat.com>
Reviewed-on: http://review.gluster.org/3915
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
glusterd: fix mountbroker option parsing routine

Properly adjust it to the new dict API as of
http://review.gluster.org/3829.

Change-Id: I8f55d2b1d590b15000984f4862c52b3cd226cef8
BUG: 850917
Signed-off-by: Csaba Henk <csaba@redhat.com>
Reviewed-on: http://review.gluster.org/3914
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
libglusterfs: Implementation of syncop_fsyncdir

Change-Id: I832b9c0bfbe804fbca98dc9e8fbe7d3174fecc82
BUG: 854326
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.org/3902
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
afr: add option description of 'open'.

Signed-off-by: Jules Wang <lancelotds@163.com>
Change-Id: I6c7dd337c758e82e9d58d4d65f53b5aa72ac5dfb
BUG: 764890
Reviewed-on: http://review.gluster.org/3895
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
mount.glusterfs: Ignore noauto and _netdev options

BUG: 827121
Change-Id: Icab4ca9adecc7b9d62e3d5e7d161c442f16ad940
Signed-off-by: Lubomir Rintel <lubo.rintel@gooddata.com>
Reviewed-on: http://review.gluster.org/3873
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>