Re: [PATCH 1/7] kvm tools: add HOME env var to hostfs

2012-08-30 Thread Sasha Levin
On 08/30/2012 11:48 AM, Pekka Enberg wrote: > On Thu, Aug 30, 2012 at 12:44 PM, Sasha Levin wrote: >> On 08/30/2012 09:50 AM, Cyrill Gorcunov wrote: >>> On Thu, Aug 30, 2012 at 09:36:37AM +0200, Sasha Levin wrote: +char *new_env[] = { "TERM=linux", "DISPLAY=192.168.33.1:0", +

Re: [PATCH 1/7] kvm tools: add HOME env var to hostfs

2012-08-30 Thread Pekka Enberg
On Thu, Aug 30, 2012 at 12:44 PM, Sasha Levin wrote: > On 08/30/2012 09:50 AM, Cyrill Gorcunov wrote: >> On Thu, Aug 30, 2012 at 09:36:37AM +0200, Sasha Levin wrote: >>> +char *new_env[] = { "TERM=linux", "DISPLAY=192.168.33.1:0", >>> +"HOME=/virt/home", NULL }; >>>

Re: [PATCH 1/7] kvm tools: add HOME env var to hostfs

2012-08-30 Thread Sasha Levin
On 08/30/2012 09:50 AM, Cyrill Gorcunov wrote: > On Thu, Aug 30, 2012 at 09:36:37AM +0200, Sasha Levin wrote: >> +char *new_env[] = { "TERM=linux", "DISPLAY=192.168.33.1:0", >> +"HOME=/virt/home", NULL }; >> + >> +mkdir("/virt/home", 0755); > > Please add check

Re: [PATCH 1/7] kvm tools: add HOME env var to hostfs

2012-08-30 Thread Cyrill Gorcunov
On Thu, Aug 30, 2012 at 09:36:37AM +0200, Sasha Levin wrote: > + char *new_env[] = { "TERM=linux", "DISPLAY=192.168.33.1:0", > + "HOME=/virt/home", NULL }; > + > + mkdir("/virt/home", 0755); Please add check for mkdir error code. Frankly, this is a bad habbit to

[PATCH 1/7] kvm tools: add HOME env var to hostfs

2012-08-30 Thread Sasha Levin
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/guest/init.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff -