search for: py_buff

Displaying 6 results from an estimated 6 matches for "py_buff".

Did you mean: sk_buff
2019 Nov 23
1
[PATCH] python: Support buffer protocol for pread() result
...tions(+), 12 deletions(-) diff --git a/plugins/python/python.c b/plugins/python/python.c index 148097f..ed299ff 100644 --- a/plugins/python/python.c +++ b/plugins/python/python.c @@ -445,10 +445,12 @@ py_pread (void *handle, void *buf, PyObject *obj = handle; PyObject *fn; PyObject *r; + Py_buffer view = {0}; + int ret = -1; if (!callback_defined ("pread", &fn)) { nbdkit_error ("%s: missing callback: %s", script, "pread"); - return -1; + return ret; } PyErr_Clear (); @@ -456,25 +458,30 @@ py_pread (void *handle, void *buf, r = P...
2020 Sep 10
1
[libnbd PATCH] python: Fix more memory leaks
...ions(+), 56 deletions(-) diff --git a/generator/Python.ml b/generator/Python.ml index 9a22f9e..3b86dc0 100644 --- a/generator/Python.ml +++ b/generator/Python.ml @@ -271,7 +271,7 @@ let print_python_binding name { args; optargs; ret; may_set_error } = | BytesIn (n, _) -> pr " Py_buffer %s;\n" n | BytesOut (n, count) -> - pr " char *%s;\n" n; + pr " char *%s = NULL;\n" n; pr " Py_ssize_t %s;\n" count | BytesPersistIn (n, _) | BytesPersistOut (n, _) -> @@ -279,11 +279,10 @@ let print_python_binding nam...
2019 Aug 09
0
[PATCH libnbd 1/2] generator: Handle closure args (cbargs) specially.
...yAndLen (UInt32 n, len) -> - pr " PyObject *py_%s;\n" n; - pr " uint32_t *%s;\n" n; - pr " size_t %s;\n" len; - | ArrayAndLen _ -> assert false | Bool n -> pr " int %s;\n" n | BytesIn (n, _) -> pr " Py_buffer %s;\n" n @@ -4169,7 +4164,6 @@ let print_python_binding name { args; ret; may_set_error } = | Int64 n -> pr " int64_t %s_i64;\n" n; pr " long long %s; /* really int64_t */\n" n - | Mutable arg -> assert false | Path n -> pr...
2020 Mar 19
5
[nbdkit PATCH 0/2] More caching of initial setup
When I added .can_FOO caching in 1.16, I missed the case that the sh plugin itself was calling .can_flush twice in some situations (in order to default .can_fua). Then right after, I regressed it to call .can_zero twice (in order to default .can_fast_zero). I also missed that .thread_model could use better caching, because at the time, I did not add testsuite coverage. Fix that now. Eric Blake
2019 Nov 25
6
[nbdkit PATCH 0/5] Counterproposal for python v2 interfaces
As mentioned in my reviews, I wonder if we should make our python callbacks look a bit more Pythonic by having kwargs added for each new flag that we want to expose. The idea was first floated here: https://www.redhat.com/archives/libguestfs/2018-April/msg00108.html Note that with my proposal, there is no need for a python script to expose a global API_VERSION variable; new flags are added
2019 Aug 09
4
[PATCH libnbd 0/2] generator: Preparatory changes to the generator.
These are some simplifications to the generator. They don't probably make much sense on their own, but they are preparatory to better handling of enums, and or'd lists of flags. Rich.