Displaying 5 results from an estimated 5 matches for "630ac2f".
2018 Apr 05
5
[nbdkit PATCH 0/3] Test zero callback of python plugin
I'm planning on tweaking the language callbacks to support fua;
first up is the python bindings. I want to move from:
def zero(h, count, offset, may_trim):
to a nicer:
def zero(h, count, offset, may_trim=False, fua=False):
where the C code passes keywords for the flags (we can add new
flags as needed), perhaps by using introspection to learn
whether the plugin has a mandatory may_trim
2018 Apr 05
0
[nbdkit PATCH 3/3] python: Test implementation of zero callback
...g of the fallback when a
zero callback is not present; but even better is testing
that the zero callback is called correctly.
Signed-off-by: Eric Blake <eblake@redhat.com>
---
tests/test.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tests/test.py b/tests/test.py
index 015b20f..630ac2f 100644
--- a/tests/test.py
+++ b/tests/test.py
@@ -41,6 +41,11 @@ def pwrite(h, buf, offset):
disk[offset:end] = buf
+def zero(h, count, offset, may_trim=False):
+ global disk
+ disk[offset:offset+count] = bytearray(count)
+
+
def flush(h):
pass
--
2.14.3
2018 Apr 11
0
[nbdkit PATCH v2 1/5] python: Let zero's may_trim parameter be optional
...y
@@ -65,7 +65,7 @@ def pwrite(h, buf, offset):
disk[offset:end] = buf
-def zero(h, count, offset, may_trim):
+def zero(h, count, offset, may_trim=False):
global disk
if may_trim:
disk[offset:offset+count] = bytearray(count)
diff --git a/tests/test.py b/tests/test.py
index 630ac2f..518cdd4 100644
--- a/tests/test.py
+++ b/tests/test.py
@@ -41,7 +41,7 @@ def pwrite(h, buf, offset):
disk[offset:end] = buf
-def zero(h, count, offset, may_trim=False):
+def zero(h, count, offset):
global disk
disk[offset:offset+count] = bytearray(count)
--
2.14.3
2018 Apr 06
1
[nbdkit PATCH] python: Let zero's may_trim parameter be optional
...y
@@ -65,7 +65,7 @@ def pwrite(h, buf, offset):
disk[offset:end] = buf
-def zero(h, count, offset, may_trim):
+def zero(h, count, offset, may_trim=False):
global disk
if may_trim:
disk[offset:offset+count] = bytearray(count)
diff --git a/tests/test.py b/tests/test.py
index 630ac2f..518cdd4 100644
--- a/tests/test.py
+++ b/tests/test.py
@@ -41,7 +41,7 @@ def pwrite(h, buf, offset):
disk[offset:end] = buf
-def zero(h, count, offset, may_trim=False):
+def zero(h, count, offset):
global disk
disk[offset:offset+count] = bytearray(count)
--
2.14.3
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