Displaying 3 results from an estimated 3 matches for "07559a5".
Did you mean:
0155d9a5
2018 Apr 11
0
[nbdkit PATCH v2 2/5] python: Expose can_zero callback
...plugin.pod
@@ -183,6 +183,13 @@ contents will be garbage collected.
def can_trim(h):
# return a boolean
+=item C<can_zero>
+
+(Optional)
+
+ def can_zero(h):
+ # return a boolean
+
=item C<pread>
(Required)
diff --git a/plugins/python/python.c b/plugins/python/python.c
index 07559a5..d75b36a 100644
--- a/plugins/python/python.c
+++ b/plugins/python/python.c
@@ -629,13 +629,8 @@ py_can_write (void *handle)
Py_DECREF (r);
return ret;
}
- /* No Python can_write callback, but there's a Python pwrite callback
- * defined, so return 1. (In C modules, nbdkit woul...
2018 Apr 11
0
[nbdkit PATCH v2 1/5] python: Let zero's may_trim parameter be optional
...onal parameter, or if the caller sets
+it to False, writing zeroes should not punch holes.
NBD only supports whole writes, so your function should try to
write the whole region (perhaps requiring a loop). If the write
diff --git a/plugins/python/python.c b/plugins/python/python.c
index 7eb91d7..07559a5 100644
--- a/plugins/python/python.c
+++ b/plugins/python/python.c
@@ -108,6 +108,73 @@ callback_defined (const char *name, PyObject **obj_rtn)
return 1;
}
+/* Checks whether a list of strings contains the given name */
+static int
+check_list (PyObject *list, const char *name)
+{
+ ssize_t i...
2018 Apr 11
10
[nbdkit PATCH v2 0/5] FUA support in Python scripts
First out of our four language bindings to add FUA support (for
reference, I added 'zero' support for python, perl, and ruby
back in 1.1.13, then Rich had to add it for ocaml in 1.1.20).
I tested this heavily under python 2, but for now only compile
tested under python 3; I plan to do further testing there and
make any tweaks if necessary.
I wrote patch 5 early on, but then realized I