diff --git a/qubes/storage/kernels.py b/qubes/storage/kernels.py index d7441b29..8242aafa 100644 --- a/qubes/storage/kernels.py +++ b/qubes/storage/kernels.py @@ -71,12 +71,18 @@ class LinuxKernel(Pool): 'driver': LinuxKernel.driver, } + def destroy(self): + pass + def remove(self, volume): pass def rename(self, volume, old_name, new_name): return volume + def setup(self): + pass + def start(self, volume): path = volume.path if not os.path.exists(path): diff --git a/qubes/storage/xen.py b/qubes/storage/xen.py index aad54d9b..7bb0dfb3 100644 --- a/qubes/storage/xen.py +++ b/qubes/storage/xen.py @@ -45,12 +45,6 @@ class XenPool(Pool): assert dir_path, "No pool dir_path specified" self.dir_path = os.path.normpath(dir_path) - create_dir_if_not_exists(self.dir_path) - appvms_path = os.path.join(self.dir_path, 'appvms') - create_dir_if_not_exists(appvms_path) - vm_templates_path = os.path.join(self.dir_path, 'vm-templates') - create_dir_if_not_exists(vm_templates_path) - def clone(self, source, target): ''' Clones the volume if the `source.pool` if the source is a :py:class:`XenVolume`. @@ -148,6 +142,16 @@ class XenPool(Pool): os.umask(old_umask) return volume + def destroy(self): + pass + + def setup(self): + create_dir_if_not_exists(self.dir_path) + appvms_path = os.path.join(self.dir_path, 'appvms') + create_dir_if_not_exists(appvms_path) + vm_templates_path = os.path.join(self.dir_path, 'vm-templates') + create_dir_if_not_exists(vm_templates_path) + def start(self, volume): if volume.volume_type == 'volatile': self._reset_volume(volume)