From fc56f7279f20af3859414061af4e9cbada34b1f8 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Tue, 9 Sep 2025 12:49:30 +0200 Subject: [PATCH] ch: Make sure the cloud-hypervisor process is killed in virCHProcessStop() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Currently, virCHProcessStop() is called either when the cloud-hypervisor process dies gracefully (e.g. on shutdown initiated from within the guest) or when virDomainDestroy() is called (or on failed start attempt, but that's not important right now). At any rate, if the cloud-hypervisor process is running it's not a child process of libvirtd rather than the init (per virCommandDaemonize() called inside of virCHMonitorNew()). This distinction is important because virCHProcessStop() then calls virProcessAbort() thinking it'll kill the process. Well, virProcessAbort() works only on child processes. Switch to virProcessKillPainfully() which does work in such cases. Signed-off-by: Michal Privoznik Reviewed-by: Ján Tomko --- src/ch/ch_process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ch/ch_process.c b/src/ch/ch_process.c index 5195d3f5da..6b779285e1 100644 --- a/src/ch/ch_process.c +++ b/src/ch/ch_process.c @@ -1028,7 +1028,7 @@ virCHProcessStop(virCHDriver *driver, virErrorPreserveLast(&orig_err); if (priv->monitor) { - virProcessAbort(vm->pid); + virProcessKillPainfully(vm->pid, true); g_clear_pointer(&priv->monitor, virCHMonitorClose); } -- 2.47.3