From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sasha Levin Subject: Re: [PATCH 1/7] kvm tools: add HOME env var to hostfs Date: Thu, 30 Aug 2012 11:51:26 +0200 Message-ID: <503F379E.9010305@gmail.com> References: <1346312203-29456-1-git-send-email-levinsasha928@gmail.com> <20120830075035.GD21422@moon> <503F35FA.1090809@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Cyrill Gorcunov , asias.hejun@gmail.com, mingo@elte.hu, kvm@vger.kernel.org To: Pekka Enberg Return-path: Received: from mail-ey0-f174.google.com ([209.85.215.174]:33331 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751307Ab2H3Juy (ORCPT ); Thu, 30 Aug 2012 05:50:54 -0400 Received: by eaac11 with SMTP id c11so475394eaa.19 for ; Thu, 30 Aug 2012 02:50:53 -0700 (PDT) In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: 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", >>>> + "HOME=/virt/home", NULL }; >>>> + >>>> + mkdir("/virt/home", 0755); >>> >>> Please add check for mkdir error code. Frankly, this is a bad habbit >>> to assume that mkdir never fails (this could be done on top of this >>> series I think but should not be leaved without attention). >> >> This is actually supposed to fail most of the times, since it runs as part of >> the init :) > > You could check for errno == EEXISTS, no? > > On Thu, Aug 30, 2012 at 12:44 PM, Sasha Levin wrote: >> There's not much we can do if it fails though, and even at that point - this >> failure isn't serious enough to even justify any further action on our end. > > I'm pretty sure users would appreciate a friendly warning explaining > that we are not running in "normal state". This is how we ran up until now :) I'm going to move that from init.c into the setup itself then.