]> git.ipfire.org Git - thirdparty/libvirt.git/commit
fix a deadlock when qemu cannot start
authorWen Congyang <wency@cn.fujitsu.com>
Fri, 30 Mar 2012 06:21:49 +0000 (14:21 +0800)
committerDaniel Veillard <veillard@redhat.com>
Fri, 30 Mar 2012 06:21:49 +0000 (14:21 +0800)
commitff68d6eeb5bca38050f4fc53108237b738b906fa
treefade016ae2f67eebbf3084a5b0f548b7a5b71d7a
parente8aa5a16c9a9827a2ba395088f76124a0a62d3ea
fix a deadlock when qemu cannot start

When qemu cannot start, we may call qemuProcessStop() twice.
We have check whether the vm is running at the beginning of
qemuProcessStop() to avoid libvirt deadlock. We call
qemuProcessStop() with driver and vm locked. It seems that
we can avoid libvirt deadlock. But unfortunately we may
unlock driver and vm in the function qemuProcessKill() while
vm->def->id is not -1. So qemuProcessStop() will be run twice,
and monitor will be freed unexpectedly. So we should set
vm->def->id to -1 at the beginning of qemuProcessStop().
src/qemu/qemu_process.c
src/qemu/qemu_process.h