virt-manager/virtinst/devices/redirdev.py
Cole Robinson 2f89ecf4a9 Remove Author lines from file headers
Similar to what was done in libvirt. See these commits:

600462834f
c99e954973
2019-01-08 11:45:35 -05:00

47 lines
1.1 KiB
Python

#
# Copyright 2011, 2013 Red Hat, Inc.
#
# This work is licensed under the GNU GPLv2 or later.
# See the COPYING file in the top-level directory.
from .device import Device
from ..xmlbuilder import XMLProperty
class DeviceRedirdev(Device):
XML_NAME = "redirdev"
@staticmethod
def pretty_type(typ):
if typ == "tcp":
return "TCP"
if typ == "spicevmc":
return "SpiceVMC"
return typ and typ.capitalize()
def parse_friendly_server(self, serverstr):
if serverstr.count(":") != 1:
raise ValueError(_("Could not determine or unsupported "
"format of '%s'") % serverstr)
self.host, self.service = serverstr.split(":")
_XML_PROP_ORDER = ["bus", "type"]
bus = XMLProperty("./@bus")
type = XMLProperty("./@type")
host = XMLProperty("./source/@host")
service = XMLProperty("./source/@service", is_int=True)
##################
# Default config #
##################
def set_defaults(self, guest):
if not self.bus:
self.bus = "usb"
if not self.type:
self.type = "spicevmc"