]> xenbits.xensource.com Git - libvirt.git/commit
qemu: avoid double shutdown
authorEric Blake <eblake@redhat.com>
Wed, 2 Feb 2011 18:16:41 +0000 (11:16 -0700)
committerEric Blake <eblake@redhat.com>
Thu, 3 Feb 2011 16:00:35 +0000 (09:00 -0700)
commit9962e406c664ed5521f5aca500c860a331cb3979
tree9b62cb4aafedf60cb543c784adddb5982040f86b
parentde53effecc68ebbd13b1d8e9ce6b2651b3c5dd86
qemu: avoid double shutdown

* src/qemu/qemu_driver.c (qemudShutdownVMDaemon): Check that vm is
still active.
Reported by Wen Congyang as follows:

Steps to reproduce this bug:

1. use gdb to debug libvirtd, and set breakpoint in the function
   qemuConnectMonitor()
2. start a vm, and the libvirtd will be stopped in qemuConnectMonitor()
3. kill -STOP $(cat /var/run/libvirt/qemu/<domain>.pid)
4. continue to run libvirtd in gdb, and libvirtd will be blocked in the
   function qemuMonitorSetCapabilities()
5. kill -9 $(cat /var/run/libvirt/qemu/<domain>.pid)

Here is log of the qemu:
=========
LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin ...
char device redirected to /dev/pts/3
2011-01-27 09:38:48.101: shutting down
2011-01-27 09:41:26.401: shutting down
=========

The vm is shut down twice. I do not know whether this behavior has
side effect, but I think we should shutdown the vm only once.
src/qemu/qemu_driver.c