[jhbuild] Add upstream libvirt patch



commit 1b5ed124d371bc27135ceb3c07fc81bcd64a57a4
Author: Christophe Fergeau <cfergeau redhat com>
Date:   Fri Jul 13 11:15:23 2012 +0200

    Add upstream libvirt patch
    
    This fixes user libvirtd autospawn which is needed for boxes
    to work properly

 modulesets/gnome-apps-3.6.modules              |    4 ++-
 patches/libvirt-0.9.13-daemon-auto-spawn.patch |   46 ++++++++++++++++++++++++
 2 files changed, 49 insertions(+), 1 deletions(-)
---
diff --git a/modulesets/gnome-apps-3.6.modules b/modulesets/gnome-apps-3.6.modules
index 09a197b..1197830 100644
--- a/modulesets/gnome-apps-3.6.modules
+++ b/modulesets/gnome-apps-3.6.modules
@@ -86,7 +86,9 @@
             module="libvirt-0.9.13.tar.gz"
             version="0.9.13"
             hash="sha256:d124e9915c88c195da9c008a6d855e53e555dca5816052e163dda61388359d5b"
-            size="20276757"/>
+            size="20276757">
+      <patch file="libvirt-0.9.13-daemon-auto-spawn.patch" strip="1"/>
+    </branch>
     <dependencies>
     </dependencies>
   </autotools>
diff --git a/patches/libvirt-0.9.13-daemon-auto-spawn.patch b/patches/libvirt-0.9.13-daemon-auto-spawn.patch
new file mode 100644
index 0000000..099676f
--- /dev/null
+++ b/patches/libvirt-0.9.13-daemon-auto-spawn.patch
@@ -0,0 +1,46 @@
+From efe6c8021146d046846ead5b5efc9828d97c1ceb Mon Sep 17 00:00:00 2001
+From: Christophe Fergeau <cfergeau redhat com>
+Date: Thu, 12 Jul 2012 13:52:36 +0200
+Subject: [PATCH] Fix daemon auto-spawning
+
+Commit 32a9aac switched libvirt to use the XDG base directories
+to locate most of its data/config. In particular, the per-user socket
+for qemu:///session is now stored in the XDG runtime directory.
+This directory is located by looking at the XDG_RUNTIME_DIR environment
+variable, with a fallback to ~/.cache/libvirt if this variable is not
+set.
+
+When the daemon is autospawned because a client application wants
+to use qemu:///session, the daemon is ran in a clean environment
+which does not contain XDG_RUNTIME_DIR. It will create its socket
+in ~/.cache/libvirt. If the client application has XDG_RUNTIME_DIR
+set, it will not look for the socket in the fallback place, and will
+fail to connect to the autospawned daemon.
+
+This patch adds XDG_RUNTIME_DIR to the daemon environment before
+auto-starting it. I've done this in virNetSocketForkDaemon rather
+than in virCommandAddEnvPassCommon as I wasn't sure we want to pass
+these variables to other commands libvirt spawns. XDG_CACHE_HOME
+and XDG_CONFIG_HOME are also added to the daemon env as it makes use
+of those as well.
+---
+ src/rpc/virnetsocket.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c
+index 0b32ffe..08dfbb0 100644
+--- a/src/rpc/virnetsocket.c
++++ b/src/rpc/virnetsocket.c
+@@ -97,6 +97,9 @@ static int virNetSocketForkDaemon(const char *binary)
+                                              NULL);
+ 
+     virCommandAddEnvPassCommon(cmd);
++    virCommandAddEnvPass(cmd, "XDG_CACHE_HOME");
++    virCommandAddEnvPass(cmd, "XDG_CONFIG_HOME");
++    virCommandAddEnvPass(cmd, "XDG_RUNTIME_DIR");
+     virCommandClearCaps(cmd);
+     virCommandDaemonize(cmd);
+     ret = virCommandRun(cmd, NULL);
+-- 
+1.7.10.4
+



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]