dog: use a minimum number of copies and zones for vdi checking

Current sheepdog allows the condition of a number of zones < a number
of copies. But "dog vdi check" cannot handle the case well because it
tries to create copies of lost/corrupted objects based on
inode->nr_copies.

This patch lets "dog vdi check" create a minimum number of copies and
zones.

Reported-by: Marcin Mirosław <marcin@mejor.pl>
Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
sheep: exit when a passed path of log dir is not a directory

This patch lets sheep exit as soon as possible when the option of log
directory (specified with "-l dir=") is not a directory, but an
ordinal file. When a path of ordinal file is passed, logger process
runs as a defunct process. This behavior is confusing for
administrators.

The purpose of this change is preventing operation miss. If sheep is
passed a wrong path name of log directory, it should notify the
mistake to administrator. Running without correct logging is really
wrose in production environment.

In addition, this patch does a trivial cleaning. The variable path in
main() of sheep is too generic. So this patch renames it to log_path.

Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
sheep: use work queue for asynchronous local request

We can use our work queue framework for handling asynchrouns requests.
There is no need to create short living events.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Revert "sheep: allow {register,unregister}_event to be called in worker thread"

Now there is no user who calls register_event in worker threads.

This reverts commit 6601e90cf2c5168dfc15919caabcaef50eb75483.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>