]> git.ipfire.org Git - thirdparty/libvirt.git/commit
ch: Make sure the cloud-hypervisor process is killed in virCHProcessStop()
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 9 Sep 2025 10:49:30 +0000 (12:49 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 10 Sep 2025 06:34:52 +0000 (08:34 +0200)
commitfc56f7279f20af3859414061af4e9cbada34b1f8
tree77aff5c479758abf15e15735b60ba17871bd3b80
parent5a89be06114299f6c31b29bba18f5bdd54dd7161
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 <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/ch/ch_process.c