runtime: VMX is migratible in vm factory case

We are not spinning up any L2 guests in vm factory, so the L1 guest
migration is expected to work even with VMX.

See https://www.linux-kvm.org/page/Nested_Guests

Fixes: #4050
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
This commit is contained in:
Peng Tao 2022-04-07 18:03:42 +08:00
parent fa09f0ec84
commit 2b0587db95
3 changed files with 1 additions and 18 deletions

View File

@ -167,19 +167,6 @@ func (q *qemuAmd64) bridges(number uint32) {
q.Bridges = genericBridges(number, q.qemuMachine.Type)
}
func (q *qemuAmd64) cpuModel() string {
cpuModel := defaultCPUModel
// VMX is not migratable yet.
// issue: https://github.com/kata-containers/runtime/issues/1750
if q.vmFactory {
hvLogger.WithField("subsystem", "qemuAmd64").Warn("VMX is not migratable yet: turning it off")
cpuModel += ",vmx=off"
}
return cpuModel
}
func (q *qemuAmd64) memoryTopology(memoryMb, hostMemoryMb uint64, slots uint8) govmmQemu.Memory {
return genericMemoryTopology(memoryMb, hostMemoryMb, slots, q.memoryOffset)
}

View File

@ -87,7 +87,7 @@ func TestQemuAmd64CPUModel(t *testing.T) {
base, ok := amd64.(*qemuAmd64)
assert.True(ok)
base.vmFactory = true
expectedOut = defaultCPUModel + ",vmx=off"
expectedOut = defaultCPUModel
model = amd64.cpuModel()
assert.Equal(expectedOut, model)
}

View File

@ -114,10 +114,6 @@ func (q *qemuPPC64le) bridges(number uint32) {
q.Bridges = genericBridges(number, q.qemuMachine.Type)
}
func (q *qemuPPC64le) cpuModel() string {
return defaultCPUModel
}
func (q *qemuPPC64le) memoryTopology(memoryMb, hostMemoryMb uint64, slots uint8) govmmQemu.Memory {
q.Logger().Debug("Aligning maxmem to multiples of 256MB. Assumption: Kernel Version >= 4.11")