stringify: use ostringstream instead of stringstream

Use ostringstream, as we don't need both input and output of the
stringstream in stringify().

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
rbd: use stringify() in options parsing routines

Use stringify() in map_option_{uuid,ip,int}_cb() instead of essentially
open-coding it.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
configure: check for blkid/blkid.h header

The check for the presence of blkid/blkid.h was missing.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Makefile: build common/secret.c with libtool

Turn common/secret.c into a libtool convenience library, libsecret.la.
Currently it is build directly, twice: for mount.ceph and rbd binaries.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
common: add module_{load,has_parameter}()

Add two kernel module helpers: module_{module,has_parameter}().  They
are going to live in common/module.[ch].

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
rbd: add libkrbd convenience library

Add libkrbd libtool convenience library to provide an interface for
mapping and unmapping rbd images programmatically.  This will be used
by the rbd binary itself and the librbd_fsx testing tool.

libkrbd takes care of the kernel module stuff (common/module.h) and
makes use of libudev to be able to properly wait for block device
creation and deletion and tell which block device got assigned by the
kernel to the newly created mapping.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
mount.ceph: switch to module_load()

Implement modprobe() in terms of module_load() from common/module.h

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
rbd: switch to libkrbd for 'rbd {map,showmapped,unmap}' operations

Thanks to libkrbd, 'rbd map' now outputs the device node it mapped to
to stdout:

    $ sudo rbd map foo
    /dev/rbd0

This will allow us to get rid of a lot of ad-hoc poll/sleep code in our
qa scripts.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
doc: do not mention modprobe in rbd docs

rbd binary will load rbd.ko itself, with appropriate options.  Loading
it by hand with default options is undesirable.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
doc: 'rbd showmapped' doesn't need privileges

No need to run 'rbd showmapped' with sudo.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
rbd: deprecate --no-settle option

Waiting for udev has been the default for a while now, and, after
switching to libkrbd, is no longer an option.  (libkrbd waits for
specific devices to show up, the old behaviour was to wait for
everything udev.)

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>