mount: Add a class which limits I/O

This class can be used to introduce an I/O limiting mechanism
in the mountpoint.
mount: Add a class parsing I/O limits config

Closes #140
mount: Add IO limit group classifier

Add a function which determines IO limiting group of a local process.
master: Update maxtotalspace on CS registration

Master keeps a variable indicating the highest amount of disk space
available on any chunkserver.

By omission, this variable wasn't updated during registration with
version 5x packets. Fix it.
mount: Fix bugs in getIoLimitGroupId

This function was suffering from a couple of problems like
throwing wrong exceptions or taking arguments by value instead
of by a reference.
mount: Introduce I/O limiting mechanism

This change makes it possible to define I/O limits for processes
from different cgroups in one hierarchy (identified by a subsystem,
eg. blkio). For example this configuration:

  subsystem blkio
  limit /group1 1024
  limit /group2 30720

limits I/O generated by processes from /group1 to 1 MB/s and by processes
from /group2 to 30 MB/s. This throughput is defined as a sum of read and
write requests (on the interface between then kernel and mount).

To enable I/O limiting, mount the filesystem with mfsiolimits=<file> option
providing a path to a file with configuration of these limits.
mount: Add a possibility to use I/O limiting without cgroups

This commit introduces support for a special entry in the I/O limit config
file, ie:

  limit unclassified <some_limit>

If this is the only entry in the config file, it will be used as a limit for
all processes. If there is also a subsystem and some limits for cgroups
specicifed, it will be used as a limit for processes from cgroups which are
not present in the configuration.
tests: Add a simple test of I/O limits
tests: Improve assertion failure messages

Consider the following test:

  a=500
  b=90
  expect_less_or_equal $a $b

This code produced the following, not very user-friendly error:

  FAILURE [2014-02-14 13:04:17] Expected: '500' <= '90'

This commit introduces more descriptive messages, ie:

  FAILURE [2014-02-14 13:04:47] Assertion 'expect_less_or_equal $a $b' failed
  Expected: '500' <= '90'
  Location: test_assert.sh:3

If the custom message is used, eg:

  MESSAGE="Checking simple arithmetics" expect_less_or_equal $a $b

the error message will look like this:

  FAILURE [2014-02-14 13:04:47] Checking simple arithmetics: Assertion 'expect_less_or_equal $a $b' failed
  Expected: '500' <= '90'
  Location: test_assert.sh:3
Merge branch io_limiting into master

Conflicts:
	tests/tools/assert.sh
tests: Increase timeouts for tests using vagrind

Some tests (eg. test_write_and_read) indicate that the time needed to
run a test using valgring is rougly 10 times bigger than the time when
valgrind is not used. Increase the timeout multiplier in valgrind.sh
from 5 to 10 to address this.
chunkserver: Fix overflow in charts

The value of "bytes read" in chunkserver's charts was overflowing
at 70 MB/s. This commit fixes this problem.

Closes #145
tests: Add possibility to generate a code coverage report

To generate such a report:
* Build sources with CMAKE_BUILD_TYPE=Coverage and install the binaries.
* Run the script: coverage.sh prepare <build-dir> to make the files in
  the build dir accessible by processes which run during tests.
* Run the tests with GENTLY_KILL=1 environmental variable. This will ensure
  that all the binaries dump coverage data on exit.
* Generate a HTML report: coverage.sh generate-html <build-dir> <out-dir>.
master, chunkserver, metalogger: Add isalive command

This commit introduces a new command isalive which can be use to test
if a daemon (mfsmaster, mfsmetalogger of mfschunkserser) if running.
The exit status of this command is as follows:
* 0 if the daemon is running
* 1 if the daemon is not running
* other if an error occured during the check

The exit status 1 is reserved to the isalive command and is used only
to indicate that the daemon is down. No other invocation (including
wrong usage, eg. mfsmaster isaliv) will exit with the status of 1.
common: Add messages for handling global IO limits

This patch adds LIZ_<MATOCL|CLTOMA>_IOLIMIT* messages that will be used
in the global IO limiting mechanism. It also adds some tools that were
needed to implement these messages, concerning serialization and unit
testing.

Closing #152
common: Fix string and vector<string> seralization

There was a bug in serialization of std::string and
std::vector<std::string>, which (depending on an architecture) may led
to serializing field length as a 64 bit variable, while it was always
deserialized as a 32 bit variable.
metarestore: Improve automatic recovery

Before this commit mfsmetarestore -a was not always very safe. Consider
the following scenario:
* Run both the master server and a metalogger on the machine and use it
* Stop the metalogger
* Use the filesystem for one year
* Stop the master server (mfsmaster stop)
* Run mfsmetarestore -a. It will recover metadata from one year ago and
  overwrite your metadata.mfs

mfsmetarestore -a will now try to find the best metadata file, which
will be used to apply all the found changelogs. It will never overwrite
newer metadata with any older version. After such a change
calling mfsmetarestore -a should always be safe and also should be the
best choice if one wants to recover the filesystem's metadata.
tests: Add a test of mfsmetarestore -a

This test verifies if the call 'mfsmetarestore -a' generates a valid
metadata file in many possible cases, eg. when metalogger's data is
newer than the master's data, or otherwise.