Przeglądaj źródła

Return better error messages from file pool

A `qubes.storage.StoragePoolException` will be returned as a useful
error from `qvm-backup`.
Demi Marie Obenour 3 lat temu
rodzic
commit
09785449ed
1 zmienionych plików z 3 dodań i 3 usunięć
  1. 3 3
      qubes/storage/file.py

+ 3 - 3
qubes/storage/file.py

@@ -271,9 +271,9 @@ 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')
+            raise qubes.storage.StoragePoolException('file pool cannot export running volumes')
         if self.is_dirty():
-            self._not_implemented('exporting a dirty volume')
+            raise qubes.storage.StoragePoolException('file pool cannot export dirty volumes')
         self._export_lock = FileVolume._marker_exported
         return self.path
 
@@ -327,7 +327,7 @@ class FileVolume(qubes.storage.Volume):
         if self._export_lock is not None:
             assert self._export_lock is FileVolume._marker_exported, \
                 'nested calls to start()'
-            self._not_implemented('starting a VM with an exported volume')
+            raise qubes.storage.StoragePoolException('file pool cannot start a VM with an exported volume')
         self._export_lock = FileVolume._marker_running
         if not self.save_on_stop and not self.snap_on_start:
             self.reset()