Skip to content

Commit f5adea9

Browse files
committed
fix: remove checking the existence of the socket path from NewLinuxRosettaUnixSocketCachingOptions
Checking the socket path parameter in the host is pointless since it’s expected to be used in the VM.
1 parent 5bbaec6 commit f5adea9

2 files changed

Lines changed: 0 additions & 14 deletions

File tree

shared_directory_arm64.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ package vz
1212
import "C"
1313
import (
1414
"fmt"
15-
"os"
1615
"runtime/cgo"
1716
"unsafe"
1817

@@ -159,9 +158,6 @@ func NewLinuxRosettaUnixSocketCachingOptions(path string) (*LinuxRosettaUnixSock
159158
if maxPathLen < len(path) {
160159
return nil, fmt.Errorf("path length exceeds maximum allowed length of %d", maxPathLen)
161160
}
162-
if _, err := os.Stat(path); err != nil {
163-
return nil, fmt.Errorf("invalid path: %w", err)
164-
}
165161

166162
cs := charWithGoString(path)
167163
defer cs.Free()

shared_directory_arm64_test.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,6 @@ func TestNewLinuxRosettaUnixSocketCachingOptions(t *testing.T) {
5959
t.Fatalf("unexpected error: %q", got)
6060
}
6161
})
62-
t.Run("invalid filename does not exists", func(t *testing.T) {
63-
filename := "doesnotexists.txt"
64-
_, err := vz.NewLinuxRosettaUnixSocketCachingOptions(filename)
65-
if err == nil {
66-
t.Fatal("expected error")
67-
}
68-
if got := err.Error(); !strings.Contains(got, "invalid path") {
69-
t.Fatalf("unexpected error: %q", got)
70-
}
71-
})
7262
}
7363

7464
func TestNewLinuxRosettaAbstractSocketCachingOptions(t *testing.T) {

0 commit comments

Comments
 (0)