From patchwork Wed Apr 19 12:56:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christian Lindig X-Patchwork-Id: 9687417 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 B762560375 for ; Wed, 19 Apr 2017 12:58:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A7B97283E2 for ; Wed, 19 Apr 2017 12:58:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 99B9628427; Wed, 19 Apr 2017 12:58:43 +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 705CA2841C for ; Wed, 19 Apr 2017 12:58:42 +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 1d0p9Z-0004L9-At; Wed, 19 Apr 2017 12:56:13 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d0p9Y-0004L3-8T for xen-devel@lists.xenproject.org; Wed, 19 Apr 2017 12:56:12 +0000 Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id F5/95-16214-B6E57F85; Wed, 19 Apr 2017 12:56:11 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprEKsWRWlGSWpSXmKPExsWyU9JRQjcr7nu EwfNFJhbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8bUee4Fn0UqZk5+x9zAeEGki5GTQ0LAT2Jx 40Y2EJtNwERixv9WMFtEQFHiwcubrCA2s8BPRonPH/lBbGEBd4kLP46xQtR4SMzseQtlG0l82 vSNEcRmEVCV2LFzElicV8BW4t2CC+wgtpCAhcTdZ/9ZQGxOAUuJX7dfg9UzCshKfGlczQyxS1 zi1pP5TBC3CUgs2XOeGcIWlXj5+B8rhC0rsf9lJ1SNjsTZ608YIWwDia1L9wHN5wCaoymxfpc +xEhLiZa9z9khbEWJKd0P2SFOE5Q4OfMJywRGsVlINs9C6J6FpHsWku5ZSLoXMLKuYtQoTi0q Sy3SNbLQSyrKTM8oyU3MzNE1NDDWy00tLk5MT81JTCrWS87P3cQIjKt6BgbGHYztJ/wOMUpyM CmJ8r758y1CiC8pP6UyI7E4I76oNCe1+BCjDAeHkgSvW+z3CCHBotT01Iq0zBxghMOkJTh4lE R4f8cApXmLCxJzizPTIVKnGBWlxHnTQPoEQBIZpXlwbbCkcolRVkqYl5GBgUGIpyC1KDezBFX +FaM4B6OSMO9/kPE8mXklcNNfAS1mAlocEfAFZHFJIkJKqoGxaXODXDjXqxk8iZsmrdJ0WOor 0q4mYhLM1bGkWlOH994JjsZS64YL9tHvee9rhMqe4/p++/3ZifITlK+FOvy+yJn61Tj8dEhmh gpfuc7ii1c+3HtfcO6wo8/ZY3P0V+3Rc1gyw/yCmNVsoSW6+yeJ5Dit1UlaEid5snLGTwMr1g cno25FTGRRYinOSDTUYi4qTgQAvyET6SUDAAA= X-Env-Sender: prvs=2757ce678=christian.lindig@citrix.com X-Msg-Ref: server-12.tower-31.messagelabs.com!1492606570!79585923!1 X-Originating-IP: [185.25.65.24] X-SpamReason: No, hits=0.0 required=7.0 tests=received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.4.12; banners=-,-,- X-VirusChecked: Checked Received: (qmail 18560 invoked from network); 19 Apr 2017 12:56:10 -0000 Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (185.25.65.24) by server-12.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 19 Apr 2017 12:56:10 -0000 X-IronPort-AV: E=Sophos;i="5.37,221,1488844800"; d="scan'208";a="44575796" From: Christian Lindig To: Wei Liu Thread-Topic: [PATCH for-4.9 v2 0/3] oxenstored: make it work on FreeBSD Thread-Index: AQHSuFjksPbWDJckS0qR/9mrqj4Gk6HMhmkA Date: Wed, 19 Apr 2017 12:56:09 +0000 Message-ID: <6B17869C-8BD8-4C5F-AF64-74E704255A2B@citrix.com> References: <20170418153144.28930-1-wei.liu2@citrix.com> In-Reply-To: <20170418153144.28930-1-wei.liu2@citrix.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: Apple Mail (2.3273) x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted Content-ID: MIME-Version: 1.0 Cc: Ian Jackson , Jonathan Ludlam , Julien Grall , "dave@recoil.org" , Xen-devel , Roger Pau Monne Subject: Re: [Xen-devel] [PATCH for-4.9 v2 0/3] oxenstored: make it work on FreeBSD 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 > On 18. Apr 2017, at 16:31, Wei Liu wrote: > > Wei Liu (3): > paths.m4: provide XENSTORED_{KVA,PORT} > oxenstored: provide options to define xenstored devices > hotplug/FreeBSD: configure xenstored > > m4/paths.m4 | 12 ++++++++++++ > tools/hotplug/FreeBSD/rc.d/xencommons.in | 8 +++++--- > tools/ocaml/xenstored/define.ml | 3 --- > tools/ocaml/xenstored/domains.ml | 7 +++++-- > tools/ocaml/xenstored/oxenstored.conf.in | 3 +++ > tools/ocaml/xenstored/xenstored.ml | 4 +++- > 6 files changed, 28 insertions(+), 9 deletions(-) > > -- > 2.11. This approach adds two new entries into oxenstored.conf that are determined by the configure script. I prefer it over the previous design not the least because it results in a much smaller change and doesn’t require new bindings for C libraries. The code looks good and I believe it doesn’t change in significant ways in its failure modes as port and fd are still read from files - just the names of these files are now coming from oxenstored.conf. I’m not sure the paths.m4 is taking the best approach by relying on $host_os rather than testing the paths but I would leave that to people with more autoconf experience to comment on. Acked-by: Ian Jackson --- Rerun autogen.sh --- m4/paths.m4 | 12 ++++++++++++ 1 file changed, 12 insertions(+) -- 2.11.0 I’d be fine with taking this patch. — Christian diff --git a/m4/paths.m4 b/m4/paths.m4 index 93ce89ab40..f208b7e39f 100644 --- a/m4/paths.m4 +++ b/m4/paths.m4 @@ -147,3 +147,15 @@ AC_SUBST(XEN_PAGING_DIR) XEN_DUMP_DIR=$xen_dumpdir_path AC_SUBST(XEN_DUMP_DIR) ]) + +case "$host_os" in +*freebsd*) XENSTORED_KVA=/dev/xen/xenstored ;; +*) XENSTORED_KVA=/proc/xen/xsd_kva ;; +esac +AC_SUBST(XENSTORED_KVA) + +case "$host_os" in +*freebsd*) XENSTORED_PORT=/dev/xen/xenstored ;; +*) XENSTORED_PORT=/proc/xen/xsd_port ;; +esac +AC_SUBST(XENSTORED_PORT)