sheep: don't send unnecessary data against read requests

This will save network traffic.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
collie: don't show cluster creation time when collie fails to get it

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
sheep: remove tempoary objects only when sheep starts up

It is not safe to remove temporary objects while sheep is running.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
collie: handle snapshot name correctly in fix get_oid

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
collie: add helper function to read vdi objects

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
collie: add vdi backup support

This enables us to create an incremental backup between two snapshots.

  $ collie vdi backup
  Usage: collie vdi backup [-s snapshot] [-F from] [-a address] [-p port] [-h] <vdiname> <backup>
  Options:
    -s, --snapshot          specify a snapshot id or tag name
    -F, --from              create a differential backup from the snapshot
    -a, --address           specify the daemon address (default: localhost)
    -p, --port              specify the daemon port
    -h, --help              display this help and exit

The created backup file contains differential data for each data
objects.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
collie: vdi restore support

This enables us to restore vdi images with backup files created by
'vdi backup' command.

  $ collie vdi restore
  Usage: collie vdi restore [-s snapshot] [-a address] [-p port] [-h] <vdiname> <backup>
  Options:
    -s, --snapshot          specify a snapshot id or tag name
    -a, --address           specify the daemon address (default: localhost)
    -p, --port              specify the daemon port
    -h, --help              display this help and exit

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
tests: add test to check vdi backup and restore

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
corosync: handle network partition

This patch adds support for network partition detection again with
more efficient way.

Even when many nodes go down at the same time, corosync dispatches
leave messages one by one.  It makes it difficult to detect a network
partition.  To determine whether there are succeeding leave events or
not, this patch uses a cpg file descriptor, which is used to check
notified corosync messages.  If the descriptor is ready for read,
sheep skip processing events and tries to receive the next events.  If
more than half numbers of nodes go down at the same time, sheep
determine that a network partition has occurred and stop serving.

With this patch, sheep can also detect NIC failure and avoid updating
epoch wrongly.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
tests: avoid false detection of network partion

If more than half nodes go down at the same time, sheep wrongly
detects a network partition failure.  This add one second sleep to
avoid the problem.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
tests/002: add correct output file

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Revert "sheep: let all sheeps with smaller epoch added into delayed_nodes list"

This reverts commit 98241c50d23d99047c37a606a845f5f0bccbbf50.

We cannot pass test 002 after the commit and it looks difficult to fix
the problem.  The benefit of the commit is not mandatory, so let's
revert it for now and fix it in future.
sheep: add command SD_OP_GET_OBJ_LIST2 to get object list in working directory

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
collie: add support for vdi objmap

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
sheep: add nosync option

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>