Skip to content

Commit de54b13

Browse files
committed
drop vmx
Signed-off-by: Maksim Fedotov <maksim.fedotov@flant.com>
1 parent 93940a0 commit de54b13

2 files changed

Lines changed: 3 additions & 28 deletions

File tree

images/virtualization-artifact/pkg/controller/kvbuilder/kvvm.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ func (b *KVVM) SetCPUModel(class *v1alpha2.VirtualMachineClass) error {
167167
cpu.Model = GenericCPUModel
168168
features := make([]virtv1.CPUFeature, 0, len(class.Status.CpuFeatures.Enabled)+2)
169169
hasSvm := false
170-
hasVMX := false
171170
hasHT := false
172171
for _, feature := range class.Status.CpuFeatures.Enabled {
173172
policy := "require"
@@ -177,9 +176,6 @@ func (b *KVVM) SetCPUModel(class *v1alpha2.VirtualMachineClass) error {
177176
if feature == "svm" {
178177
hasSvm = true
179178
}
180-
if feature == "vmx" {
181-
hasVMX = true
182-
}
183179
if feature == HTCPUFeature {
184180
hasHT = true
185181
}
@@ -191,7 +187,7 @@ func (b *KVVM) SetCPUModel(class *v1alpha2.VirtualMachineClass) error {
191187
if !hasSvm {
192188
features = append(features, virtv1.CPUFeature{Name: "svm", Policy: "optional"})
193189
}
194-
if hasVMX && !hasHT {
190+
if !hasHT {
195191
features = append(features, virtv1.CPUFeature{Name: HTCPUFeature, Policy: "optional"})
196192
}
197193
cpu.Features = features

images/virtualization-artifact/pkg/controller/kvbuilder/kvvm_test.go

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -229,14 +229,14 @@ func TestSetCPUModel(t *testing.T) {
229229
name := "test-name"
230230
namespace := "test-namespace"
231231

232-
t.Run("should add optional ht feature for intel x86 discovery cpu", func(t *testing.T) {
232+
t.Run("should add optional ht feature for discovery cpu", func(t *testing.T) {
233233
builder := NewEmptyKVVM(types.NamespacedName{Name: name, Namespace: namespace}, KVVMOptions{})
234234
class := &v1alpha2.VirtualMachineClass{
235235
Spec: v1alpha2.VirtualMachineClassSpec{
236236
CPU: v1alpha2.CPU{Type: v1alpha2.CPUTypeDiscovery},
237237
},
238238
Status: v1alpha2.VirtualMachineClassStatus{
239-
CpuFeatures: v1alpha2.CpuFeatures{Enabled: []string{"vmx", "aes"}},
239+
CpuFeatures: v1alpha2.CpuFeatures{Enabled: []string{"aes"}},
240240
},
241241
}
242242

@@ -250,27 +250,6 @@ func TestSetCPUModel(t *testing.T) {
250250
}
251251
})
252252

253-
t.Run("should not add ht feature for amd discovery cpu", func(t *testing.T) {
254-
builder := NewEmptyKVVM(types.NamespacedName{Name: name, Namespace: namespace}, KVVMOptions{})
255-
class := &v1alpha2.VirtualMachineClass{
256-
Spec: v1alpha2.VirtualMachineClassSpec{
257-
CPU: v1alpha2.CPU{Type: v1alpha2.CPUTypeDiscovery},
258-
},
259-
Status: v1alpha2.VirtualMachineClassStatus{
260-
CpuFeatures: v1alpha2.CpuFeatures{Enabled: []string{"svm", "aes"}},
261-
},
262-
}
263-
264-
if err := builder.SetCPUModel(class); err != nil {
265-
t.Fatalf("SetCPUModel() failed: %v", err)
266-
}
267-
268-
features := builder.Resource.Spec.Template.Spec.Domain.CPU.Features
269-
if containsCPUFeature(features, virtv1.CPUFeature{Name: HTCPUFeature, Policy: "optional"}) {
270-
t.Fatalf("did not expect optional ht feature for amd cpu, got %#v", features)
271-
}
272-
})
273-
274253
t.Run("should keep existing ht feature policy when already present", func(t *testing.T) {
275254
builder := NewEmptyKVVM(types.NamespacedName{Name: name, Namespace: namespace}, KVVMOptions{})
276255
class := &v1alpha2.VirtualMachineClass{

0 commit comments

Comments
 (0)