@@ -1830,6 +1830,7 @@ module VM = struct
18301830 let dbg = Xenops_task. get_dbg task in
18311831 Mem. with_reservation dbg min_kib max_kib
18321832 (fun target_plus_overhead_kib reservation_id ->
1833+ debug " VM = %s, memory [%Ld KiB, %Ld KiB], target_plus_overhead=%Ld KiB" vm.Vm. id min_kib max_kib target_plus_overhead_kib;
18331834 let domain_config, persistent =
18341835 match persistent.VmExtra. domain_config with
18351836 | Some dc ->
@@ -1870,6 +1871,7 @@ module VM = struct
18701871 let target_bytes =
18711872 target_plus_overhead_bytes --- overhead_bytes
18721873 in
1874+ debug " VM = %s, memory target_bytes = %Ld, dynamic max = %Ld" vm.Vm. id target_bytes vm.memory_dynamic_max;
18731875 min vm.memory_dynamic_max target_bytes
18741876 in
18751877 set_initial_target ~xs domid (Int64. div initial_target 1024L ) ;
@@ -2967,6 +2969,7 @@ module VM = struct
29672969 | _ ->
29682970 " "
29692971 in
2972+ debug " VM = %s, initial_target = %Ld" vm.Vm. id initial_target;
29702973 ({x with Domain. memory_target= initial_target}, timeoffset)
29712974 in
29722975 let vtpm = vtpm_of ~vm in
@@ -3106,7 +3109,9 @@ module VM = struct
31063109 let memory_actual =
31073110 let pages = Int64. of_nativeint di.Xenctrl. total_memory_pages in
31083111 let kib = Xenctrl. pages_to_kib pages in
3109- Memory. bytes_of_kib kib
3112+ let bytes = Memory. bytes_of_kib kib in
3113+ D. debug " VM %s memory actual: %Ld pages = %Ld KiB = %Ld bytes" (Uuidm. to_string uuid) pages kib bytes;
3114+ bytes
31103115 in
31113116 let memory_limit =
31123117 (* The maximum amount of memory the domain can consume is the max
@@ -3129,7 +3134,9 @@ module VM = struct
31293134 in
31303135 (* CA-31764: may be larger than static_max if maxmem has been
31313136 increased to initial-reservation. *)
3132- max memory_actual max_memory_bytes
3137+ let result = max memory_actual max_memory_bytes in
3138+ D. debug " VM %s memory limit = %Ld bytes" (Uuidm. to_string uuid) result;
3139+ result
31333140 in
31343141 let rtc =
31353142 try
0 commit comments