]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
kvm tools: add HOME env var to hostfs
authorSasha Levin <levinsasha928@gmail.com>
Fri, 31 Aug 2012 08:20:20 +0000 (10:20 +0200)
committerPekka Enberg <penberg@kernel.org>
Fri, 31 Aug 2012 08:25:36 +0000 (11:25 +0300)
Add a HOME env var when booting a hostfs guest. This will point out to a home
dir within the given guest name.

This will make several apps happier when being run under hostfs.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/kvm/builtin-setup.c
tools/kvm/guest/init.c

index 11aa676a3b522d4dac51419ad2e0233b2b6ecdf9..1b865b7fba634ca9557ebf6b6af934e90a7946f0 100644 (file)
@@ -116,6 +116,7 @@ static const char *guestfs_dirs[] = {
        "/var",
        "/var/lib",
        "/virt",
+       "/virt/home",
 };
 
 static const char *guestfs_symlinks[] = {
index e1f377f714a6ff9c2b806c370ffde606faf7dafe..ece48fd6461ce0e0259d8885a650f12a9b742b63 100644 (file)
@@ -12,7 +12,8 @@
 static int run_process(char *filename)
 {
        char *new_argv[] = { filename, NULL };
-       char *new_env[] = { "TERM=linux", "DISPLAY=192.168.33.1:0", NULL };
+       char *new_env[] = { "TERM=linux", "DISPLAY=192.168.33.1:0",
+                               "HOME=/virt/home", NULL };
 
        return execve(filename, new_argv, new_env);
 }
@@ -20,7 +21,7 @@ static int run_process(char *filename)
 static int run_process_sandbox(char *filename)
 {
        char *new_argv[] = { filename, "/virt/sandbox.sh", NULL };
-       char *new_env[] = { "TERM=linux", NULL };
+       char *new_env[] = { "TERM=linux", "HOME=/virt/home", NULL };
 
        return execve(filename, new_argv, new_env);
 }