File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ let filtered_xsdata =
6969	List. filter allowed
7070
7171exception  Restore_signature_mismatch 
72+ exception  Not_enough_memory  of int64 
7273exception  Domain_build_failed 
7374exception  Domain_restore_failed 
7475exception  Domain_restore_truncated_hvmstate 
@@ -465,7 +466,11 @@ let build_pre ~xc ~xs ~vcpus ~xen_max_mib ~shadow_mib ~required_host_free_mib do
465466	let  uuid =  get_uuid ~xc  domid in 
466467	debug " VM = %s; domid = %d; waiting for %Ld MiB of free host memory" Uuid. to_string uuid) domid required_host_free_mib;
467468	(*  CA-39743: Wait, if necessary, for the Xen scrubber to catch up. *) 
468- 	let  (_: bool ) =  wait_xen_free_mem ~xc  (Memory. kib_of_mib required_host_free_mib) in 
469+ 	if  not (wait_xen_free_mem ~xc  (Memory. kib_of_mib required_host_free_mib)) then  begin 
470+ 		error " VM = %s; domid = %d; Failed waiting for Xen to free %Ld MiB" 
471+ 			(Uuid. to_string uuid) domid required_host_free_mib;
472+ 		raise (Not_enough_memory  (Memory. bytes_of_mib required_host_free_mib))
473+ 	end ;
469474
470475	let  shadow_mib =  Int64. to_int shadow_mib in 
471476
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ open Device_common
1818type  domid  = Xenctrl .domid 
1919
2020exception  Restore_signature_mismatch 
21+ exception  Not_enough_memory  of int64 
2122exception  Domain_build_failed 
2223exception  Domain_restore_failed 
2324exception  Xenguest_protocol_failure  of string  (*  internal protocol failure *) 
Original file line number Diff line number Diff line change @@ -1079,8 +1079,11 @@ module VM = struct
10791079				let  m =  Printf. sprintf " VM = %s; domid = %d; Bootloader.Error_from_bootloader %s" Vm. id domid x in 
10801080				debug " %s" 
10811081				raise (Bootloader_error  (vm.Vm. id, x))
1082+ 			|  Domain. Not_enough_memory  m  ->
1083+ 				debug " VM = %s; domid = %d; Domain.Not_enough_memory. Needed: %Ld bytes" Vm. id domid m;
1084+ 				raise (Not_enough_memory  m)
10821085			|  e  ->
1083- 				let  m =  Printf. sprintf " VM = %s; domid = %d; Bootloader error : %s" Vm. id domid (Printexc. to_string e) in 
1086+ 				let  m =  Printf. sprintf " VM = %s; domid = %d; Error : %s" Vm. id domid (Printexc. to_string e) in 
10841087				debug " %s" 
10851088				raise e
10861089
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments