mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-23 19:05:37 +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/filepath"
|
||||
"strings"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/rneugeba/virtsock/go/hvsock"
|
||||
@ -144,14 +145,18 @@ func main() {
|
||||
}
|
||||
vsock, err := vsock.Listen(uint(62374))
|
||||
if err != nil {
|
||||
if errno, ok := err.(syscall.Errno); !ok || errno != syscall.EAFNOSUPPORT {
|
||||
log.Printf("Failed to bind to vsock port 62374: %s", err)
|
||||
}
|
||||
} else {
|
||||
listeners = append(listeners, vsock)
|
||||
}
|
||||
svcid, _ := hvsock.GuidFromString("445BA2CB-E69B-4912-8B42-D7F494D007EA")
|
||||
hvsock, err := hvsock.Listen(hvsock.HypervAddr{VmId: hvsock.GUID_WILDCARD, ServiceId: svcid})
|
||||
if err != nil {
|
||||
if errno, ok := err.(syscall.Errno); !ok || errno != syscall.EAFNOSUPPORT {
|
||||
log.Printf("Failed to bind to hvsock port: %s", err)
|
||||
}
|
||||
} else {
|
||||
listeners = append(listeners, hvsock)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user