summaryrefslogtreecommitdiff
path: root/src/pybind
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2012-10-01 20:59:20 -0700
committerSage Weil <sage@inktank.com>2012-10-15 15:34:03 -0700
commita7f634a8c8db56db204bcc08e51a405890ce80ea (patch)
treedd22ec18c78a3c76859fe06f6a75255063e5f291 /src/pybind
parentae7271e13fcf122b7a12203cc0b59fad5f76a0ff (diff)
downloadceph-a7f634a8c8db56db204bcc08e51a405890ce80ea.tar.gz
librbd: update python bindings for striped image creation
Signed-off-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'src/pybind')
-rw-r--r--src/pybind/rbd.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/pybind/rbd.py b/src/pybind/rbd.py
index 1a3f85d8419..da5bc69f229 100644
--- a/src/pybind/rbd.py
+++ b/src/pybind/rbd.py
@@ -24,6 +24,7 @@ ANONYMOUS_AUID = 0xffffffffffffffff
ADMIN_AUID = 0
RBD_FEATURE_LAYERING = 1
+RBD_FEATURE_STRIPINGV2 = 2
class Error(Exception):
pass
@@ -131,7 +132,7 @@ class RBD(object):
return (major.value, minor.value, extra.value)
def create(self, ioctx, name, size, order=None, old_format=True,
- features=0):
+ features=0, stripe_unit=0, stripe_count=0):
"""
Create an rbd image.
@@ -149,6 +150,10 @@ class RBD(object):
:type old_format: bool
:param features: bitmask of features to enable
:type features: int
+ :param stripe_unit: stripe unit in bytes (default 0 for object size)
+ :type stripe_unit: int
+ :param stripe_count: objects to stripe over before looping
+ :type stripe_count: int
:raises: :class:`ImageExists`
"""
if order is None:
@@ -160,10 +165,12 @@ class RBD(object):
c_uint64(size),
byref(c_int(order)))
else:
- ret = self.librbd.rbd_create2(ioctx.io, c_char_p(name),
+ ret = self.librbd.rbd_create3(ioctx.io, c_char_p(name),
c_uint64(size),
c_uint64(features),
- byref(c_int(order)))
+ byref(c_int(order)),
+ c_uint64(stripe_unit),
+ c_uint64(stripe_count))
if ret < 0:
raise make_ex(ret, 'error creating image')