From patchwork Thu Jun 9 12:57:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 9167061 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B677B60467 for ; Thu, 9 Jun 2016 13:35:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A7DBA28319 for ; Thu, 9 Jun 2016 13:35:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9C1BB28347; Thu, 9 Jun 2016 13:35:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 160AD28319 for ; Thu, 9 Jun 2016 13:35:15 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bB04N-0005No-6M; Thu, 09 Jun 2016 13:32:23 +0000 Received: from mail6.bemta6.messagelabs.com ([85.158.143.247]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bB04M-0005Ni-Cq for xen-devel@lists.xenproject.org; Thu, 09 Jun 2016 13:32:22 +0000 Received: from [85.158.143.35] by server-1.bemta-6.messagelabs.com id 81/AB-30266-5EF69575; Thu, 09 Jun 2016 13:32:21 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupjkeJIrShJLcpLzFFi42JxWrrBXvdpfmS 4wZPJQhbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8a6d4cYC17wVjRf+8fUwHiLq4uRk0NCwF+i adNHVhCbTUBZ4mdnLxuILSKgJ9F04DkjiM0s4CXxYt0/MFtYwEBif881sBoWARWJFRvuMIPYv AIuEss/L2WHmCkncf74T6A4BwcnULxhlxNIWEjAWaK96yMzhK0g0TH9GBNEq6DEyZlPWCBWSU gcfPECrFVCgFvib7f9BEa+WUiqZiGpWsDItIpRvTi1qCy1SNdYL6koMz2jJDcxM0fX0MBMLze 1uDgxPTUnMalYLzk/dxMjMJwYgGAHY8c/p0OMkhxMSqK8T6wjw4X4kvJTKjMSizPii0pzUosP McpwcChJ8KbkAeUEi1LTUyvSMnOAgQ2TluDgURLhbQNJ8xYXJOYWZ6ZDpE4xKkqJ8+aAJARAE hmleXBtsGi6xCgrJczLCHSIEE9BalFuZgmq/CtGcQ5GJWHeiyBTeDLzSuCmvwJazAS0ePmRcJ DFJYkIKakGRg21V4vWvTl570hg5ITT/nYSGydl/tznd0X7/HfBhSF2j88xdHZFxK8oVllklGn GIZadZOx/19Ds+qto14VC3bGacuJNy1Yu/f9U8tnxTy9kntdkH7vVWWN2f0f/0ZQnUycY5XO/ T75wn7uzdgvbtitrYhoeemytnSX89OXX0485Z01axJxVYaDEUpyRaKjFXFScCADrlU4yoQIAA A== X-Env-Sender: prvs=9619a384d=wei.liu2@citrix.com X-Msg-Ref: server-5.tower-21.messagelabs.com!1465479139!18169964!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 40403 invoked from network); 9 Jun 2016 13:32:20 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-5.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 9 Jun 2016 13:32:20 -0000 X-IronPort-AV: E=Sophos;i="5.26,444,1459814400"; d="scan'208";a="366249141" From: Wei Liu To: Xen-devel Date: Thu, 9 Jun 2016 13:57:41 +0100 Message-ID: <1465477062-28805-11-git-send-email-wei.liu2@citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1465477062-28805-1-git-send-email-wei.liu2@citrix.com> References: <1465477062-28805-1-git-send-email-wei.liu2@citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: Ian Jackson , Wei Liu Subject: [Xen-devel] [PATCH 10/11] libxl: honour XEN_LOG_DIR X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Wei Liu Acked-by: Ian Jackson --- Cc: Ian Jackson --- tools/libxl/libxl_utils.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c index 4ca6bcb..6108d4b 100644 --- a/tools/libxl/libxl_utils.c +++ b/tools/libxl/libxl_utils.c @@ -18,6 +18,7 @@ #include #include "libxl_internal.h" +#include "_paths.h" #ifndef LIBXL_HAVE_NONCONST_LIBXL_BASENAME_RETURN_VALUE const @@ -261,20 +262,20 @@ int libxl_create_logfile(libxl_ctx *ctx, const char *name, char **full_name) char *logfile, *logfile_new; int i, rc; - logfile = GCSPRINTF("/var/log/xen/%s.log", name); + logfile = GCSPRINTF(XEN_LOG_DIR "/%s.log", name); if (stat(logfile, &stat_buf) == 0) { /* file exists, rotate */ - logfile = GCSPRINTF("/var/log/xen/%s.log.10", name); + logfile = GCSPRINTF(XEN_LOG_DIR "/%s.log.10", name); unlink(logfile); for (i = 9; i > 0; i--) { - logfile = GCSPRINTF("/var/log/xen/%s.log.%d", name, i); - logfile_new = GCSPRINTF("/var/log/xen/%s.log.%d", name, i + 1); + logfile = GCSPRINTF(XEN_LOG_DIR "/%s.log.%d", name, i); + logfile_new = GCSPRINTF(XEN_LOG_DIR "/%s.log.%d", name, i + 1); rc = logrename(gc, logfile, logfile_new); if (rc) goto out; } - logfile = GCSPRINTF("/var/log/xen/%s.log", name); - logfile_new = GCSPRINTF("/var/log/xen/%s.log.1", name); + logfile = GCSPRINTF(XEN_LOG_DIR "/%s.log", name); + logfile_new = GCSPRINTF(XEN_LOG_DIR "/%s.log.1", name); rc = logrename(gc, logfile, logfile_new); if (rc)