storage/reflink: refuse to revert() dirty volume

This commit is contained in:
Rusty Bird 2018-09-09 20:01:13 +00:00
parent 677183d8a6
commit 18f9356c2c
No known key found for this signature in database
GPG Key ID: 469D78F47AAF2ADF

View File

@ -197,6 +197,9 @@ class ReflinkVolume(qubes.storage.Volume):
_remove_file(self._path_revision(number, timestamp))
def revert(self, revision=None):
if self.is_dirty():
raise qubes.storage.StoragePoolException(
'Cannot revert: {} is not cleanly stopped'.format(self.vid))
if revision is None:
number, timestamp = list(self.revisions.items())[-1]
else: