Merge pull request #155 from djs55/remove-individual-vsock-proxy

proxy: remove the dynamic vsock port allocation
This commit is contained in:
Dave Scott 2016-06-06 23:13:24 +01:00
commit 4ce0d53f85

View File

@ -3,7 +3,6 @@ package main
import ( import (
"errors" "errors"
"fmt" "fmt"
"github.com/rneugeba/virtsock/go/vsock"
"log" "log"
"net" "net"
"os" "os"
@ -12,12 +11,8 @@ import (
) )
func onePort() { func onePort() {
host, port, container := parseHostContainerAddrs() host, _, container := parseHostContainerAddrs()
vsockP, err := libproxy.NewVsockProxy(&vsock.VsockAddr{Port: uint(port)}, container)
if err != nil {
sendError(err)
}
ipP, err := libproxy.NewIPProxy(host, container) ipP, err := libproxy.NewIPProxy(host, container)
if err != nil { if err != nil {
sendError(err) sendError(err)
@ -31,8 +26,7 @@ func onePort() {
go handleStopSignals(ipP) go handleStopSignals(ipP)
// TODO: avoid this line if we are running in a TTY // TODO: avoid this line if we are running in a TTY
sendOK() sendOK()
go ipP.Run() ipP.Run()
vsockP.Run()
ctl.Close() // ensure ctl remains alive and un-GCed until here ctl.Close() // ensure ctl remains alive and un-GCed until here
os.Exit(0) os.Exit(0)
} }