From bc7706cc97531aaf1f4dd0291a26c2307f32d647 Mon Sep 17 00:00:00 2001 From: xaki23 Date: Sun, 25 Aug 2019 18:12:59 +0200 Subject: [PATCH] rename things for newer mirage-xen versions --- client_net.ml | 2 +- dao.ml | 8 ++++---- memory_pressure.ml | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/client_net.ml b/client_net.ml index 68fe6d3..df436be 100644 --- a/client_net.ml +++ b/client_net.ml @@ -4,7 +4,7 @@ open Lwt.Infix open Fw_utils -module Netback = Netchannel.Backend.Make(Netchannel.Xenstore.Make(OS.Xs)) +module Netback = Netchannel.Backend.Make(Netchannel.Xenstore.Make(Os_xen.Xs)) module ClientEth = Ethernet.Make(Netback) let src = Logs.Src.create "client_net" ~doc:"Client networking" diff --git a/dao.ml b/dao.ml index a68cc64..55d901e 100644 --- a/dao.ml +++ b/dao.ml @@ -30,7 +30,7 @@ module VifMap = struct end let directory ~handle dir = - OS.Xs.directory handle dir >|= function + Os_xen.Xs.directory handle dir >|= function | [""] -> [] (* XenStore client bug *) | items -> items @@ -46,7 +46,7 @@ let vifs ~handle domid = | Some device_id -> let vif = { ClientVif.domid; device_id } in Lwt.try_bind - (fun () -> OS.Xs.read handle (Printf.sprintf "%s/%d/ip" path device_id)) + (fun () -> Os_xen.Xs.read handle (Printf.sprintf "%s/%d/ip" path device_id)) (fun client_ip -> let client_ip = Ipaddr.V4.of_string_exn client_ip in Lwt.return (Some (vif, client_ip)) @@ -61,10 +61,10 @@ let vifs ~handle domid = ) let watch_clients fn = - OS.Xs.make () >>= fun xs -> + Os_xen.Xs.make () >>= fun xs -> let backend_vifs = "backend/vif" in Log.info (fun f -> f "Watching %s" backend_vifs); - OS.Xs.wait xs (fun handle -> + Os_xen.Xs.wait xs (fun handle -> begin Lwt.catch (fun () -> directory ~handle backend_vifs) (function diff --git a/memory_pressure.ml b/memory_pressure.ml index ed5b7e5..92271da 100644 --- a/memory_pressure.ml +++ b/memory_pressure.ml @@ -6,7 +6,7 @@ open Lwt let src = Logs.Src.create "memory_pressure" ~doc:"Memory pressure monitor" module Log = (val Logs.src_log src : Logs.LOG) -let total_pages = OS.MM.Heap_pages.total () +let total_pages = Os_xen.MM.Heap_pages.total () let pagesize_kb = Io_page.page_size / 1024 let meminfo ~used = @@ -23,7 +23,7 @@ let meminfo ~used = let report_mem_usage used = Lwt.async (fun () -> - let open OS in + let open Os_xen in Xs.make () >>= fun xs -> Xs.immediate xs (fun h -> Xs.write h "memory/meminfo" (meminfo ~used) @@ -32,16 +32,16 @@ let report_mem_usage used = let init () = Gc.full_major (); - let used = OS.MM.Heap_pages.used () in + let used = Os_xen.MM.Heap_pages.used () in report_mem_usage used let status () = - let used = OS.MM.Heap_pages.used () |> float_of_int in + let used = Os_xen.MM.Heap_pages.used () |> float_of_int in let frac = used /. float_of_int total_pages in if frac < 0.9 then `Ok else ( Gc.full_major (); - let used = OS.MM.Heap_pages.used () in + let used = Os_xen.MM.Heap_pages.used () in report_mem_usage used; let frac = float_of_int used /. float_of_int total_pages in if frac > 0.9 then `Memory_critical