From patchwork Mon Jun 13 07:49:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 9172291 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 428936048C for ; Mon, 13 Jun 2016 08:28:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 33304200E7 for ; Mon, 13 Jun 2016 08:28:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 27E632665D; Mon, 13 Jun 2016 08:28:19 +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 A3D90200E7 for ; Mon, 13 Jun 2016 08:28:18 +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 1bCNCP-0002sq-N1; Mon, 13 Jun 2016 08:26:21 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bCNCO-0002sZ-Cm for xen-devel@lists.xenproject.org; Mon, 13 Jun 2016 08:26:20 +0000 Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id 31/04-07972-A2E6E575; Mon, 13 Jun 2016 08:26:18 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupnkeJIrShJLcpLzFFi42JxWrrBXlcrLy7 cYPIvXovvWyYzOTB6HP5whSWAMYo1My8pvyKBNePW/ZNsBRvFKtbM2MvWwPhQqIuRk0NCwF+i o/c4G4jNJqAs8bOzF8wWEdCTaDrwnBHEZhbIkjhz6TU7iC0s4C3x6voksBoWAVWJvcenAcU5O HgFXCQ6WgIhRspJnD/+kxkkzAkUfvLOHCQsJOAs0TDrMDOErSDRMf0YE4jNKyAocXLmExaITR ISB1+8YIYYwy1x+/RU5gmMfLOQlM1CUraAkWkVo0ZxalFZapGuoaFeUlFmekZJbmJmDpBnope bWlycmJ6ak5hUrJecn7uJERhQDECwg/HMCudDjJIcTEqivBI+ceFCfEn5KZUZicUZ8UWlOanF hxhlODiUJHh1coFygkWp6akVaZk5wNCGSUtw8CiJ8NqBpHmLCxJzizPTIVKnGBWlxHnf5QAlB EASGaV5cG2weLrEKCslzMsIdIgQT0FqUW5mCar8K0ZxDkYlYd4EkPE8mXklcNNfAS1mAlrMsS 8aZHFJIkJKqoFRJ2rhiTuvdS6tvLXEcZPs7u0Wdpdz2jo1pL4ISc6Yc6fj5kKlRZ8uTj3Pdnj dj9b6fX/bdvkJCC21OGmT/6gzbKPbmw3bNIwyqkXqb3A1/33KIilkqbY1asLUSY1/TY6v61pz f8/pW6H2DNJmvrHbLlV/iSlL9/g2d8b/A++71ky83fH136vsciWW4oxEQy3mouJEADbMjf2iA gAA X-Env-Sender: prvs=9655a08af=wei.liu2@citrix.com X-Msg-Ref: server-2.tower-27.messagelabs.com!1465806376!45371726!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 48056 invoked from network); 13 Jun 2016 08:26:17 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-2.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 13 Jun 2016 08:26:17 -0000 X-IronPort-AV: E=Sophos;i="5.26,466,1459814400"; d="scan'208";a="366846505" From: Wei Liu To: Xen-devel Date: Mon, 13 Jun 2016 08:49:14 +0100 Message-ID: <1465804155-14469-17-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: MIA2 Cc: Ian Jackson , Wei Liu , David Scott Subject: [Xen-devel] [PATCH 16/17] oxenstored: honour XEN_RUN_STORED and XEN_CONFIG_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 Only contain changes to ocaml source code. C stub files will be handled separately. Signed-off-by: Wei Liu Acked-by: David Scott --- Cc: Ian Jackson Cc: David Scott --- tools/ocaml/xenstored/define.ml | 6 +++--- tools/ocaml/xenstored/disk.ml | 2 +- tools/ocaml/xenstored/xenstored.ml | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/ocaml/xenstored/define.ml b/tools/ocaml/xenstored/define.ml index d60861c..e9d957f 100644 --- a/tools/ocaml/xenstored/define.ml +++ b/tools/ocaml/xenstored/define.ml @@ -20,10 +20,10 @@ let xenstored_minor = 0 let xenstored_proc_kva = "/proc/xen/xsd_kva" let xenstored_proc_port = "/proc/xen/xsd_port" -let xs_daemon_socket = "/var/run/xenstored/socket" -let xs_daemon_socket_ro = "/var/run/xenstored/socket_ro" +let xs_daemon_socket = Paths.xen_run_stored ^ "/socket" +let xs_daemon_socket_ro = Paths.xen_run_stored ^ "/socket_ro" -let default_config_dir = "/etc/xen" +let default_config_dir = Paths.xen_config_dir let maxwatch = ref (50) let maxtransaction = ref (20) diff --git a/tools/ocaml/xenstored/disk.ml b/tools/ocaml/xenstored/disk.ml index 4ae1fce..4739967 100644 --- a/tools/ocaml/xenstored/disk.ml +++ b/tools/ocaml/xenstored/disk.ml @@ -15,7 +15,7 @@ *) let enable = ref false -let xs_daemon_database = "/var/run/xenstored/db" +let xs_daemon_database = Paths.xen_run_stored ^ "/db" let error fmt = Logging.error "disk" fmt diff --git a/tools/ocaml/xenstored/xenstored.ml b/tools/ocaml/xenstored/xenstored.ml index fc8cc95..30570ed 100644 --- a/tools/ocaml/xenstored/xenstored.ml +++ b/tools/ocaml/xenstored/xenstored.ml @@ -66,7 +66,7 @@ let process_domains store cons domains = let sigusr1_handler store = try let channel = open_out_gen [ Open_wronly; Open_creat; Open_trunc; ] - 0o600 "/var/run/xenstored/db.debug" in + 0o600 (Paths.xen_run_stored ^ "/db.debug") in finally (fun () -> Store.dump store channel) (fun () -> close_out channel) with _ -> @@ -266,7 +266,7 @@ let _ = let quit = ref false in if cf.restart then ( - DB.from_file store domains cons "/var/run/xenstored/db"; + DB.from_file store domains cons (Paths.xen_run_stored ^ "/db"); Event.bind_dom_exc_virq eventchn ) else ( if !Disk.enable then ( @@ -293,7 +293,7 @@ let _ = Logging.init_xenstored_log(); if cf.activate_access_log then begin - let post_rotate () = DB.to_file store cons "/var/run/xenstored/db" in + let post_rotate () = DB.to_file store cons (Paths.xen_run_stored ^ "/db") in Logging.init_access_log post_rotate end; @@ -440,5 +440,5 @@ let _ = raise exc done; info "stopping xenstored"; - DB.to_file store cons "/var/run/xenstored/db"; + DB.to_file store cons (Paths.xen_run_stored ^ "/db"); ()