]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: increase the timeout before sending SIGKILL to qemu process
authorLaine Stump <laine@laine.org>
Thu, 2 Feb 2012 17:09:44 +0000 (12:09 -0500)
committerLaine Stump <laine@laine.org>
Wed, 15 Feb 2012 18:57:15 +0000 (13:57 -0500)
commitf367cd13885a529233f069a7213c263c073264ac
treeb0e0a6fa960e0ef6f51e6f61ced655d379388c72
parent595e26c086f260c888de68761873ce1856090c45
qemu: increase the timeout before sending SIGKILL to qemu process

The current default method of terminating the qemu process is to send
a SIGTERM, wait for up to 1.6 seconds for it to cleanly shutdown, then
send a SIGKILL and wait for up to 1.4 seconds more for the process to
terminate. This is problematic because occasionally 1.6 seconds is not
long enough for the qemu process to flush its disk buffers, so the
guest's disk ends up in an inconsistent state.

Since this only occasionally happens when the timeout prior to SIGKILL
is 1.6 seconds, this patch increases that timeout to 10 seconds. At
the very least, this should reduce the occurrence from "occasionally"
to "extremely rarely". (Once SIGKILL is sent, it waits another 5
seconds for the process to die before returning).

Note that in the cases where it takes less than this for qemu to
shutdown cleanly, libvirt will *not* wait for any longer than it would
without this patch - qemuProcessKill polls the process and returns as
soon as it is gone.
src/qemu/qemu_process.c