From 8e0207a199f9e7a3503646acef2fac4f21e1a945 Mon Sep 17 00:00:00 2001 From: Bahtiar `kalkin-` Gadimov Date: Sat, 7 Nov 2015 19:04:51 +0100 Subject: [PATCH] Rename QubesXenVmStorage to XenStorage --- core/settings-xen-Linux.py | 4 ++-- core/storage/xen.py | 10 +++++----- tests/storage.py | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/core/settings-xen-Linux.py b/core/settings-xen-Linux.py index 8b23b447..30669407 100644 --- a/core/settings-xen-Linux.py +++ b/core/settings-xen-Linux.py @@ -2,9 +2,9 @@ from __future__ import absolute_import -from qubes.storage.xen import QubesXenVmStorage, XenPool +from qubes.storage.xen import XenStorage, XenPool def apply(system_path, vm_files, defaults): - defaults['storage_class'] = QubesXenVmStorage + defaults['storage_class'] = XenStorage defaults['pool_types'] = {'xen': XenPool} diff --git a/core/storage/xen.py b/core/storage/xen.py index f66126a6..9c1a75cc 100644 --- a/core/storage/xen.py +++ b/core/storage/xen.py @@ -32,13 +32,13 @@ from qubes.qubes import QubesException, vm_files from qubes.storage import Pool, QubesVmStorage -class QubesXenVmStorage(QubesVmStorage): +class XenStorage(QubesVmStorage): """ Class for VM storage of Xen VMs. """ def __init__(self, vm, **kwargs): - super(QubesXenVmStorage, self).__init__(vm, **kwargs) + super(XenStorage, self).__init__(vm, **kwargs) self.root_dev = "xvda" self.private_dev = "xvdb" @@ -158,7 +158,7 @@ class QubesXenVmStorage(QubesVmStorage): self.commit_template_changes() def rename(self, old_name, new_name): - super(QubesXenVmStorage, self).rename(old_name, new_name) + super(XenStorage, self).rename(old_name, new_name) old_dirpath = os.path.join(os.path.dirname(self.vmdir), old_name) if self.rootcow_img: @@ -226,11 +226,11 @@ class QubesXenVmStorage(QubesVmStorage): f_volatile.close() f_root.close() return - super(QubesXenVmStorage, self).reset_volatile_storage( + super(XenStorage, self).reset_volatile_storage( verbose=verbose, source_template=source_template) def prepare_for_vm_startup(self, verbose): - super(QubesXenVmStorage, self).prepare_for_vm_startup(verbose=verbose) + super(XenStorage, self).prepare_for_vm_startup(verbose=verbose) if self.drive is not None: (drive_type, drive_domain, drive_path) = self.drive.split(":") diff --git a/tests/storage.py b/tests/storage.py index 30b9cd2d..a52b62b4 100644 --- a/tests/storage.py +++ b/tests/storage.py @@ -21,7 +21,7 @@ from qubes.tests import QubesTestCase, SystemTestsMixin from qubes.qubes import defaults import qubes.storage -from qubes.storage.xen import QubesXenVmStorage, XenPool +from qubes.storage.xen import XenStorage, XenPool class TC_00_Storage(SystemTestsMixin, QubesTestCase): @@ -33,13 +33,13 @@ class TC_00_Storage(SystemTestsMixin, QubesTestCase): storage = self.qc.add_new_vm('QubesAppVm', name=vmname, pool='default', template=template).storage result = qubes.storage.dump(storage) - expected = 'qubes.storage.xen.QubesXenVmStorage' + expected = 'qubes.storage.xen.XenStorage' self.assertEquals(result, expected) def test_001_load(self): """ Loads storage type from a storage string """ - result = qubes.storage.load('qubes.storage.xen.QubesXenVmStorage') - self.assertTrue(result is QubesXenVmStorage) + result = qubes.storage.load('qubes.storage.xen.XenStorage') + self.assertTrue(result is XenStorage) def test_002_default_pool_types(self): """ The only predifined pool type is xen """ @@ -60,4 +60,4 @@ class TC_01_Storage(SystemTestsMixin, QubesTestCase): template = self.qc.get_default_template() vm = self.qc.add_new_vm('QubesAppVm', name=vmname, template=template, pool='default') - self.assertIsInstance(vm.storage, QubesXenVmStorage) + self.assertIsInstance(vm.storage, XenStorage)