The python docs are clear that in a multi-threaded app, we CANNOT call
any python functions from C code (other than a short-list of
exceptions) without first owning the GIL in the calling thread.
Although many users of nbdsh are single-threaded (where the GIL does
not matter), it is indeed possible
On Thu, Jun 09, 2022 at 03:58:45PM -0500, Eric Blake wrote:
> On Thu, Jun 09, 2022 at 11:03:02AM -0500, Eric Blake wrote:
> > On Thu, Jun 09, 2022 at 03:22:42PM +0100, Richard W.M. Jones wrote:
> > > On Thu, Jun 09, 2022 at 08:34:43AM -0500, Eric Blake wrote:
> > > > Instead of open-coding our code
On Thu, Jun 09, 2022 at 11:03:02AM -0500, Eric Blake wrote:
> On Thu, Jun 09, 2022 at 03:22:42PM +0100, Richard W.M. Jones wrote:
> > On Thu, Jun 09, 2022 at 08:34:43AM -0500, Eric Blake wrote:
> > > Instead of open-coding our code to create a PyObject wrapper of the
> > > mutable *error to be pass
On Thu, Jun 09, 2022 at 09:23:50PM +0300, Nir Soffer wrote:
> On Thu, Jun 9, 2022 at 6:24 PM Richard W.M. Jones wrote:
> > $ emacs -nw run.in# comment out GODEBUG line
...
> > $ make -C golang check
> > ...
> > PASS: run-tests.sh
>
> So when skipping libnbd_020_aio_buffer_test.go we don't get
On Thu, Jun 09, 2022 at 05:33:03PM +0100, Richard W.M. Jones wrote:
> On Thu, Jun 09, 2022 at 07:22:45PM +0300, Nir Soffer wrote:
> > On Thu, Jun 9, 2022 at 6:48 PM Richard W.M. Jones wrote:
> > > NB: this _does not_ address the other problem where GODEBUG=cgocheck=2
> > > complains about "fatal e
On Thu, Jun 9, 2022 at 6:24 PM Richard W.M. Jones wrote:
>
> On Thu, Jun 09, 2022 at 03:20:02PM +0100, Daniel P. Berrangé wrote:
> > > + go test -count=1 -v
> > > === RUN Test010Load
> > > --- PASS: Test010Load (0.00s)
> > > === RUN TestAioBuffer
> > > --- PASS: TestAioBuffer (0.00s)
> > > ===
On Thu, Jun 09, 2022 at 08:10:53PM +0300, Nir Soffer wrote:
> Previously we depended on the behavior on common platforms to panic when
> trying to use a nil pointer, but Richard reported that it segfault on
> RISC-V. Avoid the undocumented assumptions and panic explicitly with a
> useful panic mess
Previously we depended on the behavior on common platforms to panic when
trying to use a nil pointer, but Richard reported that it segfault on
RISC-V. Avoid the undocumented assumptions and panic explicitly with a
useful panic message.
Signed-off-by: Nir Soffer
---
golang/aio_buffer.go | 9 +
On Thu, Jun 09, 2022 at 11:24:48AM -0500, Eric Blake wrote:
> On Thu, Jun 09, 2022 at 03:27:36PM +0100, Richard W.M. Jones wrote:
>
> > > Post-patch:
> > > nbd> b = nbd.Buffer(10)
> > > nbd> c = h.aio_pread(b, 0)
> > > nbd> b._o.pop()
> > > Traceback (most recent call last):
> > > File "/usr/lib
On Thu, Jun 09, 2022 at 07:22:45PM +0300, Nir Soffer wrote:
> On Thu, Jun 9, 2022 at 6:48 PM Richard W.M. Jones wrote:
> > NB: this _does not_ address the other problem where GODEBUG=cgocheck=2
> > complains about "fatal error: Go pointer stored into non-Go memory".
>
> Do we keep go pointers in
On Thu, Jun 09, 2022 at 05:00:46PM +0100, Daniel P. Berrangé wrote:
> Well it isn't use-after-free, because we've cleared the
> pointer we freed.
Yes, indeed that's what I meant to say!
> > It seems a bit of an odd function however. Wouldn't it be better to
> > changes the Bytes function so that
On Thu, Jun 09, 2022 at 03:31:02PM +0100, Richard W.M. Jones wrote:
> On Thu, Jun 09, 2022 at 08:34:45AM -0500, Eric Blake wrote:
> > After the work in the previous patches, it is now a trivial feature
> > addition to support any buffer-like object as the argument to
> > h.aio_{pread,pwrite}, and m
On Thu, Jun 09, 2022 at 03:27:36PM +0100, Richard W.M. Jones wrote:
> > Post-patch:
> > nbd> b = nbd.Buffer(10)
> > nbd> c = h.aio_pread(b, 0)
> > nbd> b._o.pop()
> > Traceback (most recent call last):
> > File "/usr/lib64/python3.10/code.py", line 90, in runcode
> > exec(code, self.locals)
On Thu, Jun 9, 2022 at 6:48 PM Richard W.M. Jones wrote:
>
> On Thu, Jun 09, 2022 at 04:24:12PM +0100, Richard W.M. Jones wrote:
> > On Thu, Jun 09, 2022 at 03:20:02PM +0100, Daniel P. Berrangé wrote:
> > > > + go test -count=1 -v
> > > > === RUN Test010Load
> > > > --- PASS: Test010Load (0.00s)
On Thu, Jun 09, 2022 at 03:22:42PM +0100, Richard W.M. Jones wrote:
> On Thu, Jun 09, 2022 at 08:34:43AM -0500, Eric Blake wrote:
> > Instead of open-coding our code to create a PyObject wrapper of the
> > mutable *error to be passed to each callback, extract this into a
> > helper function. We ca
On Thu, Jun 09, 2022 at 04:48:34PM +0100, Richard W.M. Jones wrote:
> On Thu, Jun 09, 2022 at 04:24:12PM +0100, Richard W.M. Jones wrote:
> > On Thu, Jun 09, 2022 at 03:20:02PM +0100, Daniel P. Berrangé wrote:
> > > > + go test -count=1 -v
> > > > === RUN Test010Load
> > > > --- PASS: Test010Load
On Thu, Jun 09, 2022 at 04:24:12PM +0100, Richard W.M. Jones wrote:
> On Thu, Jun 09, 2022 at 03:20:02PM +0100, Daniel P. Berrangé wrote:
> > > + go test -count=1 -v
> > > === RUN Test010Load
> > > --- PASS: Test010Load (0.00s)
> > > === RUN TestAioBuffer
> > > --- PASS: TestAioBuffer (0.00s)
>
On Thu, Jun 09, 2022 at 03:20:02PM +0100, Daniel P. Berrangé wrote:
> > + go test -count=1 -v
> > === RUN Test010Load
> > --- PASS: Test010Load (0.00s)
> > === RUN TestAioBuffer
> > --- PASS: TestAioBuffer (0.00s)
> > === RUN TestAioBufferFree
> > --- PASS: TestAioBufferFree (0.00s)
> > === R
On Thu, Jun 09, 2022 at 08:34:47AM -0500, Eric Blake wrote:
> The Py_BuildValue "y#" format copies data; this is because Python
> assumes our C memory can go out of scope, while the user's python
> callback can stash off whatever bytearray object it got. But this
> copying is inefficient. Now tha
On Thu, Jun 09, 2022 at 08:34:46AM -0500, Eric Blake wrote:
> b.size() is atypical, Python programmers generally expect to be able
> to do len(b). Keep the old spelling for backwards compatibility.
> ---
> generator/Python.ml | 4
> python/t/580-aio-is-zero.py | 2 ++
> 2 files chang
On Thu, Jun 09, 2022 at 08:34:45AM -0500, Eric Blake wrote:
> After the work in the previous patches, it is now a trivial feature
> addition to support any buffer-like object as the argument to
> h.aio_{pread,pwrite}, and matching how h.pwrite already did that. For
> example, you can do h.aio_pwri
On Thu, Jun 09, 2022 at 08:34:44AM -0500, Eric Blake wrote:
> As long as we were wrapping a C buffer and not leaking any Python
> objects, we had to lock the nbd.Buffer object, to ensure that the
> PyCapsule was not released prematurely, as there was nothing else to
> hold on to. But now that the
On Tue, May 31, 2022 at 07:24:03PM -0500, Eric Blake wrote:
> On Wed, Jun 01, 2022 at 02:20:48AM +0300, Nir Soffer wrote:
> > On Tue, May 31, 2022 at 6:52 PM Eric Blake wrote:
> > >
> > > On Tue, May 31, 2022 at 10:49:03AM -0500, Eric Blake wrote:
> > > > This patch fixes the corner-case regressio
On Thu, Jun 09, 2022 at 08:34:43AM -0500, Eric Blake wrote:
> Instead of open-coding our code to create a PyObject wrapper of the
> mutable *error to be passed to each callback, extract this into a
> helper function. We can then slightly optimize things to hang on to a
> single pointer to the ctyp
On Thu, Jun 09, 2022 at 03:08:51PM +0100, Richard W.M. Jones wrote:
> On Thu, Jun 09, 2022 at 02:14:07PM +0100, Daniel P. Berrangé wrote:
> > If you can get the test to core dump, then plain old GDB core
> > dump could also be useful - might identify which specific API
> > is being called, which ca
On Thu, Jun 09, 2022 at 03:53:39PM +0200, Laszlo Ersek wrote:
> On 06/09/22 15:10, Laszlo Ersek wrote:
>
> > nm-online -x -q ||
> > (
> > systemctl -q is-active systemd-networkd &&
> > /usr/lib/systemd/systemd-networkd-wait-online -q --timeout=30
> > )
> >
> > If the final exit status is nonz
On Thu, Jun 09, 2022 at 02:14:07PM +0100, Daniel P. Berrangé wrote:
> Setting GODEBUG=cgocheck=1 or GODEBUG=cgocheck=2 can sometimes
> get more info.
Took me a while to work out that we are actually setting that already
(in ./run) which explains a couple of things: why I couldn't reproduce
the
On 06/09/22 15:10, Laszlo Ersek wrote:
> nm-online -x -q ||
> (
> systemctl -q is-active systemd-networkd &&
> /usr/lib/systemd/systemd-networkd-wait-online -q --timeout=30
> )
>
> If the final exit status is nonzero, I think that's not a problem for
> the firstboot script.
>
> The whole com
Less copying is always better. But I was quite surprised by some of
my test cases in trying to prove that I had speedups; there's a huge
difference between:
for i in range(size // m):
buf = h.pread_structured(m, m*i, f)
and
for i in range(size // m):
buf = h.pread_structured(m, m*i, f)
bu
Instead of open-coding our code to create a PyObject wrapper of the
mutable *error to be passed to each callback, extract this into a
helper function. We can then slightly optimize things to hang on to a
single pointer to the ctypes module, rather than looking it up on
every callback. The generat
The Py_BuildValue "y#" format copies data; this is because Python
assumes our C memory can go out of scope, while the user's python
callback can stash off whatever bytearray object it got. But this
copying is inefficient. Now that we already have a Python buffer-like
object in scope for the durat
b.size() is atypical, Python programmers generally expect to be able
to do len(b). Keep the old spelling for backwards compatibility.
---
generator/Python.ml | 4
python/t/580-aio-is-zero.py | 2 ++
2 files changed, 6 insertions(+)
diff --git a/generator/Python.ml b/generator/Python
After the work in the previous patches, it is now a trivial feature
addition to support any buffer-like object as the argument to
h.aio_{pread,pwrite}, and matching how h.pwrite already did that. For
example, you can do h.aio_pwrite(b'123', 0), instead of having to copy
into nbd.Buffer first. Mor
As long as we were wrapping a C buffer and not leaking any Python
objects, we had to lock the nbd.Buffer object, to ensure that the
PyCapsule was not released prematurely, as there was nothing else to
hold on to. But now that the previous commit (4f15d0e9) swapped to
wrapping a Python bytearray ob
On Thu, Jun 09, 2022 at 02:03:04PM +0100, Richard W.M. Jones wrote:
> make[2]: Entering directory '/home/rjones/d/libnbd/golang'
> perl /home/rjones/d/libnbd/podwrapper.pl --section=3 --man libnbd-golang.3 \
> --html ../html/libnbd-golang.3.html \
> libnbd-golang.pod
> /home/rjones/d/libnbd
On 06/07/22 14:59, Richard W.M. Jones wrote:
> virt-p2v uses:
>
> nm-online -t 30
>
> Apparently systemd-networkd (which I've never knowingly used) has
> another command:
>
> /usr/lib/systemd/systemd-networkd-wait-online
>
> which ought to do the same thing. (It defaults to 120 second tim
make[2]: Entering directory '/home/rjones/d/libnbd/golang'
perl /home/rjones/d/libnbd/podwrapper.pl --section=3 --man libnbd-golang.3 \
--html ../html/libnbd-golang.3.html \
libnbd-golang.pod
/home/rjones/d/libnbd/run go build
write of Go pointer 0x3fa8028000 to non-Go memory 0x3fd2c0fb20
f
On 06/07/22 15:09, Richard W.M. Jones wrote:
> This patch and the companion patch to libguestfs-common:
>
> Reviewed-by: Richard W.M. Jones
Commit 7eb1ecf467e8 (with the submodule checkout hash refreshed to
9e990f3e4530).
Thanks!
Laszlo
___
Libguestfs
On 06/06/22 16:20, Laszlo Ersek wrote:
> Factor the following internal functions from "guestfs-tools/customize" at
> commit 40b28512f700 ("Version 1.49.2.", 2022-05-26):
>
> - guest_install_command
> - guest_update_command
> - guest_uninstall_command
>
> into a new interface in "libguestfs-common
On Thu, Jun 09, 2022 at 11:58:32AM +0200, Laszlo Ersek wrote:
> On 06/09/22 10:46, Richard W.M. Jones wrote:
> > On Thu, Jun 09, 2022 at 10:25:08AM +0200, Laszlo Ersek wrote:
> >> On 06/09/22 10:11, Richard W.M. Jones wrote:
> >>> On Thu, Jun 09, 2022 at 10:02:54AM +0200, Laszlo Ersek wrote:
>
On 06/09/22 10:46, Richard W.M. Jones wrote:
> On Thu, Jun 09, 2022 at 10:25:08AM +0200, Laszlo Ersek wrote:
>> On 06/09/22 10:11, Richard W.M. Jones wrote:
>>> On Thu, Jun 09, 2022 at 10:02:54AM +0200, Laszlo Ersek wrote:
On 06/08/22 18:48, Richard W.M. Jones wrote:
> When we split virt-v
On Thu, Jun 09, 2022 at 10:25:08AM +0200, Laszlo Ersek wrote:
> On 06/09/22 10:11, Richard W.M. Jones wrote:
> > On Thu, Jun 09, 2022 at 10:02:54AM +0200, Laszlo Ersek wrote:
> >> On 06/08/22 18:48, Richard W.M. Jones wrote:
> >>> When we split virt-v2v from libguestfs many moons ago, I copied the
On Thu, Jun 09, 2022 at 10:20:47AM +0200, Laszlo Ersek wrote:
> On 06/08/22 18:49, Richard W.M. Jones wrote:
> > As well as testing a full Fedora conversion which was not really
> > tested properly before, this also adds tests of conversions of Btrfs,
> > RAID and LUKS guests.
> > ---
> > tests/Ma
On 06/09/22 10:11, Richard W.M. Jones wrote:
> On Thu, Jun 09, 2022 at 10:02:54AM +0200, Laszlo Ersek wrote:
>> On 06/08/22 18:48, Richard W.M. Jones wrote:
>>> When we split virt-v2v from libguestfs many moons ago, I copied the
>>> test-data/ subdirectory over. I didn't modify it much, and it
>>>
On 06/08/22 18:49, Richard W.M. Jones wrote:
> As well as testing a full Fedora conversion which was not really
> tested properly before, this also adds tests of conversions of Btrfs,
> RAID and LUKS guests.
> ---
> tests/Makefile.am | 8 ++
> tests/test-v2v-fedora-btr
On Thu, Jun 09, 2022 at 10:13:52AM +0200, Laszlo Ersek wrote:
> Looks OK to me, I just suggest using a different function name rather
> than "basename". While the C code is certainly OK, conceptually we
> already have two standard basename() functions, a POSIX compatible one
> from , and a glibc (_
On 06/08/22 18:49, Richard W.M. Jones wrote:
> We didn't use the phony Fedora guest before with virt-v2v (only the
> phony Windows image). This commit makes miscellaneous changes so that
> it can be used for testing:
>
> - Add dummy rpm and dracut commands.
>
> - Add dummy kernel, initramfs an
On Thu, Jun 09, 2022 at 10:02:54AM +0200, Laszlo Ersek wrote:
> On 06/08/22 18:48, Richard W.M. Jones wrote:
> > When we split virt-v2v from libguestfs many moons ago, I copied the
> > test-data/ subdirectory over. I didn't modify it much, and it
> > contains much test data that is irrelevant to v
On Wed, Jun 08, 2022 at 05:49:01PM +0100, Richard W.M. Jones wrote:
> +# Virt-v2v also needs a kernel, initrd and modules path.
> +$g->touch ("/boot/vmlinuz-$kver");
> +$g->touch ("/boot/initramfs-$kver.img");
> +$g->mkdir_p ("/lib/modules/$kver/kernel/drivers/block");
> +$g->upload ($ENV{SRCDIR}.'
On 06/08/22 18:49, Richard W.M. Jones wrote:
> Avoid this error in virt-v2v when trying to convert the phony Fedora
> guest image:
>
> [ 8.1] Checking for sufficient free disk space in the guest
> virt-v2v: error: not enough free space for conversion on filesystem
> ‘/’. 21.6 MB free < 100 MB n
On 06/08/22 18:48, Richard W.M. Jones wrote:
> When we split virt-v2v from libguestfs many moons ago, I copied the
> test-data/ subdirectory over. I didn't modify it much, and it
> contains much test data that is irrelevant to virt-v2v. (This change
> does _not_ clean up any of that ...) However
51 matches
Mail list logo