mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
Remove useless SIF_XXX_BE_DOMAIN driver flags.
Signed-off-by: Keir Fraser <keir@xensource.com>
This commit is contained in:
1 parent
3afe806f6f
commit
dc66fe31f3
10 files changed
+13
-73
No files matched your search
@@ -81,19 +81,8 @@ restart_modes = [
|
||||
STATE_DOM_OK = 1
|
||||
STATE_DOM_SHUTDOWN = 2
|
||||
|
||||
"""Flag for a block device backend domain."""
|
||||
SIF_BLK_BE_DOMAIN = (1<<4)
|
||||
|
||||
"""Flag for a net device backend domain."""
|
||||
SIF_NET_BE_DOMAIN = (1<<5)
|
||||
|
||||
"""Flag for a TPM device backend domain."""
|
||||
SIF_TPM_BE_DOMAIN = (1<<7)
|
||||
|
||||
|
||||
SHUTDOWN_TIMEOUT = 30
|
||||
|
||||
|
||||
DOMROOT = '/local/domain/'
|
||||
VMROOT = '/vm/'
|
||||
|
||||
@@ -512,11 +501,6 @@ class XendDomainInfo:
|
||||
if self.info['maxmem_KiB'] > self.info['memory_KiB']:
|
||||
self.info['maxmem_KiB'] = self.info['memory_KiB']
|
||||
|
||||
# Validate the given backend names.
|
||||
for s in self.info['backend']:
|
||||
if s not in backendFlags:
|
||||
raise VmError('Invalid backend type: %s' % s)
|
||||
|
||||
for (n, c) in self.info['device']:
|
||||
if not n or not c or n not in controllerClasses:
|
||||
raise VmError('invalid device (%s, %s)' %
|
||||
@@ -678,8 +662,7 @@ class XendDomainInfo:
|
||||
|
||||
|
||||
def getBackendFlags(self):
|
||||
return reduce(lambda x, y: x | backendFlags[y],
|
||||
self.info['backend'], 0)
|
||||
return 0
|
||||
|
||||
|
||||
def refreshShutdown(self, xeninfo = None):
|
||||
@@ -1409,25 +1392,16 @@ class XendDomainInfo:
|
||||
implements the device control specific to that device-class."""
|
||||
controllerClasses = {}
|
||||
|
||||
|
||||
"""A map of backend names and the corresponding flag."""
|
||||
backendFlags = {}
|
||||
|
||||
|
||||
def addControllerClass(device_class, backend_name, backend_flag, cls):
|
||||
def addControllerClass(device_class, backend_name, cls):
|
||||
"""Register a subclass of DevController to handle the named device-class.
|
||||
|
||||
@param backend_flag One of the SIF_XYZ_BE_DOMAIN constants, or None if
|
||||
no flag is to be set.
|
||||
"""
|
||||
cls.deviceClass = device_class
|
||||
backendFlags[backend_name] = backend_flag
|
||||
controllerClasses[device_class] = cls
|
||||
|
||||
|
||||
from xen.xend.server import blkif, netif, tpmif, pciif, usbif
|
||||
addControllerClass('vbd', 'blkif', SIF_BLK_BE_DOMAIN, blkif.BlkifController)
|
||||
addControllerClass('vif', 'netif', SIF_NET_BE_DOMAIN, netif.NetifController)
|
||||
addControllerClass('vtpm', 'tpmif', SIF_TPM_BE_DOMAIN, tpmif.TPMifController)
|
||||
addControllerClass('pci', 'pciif', None, pciif.PciController)
|
||||
addControllerClass('usb', 'usbif', None, usbif.UsbifController)
|
||||
addControllerClass('vbd', 'blkif', blkif.BlkifController)
|
||||
addControllerClass('vif', 'netif', netif.NetifController)
|
||||
addControllerClass('vtpm', 'tpmif', tpmif.TPMifController)
|
||||
addControllerClass('pci', 'pciif', pciif.PciController)
|
||||
addControllerClass('usb', 'usbif', usbif.UsbifController)
|
||||