consolecontroller.py

来自「xen虚拟机源代码安装包」· Python 代码 · 共 39 行

PY
39
字号
from xen.xend.server.DevController import DevControllerfrom xen.xend.XendLogging import logfrom xen.xend.XendError import VmErrorclass ConsoleController(DevController):    """A dummy controller for us to represent serial and vnc    console devices with persistent UUIDs.    """    valid_cfg = ['location', 'uuid', 'protocol']    def __init__(self, vm):        DevController.__init__(self, vm)        self.hotplug = False    def getDeviceDetails(self, config):        back = dict([(k, config[k]) for k in self.valid_cfg if k in config])        return (self.allocateDeviceID(), back, {})    def getDeviceConfiguration(self, devid, transaction = None):        result = DevController.getDeviceConfiguration(self, devid, transaction)        if transaction is None:            devinfo = self.readBackend(devid, *self.valid_cfg)        else:            devinfo = self.readBackendTxn(transaction, devid, *self.valid_cfg)        config = dict(zip(self.valid_cfg, devinfo))        config = dict([(key, val) for key, val in config.items()                       if val != None])        return config    def migrate(self, deviceConfig, network, dst, step, domName):        return 0    def destroyDevice(self, devid, force):        DevController.destroyDevice(self, devid, True)        

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?