]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
bhyve: clear monitor reference on close
authorRoman Bogorodskiy <bogorodskiy@gmail.com>
Sat, 11 Jul 2026 11:44:30 +0000 (13:44 +0200)
committerRoman Bogorodskiy <bogorodskiy@gmail.com>
Tue, 14 Jul 2026 17:47:46 +0000 (19:47 +0200)
Update virBhyveProcessStop() to set monitor to NULL after calling
bhyveMonitorClose().

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/bhyve/bhyve_process.c

index d501aa8bccd6d3b612e180e6462bbdaa125b33c3..636d74afccae1ac4d8c097ff8d66d99654233512 100644 (file)
@@ -673,7 +673,7 @@ virBhyveProcessStop(struct _bhyveConn *driver,
     /* Destroy monitor before running the actual destroy command to prevent
      * it from detecting VM shutdown and entering this cleanup routine again */
     if ((priv != NULL) && (priv->mon != NULL))
-         bhyveMonitorClose(priv->mon);
+         g_clear_pointer(&priv->mon, bhyveMonitorClose);
 
     cmd = virBhyveProcessBuildDestroyCmd(driver, vm->def);
     if (virCommandRun(cmd, NULL) < 0) {