diff --git a/qubes/storage/__init__.py b/qubes/storage/__init__.py index 22123b81d..5cd647bee 100644 --- a/qubes/storage/__init__.py +++ b/qubes/storage/__init__.py @@ -486,13 +486,6 @@ def outdated_volumes(self): return result - def rename(self, old_name, new_name): - ''' Notify the pools that the domain was renamed ''' - volumes = self.vm.volumes - for name, volume in volumes.items(): - pool = volume.pool - volumes[name] = pool.rename(volume, old_name, new_name) - @asyncio.coroutine def verify(self): '''Verify that the storage is sane. @@ -722,10 +715,6 @@ def init_volume(self, vm, volume_config): ''' raise self._not_implemented("init_volume") - def rename(self, volume, old_name, new_name): - ''' Called when the domain changes its name ''' - raise self._not_implemented("rename") - def setup(self): ''' Called when adding a pool to the system. Use this for implementation specific set up. diff --git a/qubes/storage/file.py b/qubes/storage/file.py index 5b3522545..f683114ec 100644 --- a/qubes/storage/file.py +++ b/qubes/storage/file.py @@ -79,26 +79,6 @@ def init_volume(self, vm, volume_config): self._volumes += [volume] return volume - def rename(self, volume, old_name, new_name): - assert issubclass(volume.__class__, FileVolume) - subdir, _, volume_path = volume.vid.split('/', 2) - - if volume._is_origin: - # TODO: Renaming the old revisions - new_path = os.path.join(self.dir_path, subdir, new_name) - if not os.path.exists(new_path): - os.mkdir(new_path, 0o755) - new_volume_path = os.path.join(new_path, self.name + '.img') - if not volume.backward_comp: - os.rename(volume.path, new_volume_path) - new_volume_path_cow = os.path.join(new_path, self.name + '-cow.img') - if os.path.exists(new_volume_path_cow) and not volume.backward_comp: - os.rename(volume.path_cow, new_volume_path_cow) - - volume.vid = os.path.join(subdir, new_name, volume_path) - - return volume - def destroy(self): pass diff --git a/qubes/storage/kernels.py b/qubes/storage/kernels.py index 1f965e92e..60d304eba 100644 --- a/qubes/storage/kernels.py +++ b/qubes/storage/kernels.py @@ -157,9 +157,6 @@ def destroy(self): def import_volume(self, dst_pool, dst_volume, src_pool, src_volume): pass - def rename(self, volume, old_name, new_name): - return volume - def setup(self): pass diff --git a/qubes/storage/lvm.py b/qubes/storage/lvm.py index 77f94d0c8..751daf604 100644 --- a/qubes/storage/lvm.py +++ b/qubes/storage/lvm.py @@ -88,23 +88,6 @@ def init_volume(self, vm, volume_config): volume_config['pool'] = self return ThinVolume(**volume_config) - def rename(self, volume, old_name, new_name): - ''' Called when the domain changes its name ''' - new_vid = "{!s}/vm-{!s}-{!s}".format(self.volume_group, new_name, - volume.name) - if volume.save_on_stop: - cmd = ['clone', volume.vid, new_vid] - qubes_lvm(cmd, self.log) - cmd = ['remove', volume.vid] - qubes_lvm(cmd, self.log) - - volume.vid = new_vid - - if volume.snap_on_start: - volume._vid_snap = volume.vid + '-snap' - reset_cache() - return volume - def setup(self): pass # TODO Should we create a non existing pool?