Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
Merge pull request #2867 from merwick/master
Browse files Browse the repository at this point in the history
qemu: Set govmmQemu NoReboot Knob
  • Loading branch information
Julio Montes authored Jul 30, 2020
2 parents 34a6962 + a162469 commit 31fcfa6
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

[[constraint]]
name = "github.com/intel/govmm"
revision = "af9e34b91ae99aff4b4ac126141259d34d98e9f2"
revision = "6c3315ba8a4262df4300b735b2c53ce3b15d21dd"

[[constraint]]
name = "github.com/kata-containers/agent"
Expand Down
7 changes: 7 additions & 0 deletions vendor/github.com/intel/govmm/qemu/qemu.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions virtcontainers/qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ func (q *qemu) createSandbox(ctx context.Context, id string, networkNS NetworkNa
NoUserConfig: true,
NoDefaults: true,
NoGraphic: true,
NoReboot: true,
Daemonize: true,
MemPrealloc: q.config.MemPrealloc,
HugePages: q.config.HugePages,
Expand Down
18 changes: 18 additions & 0 deletions virtcontainers/qemu_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,24 @@ func TestQemuMemoryTopology(t *testing.T) {
assert.Exactly(memory, expectedOut)
}

func TestQemuKnobs(t *testing.T) {
assert := assert.New(t)

sandbox, err := createQemuSandboxConfig()
assert.NoError(err)

q := &qemu{
store: sandbox.newStore,
}
err = q.createSandbox(context.Background(), sandbox.id, NetworkNamespace{}, &sandbox.config.HypervisorConfig, false)
assert.NoError(err)

assert.Equal(q.qemuConfig.Knobs.NoUserConfig, true)
assert.Equal(q.qemuConfig.Knobs.NoDefaults, true)
assert.Equal(q.qemuConfig.Knobs.NoGraphic, true)
assert.Equal(q.qemuConfig.Knobs.NoReboot, true)
}

func testQemuAddDevice(t *testing.T, devInfo interface{}, devType deviceType, expected []govmmQemu.Device) {
assert := assert.New(t)
q := &qemu{
Expand Down

0 comments on commit 31fcfa6

Please sign in to comment.