#!/usr/bin/python2 # # The Qubes OS Project, http://www.qubes-os.org # # Copyright (C) 2013 Marek Marczykowski # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # 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. # # from __future__ import absolute_import import os import os.path import subprocess import sys from qubes.storage import QubesVmStorage from qubes.qubes import QubesException class QubesXenVmStorage(QubesVmStorage): """ Class for VM storage of Xen VMs. """ def __init__(self, vm, **kwargs): super(QubesXenVmStorage, self).__init__(vm, **kwargs) self.root_dev = "xvda" self.private_dev = "xvdb" self.volatile_dev = "xvdc" self.modules_dev = "xvdd" 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 += "