sheep: change a prototype of process_main() for obtaining sender information

This patch changes a prototype of process_main() for obtaining sender
information. It is useful for detecting which node issued operations.

Cc: Fabian Zimmermann <dev.faz@gmail.com>
Cc: Valerio Pachera <sirio81@gmail.com>
Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
sheep: revive lock operation

Current sheepdog doesn't support vdi locking. This patch and
succeeding ones revive the feature. With this feature, more than two
clients (including QEMU and tgt) are not allowed to open same VDI at
the same time.

Cc: Fabian Zimmermann <dev.faz@gmail.com>
Cc: Valerio Pachera <sirio81@gmail.com>
Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
dog: use GET_VDI_INFO unconditionally in dog

dog command needs to read/write inode objects for various operations
e.g. taking snapshot. The operations shouldn't be prevented by locks
acquired by other clients (QEMU and tgt). SD_OP_GET_VDI_INFO doesn't
try to acquire the lock, so dog command should use it unconditionally.

Cc: Fabian Zimmermann <dev.faz@gmail.com>
Cc: Valerio Pachera <sirio81@gmail.com>
Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
sheep: snapshot and collect vdi state during joining to cluster

Newly joining sheep must know which vdi is locked or unlocked. For
propagating the state, new sheep must copy it from existing nodes
during join process.

This patch implements a solution for this. Below is the brief
description:
1. When a cluster accepts newly joining node, every existing node take
   a snapshot of vdi state at the epoch.
2. Newly joining node copy it via a newly defined request.
3. After applying the copied state to its internal state, the new
   sheep issues discard request to existing nodes.
4. The new sheep plays its operation log and solves difference between
   copied snapshot and latest state (produced by requests issued after
   taking snapshot).

With this scheme, new sheep can know which vdi is locked or unlocked.

Cc: Fabian Zimmermann <dev.faz@gmail.com>
Cc: Valerio Pachera <sirio81@gmail.com>
Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
sheep: a new helper function for formatting struct node_id

This is just a preparation patch.

Cc: Fabian Zimmermann <dev.faz@gmail.com>
Cc: Valerio Pachera <sirio81@gmail.com>
Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
dog: add a new subcommand "dog vdi lock list" for listing vdi locking status

This patch adds a new subcommand "dog vdi lock list". It can be used
for detecting which nodes are locking VDIs.

Cc: Fabian Zimmermann <dev.faz@gmail.com>
Cc: Valerio Pachera <sirio81@gmail.com>
Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
dog: add a new subcommand "dog vdi lock force-unlock" for unlocking VDI forcibly

In a case of sudden death of qemu, tgt, and sheep, admins must unlock
locked VDIs manually. This patch provides a new subcommand "dog vdi
lock force-unlock" for this purpose.

Correct recovery process is like below:
1. unlock locked VDIs
2. repair them with "dog vdi check"
3. launch clients for the VDIs

Cc: Fabian Zimmermann <dev.faz@gmail.com>
Cc: Valerio Pachera <sirio81@gmail.com>
Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>