search for: pymemoryview_frommemory

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

2019 Nov 23
3
[PATCH nbdkit] python: Pass memoryview to pwrite()
...gins/python/python.c @@ -496,8 +496,8 @@ py_pwrite (void *handle, const void *buf, PyErr_Clear (); r = PyObject_CallFunction (fn, "ONL", obj, - PyByteArray_FromStringAndSize (buf, count), - offset, NULL); + PyMemoryView_FromMemory ((char *)buf, count, PyBUF_READ), + offset, NULL); Py_DECREF (fn); if (check_python_failure ("pwrite") == -1) return -1; -- 2.21.0
2019 Nov 25
0
[PATCH nbdkit 1/2] python: For v2 API, avoid copy by passing a buffer to pread.
...*buf, uint32_t count, uint64_t offset, r = PyObject_CallFunction (fn, "OiL", obj, count, offset, NULL); break; case 2: - r = PyObject_CallFunction (fn, "OiLI", obj, count, offset, flags, NULL); + r = PyObject_CallFunction (fn, "ONLI", obj, + PyMemoryView_FromMemory ((char *)buf, count, PyBUF_WRITE), + offset, flags, NULL); break; default: abort (); } @@ -535,19 +537,25 @@ py_pread (void *handle, void *buf, uint32_t count, uint64_t offset, if (check_python_failure ("pread") == -1) return ret; - if (PyObject_GetBuffer (r...
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
3
[PATCH nbdkit 0/2] python: Implement pread passing buffer for v2 API.
As suggested by Nir, here: https://www.redhat.com/archives/libguestfs/2019-November/thread.html#00220
2019 Nov 25
7
[PATCH nbdkit v2 0/7] Implement nbdkit API v2 for Python plugins.
v3 was here: https://www.redhat.com/archives/libguestfs/2019-November/msg00209.html In v4: - Rebase on top of current master. Includes various fixes and updates required because of Nir's patches that went into master. - Fix api_version() -> API_VERSION in patch 2 noted previously on the mailing list. Rich.
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