From patchwork Mon Jun 13 07:49:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 9172285 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 7E2756048C for ; Mon, 13 Jun 2016 08:24:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6D5581FF27 for ; Mon, 13 Jun 2016 08:24:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 61E2A22473; Mon, 13 Jun 2016 08:24:44 +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 ACDB11FF27 for ; Mon, 13 Jun 2016 08:24:43 +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 1bCN8l-0002SC-Kq; Mon, 13 Jun 2016 08:22:35 +0000 Received: from mail6.bemta6.messagelabs.com ([85.158.143.247]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bCN8j-0002S6-Tz for xen-devel@lists.xenproject.org; Mon, 13 Jun 2016 08:22:34 +0000 Received: from [85.158.143.35] by server-3.bemta-6.messagelabs.com id 05/90-25713-94D6E575; Mon, 13 Jun 2016 08:22:33 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupjkeJIrShJLcpLzFFi42JxWrohUtcjNy7 c4MVCY4vvWyYzOTB6HP5whSWAMYo1My8pvyKBNePk1D+MBRuFKiZOuM3YwPiTv4uRk0NCwF9i 3uFdLCA2m4CyxM/OXjYQW0RAT6LpwHNGEJtZIEvizKXX7CC2sICXxP7bS5lAbBYBVYnLf86A1 fAKuEi86DzBDDFTTuL88Z9ANgcHJ1D8yTtzkLCQgLNEw6zDzBC2gkTH9GNMEK2CEidnPmGBWC UhcfDFC7BWCQFuib/d9hMY+WYhqZqFpGoBI9MqRvXi1KKy1CJdY72kosz0jJLcxMwcXUMDM73 c1OLixPTUnMSkYr3k/NxNjMBwYgCCHYwd/5wOMUpyMCmJ8kr4xIUL8SXlp1RmJBZnxBeV5qQW H2KU4eBQkuBNzgHKCRalpqdWpGXmAAMbJi3BwaMkwnsxGyjNW1yQmFucmQ6ROsWoKCXO2wTSJ wCSyCjNg2uDRdMlRlkpYV5GoEOEeApSi3IzS1DlXzGKczAqCfOagEzhycwrgZv+CmgxE9Bijn 3RIItLEhFSUg2Mm1rfzfjp9X9+6dR2tj8F20RXeVz/afLg36eFS0tvN4tyc/7wv8LUJdx7oaB e57Bh40srwQ6nl55rA0Q57yi73VEXOpbTJ3n+qKqZm6Gy+OkdTldV7U5ldbw+UNG5cu3CSOYk hgOZX6Nfm6/QPpht1Onbk5QYrf1LVCVU6s+UPxIv/jJOs/RTYinOSDTUYi4qTgQAUBYwXaECA AA= X-Env-Sender: prvs=9655a08af=wei.liu2@citrix.com X-Msg-Ref: server-2.tower-21.messagelabs.com!1465806144!4727417!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 19811 invoked from network); 13 Jun 2016 08:22:29 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-2.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 13 Jun 2016 08:22:29 -0000 X-IronPort-AV: E=Sophos;i="5.26,466,1459814400"; d="scan'208";a="359997862" From: Wei Liu To: Xen-devel Date: Mon, 13 Jun 2016 08:49:15 +0100 Message-ID: <1465804155-14469-18-git-send-email-wei.liu2@citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1465804155-14469-1-git-send-email-wei.liu2@citrix.com> References: <1465804155-14469-1-git-send-email-wei.liu2@citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: Ian Jackson , Wei Liu , David Scott Subject: [Xen-devel] [PATCH 17/17] oxenstored: honour XEN_RUN_STORED in systemd C stub 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 Generate a _paths.h for that and add proper dependency. Signed-off-by: Wei Liu Acked-by: David Scott --- Cc: Ian Jackson Cc: David Scott --- .gitignore | 1 + tools/ocaml/xenstored/Makefile | 7 +++++++ tools/ocaml/xenstored/systemd_stubs.c | 6 ++++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 5914bbe..e019f2e 100644 --- a/.gitignore +++ b/.gitignore @@ -349,6 +349,7 @@ tools/ocaml/libs/xentoollog/_xtl_levels.* tools/ocaml/libs/xentoollog/xentoollog.ml tools/ocaml/libs/xentoollog/xentoollog.mli tools/ocaml/libs/xs/paths.ml +tools/ocaml/xenstored/_paths.h tools/ocaml/xenstored/oxenstored tools/ocaml/xenstored/oxenstored.conf tools/ocaml/xenstored/paths.ml diff --git a/tools/ocaml/xenstored/Makefile b/tools/ocaml/xenstored/Makefile index 939dcaa..1769e55 100644 --- a/tools/ocaml/xenstored/Makefile +++ b/tools/ocaml/xenstored/Makefile @@ -30,6 +30,8 @@ systemd_OBJS = systemd systemd_C_OBJS = systemd_stubs OCAML_LIBRARY += systemd +$(foreach obj,$(systemd_C_OBJS),$(obj).o): _paths.h + LIBS_systemd += $(LDFLAGS-y) OBJS = paths \ @@ -93,3 +95,8 @@ genpath-target = $(call buildmakevars2module,paths.ml) $(eval $(genpath-target)) GENERATED_FILES += paths.ml + +genpath-target = $(call buildmakevars2header,_paths.h) +$(eval $(genpath-target)) + +GENERATE_FILES += _paths.h diff --git a/tools/ocaml/xenstored/systemd_stubs.c b/tools/ocaml/xenstored/systemd_stubs.c index a78a72b..322f1e0 100644 --- a/tools/ocaml/xenstored/systemd_stubs.c +++ b/tools/ocaml/xenstored/systemd_stubs.c @@ -28,6 +28,8 @@ #include #include +#include "_paths.h" + /* Will work regardless of the order systemd gives them to us */ static int oxen_get_sd_fd(const char *connect_to) { @@ -46,8 +48,8 @@ static int oxen_get_sd_fd(const char *connect_to) static int oxen_verify_socket_socket(const char *connect_to) { - if ((strcmp("/var/run/xenstored/socket_ro", connect_to) != 0) && - (strcmp("/var/run/xenstored/socket", connect_to) != 0)) { + if ((strcmp(XEN_RUN_STORED "/socket_ro", connect_to) != 0) && + (strcmp(XEN_RUN_STORED "/socket", connect_to) != 0)) { sd_notifyf(0, "STATUS=unexpected socket: %s\n" "ERRNO=%i", connect_to,