Displaying 2 results from an estimated 2 matches for "b78c0e2".
2017 Jan 26
0
[nbdkit PATCH v2 6/6] python: Support zero callback
..., offset, may_trim):
+ global disk
+ if may_trim:
+ disk[offset:offset+count] = bytearray(count)
+ else:
+ nbdkit.set_error(errno.EOPNOTSUPP)
+ raise Exception
diff --git a/plugins/python/nbdkit-python-plugin.pod b/plugins/python/nbdkit-python-plugin.pod
index 8b3d08c..b78c0e2 100644
--- a/plugins/python/nbdkit-python-plugin.pod
+++ b/plugins/python/nbdkit-python-plugin.pod
@@ -215,6 +215,26 @@ The body of your C<trim> function should "punch a hole" in the
backing store. If the trim fails, your function should throw an
exception, optionally using C<...
2017 Jan 26
10
[nbdkit PATCH v2 0/6] bind .zero to Python
Fix some things I noticed while reviewing v1, and follow Rich's
idea to add a new nbdkit_set_error() utility function with a
binding for Python users to request a particular error (rather
than being forced to live with whatever stale value is in errno
after all the intermediate binding glue code).
I could not easily find out how to register a C function callable
from perl bindings, and have