[libvirt] PATCH: Fix cleanup of transient VMs

Daniel P. Berrange berrange at redhat.com
Fri Jul 31 14:55:12 UTC 2009


If a transient VM quit unexpectedly it would never be cleaned up, resulting
in a guest that's impossible to remove

Daniel

commit 7781032c3d870f5c9dacfc02baecc151689d9c57
Author: Daniel P. Berrange <berrange at redhat.com>
Date:   Fri Jul 31 14:38:46 2009 +0100

    Fix removal of transient VMs when LXC aborts
    
    * src/lxc_driver.c: Remove transient VM after monitor triggered
      shutdown

diff --git a/src/lxc_driver.c b/src/lxc_driver.c
index f37fc5d..d62c2d7 100644
--- a/src/lxc_driver.c
+++ b/src/lxc_driver.c
@@ -774,6 +774,10 @@ static void lxcMonitorEvent(int watch,
                                          VIR_DOMAIN_EVENT_STOPPED,
                                          VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN);
     }
+    if (!vm->persistent) {
+        virDomainRemoveInactive(&driver->domains, vm);
+        vm = NULL;
+    }
 
 cleanup:
     if (vm)


-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




More information about the libvir-list mailing list