storage/reflink: delete all images at beginning of create()

Ensure that there are no leftover image files for the volume, e.g. from
an unsuccessful removal of a previous incarnation of this vid, or from
an messily restored pool filesystem backup. We don't want to preserve
any stale data (revisions) or metadata (size) in the new incarnation.
This commit is contained in:
Rusty Bird 2020-01-28 13:40:14 +00:00
parent 56f6a6ef65
commit 6659ed8d39
No known key found for this signature in database
GPG Key ID: 469D78F47AAF2ADF

View File

@ -154,6 +154,7 @@ class ReflinkVolume(qubes.storage.Volume):
@_coroutinized
@_locked
def create(self):
self._remove_all_images()
if self.save_on_stop and not self.snap_on_start:
_create_sparse_file(self._path_clean, self._get_size())
return self