rgw: clean up ops initialization, completion

ops init() was a reminiscent of an old design. Since we're
allocating new op for every request we can just init everything
in the constructor.

We now add a new complete() stage in request processing. By
default complete() will call send_response().

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: better protocols separation

This change will make it easier to add new protocol
handlers. We now determine which protocol handler to
use by querying the list of existing protocol handlers
whether the query belongs to that protocol. If so,
then just run the specific protocol's handler code.
Separated some mixed s3 and swift code into the specific
handlers.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
doc: Added commentary for BMC and VLAN.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
Merge branch 'master' of https://github.com/ceph/ceph
vstart.sh: let you specific specific ip to bind to

e.g. 192.168.122.1

Signed-off-by: Sage Weil <sage@inktank.com>
ceph.spec.in:  Build rpms with nss instead of cryptopp.
doc: Added commentary for BMC and VLAN.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
LogEntry: init in ctor

Signed-off-by: Sage Weil <sage@inktank.com>
MemoryModel: init in ctor

CID 717211: Uninitialized scalar field (UNINIT_CTOR)
At (18): Non-static class member field "last.mmap" is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Sage Weil <sage@inktank.com>
workqueue: reset heartbeat timeout under lock

This makes coverity happier:

CID 727967: Value not atomically updated (ATOMICITY)
At (44): Using an unreliable value of "hb" inside the second locked section. If the data that "hb" depends on was changed by another thread, this use might be incorrect.

Signed-off-by: Sage Weil <sage@inktank.com>
adminsocket: check return value

CID 716847: Other violation (CHECKED_RETURN)
At (5): Calling function "fcntl(sock_fd, 2, 1)" without checking return value. This library function may fail and return an error code.
At (6): No check of the return value of "fcntl(sock_fd, 2, 1)".

Signed-off-by: Sage Weil <sage@inktank.com>
adminsocket: change failure test

This makes coverity happier:

CID 716941: Using invalid iterator (INVALIDATE_ITERATOR)
At (35): Dereferencing iterator "p" though it is already past the end of its container.

only because it doesn't understand all the side-effects of the failure
branch above.

Signed-off-by: Sage Weil <sage@inktank.com>
adminsocket: init vars in ctor

At (2): Non-static class member "m_version_hook" is not initialized in this constructor nor in any functions that it calls.
CID 717212: Uninitialized pointer field (UNINIT_CTOR)
At (4): Non-static class member "m_help_hook" is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Sage Weil <sage@inktank.com>
buffer: restore stream state after hexdump()

CID 717129: Not restoring ostream format (STREAM_FORMAT_STATE)
At (51): Changing format state of stream "out" for category fill without later restoring it.

Signed-off-by: Sage Weil <sage@inktank.com>
buffer: init data val in ctor

CID 717213: Uninitialized pointer field (UNINIT_CTOR)
At (2): Non-static class member "data" is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Sage Weil <sage@inktank.com>
config: don't leak buf on dump config

CID 717074: Resource leak (RESOURCE_LEAK)
At (26): Variable "buf" going out of scope leaks the storage it points to.

Signed-off-by: Sage Weil <sage@inktank.com>
ipaddr: fix buffer overrun on ipv6 prefix of 128

CID 717020: Out-of-bounds read (OVERRUN)
At (3): Overrunning array "addr->__in6_u.__u6_addr8" of 16 bytes at byte offset 16 using index "prefix_len / 8U" (which evaluates to 16).

Signed-off-by: Sage Weil <sage@inktank.com>
lockep: fix leak in failure/assert path

This is useless excepto make coverity happy.

CID 717075: Resource leak (RESOURCE_LEAK)
At (12): Variable "bt" going out of scope leaks the storage it points to.

Signed-off-by: Sage Weil <sage@inktank.com>
obj_bencher: possible divice by zero

CID 716903: Division or modulo by zero (DIVIDE_BY_ZERO) [select defect]

Signed-off-by: Sage Weil <sage@inktank.com>
obj_bencher: protect with lock

This makes coverity happy.

CID 716963: Data race condition (MISSING_LOCK)
At (1): Accessing "this->data.finished" ("bench_data.finished") requires the "Mutex._m" lock.

Signed-off-by: Sage Weil <sage@inktank.com>