From mboxrd@z Thu Jan 1 00:00:00 1970 From: Osier Yang Subject: [libvirt] [PATCH] kvm tools: Introduce an ENV variable for the state dir Date: Fri, 11 Nov 2011 19:57:00 +0800 Message-ID: <1321012626-31713-3-git-send-email-jyang@redhat.com> References: <1321012626-31713-1-git-send-email-jyang@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: 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 Return-path: In-Reply-To: <1321012626-31713-1-git-send-email-jyang@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com List-Id: kvm.vger.kernel.org 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 **argv) int main(int argc, char *argv[]) { - kvm__set_dir("%s/%s", HOME_DIR, KVM_PID_FILE_PATH); + char *state_dir = 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]); } -- 1.7.6