Displaying 20 results from an estimated 300 matches similar to: "[PATCH nbdkit] python: Pass memoryview to pwrite()"
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
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 23
8
[PATCH nbdkit v3 0/7] Implement nbdkit API v2 for Python plugins.
v2 was here:
https://www.redhat.com/archives/libguestfs/2019-November/msg00163.html
I pushed patch 1 (with spelling fix), patch 4 and patch 5 since those
were previously ACKed on the list.
Differences in v3:
- Add error checking to PyModule_AddIntConstant.
- Use API_VERSION constant instead of function.
- Add max API version supported to --dump-plugin output.
- Print API_VERSION selected by
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 Oct 04
2
samba-tool user syncpasswords crashes with python3
the script works...
root at probe28:~# cat test.dat
dn: CN=userxxxx,OU=Users,OU=xxxxx,OU=Organizations,DC=xxxxx,DC=xxxxx
proxyAddresses: SMTP:xxxxx.xxxxx at xxxxx.org
objectGUID: 637f4e70-8c1e-4e89-a6fc-82d525e584f2
pwdLastSet: 0
objectSid: S-1-5-21-1608159440-4144762864-1017073214-27184
sAMAccountName: userxxxx
mail: xxxxx.xxxxx at xxxxx.xxxxx
userAccountControl: 514
virtualClearTextUTF8::
2018 Dec 07
2
[PATCH] v2v: -o rhv-upload: Fix emulated zero
Replace python 2 only "buffer" with "memoryview".
Falling back to emulated zero would fail with:
NameError: name 'buffer' is not defined
I did not test the changed code but it was not tested before so it is
unlikely to be worse.
Detected by pylint.
---
v2v/rhv-upload-plugin.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
2019 Oct 04
2
samba-tool user syncpasswords crashes with python3
Hi,
i sync the passwords from samba to other backends using "samba-tool
user syncpasswords"
On my operative system (samba 4.10 and python2) all works fine.
I upgraded my test-DC to samba 4.11 and python3 and now the samba-tool
user syncpasswords --daemon crashes.
Fri Oct 4 12:29:47 2019: pid[983]: Attached to
logfile[/usr/local/samba/var/log.syncpw]
Fri Oct 4 12:29:47 2019:
2018 Apr 06
6
[nbdkit PATCH 0/2] Python cleanups
I noticed these while working on adding fua support into python,
these are independent enough to push now (and I'll have to rebase
my 'optional may_trim' patch on top of this).
Eric Blake (2):
python: Use Py_XDEFREF()
python: Simplify calling into plugin
plugins/python/python.c | 106 ++++++++----------------------------------------
1 file changed, 18 insertions(+), 88
2019 Nov 23
1
[PATCH] python: Support buffer protocol for pread() result
pread() can return now any object supporting the buffer protocol[1] such
as bytearray, bytes, or memoryview.
[1] https://docs.python.org/3/c-api/buffer.html
---
When the new python tests will be in master we can add some automated tests.
For now I tested this manually using the example plugin as is and with
these changes:
def pread(h, count, offset):
global disk
return
2018 Dec 07
1
Re: [PATCH] v2v: -o rhv-upload: Fix emulated zero
On Fri, Dec 7, 2018 at 8:50 PM Richard W.M. Jones <rjones@redhat.com> wrote:
> On Fri, Dec 07, 2018 at 07:55:28PM +0200, Nir Soffer wrote:
> > Replace python 2 only "buffer" with "memoryview".
> >
> > Falling back to emulated zero would fail with:
> >
> > NameError: name 'buffer' is not defined
> >
> > I did not
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
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
2019 Nov 23
2
Re: [PATCH nbdkit v2 10/10] tests: Test the Python plugin thoroughly.
On Sat, Nov 23, 2019 at 3:10 PM Richard W.M. Jones <rjones@redhat.com> wrote:
>
> On Sat, Nov 23, 2019 at 01:42:15AM +0200, Nir Soffer wrote:
> > On Fri, Nov 22, 2019 at 9:55 PM Richard W.M. Jones <rjones@redhat.com> wrote:
> > > +def pread(h, count, offset, flags):
> > > + assert flags == 0
> > > + return
2019 Nov 22
18
[PATCH nbdkit v2 00/10] Implement nbdkit API v2 for Python plugins.
v1:
https://www.redhat.com/archives/libguestfs/2019-November/msg00153.html
v2:
- Fix implementation of can_cache.
- Add implementation of can_fua.
- Add a very thorough test suite which tests every command + flag
combination.
2019 Nov 21
10
[PATCH nbdkit 0/8] Implement nbdkit API v2 for Python plugins.
And fill out most of the missing bits of the API.
Rich.
2019 Nov 25
0
[PATCH nbdkit 1/2] python: For v2 API, avoid copy by passing a buffer to pread.
It's more efficient if we pass the C buffer directly to Python code.
In some cases the Python code will be able to write directly into the
C buffer using functions like file.readinto and socket.recv_into.
This avoids an extra copy.
Thanks: Nir Soffer
---
plugins/python/example.py | 8 ++++---
plugins/python/nbdkit-python-plugin.pod | 16 +++++--------
plugins/python/python.c
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 22
3
Re: [PATCH nbdkit v2 10/10] tests: Test the Python plugin thoroughly.
On Fri, Nov 22, 2019 at 9:55 PM Richard W.M. Jones <rjones@redhat.com> wrote:
>
> This tests the Python plugin thoroughly by issuing client commands
> through libnbd and checking we get the expected results.
> ---
> tests/Makefile.am | 13 +--
> tests/test-python-plugin.py | 134 ++++++++++++++++++++++++++++
> tests/test-python.py | 172
2009 May 10
2
In C, a fast way to slice a vector?
Hello,
Suppose in the following code,
PROTECT(sr = R_tryEval( .... ))
sr is a RAWSXP vector. I wish to return another RAWSXP starting at
position 13 onwards (base=0).
I could create another RAWSXP of the correct length and then memcpy
the required bytes and length to this new one.
However is there a more efficient method?
Regards
Saptarshi Guha
2018 Apr 11
10
[nbdkit PATCH v2 0/5] FUA support in Python scripts
First out of our four language bindings to add FUA support (for
reference, I added 'zero' support for python, perl, and ruby
back in 1.1.13, then Rich had to add it for ocaml in 1.1.20).
I tested this heavily under python 2, but for now only compile
tested under python 3; I plan to do further testing there and
make any tweaks if necessary.
I wrote patch 5 early on, but then realized I