Hi Richard and Lersek,
Thanks for your help on this issue and thanks for picking up my patch
and applying it upstream!
On Tue. 20 June 2023 à 17:10, Richard W.M. Jones wrote:
> I think you've solved the problem now, but for future reference you
> can run:
>
> $ virt-rescue
Perfect! This last
It's useful to have a message which is printed as the top level
statements in the plugin module are being initialized, for debugging
purposes.
---
tests/test_ocaml_plugin.ml | 5 +
1 file changed, 5 insertions(+)
diff --git a/tests/test_ocaml_plugin.ml b/tests/test_ocaml_plugin.ml
index 561a8
Replace:
caml_leave_blocking_section
...
caml_enter_blocking_section
with the more sensibly named (and equivalent):
caml_acquire_runtime_system
...
caml_release_runtime_system
In addition we must release the runtime system just after caml_startup
and only acquire it around callbacks
In OCaml 5.0 you will see this warning:
Alert ocaml_deprecated_auto_include:
OCaml's lib directory layout changed in 5.0. The unix subdirectory has been
automatically added to the search path, but you should add -I +unix to the
command-line to silence this alert (e.g. by adding unix to the
OCaml 5 is strict about registering threads before calling OCaml heap
functions, and will abort the program with this error if you don't do
this correctly:
Fatal error: no domain lock held
Fix this as explained in the comment.
Note (as it's not explained well in the documentation): Threads
cre
(Not for review, I've already pushed this upstream as
commits 35db543e3..9d4b87e03)
This series fixes nbdkit for OCaml 5 (thanks Jerry James for providing
the Fedora packages necessary), and I tested it and it compiles and
tests fine at least as far back as OCaml 4.05.
It was quite complicated an
If the OCaml code did not provide a close method, we would never call
close_wrapper, and then we ended up leaking the global root and handle.
---
plugins/ocaml/plugin.c | 18 ++
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/plugins/ocaml/plugin.c b/plugins/ocaml/pl
---
configure.ac | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index c1d83a568..39b58b44e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -935,8 +935,8 @@ AC_SUBST([PYTHON_LDFLAGS])
dnl For the OCaml plugin, you can set OCAMLOPTFLAGS before
OCaml 5 is stricter than earlier versions about correct locking.
We must release the OCaml runtime lock when calling nbd_close since it
may do some long-running operations and we want to allow concurrent
threads to run.
However specifically if there are callbacks (eg. a debug callback)
then we wo