From patchwork Wed Jun 15 11:15:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 9178185 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 7426D604DB for ; Wed, 15 Jun 2016 11:17:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6446627F48 for ; Wed, 15 Jun 2016 11:17:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5962E281FE; Wed, 15 Jun 2016 11:17:30 +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 04C3027F48 for ; Wed, 15 Jun 2016 11:17:30 +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 1bD8n5-0004Wj-PX; Wed, 15 Jun 2016 11:15:23 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bD8n4-0004W1-DS for xen-devel@lists.xenproject.org; Wed, 15 Jun 2016 11:15:22 +0000 Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id BF/D3-29442-9C831675; Wed, 15 Jun 2016 11:15:21 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprAIsWRWlGSWpSXmKPExsXitHRDpO4Ji8R wgz+zLSy+b5nM5MDocfjDFZYAxijWzLyk/IoE1owPy1YyFRwUqlg0/S1rA+N7/i5GTg4JAX+J C217WUFsNgFliZ+dvWwgtoiAnkTTgeeMIDazgJfEi3X/wGxhAWOJ1fMfsoPYLAKqElOObASr5 xVwlrg88RoLxEw5ifPHfzKD2JwCLhL/f7eB9QqB1Hy7xQZhK0h0TD/GBNErKHFy5hMWiF0SEg dfvADq5QCawy3xt9t+AiPfLCRVs5BULWBkWsWoUZxaVJZapGtoopdUlJmeUZKbmJmja2hgqpe bWlycmJ6ak5hUrJecn7uJERhSDECwg/Hsac9DjJIcTEqivB5yieFCfEn5KZUZicUZ8UWlOanF hxhlODiUJHiDzIFygkWp6akVaZk5wOCGSUtw8CiJ8PqCpHmLCxJzizPTIVKnGBWlxCH6BEASG aV5cG2wiLrEKCslzMsIdIgQT0FqUW5mCar8K0ZxDkYlYd4kkCk8mXklcNNfAS1mAlpsMz0eZH FJIkJKqoFR+uoWg6qY0BMqcbNk+6zWmER+y3d32fmU96pnwMe6hc3mk7i7WXtn+jieZVuyqX3 G+4ntqw08E59uCF0houR0dI/RsnOGr+tVi+reckYcupFWyf328vw/8jc5PuzbuSj32dcGqfQX B6N5yq33801PE+tcW/BQ5PPmArvwJ7yLq11+20tsuhqixFKckWioxVxUnAgATfyy6qMCAAA= X-Env-Sender: prvs=967af9503=wei.liu2@citrix.com X-Msg-Ref: server-5.tower-206.messagelabs.com!1465989319!44993987!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 48193 invoked from network); 15 Jun 2016 11:15:20 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-5.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 15 Jun 2016 11:15:20 -0000 X-IronPort-AV: E=Sophos;i="5.26,475,1459814400"; d="scan'208";a="360560020" From: Wei Liu To: Xen-devel Date: Wed, 15 Jun 2016 12:15:08 +0100 Message-ID: <1465989309-12418-7-git-send-email-wei.liu2@citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1465989309-12418-1-git-send-email-wei.liu2@citrix.com> References: <1465989309-12418-1-git-send-email-wei.liu2@citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: Ian Jackson , Wei Liu Subject: [Xen-devel] [PATCH 6/7] libxenstat: honour XEN_RUN_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 This is because libxl uses XEN_RUN_DIR to generate the socket path for libxenstat while libxenstat itself uses hard-coded path, which is not necessary in sync with libxl. Generate a _paths.h because it is required to make this change work. Signed-off-by: Wei Liu --- Cc: Ian Jackson --- .gitignore | 1 + tools/xenstat/libxenstat/Makefile | 7 ++++++- tools/xenstat/libxenstat/src/xenstat_qmp.c | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index d4ffaa6..9b8dece 100644 --- a/.gitignore +++ b/.gitignore @@ -220,6 +220,7 @@ tools/xenmon/xentrace_setmask tools/xenmon/xenbaked tools/xenpaging/xenpaging tools/xenpmd/xenpmd +tools/xenstat/libxenstat/src/_paths.h tools/xenstat/xentop/xentop tools/xenstore/xenstore tools/xenstore/xenstore-chmod diff --git a/tools/xenstat/libxenstat/Makefile b/tools/xenstat/libxenstat/Makefile index 850d24a..213d998 100644 --- a/tools/xenstat/libxenstat/Makefile +++ b/tools/xenstat/libxenstat/Makefile @@ -40,6 +40,8 @@ LDLIBS-$(CONFIG_SunOS) += -lkstat .PHONY: all all: $(LIB) $(SHLIB) $(SHLIB_LINKS) +$(OBJECTS-y): src/_paths.h + $(LIB): $(OBJECTS-y) $(AR) rc $@ $^ $(RANLIB) $@ @@ -135,9 +137,12 @@ endif .PHONY: clean clean: rm -f $(LIB) $(SHLIB) $(SHLIB_LINKS) $(OBJECTS-y) \ - $(BINDINGS) $(BINDINGSRC) $(DEPS) + $(BINDINGS) $(BINDINGSRC) $(DEPS) src/_paths.h .PHONY: distclean distclean: clean -include $(DEPS) + +genpath-target = $(call buildmakevars2header,src/_paths.h) +$(eval $(genpath-target)) diff --git a/tools/xenstat/libxenstat/src/xenstat_qmp.c b/tools/xenstat/libxenstat/src/xenstat_qmp.c index c12929a..a87c937 100644 --- a/tools/xenstat/libxenstat/src/xenstat_qmp.c +++ b/tools/xenstat/libxenstat/src/xenstat_qmp.c @@ -23,6 +23,7 @@ #include #include "xenstat_priv.h" +#include "_paths.h" #ifdef HAVE_YAJL_YAJL_VERSION_H # include @@ -398,7 +399,7 @@ static void read_attributes_qdisk_dom(xenstat_node *node, domid_t domain) free(val); /* Connect to this VMs QMP socket */ - snprintf(path, sizeof(path), "/var/run/xen/qmp-libxenstat-%i", domain); + snprintf(path, sizeof(path), XEN_RUN_DIR "/qmp-libxenstat-%i", domain); if ((qfd = qmp_connect(path)) < 0) return;