search for: 015b20f

Displaying 2 results from an estimated 2 matches for "015b20f".

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
...ed testing 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