similar to: Note new Python API in nbdkit 1.17.3

Displaying 20 results from an estimated 10000 matches similar to: "Note new Python API in nbdkit 1.17.3"

2019 Nov 22
0
Re: [PATCH nbdkit v2 03/10] python: Implement nbdkit API version 2.
On Fri, Nov 22, 2019 at 02:55:31PM -0600, Eric Blake wrote: > On 11/22/19 1:53 PM, Richard W.M. Jones wrote: > >To avoid breaking existing plugins, Python plugins wishing to use > >version 2 of the API must opt in by declaring: > > > > def api_version(): > > return 2 > > > >(Plugins which do not do this are assumed to want API version 1). >
2019 Nov 21
0
Re: Extending the nbdkit python plugin
On Thu, Nov 21, 2019 at 01:57:28PM +0000, Richard W.M. Jones wrote: > We have an nbdkit plugin that lets you write NBD servers in Python. > An example of an existing Python plugin is here: > > https://github.com/libguestfs/nbdkit/blob/master/plugins/python/example.py#L1 > > This morning I tried to modify the plugin to use the newer nbdkit API > (version 2). One of the
2019 Nov 22
1
Re: [PATCH nbdkit v2 03/10] python: Implement nbdkit API version 2.
On 11/22/19 3:14 PM, Richard W.M. Jones wrote: >>> @@ -54,20 +61,20 @@ def get_size(h): >>> return len(disk) >>> -def pread(h, count, offset): >>> +def pread(h, count, offset, flags): >>> global disk >>> return disk[offset:offset+count] >> >> Do we really want to be passing 'flags' as an integer that the
2019 Nov 22
1
Re: [PATCH nbdkit v2 03/10] python: Implement nbdkit API version 2.
On 11/22/19 3:46 PM, Nir Soffer wrote: >>>> and for zero (once fast zero is supported later in the series), it could >>>> look like: >>>> >>>> def zero(h, count, offset, may_trim=False, fua=False, fast=False): >>> >>> This is nicer - but not extensible. >> >> Why not? Any future flag additions would still appear as new
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 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 22
0
Re: [PATCH nbdkit v2 03/10] python: Implement nbdkit API version 2.
On Fri, Nov 22, 2019 at 11:35 PM Eric Blake <eblake@redhat.com> wrote: > > On 11/22/19 3:20 PM, Nir Soffer wrote: > > >>> +# There are several variants of the API. nbdkit will call this > >>> +# function first to determine which one you want to use. This is the > >>> +# latest version at the time this example was written. > >>> +def
2019 Nov 21
0
Re: Extending the nbdkit python plugin
This may be confusing at first but is not that difficult once you wrap your head around it. There are two types of arguments in Python: positional(*) and keyword(**). There is a rule that all positional arguments are defined before the keyword arguments. Also once an argument has a default value it is considered keyword (not positional). There are some nuances for which is best to reach to some
2019 Nov 21
5
Extending the nbdkit python plugin
We have an nbdkit plugin that lets you write NBD servers in Python. An example of an existing Python plugin is here: https://github.com/libguestfs/nbdkit/blob/master/plugins/python/example.py#L1 This morning I tried to modify the plugin to use the newer nbdkit API (version 2). One of the things that would change would be passing flags parameters to some functions, eg: def pwrite (h, buf,
2018 Apr 11
0
[nbdkit PATCH v2 1/5] python: Let zero's may_trim parameter be optional
In preparation for adding other optional flag arguments to the python bindings, start by making the existing 'may_trim' flag to 'zero' be optional. That is, the plugin need not define the parameter if it does not make any semantic difference (ie. if the plugin ignores the hint and never trims); while if the parameter exists, we now pass it as a keyword argument rather than as a
2018 Apr 11
0
[nbdkit PATCH v2 4/5] python: Expose FUA support
Expose support for the FUA flag to pwrite, zero, and trim, as well as a can_fua callback, for use in python plugins. There are some slight semantic differences: the C plugin had to switch to a new API with a single uint32_t flags argument (so we don't have to keep adding new ABI when new flags are added), but in so doing, there is no way to probe whether a C plugin supports FUA flags, so the
2018 Apr 06
1
[nbdkit PATCH] python: Let zero's may_trim parameter be optional
In preparation for adding other optional flag arguments to the python bindings, start by making the existing 'may_trim' flag to 'zero' be optional. That is, the plugin need not define the parameter if it does not make any semantic difference (ie. if the plugin ignores the hint and never trims); while if the parameter exists, we now pass it as a keyword argument rather than as a
2019 Nov 22
0
Re: [PATCH nbdkit v2 03/10] python: Implement nbdkit API version 2.
On Fri, Nov 22, 2019 at 10:55 PM Eric Blake <eblake@redhat.com> wrote: > > On 11/22/19 1:53 PM, Richard W.M. Jones wrote: > > To avoid breaking existing plugins, Python plugins wishing to use > > version 2 of the API must opt in by declaring: > > > > def api_version(): > > return 2 > > > > (Plugins which do not do this are assumed to
2020 Feb 21
1
Re: Plans for nbdkit 1.18 release?
On Thu, Feb 20, 2020 at 05:03:18PM -0600, Eric Blake wrote: > On 2/20/20 3:37 PM, Richard W.M. Jones wrote: > >Hi Eric, > > > >nbdkit 1.16 was released over 3 months ago, and there has been quite a > >lot of upstream development since then, so it could be about time for > >a new stable release. Anything in particular that you would like to > >get in to 1.18?
2018 Apr 11
0
[nbdkit PATCH v2 5/5] RFC: python: Track and cache per-connection state in C struct
Now that we have FUA support, the C code can call can_fua as frequently as on every write. If the python script has a can_fua, we can avoid doubling the calls into python by caching the per-connection results, done by wrapping the python handle in a C struct. This commit is marked RFC because it might be nicer if the C code implemented the caching for ALL plugins (TODO already mentions that).
2018 Apr 11
0
[nbdkit PATCH v2 3/5] python: Update internals to plugin API level 2
Adjust internal functions in preparation for FUA support; although at this point, the default plugins.c can_fua implementation correctly reports python as needing emulation, and we can assert that we aren't seeing a FUA flag. Signed-off-by: Eric Blake <eblake@redhat.com> --- plugins/python/python.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git
2019 Nov 22
4
Re: [PATCH nbdkit v2 03/10] python: Implement nbdkit API version 2.
On 11/22/19 3:20 PM, Nir Soffer wrote: >>> +# There are several variants of the API. nbdkit will call this >>> +# function first to determine which one you want to use. This is the >>> +# latest version at the time this example was written. >>> +def api_version(): >>> + return 2 >> >> Matches the C counterpart of #define
2019 Nov 22
8
Re: [PATCH nbdkit v2 03/10] python: Implement nbdkit API version 2.
On 11/22/19 1:53 PM, Richard W.M. Jones wrote: > To avoid breaking existing plugins, Python plugins wishing to use > version 2 of the API must opt in by declaring: > > def api_version(): > return 2 > > (Plugins which do not do this are assumed to want API version 1). Could we also permit the python code to declare a global variable instead of a function? But a
2018 Apr 19
1
Re: [nbdkit PATCH v2 5/5] RFC: python: Track and cache per-connection state in C struct
On Wed, Apr 11, 2018 at 12:03:42AM -0500, Eric Blake wrote: > Now that we have FUA support, the C code can call can_fua as > frequently as on every write. If the python script has a > can_fua, we can avoid doubling the calls into python by > caching the per-connection results, done by wrapping the > python handle in a C struct. > > This commit is marked RFC because it might
2015 Oct 26
0
[ANNOUNCE] xorg-server 1.17.3
Various bugfixes across the board.  The most visible changes include fixing GLX extension setup under Xwayland and other non-Xorg servers (enabling core contexts in more scenarios), and various stability fixes to glamor and the Present extension.  Full change list: Aaron Plattner (1):       privates: Clear screen-specific keys during CloseScreen Adam Jackson (9):       fb: Make rootless-agnostic