From: Wei Liu <wei.liu2@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: "Wei Liu" <wei.liu2@citrix.com>,
Jonathan.Ludlam@citrix.com,
"Ian Jackson" <Ian.Jackson@eu.citrix.com>,
"Julien Grall" <julien.grall@arm.com>,
christian.lindig@citrix.com, dave@recoil.org,
"Roger Pau Monné" <roger.pau@citrix.com>
Subject: [PATCH for-4.9 v2 2/3] oxenstored: provide options to define xenstored devices
Date: Tue, 18 Apr 2017 16:31:43 +0100 [thread overview]
Message-ID: <20170418153144.28930-3-wei.liu2@citrix.com> (raw)
In-Reply-To: <20170418153144.28930-1-wei.liu2@citrix.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
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 +++-
4 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/tools/ocaml/xenstored/define.ml b/tools/ocaml/xenstored/define.ml
index 5a604d1bea..2965c08534 100644
--- a/tools/ocaml/xenstored/define.ml
+++ b/tools/ocaml/xenstored/define.ml
@@ -17,9 +17,6 @@
let xenstored_major = 1
let xenstored_minor = 0
-let xenstored_proc_kva = "/proc/xen/xsd_kva"
-let xenstored_proc_port = "/proc/xen/xsd_port"
-
let xs_daemon_socket = Paths.xen_run_stored ^ "/socket"
let xs_daemon_socket_ro = Paths.xen_run_stored ^ "/socket_ro"
diff --git a/tools/ocaml/xenstored/domains.ml b/tools/ocaml/xenstored/domains.ml
index fdae298613..4134630c58 100644
--- a/tools/ocaml/xenstored/domains.ml
+++ b/tools/ocaml/xenstored/domains.ml
@@ -127,11 +127,14 @@ let create xc doms domid mfn port =
Domain.bind_interdomain dom;
dom
+let xenstored_kva = ref ""
+let xenstored_port = ref ""
+
let create0 doms =
let port, interface =
(
- let port = Utils.read_file_single_integer Define.xenstored_proc_port
- and fd = Unix.openfile Define.xenstored_proc_kva
+ let port = Utils.read_file_single_integer !xenstored_port
+ and fd = Unix.openfile !xenstored_kva
[ Unix.O_RDWR ] 0o600 in
let interface = Xenmmap.mmap fd Xenmmap.RDWR Xenmmap.SHARED
(Xenmmap.getpagesize()) 0 in
diff --git a/tools/ocaml/xenstored/oxenstored.conf.in b/tools/ocaml/xenstored/oxenstored.conf.in
index 536611e8d0..6579b84448 100644
--- a/tools/ocaml/xenstored/oxenstored.conf.in
+++ b/tools/ocaml/xenstored/oxenstored.conf.in
@@ -69,3 +69,6 @@ persistent = false
# Perodically scanning all the rings as a safenet for lazy clients.
# Define the interval in seconds, set to negative to disable.
# ring-scan-interval = 20
+
+xenstored-kva = @XENSTORED_KVA@
+xenstored-port = @XENSTORED_PORT@
diff --git a/tools/ocaml/xenstored/xenstored.ml b/tools/ocaml/xenstored/xenstored.ml
index bb780d0459..33cff5f446 100644
--- a/tools/ocaml/xenstored/xenstored.ml
+++ b/tools/ocaml/xenstored/xenstored.ml
@@ -118,7 +118,9 @@ let parse_config filename =
("access-log-special-ops", Config.Set_bool Logging.access_log_special_ops);
("allow-debug", Config.Set_bool Process.allow_debug);
("ring-scan-interval", Config.Set_int ring_scan_interval);
- ("pid-file", Config.Set_string pidfile); ] in
+ ("pid-file", Config.Set_string pidfile);
+ ("xenstored-kva", Config.Set_string Domains.xenstored_kva);
+ ("xenstored-port", Config.Set_string Domains.xenstored_port);] in
begin try Config.read filename options (fun _ _ -> raise Not_found)
with
| Config.Error err -> List.iter (fun (k, e) ->
--
2.11.0
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-04-18 15:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-18 15:31 [PATCH for-4.9 v2 0/3] oxenstored: make it work on FreeBSD Wei Liu
2017-04-18 15:31 ` [PATCH for-4.9 v2 1/3] paths.m4: provide XENSTORED_{KVA, PORT} Wei Liu
2017-04-20 10:28 ` Roger Pau Monné
2017-04-18 15:31 ` Wei Liu [this message]
2017-04-18 15:31 ` [PATCH for-4.9 v2 3/3] hotplug/FreeBSD: configure xenstored Wei Liu
2017-04-20 10:33 ` Roger Pau Monné
2017-04-19 12:56 ` [PATCH for-4.9 v2 0/3] oxenstored: make it work on FreeBSD Christian Lindig
2017-04-20 10:22 ` Ian Jackson
2017-04-20 12:50 ` Julien Grall
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170418153144.28930-3-wei.liu2@citrix.com \
--to=wei.liu2@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=Jonathan.Ludlam@citrix.com \
--cc=christian.lindig@citrix.com \
--cc=dave@recoil.org \
--cc=julien.grall@arm.com \
--cc=roger.pau@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).