]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
Fix now dead cleanup of VMs on libvirtd restart
authorDaniel P. Berrange <berrange@redhat.com>
Fri, 15 Jul 2011 14:33:15 +0000 (15:33 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 18 Jul 2011 15:13:56 +0000 (16:13 +0100)
commit80cafba31012932e9fe3817d3fd40fa9333c3f6c
tree77705352ca899539dcfaa2bdac45cd5a19238dcd
parent2c32898c3992625a4b5c9625df0113f20422ee53
Fix now dead cleanup of VMs on libvirtd restart

When libvirtd restarts it will attempt to reconnect to existing
LXC containers. If it loads a XML state file for the container
the container will appear running. If we fail to read the PID
file, or fail to connect to the LXC monitor, we should be killing
off the guest, but if the VMs cgroup does not exist any more,
cleanup will get skipped. Reading the PID file is also pointless
since the PID is in the XML statefile

In lxcReconnectVM we do not need to read the PID file. If part
of the reconnect process fails we need to run the VM terminate
code as a safety net.

In lxcVMTerminate, if we can't obtain the VM cgroup, we know
the process has died, but we must still run lxcVMCleanup to
clear out the virDomainObjPtr live state

* src/lxc/lxc_driver.c: Fix cleanup of dead VMs on restart
src/lxc/lxc_driver.c