Fix bugs found by Rusty Bird

This commit is contained in:
Demi Marie Obenour 2020-11-25 16:42:35 -05:00
parent ec51673f21
commit 7275939000
No known key found for this signature in database
GPG Key ID: 28A45C93B0B5B6E0

View File

@ -271,6 +271,8 @@ class FileVolume(qubes.storage.Volume):
if self._export_lock is not None:
assert self._export_lock is FileVolume._marker_running, \
'nested calls to export()'
self._not_implemented('exporting a starting volume')
if self.is_dirty():
self._not_implemented('exporting a dirty volume')
self._export_lock = FileVolume._marker_exported
return self.path
@ -326,8 +328,6 @@ class FileVolume(qubes.storage.Volume):
assert self._export_lock is FileVolume._marker_exported, \
'nested calls to start()'
self._not_implemented('starting a VM with an exported volume')
if self.is_dirty():
self._not_implemented('exporting a dirty volume')
self._export_lock = FileVolume._marker_running
if not self.save_on_stop and not self.snap_on_start:
self.reset()