int is_exclusive_lock_owner(ImageCtx *ictx, bool *is_owner);
int remove(librados::IoCtx& io_ctx, const char *imgname,
- ProgressContext& prog_ctx);
+ ProgressContext& prog_ctx, bool force=false);
int snap_list(ImageCtx *ictx, std::vector<snap_info_t>& snaps);
int snap_exists(ImageCtx *ictx, const char *snap_name, bool *exists);
+ int snap_get_limit(ImageCtx *ictx, uint64_t *limit);
+ int snap_set_limit(ImageCtx *ictx, uint64_t limit);
int snap_is_protected(ImageCtx *ictx, const char *snap_name,
bool *is_protected);
int copy(ImageCtx *ictx, IoCtx& dest_md_ctx, const char *destname,
on_op_complete);
}
+ void execute(const journal::SnapLimitEvent &_) {
+ image_ctx.operations->execute_snap_set_limit(event.limit, on_op_complete);
+ }
+
virtual void finish(int r) override {
+ CephContext *cct = image_ctx.cct;
+ if (r < 0) {
+ lderr(cct) << "ExecuteOp: " << __func__ << ": r=" << r << dendl;
+ on_op_complete->complete(r);
+ return;
+ }
+
+ ldout(cct, 20) << "ExecuteOp: " << __func__ << dendl;
RWLock::RLocker owner_locker(image_ctx.owner_lock);
execute(event);
}
char* PyBytes_AsString(PyObject *string) except NULL
int _PyBytes_Resize(PyObject **string, Py_ssize_t newsize) except -1
-ctypedef int (*librbd_progress_fn_t)(uint64_t offset, uint64_t total, void* ptr)
+cdef extern from "time.h":
+ ctypedef long int time_t
+ cdef extern from "limits.h":
+ cdef uint64_t INT64_MAX
+
cdef extern from "rbd/librbd.h" nogil:
enum:
_RBD_FEATURE_LAYERING "RBD_FEATURE_LAYERING"
LIBRADOS_OP_FLAG_FADVISE_RANDOM)
from rbd import (RBD, Image, ImageNotFound, InvalidArgument, ImageExists,
ImageBusy, ImageHasSnapshots, ReadOnlyImage,
- FunctionNotSupported, ArgumentOutOfRange,
+ FunctionNotSupported, ArgumentOutOfRange, DiskQuotaExceeded,
RBD_FEATURE_LAYERING, RBD_FEATURE_STRIPINGV2,
- RBD_FEATURE_EXCLUSIVE_LOCK)
+ RBD_FEATURE_EXCLUSIVE_LOCK, RBD_FEATURE_JOURNALING,
+ RBD_MIRROR_MODE_DISABLED, RBD_MIRROR_MODE_IMAGE,
+ RBD_MIRROR_MODE_POOL, RBD_MIRROR_IMAGE_ENABLED,
+ RBD_MIRROR_IMAGE_DISABLED, MIRROR_IMAGE_STATUS_STATE_UNKNOWN)
rados = None
ioctx = None