libguestfs/0017-ocaml-Release-runtime-lock-around-guestfs_close.patch
Richard W.M. Jones d9b4d60317 Remove bundled ocaml-augeas
resolves: RHEL-32142
2024-06-20 12:52:43 +01:00

29 lines
976 B
Diff

From 73045a40a9bc3b556eb3893872b4c39ec3161f99 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 27 Jun 2023 11:36:55 +0100
Subject: [PATCH] ocaml: Release runtime lock around guestfs_close
When finalizing the handle we call guestfs_close. This function could
be long-running (eg. it may have to shut down the qemu subprocess), so
release the runtime lock.
(cherry picked from commit 4a79c023e57e07844c2ac3259aaf9b885e402fdf)
---
ocaml/guestfs-c.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/ocaml/guestfs-c.c b/ocaml/guestfs-c.c
index 8c8aa460..a1865a72 100644
--- a/ocaml/guestfs-c.c
+++ b/ocaml/guestfs-c.c
@@ -77,7 +77,9 @@ guestfs_finalize (value gv)
* above, which is why we don't want to delete them before
* closing the handle.
*/
+ caml_release_runtime_system ();
guestfs_close (g);
+ caml_acquire_runtime_system ();
/* Now unregister the global roots. */
if (roots && len > 0) {