Skip to content

Commit 57e5f9a

Browse files
committed
Use SIGKILL, remove patchDrive artifacts
Signed-off-by: Plamen Petrov <[email protected]>
1 parent db02b0c commit 57e5f9a

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

runtime/service.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,8 @@ type service struct {
152152
vsockPortMu sync.Mutex
153153

154154
// httpControlClient is to send pause/resume/snapshot commands to the microVM
155-
httpControlClient *http.Client
156-
firecrackerPid int
157-
taskDrivePathOnHost string
155+
httpControlClient *http.Client
156+
firecrackerPid int
158157
}
159158

160159
func shimOpts(shimCtx context.Context) (*shim.Opts, error) {
@@ -838,7 +837,7 @@ func (s *service) CreateSnapshot(ctx context.Context, req *proto.CreateSnapshotR
838837
// Offload Shuts down a VM and deletes the corresponding firecracker socket
839838
// and vsock. All of the other resources will persist
840839
func (s *service) Offload(ctx context.Context, req *proto.OffloadRequest) (*empty.Empty, error) {
841-
if err := syscall.Kill(s.firecrackerPid, 9); err != nil {
840+
if err := syscall.Kill(s.firecrackerPid, syscall.SIGKILL); err != nil {
842841
s.logger.WithError(err).Error("Failed to kill firecracker process")
843842
return nil, err
844843
}
@@ -1061,8 +1060,6 @@ func (s *service) Create(requestCtx context.Context, request *taskAPI.CreateTask
10611060
}
10621061
rootfsMnt := request.Rootfs[0]
10631062

1064-
s.taskDrivePathOnHost = rootfsMnt.Source
1065-
10661063
err = s.containerStubHandler.Reserve(requestCtx, request.ID,
10671064
rootfsMnt.Source, vmBundleDir.RootfsPath(), "ext4", nil, s.driveMountClient, s.machine)
10681065
if err != nil {

0 commit comments

Comments
 (0)