2024-09-30 15:51:59 +00:00
|
|
|
From 166e4e90eef0d4c81a92940e5d61450d70f00662 Mon Sep 17 00:00:00 2001
|
2024-03-28 10:46:39 +00:00
|
|
|
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) {
|