diff --git a/core/storage/__init__.py b/core/storage/__init__.py index 8e2ac720..c5d3c4a1 100644 --- a/core/storage/__init__.py +++ b/core/storage/__init__.py @@ -30,7 +30,7 @@ import subprocess import sys import qubes.qubesutils -from qubes.qubes import QubesException, defaults, system_path, vm_files +from qubes.qubes import QubesException, defaults, system_path CONFIG_FILE = '/etc/qubes/storage.conf' @@ -57,6 +57,10 @@ class QubesVmStorage(object): else: self.root_img_size = defaults['root_img_size'] + self.root_dev = "xvda" + self.private_dev = "xvdb" + self.volatile_dev = "xvdc" + self.modules_dev = "xvdd" # For now compute this path still in QubesVm self.modules_img = modules_img @@ -65,6 +69,25 @@ class QubesVmStorage(object): # Additional drive (currently used only by HVM) self.drive = None + def format_disk_dev(self, path, script, vdev, rw=True, type="disk", + domain=None): + if path is None: + return '' + template = " \n" \ + " \n" \ + " \n" \ + " \n" \ + "{params}" \ + " \n" + params = "" + if not rw: + params += " \n" + if domain: + params += " \n" % domain + if script: + params += "