dog: log dog operation in syslog

This patch is based on a request from our internal team. Currently,
sheepdog doesn't provide a way of logging admin's operation. The lack
of this feature is serious because we cannot find any evidence of
operation.

This patch adds the logging feature in dog command. If the environment
variable, SHEEPDOG_DOG_LOG, has value, dog command logs its command
line argument with syslog. If SHEEPDOG_DOG_LOG_PATH is specified
additionally, the log is written to the file of the path.

Below is an example of the log:
- with standard syslog
  Dec 27 10:57:42 dhcpff33 sheepdog admin operation[9809]:  dog
  cluster format -c 1
- with custom path
  2013 Dec 27 17:20:56 :  dog vdi list

Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
[ remove extra blank lines - Yuan]
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
dog: fix wrong use of argument for dog_exec_req()

It should use argument 'vdi_inuse' for dog_exec_req() in
parse_vdi() and cluster_format() because 'vdi_inuse' is already the address
of a memory-space. It will cause data corruption in some non-x86 machines.

Reviewed-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
Signed-off-by: Robin Dong <sanbai@taobao.com>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>

Conflicts:
	dog/cluster.c
	dog/common.c

Conflicts were resolved by Hitoshi Mitake.
Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
sheep: remove invalid usage of current_vnode_info

The variable current_vnode_info should be treated with the functions
get_vnode_info() and put_vnode_info(). But some part of group.c didn't
follow this rule. This patch fixes the clear problem in
update_cluster_info(), sd_leave_handler() and kick_node_recover().

Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>

Conflicts:
	sheep/group.c

Conflicts were resolved by Hitoshi Mitake.
Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
sheep: operate vnode info between get_vnode_info() and put_vnode_info()

vnode_info should be obtained by get_vnode_info() and released by
put_vnode_info(). Some part of group.c don't follow the manner. It
doesn't cause a serious problem practically but is not good for coding
convention. This patch does refactoring for this problem.

Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>

Conflicts:
	sheep/group.c

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