lib: add a new wrapper function of strdup()

Reviewed-by: Ruoyu <liangry@ucweb.com>
Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
dog: duplicate value which is passed via command line for simplyfing cleaning

With this change, vdi_setattr() duplicates value which is passed via
command line with xstrdup(). With this change, dog can free() the
value unconditionally. It makes the intention of the code clear.

Reported-by: Ruoyu <liangry@ucweb.com>
Reviewed-by: Ruoyu <liangry@ucweb.com>
Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
cluster/zookeeper: add log information for zk auto-recoonect

Reported-by: Valerio Pachera <sirio81@gmail.com>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
test/func: wait after starting or killing sheep

Otherwise, test will be failure if using zookeeper as cluster manager.

Signed-off-by: Ruoyu <liangry@ucweb.com>
Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
tools/zk_control: fix typo of QUEUE_ZNODE

Signed-off-by: Ruoyu <liangry@ucweb.com>
dog: let sheeps prevent inode update requests during snapshot creation

The recent new GC algorithm requires mutual exclusion between inode
update and and snapshot creation. This patch let sheeps prevent inode
update requests during snapshot creation with VDI locking information.

Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
sheep: cleanup generational reference counting code and document

This patch does a little refactoring of generational reference
counting. It also fixes trivial problems of pseudo code in
doc/object-reclaim.txt.

Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
sheep: update inode coherence protocol for iSCSI multipath

This patch makes 3 changes in inode coherence protocol:
1. add a new flag for indicating requests from tgtd
   It is required because dog command can read VDIs which are used by
   tgtd. Current coherence protocol can be violated by this
   behavior. The new flag is added for preventing this problem.
2. accurate detection of inode reload
3. also return SD_RES_INODE_INVALIDATED in a case of create and write
   request

Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
tests/functional: launch tgt with multi threaded mode in 096

There's no reason for launching tgt with only 1 backing store thread.

Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
sheep: improve inode coherence protocol

Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>