packaging: erasure-code plugins go in /usr/lib/ceph

Install the plugins in /usr/lib/ceph/erasure-code instead of
/usr/lib/erasure-code to comply with FHS : "Applications may use a
single subdirectory under /usr/lib."

http://refspecs.linuxfoundation.org/FHS_2.3/fhs-2.3.html

The debian package is modified to install the plugins as part of the
ceph package which also ships rados-classes.

Signed-off-by: Loic Dachary <loic@dachary.org>
mon: osd create pool must fail on incompatible type

When osd create pool is called twice on the same pool, it will succeed
because the pool already exists. However, if a different type is
specified, it must fail.

Signed-off-by: Loic Dachary <loic@dachary.org>
osd: pool properties are not an array

They must be dumped with open_object_section instead of
open_array_section otherwise only the values are displayed.

Signed-off-by: Loic Dachary <loic@dachary.org>
common: implement get_str_map to parse key/values

It is capable of parsing json or key=value pairs. The prototype is made
to look like get_str_list. The implementation is in common + include and
use .h. It will probably be moved to common and use .hpp instead, along
with str_list.{cc,h}.

Signed-off-by: Loic Dachary <loic@dachary.org>
mon: do not include = in pool properties values

foo=bar was parsed as {"foo":"=bar"} instead of {"foo":"bar"} because of
the missing equal++

Signed-off-by: Loic Dachary <loic@dachary.org>
mon: add error message argument to prepare_new_pool

Add a stringstream argument to prepare_new_pool for the purpose of
recording human readable error message.

Signed-off-by: Loic Dachary <loic@dachary.org>
mon: erasure code pool properties defaults

If no properties are set when creating an erasure coded pool, default to
using the jerasure plugin with the cauchy_good technique which is the
fastest.

The defaults are set with osd_pool_default_erasure_code_properties.

The erasure code plugins are loaded from the directory specified in the
erasure-code-directory property. Contrary to the other properties it
will most commonly be the same throughout the cluster. The default is
set to /usr/lib/ceph/erasure-code with
osd_pool_default_erasure_code_directory

Signed-off-by: Loic Dachary <loic@dachary.org>
mon: unit test for osd pool create

It is inconvenient to run such tests in the
qa/workunits/cephtool/test.sh because they require that the mon is
restarted to test errors in the format of the default erasure code
properties and check the appropriate error message is output.

osd-pool-create.sh runs a single mon from sources using command
line options and a temporary directory, the same way vstart.sh does but
lightweight.

Signed-off-by: Loic Dachary <loic@dachary.org>