Commit e9d7ea3f authored by Thibault VINCENT's avatar Thibault VINCENT
Browse files

add: support for unix sockets in TCPTunnelJob

parent 6cd44a88
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -732,18 +732,21 @@ class NodeHandler(RpcHandler):
    def tun_connect_hv(self, res, migration=False):
        '''
        '''
        # FIXME magic values
        ip = '127.0.0.1'
        if migration and self._host_handle.get_hv_type() == 'xen':
            port = 8002
        else:
            port = 16509
        # facilities
        jobmgr = self._host_handle.jobmgr
        # get the job
        job = jobmgr.get_job(res['jid'])
        # connect to libvirt
        job.tunnel_connect((ip, port))
        # choose connection endpoint
        if self._host_handle.get_hv_type() == 'xen':
            # FIXME magic values
            ip = '127.0.0.1'
            port = 8002 if migration else 16509
            endpoint = (ip, port)
        else:
            # FIXME magic values
            endpoint = '/var/run/libvirt/libvirt-sock'
        # connect to libvirt/hv
        job.tunnel_connect(endpoint)

    @pure
    def tun_destroy(self, res):