devices: Remove a bunch of unused static lists

This commit is contained in:
Cole Robinson 2018-09-06 11:49:09 -04:00
parent 84a68d56de
commit be1f5a6e25
5 changed files with 3 additions and 41 deletions

View File

@ -39,22 +39,6 @@ class _DeviceChar(Device):
MODE_BIND = "bind"
MODES = [MODE_CONNECT, MODE_BIND]
PROTOCOL_RAW = "raw"
PROTOCOL_TELNET = "telnet"
PROTOCOLS = [PROTOCOL_RAW, PROTOCOL_TELNET]
CHANNEL_TARGET_GUESTFWD = "guestfwd"
CHANNEL_TARGET_VIRTIO = "virtio"
CHANNEL_TARGETS = [CHANNEL_TARGET_GUESTFWD,
CHANNEL_TARGET_VIRTIO]
CONSOLE_TARGET_SERIAL = "serial"
CONSOLE_TARGET_UML = "uml"
CONSOLE_TARGET_XEN = "xen"
CONSOLE_TARGET_VIRTIO = "virtio"
CONSOLE_TARGETS = [CONSOLE_TARGET_SERIAL, CONSOLE_TARGET_UML,
CONSOLE_TARGET_XEN, CONSOLE_TARGET_VIRTIO]
CHANNEL_NAME_SPICE = "com.redhat.spice.0"
CHANNEL_NAME_QEMUGA = "org.qemu.guest_agent.0"
CHANNEL_NAME_LIBGUESTFS = "org.libguestfs.channel.0"
@ -233,9 +217,9 @@ class _DeviceChar(Device):
if not self.source_mode and self.supports_property("source_mode"):
self.source_mode = self.MODE_BIND
if not self.protocol and self.supports_property("protocol"):
self.protocol = self.PROTOCOL_RAW
self.protocol = "raw"
if not self.target_type and self.DEVICE_TYPE == "channel":
self.target_type = self.CHANNEL_TARGET_VIRTIO
self.target_type = "virtio"
if not self.target_name and self.type == self.TYPE_SPICEVMC:
self.target_name = self.CHANNEL_NAME_SPICE

View File

@ -35,10 +35,6 @@ class DeviceAddress(XMLBuilder):
ADDRESS_TYPE_CCID = "ccid"
ADDRESS_TYPE_SPAPR_VIO = "spapr-vio"
TYPES = [ADDRESS_TYPE_PCI, ADDRESS_TYPE_DRIVE,
ADDRESS_TYPE_VIRTIO_SERIAL, ADDRESS_TYPE_CCID,
ADDRESS_TYPE_SPAPR_VIO]
XML_NAME = "address"
_XML_PROP_ORDER = ["type", "domain", "controller", "bus", "slot",
"function", "target", "unit", "multifunction"]

View File

@ -44,7 +44,6 @@ class DeviceGraphics(Device):
TYPE_VNC = "vnc"
TYPE_RDP = "rdp"
TYPE_SPICE = "spice"
TYPES = [TYPE_VNC, TYPE_SDL, TYPE_RDP, TYPE_SPICE]
CHANNEL_TYPE_MAIN = "main"
CHANNEL_TYPE_DISPLAY = "display"
@ -52,15 +51,6 @@ class DeviceGraphics(Device):
CHANNEL_TYPE_CURSOR = "cursor"
CHANNEL_TYPE_PLAYBACK = "playback"
CHANNEL_TYPE_RECORD = "record"
CHANNEL_TYPES = [CHANNEL_TYPE_MAIN, CHANNEL_TYPE_DISPLAY,
CHANNEL_TYPE_INPUTS, CHANNEL_TYPE_CURSOR,
CHANNEL_TYPE_PLAYBACK, CHANNEL_TYPE_RECORD]
CHANNEL_MODE_SECURE = "secure"
CHANNEL_MODE_INSECURE = "insecure"
CHANNEL_MODE_ANY = "any"
CHANNEL_MODES = [CHANNEL_MODE_SECURE, CHANNEL_MODE_INSECURE,
CHANNEL_MODE_ANY]
KEYMAP_LOCAL = "local"
KEYMAP_DEFAULT = "default"

View File

@ -16,9 +16,6 @@ class DevicePanic(Device):
MODEL_PSERIES = "pseries"
MODEL_HYPERV = "hyperv"
MODEL_S390 = "s390"
MODELS = [MODEL_ISA, MODEL_PSERIES, MODEL_HYPERV, MODEL_S390]
ISA_ADDRESS_TYPE = "isa"
@staticmethod
def get_pretty_model(panic_model):
@ -61,6 +58,6 @@ class DevicePanic(Device):
def set_defaults(self, guest):
if not self.type and self.iobase:
self.type = DevicePanic.ISA_ADDRESS_TYPE
self.type = "isa"
if not self.model:
self.model = self.get_default_model(guest)

View File

@ -51,9 +51,6 @@ class _CPUFeature(XMLBuilder):
"""
Class for generating <cpu> child <feature> XML
"""
POLICIES = ["force", "require", "optional", "disable", "forbid"]
XML_NAME = "feature"
_XML_PROP_ORDER = ["policy", "name"]
@ -65,8 +62,6 @@ class DomainCpu(XMLBuilder):
"""
Class for generating <cpu> XML
"""
MATCHS = ["minimum", "exact", "strict"]
XML_NAME = "cpu"
_XML_PROP_ORDER = ["mode", "match", "_model", "vendor",
"sockets", "cores", "threads", "features"]