mirror of
https://github.com/mirage/qubes-mirage-firewall.git
synced 2024-12-26 07:39:25 -05:00
address @hannesm comments
This commit is contained in:
parent
46deafa650
commit
05c7a8d1d9
14
config.ml
14
config.ml
@ -1,4 +1,4 @@
|
|||||||
(* mirage >= 4.5.0 *)
|
(* mirage >= 4.5.0 & < 5.0.0 *)
|
||||||
(* Copyright (C) 2017, Thomas Leonard <thomas.leonard@unikernel.com>
|
(* Copyright (C) 2017, Thomas Leonard <thomas.leonard@unikernel.com>
|
||||||
See the README file for details. *)
|
See the README file for details. *)
|
||||||
|
|
||||||
@ -14,23 +14,23 @@ let ipv4_dns2 = runtime_arg ~pos:__POS__ "Unikernel.ipv4_dns2"
|
|||||||
|
|
||||||
let main =
|
let main =
|
||||||
main
|
main
|
||||||
~runtime_args:[ nat_table_size; ]
|
~runtime_args:[ nat_table_size; ipv4; ipv4_gw; ipv4_dns; ipv4_dns2; ]
|
||||||
~packages:[
|
~packages:[
|
||||||
package "vchan" ~min:"4.0.2";
|
package "vchan" ~min:"4.0.2";
|
||||||
package "cstruct";
|
package "cstruct";
|
||||||
package "astring";
|
package "astring";
|
||||||
package "tcpip" ~min:"3.7.0";
|
package "tcpip" ~min:"3.7.0";
|
||||||
package "arp" ~min:"2.3.0" ~sublibs:["mirage"];
|
package ~min:"2.3.0" ~sublibs:["mirage"] "arp";
|
||||||
package "ethernet" ~min:"3.0.0";
|
package ~min:"3.0.0" "ethernet";
|
||||||
package "shared-memory-ring" ~min:"3.0.0";
|
package "shared-memory-ring" ~min:"3.0.0";
|
||||||
package "netchannel" ~min:"2.1.3";
|
package ~min:"2.1.3" "netchannel";
|
||||||
package "mirage-net-xen" ~min:"2.1.3";
|
package "mirage-net-xen" ~min:"2.1.3";
|
||||||
package "ipaddr" ~min:"5.2.0";
|
package "ipaddr" ~min:"5.2.0";
|
||||||
package "mirage-qubes" ~min:"0.9.1";
|
package "mirage-qubes" ~min:"0.9.1";
|
||||||
package "mirage-nat" ~min:"3.0.1";
|
package ~min:"3.0.1" "mirage-nat";
|
||||||
package "mirage-logs";
|
package "mirage-logs";
|
||||||
package "mirage-xen" ~min:"8.0.0";
|
package "mirage-xen" ~min:"8.0.0";
|
||||||
package "dns-client" ~min:"6.4.0";
|
package ~min:"6.4.0" "dns-client";
|
||||||
package "pf-qubes";
|
package "pf-qubes";
|
||||||
]
|
]
|
||||||
"Unikernel.Main" (random @-> mclock @-> time @-> job)
|
"Unikernel.Main" (random @-> mclock @-> time @-> job)
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
(* Copyright (C) 2015, Thomas Leonard <thomas.leonard@unikernel.com>
|
(* Copyright (C) 2015, Thomas Leonard <thomas.leonard@unikernel.com>
|
||||||
See the README file for details. *)
|
See the README file for details. *)
|
||||||
|
|
||||||
open Lwt
|
|
||||||
|
|
||||||
let src = Logs.Src.create "memory_pressure" ~doc:"Memory pressure monitor"
|
let src = Logs.Src.create "memory_pressure" ~doc:"Memory pressure monitor"
|
||||||
module Log = (val Logs.src_log src : Logs.LOG)
|
module Log = (val Logs.src_log src : Logs.LOG)
|
||||||
|
|
||||||
@ -12,21 +10,6 @@ let fraction_free stats =
|
|||||||
let { Xen_os.Memory.free_words; heap_words; _ } = stats in
|
let { Xen_os.Memory.free_words; heap_words; _ } = stats in
|
||||||
float free_words /. float heap_words
|
float free_words /. float heap_words
|
||||||
|
|
||||||
let meminfo stats =
|
|
||||||
let { Xen_os.Memory.free_words; heap_words; _ } = stats in
|
|
||||||
let mem_total = heap_words * wordsize_in_bytes in
|
|
||||||
let mem_free = free_words * wordsize_in_bytes in
|
|
||||||
Log.info (fun f -> f "Writing meminfo: free %a / %a (%.2f %%)"
|
|
||||||
Fmt.bi_byte_size mem_free
|
|
||||||
Fmt.bi_byte_size mem_total
|
|
||||||
(fraction_free stats *. 100.0));
|
|
||||||
Printf.sprintf "MemTotal: %d kB\n\
|
|
||||||
MemFree: %d kB\n\
|
|
||||||
Buffers: 0 kB\n\
|
|
||||||
Cached: 0 kB\n\
|
|
||||||
SwapTotal: 0 kB\n\
|
|
||||||
SwapFree: 0 kB\n" (mem_total / 1024) (mem_free / 1024)
|
|
||||||
|
|
||||||
let init () =
|
let init () =
|
||||||
Gc.full_major ()
|
Gc.full_major ()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user