Skip to content

Commit 4220998

Browse files
committed
make ht optional
Signed-off-by: Maksim Fedotov <maksim.fedotov@flant.com>
1 parent a21bdc3 commit 4220998

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ func (b *KVVM) SetCPUModel(class *v1alpha2.VirtualMachineClass) error {
163163
cpu.Model = virtv1.CPUModeHostPassthrough
164164
case v1alpha2.CPUTypeModel:
165165
cpu.Model = class.Spec.CPU.Model
166-
cpu.Features = []virtv1.CPUFeature{{Name: HTCPUFeature, Policy: "require"}}
166+
cpu.Features = []virtv1.CPUFeature{{Name: HTCPUFeature, Policy: "optional"}}
167167
case v1alpha2.CPUTypeDiscovery, v1alpha2.CPUTypeFeatures:
168168
cpu.Model = GenericCPUModel
169169
features := make([]virtv1.CPUFeature, 0, len(class.Status.CpuFeatures.Enabled)+1)

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,12 +242,11 @@ func TestSetCPUModel(t *testing.T) {
242242
}
243243

244244
features := builder.Resource.Spec.Template.Spec.Domain.CPU.Features
245-
if !containsCPUFeature(features, virtv1.CPUFeature{Name: HTCPUFeature, Policy: "require"}) {
246-
t.Fatalf("expected required ht feature to be added for model cpu, got %#v", features)
245+
if !containsCPUFeature(features, virtv1.CPUFeature{Name: HTCPUFeature, Policy: "optional"}) {
246+
t.Fatalf("expected optional ht feature to be added for model cpu, got %#v", features)
247247
}
248248
})
249249

250-
251250
t.Run("should keep existing ht feature policy when already present", func(t *testing.T) {
252251
builder := NewEmptyKVVM(types.NamespacedName{Name: name, Namespace: namespace}, KVVMOptions{})
253252
class := &v1alpha2.VirtualMachineClass{

0 commit comments

Comments
 (0)