mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-27 20:48:11 +00:00
diagnostics: Only log connection failure if not EAFNOTSUPPORT
EAFNOTSUPPORT likely means we are running on a hypervisor which doesn't support that particular socket type. Signed-off-by: Ian Campbell <ian.campbell@docker.com>
This commit is contained in:
parent
d9288f5bba
commit
dd41c21021
@ -12,6 +12,7 @@ import (
|
|||||||
"path"
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/rneugeba/virtsock/go/hvsock"
|
"github.com/rneugeba/virtsock/go/hvsock"
|
||||||
@ -144,14 +145,18 @@ func main() {
|
|||||||
}
|
}
|
||||||
vsock, err := vsock.Listen(uint(62374))
|
vsock, err := vsock.Listen(uint(62374))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if errno, ok := err.(syscall.Errno); !ok || errno != syscall.EAFNOSUPPORT {
|
||||||
log.Printf("Failed to bind to vsock port 62374: %s", err)
|
log.Printf("Failed to bind to vsock port 62374: %s", err)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
listeners = append(listeners, vsock)
|
listeners = append(listeners, vsock)
|
||||||
}
|
}
|
||||||
svcid, _ := hvsock.GuidFromString("445BA2CB-E69B-4912-8B42-D7F494D007EA")
|
svcid, _ := hvsock.GuidFromString("445BA2CB-E69B-4912-8B42-D7F494D007EA")
|
||||||
hvsock, err := hvsock.Listen(hvsock.HypervAddr{VmId: hvsock.GUID_WILDCARD, ServiceId: svcid})
|
hvsock, err := hvsock.Listen(hvsock.HypervAddr{VmId: hvsock.GUID_WILDCARD, ServiceId: svcid})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if errno, ok := err.(syscall.Errno); !ok || errno != syscall.EAFNOSUPPORT {
|
||||||
log.Printf("Failed to bind to hvsock port: %s", err)
|
log.Printf("Failed to bind to hvsock port: %s", err)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
listeners = append(listeners, hvsock)
|
listeners = append(listeners, hvsock)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user