make qsort and bsearch type safe

This introduces wrappers around qsort and bsearch to make them type
safe.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
collie: fill line with spaces correctly in show_progress()

The current collie doesn't print spaces after the progress bar to the
end of line, so the error message aren't be formated correctly.

For example:

  $ collie vdi check test
   98.0 % [============================>] 196 MB / 200 MB   f
  ixed missing 7c2b2500000011
  100.0 % [=============================] 200 MB / 200 MB
  finish check&repair test

This fixes the problem.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
tests/055: use _safe_remove to emulate disk failure

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
tests: change cipher mode for random function from CTR to CBC

This uses CBC instead because CTR is not supported by the older
version of openssl.  In addition, we don't need a secure encription,
so this patch uses a faster 128 bit mode.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
sheep: clean up node comparison

Use node_is_local() to check that the node is local, use node_eq() to
check two nodes are the same one, and remove unnecessary function
is_myself().

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
recovery: check whether the object is already scheduled at first

We can do the check before finding the target nodes.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
[tmp] tests/060

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