summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wilkins <john.wilkins@inktank.com>2013-06-05 11:45:43 -0700
committerJohn Wilkins <john.wilkins@inktank.com>2013-06-05 11:45:43 -0700
commit6f78b6e039ddd475b0317f121a3e0cac407333df (patch)
treeb1340761dade3d776caafbfa46a74318ea381934
parentd97031175f8ae5663548a92ef48b99baf377c10a (diff)
parent8c23d8cb46d432ca3c840336e02a9eed868d78f3 (diff)
downloadceph-6f78b6e039ddd475b0317f121a3e0cac407333df.tar.gz
Merge branch 'master' of https://github.com/ceph/ceph
-rw-r--r--doc/dev/rbd-diff.rst37
-rw-r--r--src/pybind/rados.py14
2 files changed, 23 insertions, 28 deletions
diff --git a/doc/dev/rbd-diff.rst b/doc/dev/rbd-diff.rst
index e258afd100b..e40124a002f 100644
--- a/doc/dev/rbd-diff.rst
+++ b/doc/dev/rbd-diff.rst
@@ -22,22 +22,22 @@ records.
From snap
---------
-u8: 'f'
-le32: snap name length
-snap name
+- u8: 'f'
+- le32: snap name length
+- snap name
To snap
-------
-u8: 't'
-le32: snap name length
-snap name
+- u8: 't'
+- le32: snap name length
+- snap name
Size
----
-u8: 's'
-u64: (ending) image size
+- u8: 's'
+- u64: (ending) image size
Data Records
~~~~~~~~~~~~
@@ -47,17 +47,17 @@ These records come in the second part of the sequence.
Updated data
------------
-u8: 'w'
-le64: offset
-le64: length
-length bytes of actual data
+- u8: 'w'
+- le64: offset
+- le64: length
+- length bytes of actual data
Zero data
---------
-u8: 'z'
-le64: offset
-le64: length
+- u8: 'z'
+- le64: offset
+- le64: length
Final Record
@@ -66,9 +66,4 @@ Final Record
End
---
-u8: 'e'
-
-
-
-
-
+- u8: 'e'
diff --git a/src/pybind/rados.py b/src/pybind/rados.py
index b465728179e..f18f179d030 100644
--- a/src/pybind/rados.py
+++ b/src/pybind/rados.py
@@ -217,7 +217,7 @@ Rados object in state %s." % (self.state))
length = 20
while True:
ret_buf = create_string_buffer(length)
- ret = self.librados.rados_conf_get(self.cluster, option,
+ ret = self.librados.rados_conf_get(self.cluster, c_char_p(option),
ret_buf, c_size_t(length))
if (ret == 0):
return ret_buf.value
@@ -394,11 +394,11 @@ Rados object in state %s." % (self.state))
:returns: str - cluster fsid
"""
self.require_state("connected")
- fsid_len = 36
- fsid = create_string_buffer(fsid_len + 1)
+ buf_len = 37
+ fsid = create_string_buffer(buf_len)
ret = self.librados.rados_cluster_fsid(self.cluster,
byref(fsid),
- fsid_len + 1)
+ c_size_t(buf_len))
if ret < 0:
raise make_ex(ret, "error getting cluster fsid")
return fsid.value
@@ -501,7 +501,7 @@ class SnapIterator(object):
while True:
self.snaps = (ctypes.c_uint64 * num_snaps)()
ret = self.ioctx.librados.rados_ioctx_snap_list(self.ioctx.io,
- self.snaps, num_snaps)
+ self.snaps, c_int(num_snaps))
if (ret >= 0):
self.max_snap = ret
break
@@ -528,7 +528,7 @@ ioctx '%s'" % self.ioctx.name)
while True:
name = create_string_buffer(name_len)
ret = self.ioctx.librados.rados_ioctx_snap_get_name(self.ioctx.io, \
- snap_id, byref(name), name_len)
+ c_uint64(snap_id), byref(name), c_int(name_len))
if (ret == 0):
name_len = ret
break
@@ -1102,7 +1102,7 @@ written." % (self.name, ret, length))
self.require_ioctx_open()
if not isinstance(key, str):
raise TypeError('key must be a string')
- ret = self.librados.rados_trunc(self.io, c_char_p(key), c_size_t(size))
+ ret = self.librados.rados_trunc(self.io, c_char_p(key), c_uint64(size))
if ret < 0:
raise make_ex(ret, "Ioctx.trunc(%s): failed to truncate %s" % (self.name, key))
return ret