]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
bhyve: error handling for monitor opening
authorRoman Bogorodskiy <bogorodskiy@gmail.com>
Sat, 11 Jul 2026 11:30:00 +0000 (13:30 +0200)
committerRoman Bogorodskiy <bogorodskiy@gmail.com>
Tue, 14 Jul 2026 17:47:31 +0000 (19:47 +0200)
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>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/bhyve/bhyve_process.c

index 2221d8700a20715e3fdd69fd484ad67940296de4..4d93ba8fac6b7bcc22f72e0d0ce0f87878c8a748 100644 (file)
@@ -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;