Commit-ID: ecd036b58ac975731ba1c712c126171e9f538639 Gitweb: http://git.kernel.org/tip/ecd036b58ac975731ba1c712c126171e9f538639 Author: Sasha Levin <levinsasha928@xxxxxxxxx> AuthorDate: Fri, 31 Aug 2012 10:20:20 +0200 Committer: Pekka Enberg <penberg@xxxxxxxxxx> CommitDate: Fri, 31 Aug 2012 11:25:36 +0300 kvm tools: add HOME env var to hostfs 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@xxxxxxxxx> Signed-off-by: Pekka Enberg <penberg@xxxxxxxxxx> --- tools/kvm/builtin-setup.c | 1 + tools/kvm/guest/init.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/kvm/builtin-setup.c b/tools/kvm/builtin-setup.c index 11aa676..1b865b7 100644 --- a/tools/kvm/builtin-setup.c +++ b/tools/kvm/builtin-setup.c @@ -116,6 +116,7 @@ static const char *guestfs_dirs[] = { "/var", "/var/lib", "/virt", + "/virt/home", }; static const char *guestfs_symlinks[] = { diff --git a/tools/kvm/guest/init.c b/tools/kvm/guest/init.c index e1f377f..ece48fd 100644 --- a/tools/kvm/guest/init.c +++ b/tools/kvm/guest/init.c @@ -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); } -- To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html