From: Michal Privoznik Date: Tue, 9 Sep 2025 10:49:30 +0000 (+0200) Subject: ch: Make sure the cloud-hypervisor process is killed in virCHProcessStop() X-Git-Tag: v11.8.0-rc1~57 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fc56f7279f20af3859414061af4e9cbada34b1f8;p=thirdparty%2Flibvirt.git ch: Make sure the cloud-hypervisor process is killed in virCHProcessStop() 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 --- 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); }