diff options
author | Jon Ludlam <jonathan.ludlam@eu.citrix.com> | 2011-10-10 16:41:16 +0100 |
---|---|---|
committer | Jon Ludlam <jonathan.ludlam@eu.citrix.com> | 2011-10-10 16:41:16 +0100 |
commit | c69fddbd5dfa3004aaf2d0f2dde00c9ec3dd6d5d (patch) | |
tree | 026fb9ddfbfe1cfdf8273b1a26b0806387a2d826 /tools/ocaml/xenstored/process.ml | |
parent | cc3739d41c4b4536e88c07256df3e89d41f5816f (diff) | |
download | xen-c69fddbd5dfa3004aaf2d0f2dde00c9ec3dd6d5d.tar.gz xen-c69fddbd5dfa3004aaf2d0f2dde00c9ec3dd6d5d.tar.bz2 xen-c69fddbd5dfa3004aaf2d0f2dde00c9ec3dd6d5d.zip |
tools/ocaml: Remove log library from tools/ocaml/libs
The only user was oxenstored, which has had the relevant bits
merged in.
Signed-off-by: Zheng Li <zheng.li@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
Diffstat (limited to 'tools/ocaml/xenstored/process.ml')
-rw-r--r-- | tools/ocaml/xenstored/process.ml | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/tools/ocaml/xenstored/process.ml b/tools/ocaml/xenstored/process.ml index a6b5e45896..c2aeaa94a4 100644 --- a/tools/ocaml/xenstored/process.ml +++ b/tools/ocaml/xenstored/process.ml @@ -14,6 +14,9 @@ * GNU Lesser General Public License for more details. *) +let error fmt = Logging.error "process" fmt +let info fmt = Logging.info "process" fmt + open Printf open Stdext @@ -79,7 +82,7 @@ let create_implicit_path t perm path = (* packets *) let do_debug con t domains cons data = - if not !allow_debug + if not (Connection.is_dom0 con) && not !allow_debug then None else try match split None '\000' data with | "print" :: msg :: _ -> @@ -89,6 +92,9 @@ let do_debug con t domains cons data = let domid = int_of_string domid in let quota = (Store.get_quota t.Transaction.store) in Some (Quota.to_string quota domid ^ "\000") + | "watches" :: _ -> + let watches = Connections.debug cons in + Some (watches ^ "\000") | "mfn" :: domid :: _ -> let domid = int_of_string domid in let con = Connections.find_domain cons domid in @@ -357,8 +363,7 @@ let process_packet ~store ~cons ~doms ~con ~tid ~rid ~ty ~data = in input_handle_error ~cons ~doms ~fct ~ty ~con ~t ~rid ~data; with exn -> - Logs.error "general" "process packet: %s" - (Printexc.to_string exn); + error "process packet: %s" (Printexc.to_string exn); Connection.send_error con tid rid "EIO" let write_access_log ~ty ~tid ~con ~data = @@ -372,7 +377,7 @@ let do_input store cons doms con = let packet = Connection.pop_in con in let tid, rid, ty, data = Xenbus.Xb.Packet.unpack packet in (* As we don't log IO, do not call an unnecessary sanitize_data - Logs.info "io" "[%s] -> [%d] %s \"%s\"" + info "[%s] -> [%d] %s \"%s\"" (Connection.get_domstr con) tid (Xenbus.Xb.Op.to_string ty) (sanitize_data data); *) process_packet ~store ~cons ~doms ~con ~tid ~rid ~ty ~data; @@ -386,7 +391,7 @@ let do_output store cons doms con = let packet = Connection.peek_output con in let tid, rid, ty, data = Xenbus.Xb.Packet.unpack packet in (* As we don't log IO, do not call an unnecessary sanitize_data - Logs.info "io" "[%s] <- %s \"%s\"" + info "[%s] <- %s \"%s\"" (Connection.get_domstr con) (Xenbus.Xb.Op.to_string ty) (sanitize_data data);*) write_answer_log ~ty ~tid ~con ~data; |