def __init__(self, macaddr=None, type=TYPE_BRIDGE, bridge=None,
                 network=None, model=None, conn=None,
                 parsexml=None, parsexmlnode=None, caps=None):
        # pylint: disable=W0622
        # Redefining built-in 'type', but it matches the XML so keep it

        VirtualDevice.__init__(self, conn, parsexml, parsexmlnode, caps)

        self._network = None
        self._bridge = None
        self._macaddr = None
        self._type = None
        self._model = None
        self._target_dev = None
        self._source_dev = None
        self._source_mode = "vepa"
        self._virtualport = VirtualPort(conn, parsexml, parsexmlnode, caps)

        # Generate _random_mac
        self._random_mac = None
        self._default_bridge = None

        if self._is_parse():
            return

        self.type = type
        self.macaddr = macaddr
        self.bridge = bridge
        self.source_dev = bridge
        self.network = network
        self.model = model

        if self.type == self.TYPE_VIRTUAL:
            if network is None:
                raise ValueError(_("A network name was not provided"))
Ejemplo n.º 2
0
    def __init__(self,
                 conn,
                 nodedev=None,
                 parsexml=None,
                 parsexmlnode=None,
                 caps=None):
        """
        @param conn: Connection the device/guest will be installed on
        @type conn: libvirt.virConnect
        @param nodedev: Optional NodeDevice instance for device being
                         attached to the guest
        @type nodedev: L{virtinst.NodeDeviceParser.NodeDevice}
        """
        VirtualDevice.__init__(self, conn, parsexml, parsexmlnode, caps)

        self._mode = None
        self._type = None
        self._managed = None
        self._nodedev = nodedev
        self._vendor = None
        self._product = None
        self._bus = None
        self._device = None
        self._domain = "0x0"
        self._slot = None
        self._function = None

        if self._is_parse():
            return

        self.managed = True
        if self.is_xen():
            self.managed = False
Ejemplo n.º 3
0
    def __init__(self, conn, dev_type,
                 parsexml=None, parsexmlnode=None, caps=None):
        if dev_type not in self.dev_types:
            raise ValueError(_("Unknown character device type '%s'") % dev_type)
        self._dev_type = dev_type
        self._virtual_device_type = self._dev_type

        VirtualDevice.__init__(self, conn,
                                             parsexml, parsexmlnode, caps)

        # Init
        self._source_path = None
        self._source_mode = self.CHAR_MODE_BIND
        self._source_host = "127.0.0.1"
        self._source_port = None
        self._target_type = None
        self._target_address = None
        self._target_port = None
        self._target_name = None
        self._bind_host = None
        self._bind_port = None
        self._protocol = self.CHAR_PROTOCOL_RAW
        self._address_type = None

        if self.char_type == self.CHAR_UDP:
            self._source_mode = self.CHAR_MODE_CONNECT

        if self._is_parse():
            return

        if not self._char_type:
            raise ValueError("Must be instantiated through a subclass.")

        self.char_type = self._char_type
Ejemplo n.º 4
0
    def __init__(self, type=TYPE_VNC, port=-1, listen=None, passwd=None,
                 keymap=KEYMAP_DEFAULT, conn=None, parsexml=None,
                 parsexmlnode=None, tlsPort=-1, channels=None,
                 caps=None, passwdValidTo=None):
        # pylint: disable=W0622
        # Redefining built-in 'type', but it matches the XML so keep it

        VirtualDevice.__init__(self, conn, parsexml, parsexmlnode, caps)

        self._type   = None
        self._port   = None
        self._tlsPort = None
        self._listen = None
        self._passwd = None
        self._passwdValidTo = None
        self._keymap = None
        self._xauth = None
        self._display = None
        self._socket = None
        self._channels = {}
        self._local_keymap = -1

        if self._is_parse():
            return

        self.type = type
        self.port = port
        self.tlsPort = tlsPort
        self.keymap = keymap
        self.listen = listen
        self.passwd = passwd
        self.passwdValidTo = passwdValidTo
        if channels:
            self.channels = channels
Ejemplo n.º 5
0
    def __init__(self, conn, nodedev=None,
                 parsexml=None, parsexmlnode=None, caps=None):
        """
        @param conn: Connection the device/guest will be installed on
        @type conn: libvirt.virConnect
        @param nodedev: Optional NodeDevice instance for device being
                         attached to the guest
        @type nodedev: L{virtinst.NodeDeviceParser.NodeDevice}
        """
        VirtualDevice.__init__(self, conn, parsexml,
                                             parsexmlnode, caps)

        self._mode = None
        self._type = None
        self._managed = None
        self._nodedev = nodedev
        self._vendor = None
        self._product = None
        self._bus = None
        self._device = None
        self._domain = "0x0"
        self._slot = None
        self._function = None

        if self._is_parse():
            return

        self.managed = True
        if self.is_xen():
            self.managed = False
Ejemplo n.º 6
0
    def __init__(self, conn=None, model=MODEL_DEFAULT,
                 parsexml=None, parsexmlnode=None, caps=None):
        VirtualDevice.__init__(self, conn, parsexml,
                                             parsexmlnode, caps)

        self._model = None

        if self._is_parse():
            return

        self.model = model
Ejemplo n.º 7
0
    def __init__(self, conn, parsexml=None, parsexmlnode=None, caps=None):
        VirtualDevice.__init__(self, conn, parsexml, parsexmlnode, caps)

        self._type = None
        self._bus = None

        if self._is_parse():
            return

        self.type = self.INPUT_TYPE_DEFAULT
        self.bus = self.INPUT_BUS_DEFAULT
Ejemplo n.º 8
0
    def __init__(self, conn, parsexml=None, parsexmlnode=None, caps=None):
        VirtualDevice.__init__(self, conn, parsexml, parsexmlnode, caps)

        self._model = None
        self._action = None

        if self._is_parse():
            return

        self.model = self.MODEL_DEFAULT
        self.action = self.ACTION_DEFAULT
Ejemplo n.º 9
0
    def __init__(self, conn, parsexml=None, parsexmlnode=None, caps=None):
        VirtualDevice.__init__(self, conn, parsexml,
                                             parsexmlnode, caps)

        self._type = None
        self._bus = None

        if self._is_parse():
            return

        self.type = self.INPUT_TYPE_DEFAULT
        self.bus = self.INPUT_BUS_DEFAULT
Ejemplo n.º 10
0
    def __init__(self, conn, parsexml=None, parsexmlnode=None, caps=None):
        VirtualDevice.__init__(self, conn,
                                             parsexml, parsexmlnode, caps)

        self._model_type    = None
        self._vram          = None
        self._heads         = None

        if self._is_parse():
            return

        self.model_type = self.MODEL_DEFAULT
Ejemplo n.º 11
0
    def __init__(self, conn, parsexml=None, parsexmlnode=None, caps=None):
        VirtualDevice.__init__(self, conn, parsexml,
                                             parsexmlnode, caps)

        self._model = None
        self._action = None

        if self._is_parse():
            return

        self.model = self.MODEL_DEFAULT
        self.action = self.ACTION_DEFAULT
Ejemplo n.º 12
0
    def __init__(self,
                 conn=None,
                 model=MODEL_DEFAULT,
                 parsexml=None,
                 parsexmlnode=None,
                 caps=None):
        VirtualDevice.__init__(self, conn, parsexml, parsexmlnode, caps)

        self._model = None

        if self._is_parse():
            return

        self.model = model
Ejemplo n.º 13
0
    def __init__(self, conn=None, parsexml=None, parsexmlnode=None, caps=None):
        VirtualDevice.__init__(self, conn, parsexml, parsexmlnode, caps)
        self._type = None
        self._model = None
        self._backend_type = None
        self._bind_host = None
        self._bind_service = None
        self._connect_host = None
        self._connect_service = None
        self._rate_bytes = None
        self._rate_period = None

        self._device = None
        if self._is_parse():
            return
Ejemplo n.º 14
0
    def __init__(self, conn=None, parsexml=None, parsexmlnode=None, caps=None):
        VirtualDevice.__init__(self, conn, parsexml, parsexmlnode, caps)
        self._type = None
        self._model = None
        self._backend_type = None
        self._bind_host = None
        self._bind_service = None
        self._connect_host = None
        self._connect_service = None
        self._rate_bytes = None
        self._rate_period = None

        self._device = None
        if self._is_parse():
            return
Ejemplo n.º 15
0
    def __init__(self, bus=BUS_DEFAULT, stype=TYPE_DEFAULT,
                 conn=None, parsexml=None, parsexmlnode=None, caps=None):
        """
        @param conn: Connection the device/guest will be installed on
        @type conn: libvirt.virConnect
        """
        VirtualDevice.__init__(self, conn, parsexml,
                                             parsexmlnode, caps)

        self._type = None
        self._bus = None
        self._host = None
        self._service = None
        if self._is_parse():
            return

        self.bus = bus
        self.type = stype
Ejemplo n.º 16
0
    def __init__(self, conn, parsexml=None, parsexmlnode=None, caps=None):
        VirtualDevice.__init__(self, conn, parsexml, parsexmlnode, caps)

        self._type = None
        self._mode = None
        self._driver = None
        self._target = None
        self._source = None
        self._readonly = None
        self._wrpolicy = None

        if self._is_parse():
            return

        self.mode = self.MODE_DEFAULT
        self.type = self.TYPE_DEFAULT
        self.driver = self.DRIVER_DEFAULT
        self.wrpolicy = self.WRPOLICY_DEFAULT
Ejemplo n.º 17
0
    def __init__(self, conn, parsexml=None, parsexmlnode=None, caps=None,
                 model=None):
        VirtualDevice.__init__(self, conn,
                                             parsexml, parsexmlnode, caps)

        self._index = 0
        self._ports = None
        self._vectors = None
        self._model = None
        self._master = VirtualDeviceMaster(conn,
                                           parsexml=parsexml,
                                           parsexmlnode=parsexmlnode,
                                           caps=caps)

        if self._is_parse():
            return

        self.model = model
Ejemplo n.º 18
0
    def __init__(self, conn, parsexml=None, parsexmlnode=None, caps=None):
        VirtualDevice.__init__(self, conn, parsexml,
                                             parsexmlnode, caps)

        self._type = None
        self._mode = None
        self._driver = None
        self._target = None
        self._source = None
        self._readonly = None
        self._wrpolicy = None

        if self._is_parse():
            return

        self.mode = self.MODE_DEFAULT
        self.type = self.TYPE_DEFAULT
        self.driver = self.DRIVER_DEFAULT
        self.wrpolicy = self.WRPOLICY_DEFAULT
Ejemplo n.º 19
0
    def __init__(self,
                 macaddr=None,
                 type=TYPE_BRIDGE,
                 bridge=None,
                 network=None,
                 model=None,
                 conn=None,
                 parsexml=None,
                 parsexmlnode=None,
                 caps=None):
        # pylint: disable=W0622
        # Redefining built-in 'type', but it matches the XML so keep it

        VirtualDevice.__init__(self, conn, parsexml, parsexmlnode, caps)

        self._network = None
        self._bridge = None
        self._macaddr = None
        self._type = None
        self._model = None
        self._target_dev = None
        self._source_dev = None
        self._source_mode = "vepa"
        self._virtualport = VirtualPort(conn, parsexml, parsexmlnode, caps)

        # Generate _random_mac
        self._random_mac = None
        self._default_bridge = None

        if self._is_parse():
            return

        self.type = type
        self.macaddr = macaddr
        self.bridge = bridge
        self.source_dev = bridge
        self.network = network
        self.model = model

        if self.type == self.TYPE_VIRTUAL:
            if network is None:
                raise ValueError(_("A network name was not provided"))
Ejemplo n.º 20
0
    def __init__(self,
                 conn,
                 parsexml=None,
                 parsexmlnode=None,
                 caps=None,
                 model=None):
        VirtualDevice.__init__(self, conn, parsexml, parsexmlnode, caps)

        self._index = 0
        self._ports = None
        self._vectors = None
        self._model = None
        self._master = VirtualDeviceMaster(conn,
                                           parsexml=parsexml,
                                           parsexmlnode=parsexmlnode,
                                           caps=caps)

        if self._is_parse():
            return

        self.model = model