File tree 3 files changed +6
-4
lines changed
3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 82
82
"address_space" : 1800 ,
83
83
"remapping" : [" 0xC000000000" , 256 ],
84
84
"max_memory" : 64 ,
85
- "relocate_fixed_mmap" : false ,
86
85
"concurrency" : 4 ,
87
86
"storage" : true
88
87
},
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ func main() {
53
53
54
54
varnish .StorageRegister ("my_storage" , my_storage )
55
55
56
- fmt .Println ("Go Compute Example ready (" , os .Args [2 ], ")" )
56
+ // Storage/request can be determined from environment variable KVM_TYPE
57
+ fmt .Println ("Go Compute Example ready (" , os .Getenv ("KVM_TYPE" ), ")" )
57
58
varnish .WaitForRequests ()
58
59
}
Original file line number Diff line number Diff line change @@ -32,12 +32,14 @@ import "C"
32
32
import (
33
33
"errors"
34
34
"os"
35
- "strings"
36
35
"unsafe"
37
36
)
38
37
39
38
func IsLinuxMain () bool {
40
- return strings .Contains (os .Args [0 ], "/" )
39
+ // The presence of environment variable KVM_TYPE means we are running
40
+ // in a KVM sandbox. Simply check if it exists:
41
+ _ , ok := os .LookupEnv ("KVM_TYPE" )
42
+ return ! ok
41
43
}
42
44
43
45
type GetHandler func (string , string )
You can’t perform that action at this time.
0 commit comments