rbd: Allow CLI to optionally create shared images

Images that are flagged as shared cannot use the RBD
object map nor RBD mirroring features.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
librados: Fix tracepoint compile error

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
rbd: Create async versions of long-running maintenance operations

Resize and flatten now have async versions. The existing resize
and flatten operations now use the async versions internally. The
async operations will be used by the client holding the exclusive
lock when it receives maintenance requests from other clients.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
librados: Expose RadosClient instance id through librados

Allow librados clients to utilize the global id of the RadosClient.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
rbd: Add maintenance operation requests to ImageWatcher

Snapshot, flatten, and resize maintenance operations can now
be coordinated via the client holding the exclusive lock for the
image.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
rbd: Coordinate maintenance through exclusive lock leader

When the exclusive lock feature is enabled, only a single client can
modify the image.  As a result, certain maintenance activities
need to be proxied from the maintenance client to the active
leader.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
librados: Add exec_mutable operation

The existing exec operation does not pass the current
snapshot context.  The new exec_mutable operation
includes the snapshot context so that methods which
update objects can be rolled back.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
rbd: Implement object map for tracking in-use objects

The object map is stored in a new 'rbd_object_map.<id>'
object in the image's pool. The object map tracks blocks
that are in-use, non-existent, and are pending deletion.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
rbd: Use object map for IO operations

When the RBD exclusive lock is enabled, IO operations
now check whether or not an object exists before
sending a IO operation to RADOS.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>