From 37fb778e5338b6700d8b3165adb35e2a4c8fc083 Mon Sep 17 00:00:00 2001 From: Roman Bogorodskiy Date: Sun, 20 Jul 2025 15:55:07 +0200 Subject: [PATCH] bhyve: don't reset domain autostart flag on destroy Currently, virBhyveProcessStop() uses the virDomainDeleteConfig() helper to clean up domain status. It passes BHYVE_STATE_DIR as a configuration dir and NULL as autostart dir, so the helper does its job, even though it has a different purpose. However, the issue is that it also resets the autostart (and autostartOnce) property. This results in a situation that when a persistent domain with autostart enabled gets destroyed, its autostart state is reported as disabled, which is not correct. To fix that, implement the bhyveProcessRemoveDomainStatus() which removes the status file without side effects on the virDomainObj object. Signed-off-by: Roman Bogorodskiy Reviewed-by: Michal Privoznik def->name); - virDomainDeleteConfig(BHYVE_STATE_DIR, NULL, vm); + bhyveProcessRemoveDomainStatus(BHYVE_STATE_DIR, vm->def->name); return ret; } -- 2.47.2