Add wrapper for rbd_pool_metadata_remove() function which removes pool
metadata associated with a given key.
Signed-off-by: Mudit Agarwal <muagarwa@redhat.com>
Add wrapper for rbd_pool_metadata_set() function which sets pool metadata
associated with the given key.
Signed-off-by: Mudit Agarwal <muagarwa@redhat.com>
Add wrapper for rbd_pool_metadata_get() function which returns pool metadata
associated with the given key.
Signed-off-by: Mudit Agarwal <muagarwa@redhat.com>
Previously, the types were named RbdImageOptions and RbdImageOption.
Now they are named ImageOptions and ImageOption.
Type aliases have been added to prevent existing code from
breaking. As these types were new in v0.2, I suspect we can drop
the aliases post-v0.3.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Image option constants are now named ImageOptionX, without an Rbd
prefix. Aliases to the old names are provided and doc comments for both.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
A previous change improved our use of pointers such that go vet no
longer had an issue with these lines but if we ever need to change the
interaction between rbd and rados like that again we can now rely on a
single call site `cephIoctx` that will return our ceph/c type given the
public Go-language level type from the rados pkg.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
The void * is (ab)used in C for passing arbitrary data to the callback,
which in our case is a integer index. However, Go tools can not tell
this is OK and throws an error running go vet. Change the wrapper
function to take a uintptr_t and cast that to void* only in the
(unchecked) C layer.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Moving the errutil pkg to "internal/errutil" makes errutil private-like
and accessible to only other go-ceph packages. The functions it provided
were always meant to be used only by go-ceph, this just makes it more
official. This is a breaking change but it was only available to
outside users for 1 release and it is somewhat doubtful users outside
of go-ceph would have reached for these functions.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
No functionality change. Move various snapshot related functions to
their own file. This helps logically group these related funcs in one
place.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
The DiffIterate call accepts a data structure argument containing the
parameters of the image to "diff" and a callback function. This callback
is called in the C code, making use of the recently added callbacks
helper.
The callback itself is called with the offset and length of the
differing area in the image as well as a data parameter so that
a common function can distinguish or update different data for
different calls if needed (compare to a void* in C).
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Checking if there are other clients interested in changes to an RBD
image is important for certain actions. For example, the Ceph-CSI
project would not want to remove an image in case it is still mounted
somewhere.
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Applications will mostly want to show names of features to their users,
and not just a few bits. With the FeatureSet functions it becomes simple
for applications to map the name of a feature to bits, and the other way
around
Signed-off-by: Niels de Vos <ndevos@redhat.com>