From 15d5e6edbb1222d79b2deb3fa68f299ad2c76c2a Mon Sep 17 00:00:00 2001 From: Bahtiar `kalkin-` Gadimov Date: Sat, 7 Nov 2015 18:58:49 +0100 Subject: [PATCH] Add Pool & XenPool --- core/settings-xen-Linux.py | 4 +++- core/storage/__init__.py | 13 ++++++++----- core/storage/xen.py | 12 ++++++++---- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/core/settings-xen-Linux.py b/core/settings-xen-Linux.py index de5084f5..8b23b447 100644 --- a/core/settings-xen-Linux.py +++ b/core/settings-xen-Linux.py @@ -2,7 +2,9 @@ from __future__ import absolute_import -from qubes.storage.xen import QubesXenVmStorage +from qubes.storage.xen import QubesXenVmStorage, XenPool + def apply(system_path, vm_files, defaults): defaults['storage_class'] = QubesXenVmStorage + defaults['pool_types'] = {'xen': XenPool} diff --git a/core/storage/__init__.py b/core/storage/__init__.py index 29cf8654..795aa37a 100644 --- a/core/storage/__init__.py +++ b/core/storage/__init__.py @@ -16,22 +16,21 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +# USA. # from __future__ import absolute_import import os import os.path -import re import shutil import subprocess import sys -from qubes.qubes import vm_files,system_path,defaults -from qubes.qubes import QubesException import qubes.qubesutils +from qubes.qubes import QubesException, defaults, system_path, vm_files + class QubesVmStorage(object): """ @@ -199,3 +198,7 @@ class QubesVmStorage(object): print >>sys.stderr, "WARNING: Creating empty VM private image file: {0}".\ format(self.private_img) self.create_on_disk_private_img(verbose=False) + + +class Pool(object): + pass diff --git a/core/storage/xen.py b/core/storage/xen.py index 00c3b3da..f66126a6 100644 --- a/core/storage/xen.py +++ b/core/storage/xen.py @@ -16,20 +16,20 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +# USA. # from __future__ import absolute_import import os import os.path +import re import subprocess import sys -import re -from qubes.storage import QubesVmStorage from qubes.qubes import QubesException, vm_files +from qubes.storage import Pool, QubesVmStorage class QubesXenVmStorage(QubesVmStorage): @@ -249,3 +249,7 @@ class QubesXenVmStorage(QubesVmStorage): raise QubesException( "VM '{}' holding '{}' does not exists".format( drive_domain, drive_path)) + + +class XenPool(Pool): + pass