File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -2037,12 +2037,16 @@ let vm_install_real printer rpc session_id template name description params =
20372037
20382038	let  suspend_sr_ref =  match  sr_ref with 
20392039		|  Some  sr  ->
2040- 			if  sr =  Ref. null then 
2041- 				(*  Template is a snapshot - copy the suspend_SR from the template *) 
2042- 				Client.VM. get_suspend_SR rpc session_id template
2043- 			else 
2040+ 			let  ref_is_valid =  Server_helpers. exec_with_new_task
2041+ 				~session_id  " Checking suspend_SR validity" 
2042+ 				(fun  __context  -> Db. is_valid_ref __context sr)
2043+ 			in 
2044+ 			if  ref_is_valid then 
20442045				(*  sr-uuid and/or sr-name-label was specified - use this as the suspend_SR *) 
20452046				sr
2047+ 			else 
2048+ 				(*  Template is a snapshot - copy the suspend_SR from the template *) 
2049+ 				Client.VM. get_suspend_SR rpc session_id template
20462050		|  None  ->
20472051			(*  Not a snapshot and no sr-uuid or sr-name-label specified - copy the suspend_SR from the template *) 
20482052			Client.VM. get_suspend_SR rpc session_id template in 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments