diff options
author | Josh Durgin <josh.durgin@inktank.com> | 2012-06-08 07:43:32 -0700 |
---|---|---|
committer | Josh Durgin <josh.durgin@inktank.com> | 2012-06-09 17:24:50 -0700 |
commit | 5b40b4b94c2199aa09d40ead4b6499395ae3e4e3 (patch) | |
tree | 289b1320de3e5cbcac8bd7d632509f0dfe87556e /src/include | |
parent | bfbed50886152bb700aa89594d83dcc064328bd3 (diff) | |
download | ceph-5b40b4b94c2199aa09d40ead4b6499395ae3e4e3.tar.gz |
librbd: add create2 to create an image with the new format
This will fail if features are requested that the client or server
does not support. Currently there are no features defined, so
zero is the only valid value.
copy() preserves the format and features of the source image.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/rbd/librbd.h | 4 | ||||
-rw-r--r-- | src/include/rbd/librbd.hpp | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/include/rbd/librbd.h b/src/include/rbd/librbd.h index c2ed7bfb0b2..8aafcad9a75 100644 --- a/src/include/rbd/librbd.h +++ b/src/include/rbd/librbd.h @@ -30,7 +30,7 @@ extern "C" { #define LIBRBD_VER_MAJOR 0 #define LIBRBD_VER_MINOR 1 -#define LIBRBD_VER_EXTRA 2 +#define LIBRBD_VER_EXTRA 3 #define LIBRBD_VERSION(maj, min, extra) ((maj << 16) + (min << 8) + extra) @@ -67,6 +67,8 @@ void rbd_version(int *major, int *minor, int *extra); /* images */ int rbd_list(rados_ioctx_t io, char *names, size_t *size); int rbd_create(rados_ioctx_t io, const char *name, uint64_t size, int *order); +int rbd_create2(rados_ioctx_t io, const char *name, uint64_t size, + uint64_t features, int *order); int rbd_remove(rados_ioctx_t io, const char *name); int rbd_remove_with_progress(rados_ioctx_t io, const char *name, librbd_progress_fn_t cb, void *cbdata); diff --git a/src/include/rbd/librbd.hpp b/src/include/rbd/librbd.hpp index 915833a9088..6ada8d41393 100644 --- a/src/include/rbd/librbd.hpp +++ b/src/include/rbd/librbd.hpp @@ -68,6 +68,8 @@ public: int open(IoCtx& io_ctx, Image& image, const char *name, const char *snapname); int list(IoCtx& io_ctx, std::vector<std::string>& names); int create(IoCtx& io_ctx, const char *name, uint64_t size, int *order); + int create2(IoCtx& io_ctx, const char *name, uint64_t size, + uint64_t features, int *order); int remove(IoCtx& io_ctx, const char *name); int remove_with_progress(IoCtx& io_ctx, const char *name, ProgressContext& pctx); int rename(IoCtx& src_io_ctx, const char *srcname, const char *destname); |