def add_conn(self, uri):
        conn = self._check_conn(uri)
        if conn:
            return conn

        conn = vmmConnection(uri)
        self.conns[uri] = {"conn": conn, "windowHost": None, "windowDetails": {}, "windowClone": None}

        conn.connect("vm-removed", self._do_vm_removed)
        conn.connect("state-changed", self._do_conn_changed)
        conn.tick()
        self.emit("conn-added", conn)
        self.config.add_conn(conn.get_uri())

        return conn
    def open_connection(self, url):
        '''Lets the user change the url for the connection.'''
        old_conn = self.__conn
        old_url  = self.__url
        old_vmmconn = self.__vmmconn

        try:
            self.__vmmconn = vmmConnection(url)
            self.__vmmconn.open(sync=True)

            self.__conn = self.__vmmconn.vmm
            self.__url  = url
            set_default_url(url)
        except Exception, error:
            self.__conn = old_conn
            self.__url  = old_url
            self.__vmmconn = old_vmmconn
            raise error
Beispiel #3
0
    def open_connection(self, url):
        '''Lets the user change the url for the connection.'''
        old_conn = self.__conn
        old_url = self.__url
        old_vmmconn = self.__vmmconn

        try:
            self.__vmmconn = vmmConnection(url)
            self.__vmmconn.open(sync=True)

            self.__conn = self.__vmmconn.vmm
            self.__url = url
            set_default_url(url)
        except Exception, error:
            self.__conn = old_conn
            self.__url = old_url
            self.__vmmconn = old_vmmconn
            raise error
Beispiel #4
0
    def add_conn_to_ui(self, uri):
        # Public method called from virt-manager.py
        conn = self._check_conn(uri)
        if conn:
            return conn

        conn = vmmConnection(uri)
        self.conns[uri] = {
            "conn": conn,
            "windowHost": None,
            "windowDetails": {},
            "windowClone": None,
        }

        conn.connect("vm-removed", self._do_vm_removed)
        conn.connect("state-changed", self._do_conn_changed)
        conn.tick()
        self.emit("conn-added", conn)

        return conn
Beispiel #5
0
    def make_conn(self, uri, probe=False):
        conn = self._check_conn(uri)
        if conn:
            return conn

        conn = vmmConnection(uri)
        self.conns[uri] = {
            "conn": conn,
            "windowHost": None,
            "windowDetails": {},
            "windowClone": None,
            "probeConnection": probe
        }

        conn.connect("vm-removed", self._do_vm_removed)
        conn.connect("state-changed", self._do_conn_changed)
        conn.connect("connect-error", self._connect_error)
        conn.connect("priority-tick", self._schedule_priority_tick)

        return conn
Beispiel #6
0
    def add_conn_to_ui(self, uri):
        # Public method called from virt-manager.py
        conn = self._check_conn(uri)
        if conn:
            return conn

        conn = vmmConnection(uri)
        self.conns[uri] = {
            "conn": conn,
            "windowHost": None,
            "windowDetails": {},
            "windowClone": None,
        }

        conn.connect("vm-removed", self._do_vm_removed)
        conn.connect("state-changed", self._do_conn_changed)
        conn.tick()
        self.emit("conn-added", conn)

        return conn
Beispiel #7
0
    def add_conn(self, uri):
        conn = self._check_conn(uri)
        if conn:
            return conn

        conn = vmmConnection(uri)
        self.conns[uri] = {
            "conn": conn,
            "windowHost": None,
            "windowDetails": {},
            "windowClone": None,
        }

        conn.connect("vm-removed", self._do_vm_removed)
        conn.connect("state-changed", self._do_conn_changed)
        conn.tick()
        self.emit("conn-added", conn)
        self.config.add_conn(conn.get_uri())

        return conn