]> xenbits.xensource.com Git - libvirt.git/commitdiff
lxc: Do not try to reconnect inactive domain when do lxcStartup
authorOsier Yang <jyang@redhat.com>
Tue, 3 May 2011 06:48:03 +0000 (14:48 +0800)
committerOsier Yang <jyang@redhat.com>
Tue, 3 May 2011 06:48:03 +0000 (14:48 +0800)
Otherwise if there are inactive lxc domains, lxcStartup will
try to reconnect to sockets of these domains, which results in
errors in libvirtd log.

src/lxc/lxc_driver.c

index e90530284c41b2da6a656321b940cd0ba9aa0031..ef7827b492b98729a6cacb48b071c50d4909b2fc 100644 (file)
@@ -1992,6 +1992,9 @@ lxcReconnectVM(void *payload, const void *name ATTRIBUTE_UNUSED, void *opaque)
 
     virDomainObjLock(vm);
 
+    if (!virDomainObjIsActive(vm))
+        goto cleanup;
+
     priv = vm->privateData;
     if ((priv->monitor = lxcMonitorClient(driver, vm)) < 0) {
         goto cleanup;