search for: acquire_python_gil_for_current_scop

Displaying 7 results from an estimated 7 matches for "acquire_python_gil_for_current_scop".

2020 Aug 05
5
[PATCH nbdkit 3/4] python: Allow thread model to be set from Python plugins.
This is working for me now, although possibly only on Python 3.9. Dan suggested PyEval_InitThreads but that was deprecated in Python 3.7. Rich.
2020 Aug 10
0
Re: [PATCH nbdkit] python: Implement can_extents + extents.
...kit.CACHE_NATIVE We expose various constants through 'import nbdkit', so... > +++ b/plugins/python/python.c > @@ -1020,6 +1020,79 @@ py_can_cache (void *handle) > return NBDKIT_CACHE_NONE; > } > > +static int > +py_can_extents (void *handle) > +{ > + ACQUIRE_PYTHON_GIL_FOR_CURRENT_SCOPE; > + return boolean_callback (handle, "can_extents", "extents"); > +} > + > +static int > +py_extents (void *handle, uint32_t count, uint64_t offset, > + uint32_t flags, struct nbdkit_extents *extents) > +{ > + ACQUIRE_PYTHON_GIL_FOR_CURRENT...
2020 Aug 10
5
[PATCH nbdkit] python: Implement can_extents + extents.
...orted. diff --git a/plugins/python/python.c b/plugins/python/python.c index 398473f5..585cd9e6 100644 --- a/plugins/python/python.c +++ b/plugins/python/python.c @@ -1020,6 +1020,79 @@ py_can_cache (void *handle) return NBDKIT_CACHE_NONE; } +static int +py_can_extents (void *handle) +{ + ACQUIRE_PYTHON_GIL_FOR_CURRENT_SCOPE; + return boolean_callback (handle, "can_extents", "extents"); +} + +static int +py_extents (void *handle, uint32_t count, uint64_t offset, + uint32_t flags, struct nbdkit_extents *extents) +{ + ACQUIRE_PYTHON_GIL_FOR_CURRENT_SCOPE; + struct handle *h = handle; +...
2020 Sep 01
0
[nbdkit PATCH 1/2] python: Implement .list_exports and friends
...git a/plugins/python/python.c b/plugins/python/python.c index 27c5ede2..498ffebc 100644 --- a/plugins/python/python.c +++ b/plugins/python/python.c @@ -536,6 +536,99 @@ py_get_ready (void) return 0; } +static int +py_list_exports (int readonly, int is_tls, struct nbdkit_exports *exports) +{ + ACQUIRE_PYTHON_GIL_FOR_CURRENT_SCOPE; + PyObject *fn; + PyObject *r; + PyObject *iter, *t; + + if (!callback_defined ("list_exports", &fn)) + /* Do the same as the core server */ + return nbdkit_add_default_export (exports); + + PyErr_Clear (); + + r = PyObject_CallFunction (fn, "ii", readonly, is_...
2020 Aug 10
0
Re: [PATCH nbdkit] python: Implement can_extents + extents.
...ns/python/python.c > index 398473f5..585cd9e6 100644 > --- a/plugins/python/python.c > +++ b/plugins/python/python.c > @@ -1020,6 +1020,79 @@ py_can_cache (void *handle) > return NBDKIT_CACHE_NONE; > } > > +static int > +py_can_extents (void *handle) > +{ > + ACQUIRE_PYTHON_GIL_FOR_CURRENT_SCOPE; > + return boolean_callback (handle, "can_extents", "extents"); > +} > + > +static int > +py_extents (void *handle, uint32_t count, uint64_t offset, > + uint32_t flags, struct nbdkit_extents *extents) > +{ > + ACQUIRE_PYTHON_GIL_FOR_CURRENT...
2020 Sep 01
4
[nbdkit PATCH 0/2] More language bindings for .list_exports
This picks up python and ocaml. Some of our languages are lacking a number of bindings (for example, lua and perl lack .extents, so I didn't have anything to copy from), and I felt less comfortable with golang and rust. But for python and ocaml, I was able to test a working implementation. Eric Blake (2): python: Implement .list_exports and friends ocaml: Implement .list_exports and
2020 Sep 21
18
[nbdkit PATCH v3 00/14] exportname filter
It's been several weeks since I posted v2 (I got distracted by improving libnbd to better test things, which in turn surfaced some major memory leak problems in nbdsh that are now fixed). Many of the patches are minor rebases from v2, with the biggest changes being fallout from: - patch 2: rename nbdkit_add_default_export to nbdkit_use_default_export - overall: this missed 1.22, so update