From patchwork Fri Aug 31 08:20:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 1391581 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 35B9DDF215 for ; Fri, 31 Aug 2012 08:20:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751398Ab2HaIUi (ORCPT ); Fri, 31 Aug 2012 04:20:38 -0400 Received: from mail-ob0-f174.google.com ([209.85.214.174]:44810 "EHLO mail-ob0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751328Ab2HaIUL (ORCPT ); Fri, 31 Aug 2012 04:20:11 -0400 Received: by obbuo13 with SMTP id uo13so4991366obb.19 for ; Fri, 31 Aug 2012 01:20:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=lvcdziOeSndwn8//8Fgjd+ynS0U95xhC7/NL+SOAjbY=; b=Zzkoqism74CewrYAniF5rvVOcPbVZZEwuHz6UQ3/hwl/x6vMRs5JPg/ce1RVzBmtLR VmSOOyPeD2vC57QzM60HiQf+4cl50ofPFZ9N6WVlaOnhbDnZDi1x65wtLuAOqlXkuDBR ZkTclLt+Z3iYQ0pYwygViAUnErPlwg6U7vQIIyFIa6hjptHisW1HcZzQYSoYPRojhAaf fYh04JgjTd38G/yFXtL06CQbFiYPAFo1Rf3vomMyyUzxASK0J92+Y8Sv68iHud60muMB 1cQLYF4sL1yxzoWuhjikWQbVRV1u0us1/6Tvmu7MoG9sXnYtH+XpXUf7jEUa5gjUz+U1 bVYg== Received: by 10.60.32.136 with SMTP id j8mr7232026oei.0.1346401210929; Fri, 31 Aug 2012 01:20:10 -0700 (PDT) Received: from lappy.us.oracle.com (20.Red-80-59-140.staticIP.rima-tde.net. [80.59.140.20]) by mx.google.com with ESMTPS id ov5sm3516085obc.2.2012.08.31.01.20.05 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 31 Aug 2012 01:20:09 -0700 (PDT) From: Sasha Levin To: penberg@kernel.org Cc: asias.hejun@gmail.com, mingo@elte.hu, gorcunov@openvz.org, kvm@vger.kernel.org, Sasha Levin Subject: [PATCH v2] kvm tools: add HOME env var to hostfs Date: Fri, 31 Aug 2012 10:20:20 +0200 Message-Id: <1346401220-1724-1-git-send-email-levinsasha928@gmail.com> X-Mailer: git-send-email 1.7.12 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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 --- 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); }