Skip to content

Commit 78381c3

Browse files
authored
Allow configuration of block_device cache strategy in firecracker (#615)
Signed-off-by: Swagat Bora <sbora@amazon.com> Co-authored-by: Swagat Bora <sbora@amazon.com>
1 parent b88e16e commit 78381c3

File tree

9 files changed

+167
-74
lines changed

9 files changed

+167
-74
lines changed

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ require (
1313
github.com/containerd/typeurl v1.0.2
1414
github.com/containernetworking/cni v1.0.1
1515
github.com/containernetworking/plugins v1.1.1
16-
github.com/firecracker-microvm/firecracker-go-sdk v0.22.1-0.20220302172044-565c88a871e2
16+
github.com/firecracker-microvm/firecracker-go-sdk v0.22.1-0.20220427214706-47505a9cf951
1717
github.com/go-ole/go-ole v1.2.4 // indirect
1818
github.com/gofrs/uuid v3.3.0+incompatible
1919
github.com/gogo/protobuf v1.3.2
@@ -27,7 +27,7 @@ require (
2727
github.com/shirou/gopsutil v2.18.12+incompatible
2828
github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 // indirect
2929
github.com/sirupsen/logrus v1.8.1
30-
github.com/stretchr/testify v1.7.0
30+
github.com/stretchr/testify v1.7.1
3131
github.com/vishvananda/netlink v1.1.1-0.20210330154013-f5de75959ad5
3232
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
3333
golang.org/x/sys v0.0.0-20220209214540-3681064d5158

go.sum

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,8 @@ github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLi
347347
github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
348348
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
349349
github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
350-
github.com/firecracker-microvm/firecracker-go-sdk v0.22.1-0.20220302172044-565c88a871e2 h1:vUEzKnC8if0UyjpXh8zZl0VW/xVidcyXt0xn7nwZOx4=
351-
github.com/firecracker-microvm/firecracker-go-sdk v0.22.1-0.20220302172044-565c88a871e2/go.mod h1:bNZ9JikG9OmPPqXMRJfHmSlIH0dMKeAA6HUyTtSyPlw=
350+
github.com/firecracker-microvm/firecracker-go-sdk v0.22.1-0.20220427214706-47505a9cf951 h1:j1zRfar/9U22TeptQIwXB07hyuctgb6++HIxP0nXBhI=
351+
github.com/firecracker-microvm/firecracker-go-sdk v0.22.1-0.20220427214706-47505a9cf951/go.mod h1:60W3x6ftClUbRKpqXl7XvrhM/Uv3tochNRq+RlZsd1M=
352352
github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k=
353353
github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k=
354354
github.com/frankban/quicktest v1.11.3 h1:8sXhOn0uLys67V8EsXLc6eszDs8VXWxL3iRvebPhedY=
@@ -402,8 +402,8 @@ github.com/go-openapi/jsonreference v0.19.6 h1:UBIxjkht+AWIgYzCDSv2GN+E/togfwXUJ
402402
github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns=
403403
github.com/go-openapi/loads v0.21.1 h1:Wb3nVZpdEzDTcly8S4HMkey6fjARRzb7iEaySimlDW0=
404404
github.com/go-openapi/loads v0.21.1/go.mod h1:/DtAMXXneXFjbQMGEtbamCZb+4x7eGwkvZCvBmwUG+g=
405-
github.com/go-openapi/runtime v0.23.1 h1:/Drg9R96eMmgKJHVWZADz78XbE39/6QiIiB45mc+epo=
406-
github.com/go-openapi/runtime v0.23.1/go.mod h1:AKurw9fNre+h3ELZfk6ILsfvPN+bvvlaU/M9q/r9hpk=
405+
github.com/go-openapi/runtime v0.23.3 h1:/dxjx4KCOQI5ImBMz036F6v/DzZ2NUjSRvbLJs1rgoE=
406+
github.com/go-openapi/runtime v0.23.3/go.mod h1:AKurw9fNre+h3ELZfk6ILsfvPN+bvvlaU/M9q/r9hpk=
407407
github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc=
408408
github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo=
409409
github.com/go-openapi/spec v0.20.4 h1:O8hJrt0UMnhHcluhIdUgCLRWyM2x7QkBXRvOs7m+O1M=
@@ -926,8 +926,9 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
926926
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
927927
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
928928
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
929-
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
930929
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
930+
github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY=
931+
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
931932
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
932933
github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
933934
github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=

proto/types.pb.go

Lines changed: 87 additions & 66 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proto/types.proto

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ message FirecrackerRootDrive {
124124
// (Optional) RateLimiter configuration that will be applied to the
125125
// backing-drive for the VM's rootfs
126126
FirecrackerRateLimiter RateLimiter = 4;
127+
128+
// (Optional) CacheType specifies the caching strategy for the block device.
129+
// The supported caching strategies are: "Unsafe"(default) and "Writeback".
130+
string CacheType = 5;
127131
}
128132

129133
message FirecrackerDriveMount {
@@ -153,6 +157,10 @@ message FirecrackerDriveMount {
153157
// writes to the image from within the guest. Defaults to false, in which case
154158
// the block device in the VM will be read-only.
155159
bool IsWritable = 6;
160+
161+
// (Optional) CacheType specifies the caching strategy for the block device.
162+
// The supported caching strategies are: "Unsafe"(default) and "Writeback".
163+
string CacheType = 7;
156164
}
157165

158166
// Message to specify an IO rate limiter with bytes/s and ops/s limits

0 commit comments

Comments
 (0)