]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Daemonize fuse thread in libvirt_lxc
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 7 Mar 2013 18:49:45 +0000 (18:49 +0000)
committerDoug Goldstein <cardoe@cardoe.com>
Thu, 14 Mar 2013 04:23:50 +0000 (23:23 -0500)
In some startup failure modes, the fuse thread may get itself
wedged. This will cause the entire libvirt_lxc process to
hang trying to the join the thread. There is no compelling
reason to wait for the thread to exit if the whole process
is exiting, so just daemonize the fuse thread instead.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
(cherry picked from commit e31f32c6a3e028af3b3db2fcbb755a908b4a4b43)

src/lxc/lxc_fuse.c

index b6808da86b2f416a4185280e53e57753021913e2..c4be58ebdd8a27b34bcbed944b6f61be0d90f199 100644 (file)
@@ -320,7 +320,7 @@ int lxcSetupFuse(virLXCFusePtr *f, virDomainDefPtr def)
         goto cleanup1;
     }
 
-    if (virThreadCreate(&fuse->thread, true, lxcFuseRun,
+    if (virThreadCreate(&fuse->thread, false, lxcFuseRun,
                         (void *)fuse) < 0) {
         lxcFuseDestroy(fuse);
         goto cleanup1;
@@ -351,8 +351,6 @@ void lxcFreeFuse(virLXCFusePtr *f)
             fuse_exit(fuse->fuse);
         virMutexUnlock(&fuse->lock);
 
-        virThreadJoin(&fuse->thread);
-
         VIR_FREE(fuse->mountpoint);
         VIR_FREE(*f);
     }