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.
common: Add macro for generating serializable classes

Add a macro that defines a class, that has automatically generated
methods for serialization. Due to the genericness of this
implementation, there is no need to implement a unit test that
checks if serialization works fine for objects created with use
of this macro.

The macro should be used like this:

include "common/serializable_class.h"

SERIALIZABLE_CLASS_BEGIN(MyClassName : public SomeBase)
SERIALIZABLE_CLASS_BODY(
    MyClassName,
    int   , fieldA,
    double, fieldB,
    long  , fieldC
)
    // Macro doesn't close class definition bracket, so we can provide
    // any additional code we want:
    MyClassName() = default; // Like a constructor
    void myMethod() {
        fieldA_ = 5; // We can also use class fields using underscore
    }
SERIALIZABLE_CLASS_END

int main() {
    MyClassName a = MyClassName(0, 1.0, 2l); // A tuple-like
                            // constructor is also generated
    std::vector<uint8_t> buffer;
    serialize(buffer, a);
}

Change-Id: I3bd3f1e1ed2111f89aa9561c0d1571d5e424b23a
common: Reorganize code serializing vectors

LizardFS does send vector length when serializing it, MooseFS does
not. This patch provides code needed to do both types of serialization.
tests: Fix name of one unit test file

Because of this wrong name the code didn't compile with tests
turned off.
tests: Add a stack trace to error messages

With assert inside functions it was difficult to trace errors since
there was no way to tell where a function was called from.
This commit adds get_stack and print_stack functions which display
the call stack with the file and the line where the function was called
from along with the arguments. Stack traces are also added to error
messages.
common: Modify serializable_class and MooseFSVector

* Make COUNT_ARGS and COUNT_ARGS_ macros automatically generated.
* Make MooseFSVectar be able to serialize vectors of types
which instances can have different sizes.
master, metadump: Rearrange metadata versions

The development of LizardFS has been made difficult because of limited metadata
version range. This commit widens it.
master, mount: Enable xattr support

This commit makes possible to use xattr in LizardFS installations.
No refactor performed.
tests: Add test of supporting xattr
tests: Use xattrs in test_metadata_recovery

Test if extended attributes can be recovered from metadata.
tests: Add wait_for function

This function makes it possible to wait for a specified condition in a test,
some examples:

  # Wait up to 1 minute for a file to be created
  assert_success wait_for 'ls | wc -l | grep "[1-9]"' '1 minute'

  # Wait up to 30 seconds for 8 chunks to be created
  wait_for '(( $(mfsdirinfo dir | grep chunks: | awk "{print \$2"}) >= 8 ))' '30 seconds'

Change-Id: I29d1892eb8c6aa84da263ee33738c57fcfe3ce91
copyright: Update author list

Change-Id: I79a36080cab26fad413d7a61f32cc3d7b46ba080
common: Add LIZARDFS_CREATE_EXCEPTION_CLASS_MSG

Add a macro which creates exception class with predefined message, like:

LIZARDFS_CREATE_EXCEPTION_CLASS_MSG(FooException, Exception,
		"Foo happens");
throw FooException();

Change-Id: I924934c0c451535fb993b1fdefdc05e6667cb4b6
master: Add option 'nomasterpermcheck' in mfsexports.cfg

This commit introduces a possibility to disable permission checking in
master server. This feature will be needed in ACL support implementation.

Change-Id: I9970f25ecb38f656fa36d89e6e6b212b94c78ccf
mount: Remove ACL filtering in mount

ACL support was planned to be in MooseFS in future. To prevent using them
unimplemented, ACL have been filtered in xattr. This commit removes this
filter.

Change-Id: I54ee9ce4194060d994be0cf210b0aa7de9a90710
common: Add cfg_get*() functions

This commit introduces new functions:
* cfg_getstring() - for getting std::string instead of char* that must be freed;
* cfg_get() - unified cfg_get<uint32|str|...>() which uses overloading;
* cfg_get<min|max|minmax>value() - cfg_get() with limiting value.

They will be needed for reading e.g. I/O limits configuration.

Change-Id: I10fb8eef4fb2bb09615604918afedb0ae0a3ee62
mount: move and rename IoLimitConfigLoader

Rename IoLimitConfigLoader to IoLimitsConfigLoader (plural "Limits").

Move IoLimitsConfigLoader from mount to common.

Change-Id: Ib77ef3667a9f14b9647f12c1f7fd1664d0cce7ec