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.

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.

Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
sheep: add a list for storing information of all clients

This is a preparation patch. Currently we don't have a way of
enumerating entire information of clients. This patch adds a single
list for doing it.

Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
sheep: associate client info and locked vdi

This patch associates client info and locked vdi. The association is
required for releasing locked VDI in a case of unexpected death of
clients.

Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
sheep: add an API for releasing VDI

There are 3 cases of VDI releasing:
1. client processes (QEMU and tgt) releases explicitly
2. client processes (QEMU and tgt) die suddenly
3. node leaves

All of them must be handled in a single policy because they must have
same effect. Currently, the case 1 and 3 are supported. This patch
makes the mechanism general and lets destroy_client() use for
supporting the case 2.

Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
sheep: unlock existing lock in a case of double locking

Typical sheepdog clients issues two or more locking request
(SD_OP_LOCK_VDI, typically issued in the function
find_vdi_name() of clients) during their lifetime because it is
required when snapshots of their VDIs are taken. In such a case, an
existing lock becomes needless because the lock points snapshot. This
patch add a release procedure for the case.

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.

Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
sheep: snapshot and collect vdi state during joining to cluster

ToDo: import lock state by newly joining node

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