Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions runtime/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -590,11 +590,19 @@ func (s *service) createVM(requestCtx context.Context, request *proto.CreateVMRe
opts = append(opts, jailedOpts...)

if request.LoadSnapshot {
if request.SnapshotPath == "" || request.MemFilePath == "" || request.ContainerSnapshotPath == "" {
return errors.New("failed to load snapshot: one of the snapshot loading parameters was not provided")
if request.SnapshotPath == "" || request.ContainerSnapshotPath == "" {
return errors.New("failed to load snapshot: snapshot path or container snapshot path was not provided")
}
if request.MemFilePath == "" && request.MemBackend.BackendType != "Uffd" {
return errors.New("failed to load snapshot: memroy file path was not provided")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

Suggested change
return errors.New("failed to load snapshot: memroy file path was not provided")
return errors.New("failed to load snapshot: memory file path was not provided")

}
opts = append(opts, firecracker.WithSnapshot(request.MemFilePath, request.SnapshotPath, request.ContainerSnapshotPath,
func(c *firecracker.SnapshotConfig) { c.ResumeVM = true }))

opts = append(opts,
firecracker.WithSnapshot(
request.MemFilePath,
request.SnapshotPath,
firecracker.WithMemoryBackend(request.MemBackend.BackendType, request.MemBackend.BackendPath),
func(c *firecracker.SnapshotConfig) { c.ResumeVM = true }))
}

// In the event that a noop jailer is used, we will pass in the shim context
Expand Down