]> xenbits.xensource.com Git - libvirt.git/commit
Fix cleanup on VM state after failed QEMU startup
authorDaniel P. Berrange <berrange@redhat.com>
Mon, 14 Feb 2011 09:35:47 +0000 (09:35 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 14 Feb 2011 16:02:00 +0000 (16:02 +0000)
commit41f551e25eaaf6a978ffcf4edd1e441a4fb96cd9
tree628dd44fd46e192ac22c4bc5d16baf54a970dd7d
parent3ed18372a3531f7cd2ccb5a55f48744f8ace4916
Fix cleanup on VM state after failed QEMU startup

Commit 9962e406c664ed5521f5aca500c860a331cb3979 introduced a
problem where if the VM failed to startup, it would not be
correctly cleaned up. Amongst other things the SELinux
security label would not be removed, which prevents the VM
from ever starting again.

The virDomainIsActive() check at the start of qemudShutdownVMDaemon
checks for vm->def->id not being -1. By moving the assignment of the
VM id to the start of qemudStartVMDaemon, we can ensure cleanup will
occur on failure

* src/qemu/qemu_driver.c: Move initialization of 'vm->def->id'
  so that qemudShutdownVMDaemon() will process the shutdown
src/qemu/qemu_driver.c