console fifos in separate directory

This commit is contained in:
Stefan Grundmann 2018-10-07 01:22:48 +00:00
parent 133884faf4
commit 4c5a795a3b
2 changed files with 2 additions and 2 deletions

View file

@ -51,7 +51,7 @@ let read_console name ring channel () =
Lwt_io.close channel) Lwt_io.close channel)
let open_fifo name = let open_fifo name =
let fifo = Fpath.(Vmm_core.tmpdir / name + "fifo") in let fifo = Fpath.(Vmm_core.tmpdir / "fifo" / name) in
Lwt.catch (fun () -> Lwt.catch (fun () ->
Logs.debug (fun m -> m "opening %a for reading" Fpath.pp fifo) ; Logs.debug (fun m -> m "opening %a for reading" Fpath.pp fifo) ;
Lwt_io.open_file ~mode:Lwt_io.Input (Fpath.to_string fifo) >>= fun channel -> Lwt_io.open_file ~mode:Lwt_io.Input (Fpath.to_string fifo) >>= fun channel ->

View file

@ -59,7 +59,7 @@ let rec mkfifo name =
let image_file, fifo_file = let image_file, fifo_file =
((fun vm -> Fpath.(tmpdir / (vm_id vm) + "img")), ((fun vm -> Fpath.(tmpdir / (vm_id vm) + "img")),
(fun vm -> Fpath.(tmpdir / (vm_id vm) + "fifo"))) (fun vm -> Fpath.(tmpdir / "fifo" / (vm_id vm))))
let rec fifo_exists file = let rec fifo_exists file =
try Ok (Unix.((stat @@ Fpath.to_string file).st_kind = S_FIFO)) with try Ok (Unix.((stat @@ Fpath.to_string file).st_kind = S_FIFO)) with