qmemman: fix crash when VM fails to start
In this case, qmemman would not manage to get any memory state for such VM, so memory_current would be 'None'. But later it would perform arithmetics on it, which would result in qmemman crash (TypeError exception). Fixes QubesOS/qubes-issues#1601
This commit is contained in:
		
							parent
							
								
									301eed55b3
								
							
						
					
					
						commit
						78b63eb21a
					
				@ -37,7 +37,7 @@ slow_memset_react_msg="VM didn't give back all requested memory"
 | 
			
		||||
class DomainState:
 | 
			
		||||
    def __init__(self, id):
 | 
			
		||||
        self.meminfo = None		#dictionary of memory info read from client
 | 
			
		||||
        self.memory_current = None	#the current memory size
 | 
			
		||||
        self.memory_current = 0     # the current memory size
 | 
			
		||||
        self.memory_actual = None   # the current memory allocation (what VM
 | 
			
		||||
                                    #  is using or can use at any time)
 | 
			
		||||
        self.memory_maximum = None	#the maximum memory size
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user