Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion xenvm/lvs.ml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ let lvs copts noheadings nosuffix units fields offline physical_device (vg_name,
let inner l = Lwt_list.fold_left_s (fun acc s -> s >>= fun s -> Lwt.return (s::acc)) [] l >>= fun l -> Lwt.return (List.rev l) in
inner (List.map inner rows) >>= fun rows ->
let lines = print_table noheadings (" "::headings) (List.map (fun r -> " "::r) rows) in
Lwt_list.iter_s (fun x -> stdout "%s" x) lines
Lwt_list.iter_s (fun x -> stdout ~do_syslog:(not segs) "%s" x) lines
)

let lvs_cmd =
Expand Down
8 changes: 5 additions & 3 deletions xenvm/xenvm_common.ml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ let dm = ref (module Retrymapper.Make(Devmapper.Linux) : S.RETRYMAPPER)

let syslog = Lwt_log.syslog ~facility:`Daemon ()

let stdout fmt = Printf.ksprintf (fun s ->
Printf.printf "%s\n%!" s;
Lwt_log.log ~logger:syslog ~level:Lwt_log.Notice ("stdout:" ^ s)
let stdout ?(do_syslog=true) fmt = Printf.ksprintf (fun s ->
Printf.printf "%s\n%!" s;
if do_syslog
then Lwt_log.log ~logger:syslog ~level:Lwt_log.Notice ("stdout:" ^ s)
else Lwt.return ()
) fmt
let stderr fmt = Printf.ksprintf (fun s ->
Printf.fprintf stderr "%s\n%!" s;
Expand Down