From mboxrd@z Thu Jan 1 00:00:00 1970 From: Osier Yang Subject: Re: [libvirt] [PATCH] kvm tools: Introduce an ENV variable for the state dir Date: Fri, 09 Dec 2011 15:18:25 +0800 Message-ID: <4EE1B641.5090304@redhat.com> References: <1321012626-31713-1-git-send-email-jyang@redhat.com> <1321012626-31713-3-git-send-email-jyang@redhat.com> <20111206143947.GB7937@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: libvir-list@redhat.com, kvm@vger.kernel.org, penberg@cs.helsinki.fi, levinsasha928@gmail.com, gorcunov@gmail.com, mingo@elte.hu, asias.hejun@gmail.com To: "Daniel P. Berrange" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:25843 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750770Ab1LIHSo (ORCPT ); Fri, 9 Dec 2011 02:18:44 -0500 In-Reply-To: <20111206143947.GB7937@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 2011=E5=B9=B412=E6=9C=8806=E6=97=A5 22:39, Daniel P. Berrange wrote: > On Fri, Nov 11, 2011 at 07:57:00PM +0800, Osier Yang wrote: >> Which is named as "KVMTOOL_STATE_DIR", so that the user can >> configure the path of state directly as he wants. >> --- >> tools/kvm/main.c | 7 ++++++- >> 1 files changed, 6 insertions(+), 1 deletions(-) >> >> diff --git a/tools/kvm/main.c b/tools/kvm/main.c >> index 05bc82c..37b2b1d 100644 >> --- a/tools/kvm/main.c >> +++ b/tools/kvm/main.c >> @@ -13,7 +13,12 @@ static int handle_kvm_command(int argc, char **ar= gv) >> >> int main(int argc, char *argv[]) >> { >> - kvm__set_dir("%s/%s", HOME_DIR, KVM_PID_FILE_PATH); >> + char *state_dir =3D getenv("KVMTOOL_STATE_DIR"); >> + >> + if (state_dir) >> + kvm__set_dir("%s", state_dir); >> + else >> + kvm__set_dir("%s/%s", HOME_DIR, KVM_PID_FILE_PATH); >> >> return handle_kvm_command(argc - 1,&argv[1]); >> } > > As per my comments in the first patch, I don't think this is critical > for libvirt's needs. We should just honour the default location that > the KVM tool uses, rather than forcing a libvirt specific location. > Thanks for the guy who pushed the patch, it's already in kvmtool's source. It will be useful when we run the kvmtool process as=20 non-priviledge user and group. Regards, Osier