storage/lvm: make sure volume cache is refreshed after changes
Even if start/stop fails, still refresh the cache. The failed operation might still modified something.
This commit is contained in:
		
							parent
							
								
									145ccfb34e
								
							
						
					
					
						commit
						08583af1ff
					
				@ -432,16 +432,18 @@ class ThinVolume(qubes.storage.Volume):
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    def start(self):
 | 
			
		||||
        try:
 | 
			
		||||
            if self.snap_on_start or self.save_on_stop:
 | 
			
		||||
                if not self.save_on_stop or not self.is_dirty():
 | 
			
		||||
                    self._snapshot()
 | 
			
		||||
            else:
 | 
			
		||||
                self._reset()
 | 
			
		||||
 | 
			
		||||
        finally:
 | 
			
		||||
            reset_cache()
 | 
			
		||||
        return self
 | 
			
		||||
 | 
			
		||||
    def stop(self):
 | 
			
		||||
        try:
 | 
			
		||||
            if self.save_on_stop:
 | 
			
		||||
                self._commit()
 | 
			
		||||
            if self.snap_on_start or self.save_on_stop:
 | 
			
		||||
@ -450,6 +452,7 @@ class ThinVolume(qubes.storage.Volume):
 | 
			
		||||
            else:
 | 
			
		||||
                cmd = ['remove', self.vid]
 | 
			
		||||
                qubes_lvm(cmd, self.log)
 | 
			
		||||
        finally:
 | 
			
		||||
            reset_cache()
 | 
			
		||||
        return self
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user