Skip to content

Commit d9cfc92

Browse files
committed
CA-85168: Initialize dom0 memory_dynamic_min and memory_dynamic_max with some sensible values
Signed-off-by: Thomas Gazagnaire <[email protected]>
1 parent 9208528 commit d9cfc92

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ocaml/xapi/xapi_xenops.ml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,6 +1140,8 @@ let rec events_watch ~__context from =
11401140
let manage_dom0 dbg =
11411141
(* Tell xenopsd to manage domain 0 *)
11421142
let uuid = Xapi_inventory.lookup Xapi_inventory._control_domain_uuid in
1143+
let di = Vmopshelpers.with_xc (fun xc -> Xenctrl.domain_getinfo xc 0) in
1144+
let memory_actual_kib = Xenctrl.pages_to_kib (Int64.of_nativeint di.Xenctrl.total_memory_pages) in
11431145
let open Vm in
11441146
if not(vm_exists_in_xenopsd dbg uuid)
11451147
then begin
@@ -1157,9 +1159,9 @@ let manage_dom0 dbg =
11571159
};
11581160
suppress_spurious_page_faults = false;
11591161
machine_address_size = None;
1160-
memory_static_max = 0L;
1161-
memory_dynamic_max = 0L;
1162-
memory_dynamic_min = 0L;
1162+
memory_static_max = memory_actual_kib;
1163+
memory_dynamic_max = memory_actual_kib;
1164+
memory_dynamic_min = memory_actual_kib;
11631165
vcpu_max = 0;
11641166
vcpus = 0;
11651167
scheduler_params = { priority = None; affinity = [] };

0 commit comments

Comments
 (0)