[PATCH 1/3] bhyve: error handling for monitor opening

Roman Bogorodskiy posted 3 patches 2 months ago
[PATCH 1/3] bhyve: error handling for monitor opening
Posted by Roman Bogorodskiy 2 months ago
The virBhyveProcessStartImpl() function which implements domain start
does not check if bhyve monitor open is successful. Check that and
jump to the cleanup routines if it was not.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
---
 src/bhyve/bhyve_process.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/bhyve/bhyve_process.c b/src/bhyve/bhyve_process.c
index 2221d8700a..4d93ba8fac 100644
--- a/src/bhyve/bhyve_process.c
+++ b/src/bhyve/bhyve_process.c
@@ -411,7 +411,8 @@ virBhyveProcessStartImpl(struct _bhyveConn *driver,
 
     vm->def->id = vm->pid;
     virDomainObjSetState(vm, VIR_DOMAIN_RUNNING, reason);
-    priv->mon = bhyveMonitorOpen(vm, driver);
+    if ((priv->mon = bhyveMonitorOpen(vm, driver)) == NULL)
+        goto cleanup;
 
     if (virBhyveDomainObjStartWorker(vm) < 0)
         goto cleanup;
-- 
2.52.0
Re: [PATCH 1/3] bhyve: error handling for monitor opening
Posted by Peter Krempa via Devel 2 months ago
On Sun, Jul 12, 2026 at 09:32:29 +0200, Roman Bogorodskiy wrote:
> The virBhyveProcessStartImpl() function which implements domain start
> does not check if bhyve monitor open is successful. Check that and
> jump to the cleanup routines if it was not.
> 
> Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
> ---
>  src/bhyve/bhyve_process.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Reviewed-by: Peter Krempa <pkrempa@redhat.com>