Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions .hack/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ go 1.11
require (
github.com/awslabs/tc-redirect-tap v0.0.0-20220715050423-f2af44521093 // indirect
github.com/containernetworking/plugins v1.1.1 // indirect
github.com/kunalkushwaha/ltag v0.2.3 // indirect
)
2 changes: 2 additions & 0 deletions .hack/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,8 @@ github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfn
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kunalkushwaha/ltag v0.2.3 h1:5rwJiC1oQ/OiamZ8JNCHQGUe7OkHTFrRtyNon3VYPok=
github.com/kunalkushwaha/ltag v0.2.3/go.mod h1:w1hVMWOh870f+WAv/UIoZAy0bHCbPP4+W6JxNcPUiQA=
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ DISABLE_ROOT_TESTS?=1
DOCKER_IMAGE_TAG?=latest
EXTRAGOARGS:=
FIRECRACKER_DIR=build/firecracker
FIRECRACKER_TARGET?=x86_64-unknown-linux-musl
arch=$(shell uname -m)
FIRECRACKER_TARGET?=$(arch)-unknown-linux-musl

FC_TEST_DATA_PATH?=testdata
FC_TEST_BIN_PATH:=$(FC_TEST_DATA_PATH)/bin
Expand All @@ -28,7 +29,6 @@ UID = $(shell id -u)
GID = $(shell id -g)

firecracker_version=v1.0.0
arch=$(shell uname -m)

# The below files are needed and can be downloaded from the internet
release_url=https://github.com/firecracker-microvm/firecracker/releases/download/$(firecracker_version)/firecracker-$(firecracker_version)-$(arch).tgz
Expand Down
10 changes: 9 additions & 1 deletion machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"os/exec"
"os/signal"
"path/filepath"
"runtime"
"strconv"
"strings"
"sync"
Expand Down Expand Up @@ -65,6 +66,9 @@ type SeccompConfig struct {
// be started again.
var ErrAlreadyStarted = errors.New("firecracker: machine already started")

// ErrGraceShutdown signifies that the Machine will shutdown gracefully and SendCtrlAltDelete is unable to send
//var ErrGraceShutdown = errors.New("Shutdown gracefully: SendCtrlAltDelete is not supported if the arch is ARM64")

type MMDSVersion string

const (
Expand Down Expand Up @@ -456,7 +460,11 @@ func (m *Machine) Start(ctx context.Context) error {
// Shutdown requests a clean shutdown of the VM by sending CtrlAltDelete on the virtual keyboard
func (m *Machine) Shutdown(ctx context.Context) error {
m.logger.Debug("Called machine.Shutdown()")
return m.sendCtrlAltDel(ctx)
if runtime.GOARCH != "arm64" {
return m.sendCtrlAltDel(ctx)
} else {
return m.StopVMM()
}
}

// Wait will wait until the firecracker process has finished. Wait is safe to
Expand Down
7 changes: 5 additions & 2 deletions network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"net"
"os"
"path/filepath"
"runtime"
"sync"
"testing"
"time"
Expand Down Expand Up @@ -253,7 +254,7 @@ func testNetworkMachineCNI(t *testing.T, useConfFile bool) {
}
fctesting.RequiresRoot(t)

cniBinPath := []string{"/opt/cni/bin", testDataBin}
cniBinPath := []string{testDataBin, "/opt/cni/bin"}

dir, err := ioutil.TempDir("", fsSafeTestName.Replace(t.Name()))
require.NoError(t, err)
Expand Down Expand Up @@ -312,6 +313,9 @@ func testNetworkMachineCNI(t *testing.T, useConfFile bool) {
require.NoError(t, err, "cni conf should parse")
}

if runtime.GOARCH == "arm64" {
return
}
numVMs := 10
vmIPs := make(chan string, numVMs)

Expand Down Expand Up @@ -405,7 +409,6 @@ func newCNIMachine(t *testing.T,
MachineCfg: models.MachineConfiguration{
VcpuCount: Int64(2),
MemSizeMib: Int64(256),
Smt: Bool(true),
},
Drives: []models.Drive{
{
Expand Down