MCPcopy
hub / github.com/firecracker-microvm/firecracker-containerd / deleteProc

Method deleteProc

internal/vm/task.go:141–161  ·  view source on GitHub ↗
(taskID, execID string)

Source from the content-addressed store, hash-verified

139}
140
141func (m *taskManager) deleteProc(taskID, execID string) (*vmProc, error) {
142 m.mu.Lock()
143 defer m.mu.Unlock()
144
145 _, ok := m.tasks[taskID]
146 if !ok {
147 return nil, fmt.Errorf("cannot delete exec %q from non-existent task %q", execID, taskID)
148 }
149
150 proc, ok := m.tasks[taskID][execID]
151 if !ok {
152 return nil, fmt.Errorf("cannot delete non-existent exec %q from task %q", execID, taskID)
153 }
154
155 delete(m.tasks[taskID], execID)
156 if len(m.tasks[taskID]) == 0 {
157 delete(m.tasks, taskID)
158 }
159
160 return proc, nil
161}
162
163func (m *taskManager) ShutdownIfEmpty() bool {
164 m.mu.Lock()

Callers 3

CreateTaskMethod · 0.95
ExecProcessMethod · 0.95
DeleteProcessMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected