diff --git a/builder/proxmox/config.go b/builder/proxmox/config.go index 22cb6786d..41288cb7a 100644 --- a/builder/proxmox/config.go +++ b/builder/proxmox/config.go @@ -53,6 +53,7 @@ type Config struct { Agent bool `mapstructure:"qemu_agent"` SCSIController string `mapstructure:"scsi_controller"` Onboot bool `mapstructure:"onboot"` + DisableKVM bool `mapstructure:"disable_kvm"` TemplateName string `mapstructure:"template_name"` TemplateDescription string `mapstructure:"template_description"` diff --git a/builder/proxmox/config.hcl2spec.go b/builder/proxmox/config.hcl2spec.go index 73a70b6a1..5136e933f 100644 --- a/builder/proxmox/config.hcl2spec.go +++ b/builder/proxmox/config.hcl2spec.go @@ -96,6 +96,7 @@ type FlatConfig struct { Agent *bool `mapstructure:"qemu_agent" cty:"qemu_agent" hcl:"qemu_agent"` SCSIController *string `mapstructure:"scsi_controller" cty:"scsi_controller" hcl:"scsi_controller"` Onboot *bool `mapstructure:"onboot" cty:"onboot" hcl:"onboot"` + DisableKVM *bool `mapstructure:"disable_kvm" cty:"disable_kvm" hcl:"disable_kvm"` TemplateName *string `mapstructure:"template_name" cty:"template_name" hcl:"template_name"` TemplateDescription *string `mapstructure:"template_description" cty:"template_description" hcl:"template_description"` UnmountISO *bool `mapstructure:"unmount_iso" cty:"unmount_iso" hcl:"unmount_iso"` @@ -202,6 +203,7 @@ func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { "qemu_agent": &hcldec.AttrSpec{Name: "qemu_agent", Type: cty.Bool, Required: false}, "scsi_controller": &hcldec.AttrSpec{Name: "scsi_controller", Type: cty.String, Required: false}, "onboot": &hcldec.AttrSpec{Name: "onboot", Type: cty.Bool, Required: false}, + "disable_kvm": &hcldec.AttrSpec{Name: "disable_kvm", Type: cty.Bool, Required: false}, "template_name": &hcldec.AttrSpec{Name: "template_name", Type: cty.String, Required: false}, "template_description": &hcldec.AttrSpec{Name: "template_description", Type: cty.String, Required: false}, "unmount_iso": &hcldec.AttrSpec{Name: "unmount_iso", Type: cty.Bool, Required: false}, diff --git a/builder/proxmox/config_test.go b/builder/proxmox/config_test.go index e9889ba38..1c4f03552 100644 --- a/builder/proxmox/config_test.go +++ b/builder/proxmox/config_test.go @@ -98,6 +98,7 @@ func TestBasicExampleFromDocsIsValid(t *testing.T) { // Agent not set, default is true // SCSI controller not set, using default 'lsi' // Firewall toggle not set, using default: 0 + // Disable KVM not set, using default: 0 if b.config.Memory != 512 { t.Errorf("Expected Memory to be 512, got %d", b.config.Memory) @@ -126,6 +127,9 @@ func TestBasicExampleFromDocsIsValid(t *testing.T) { if b.config.Agent != true { t.Errorf("Expected Agent to be true, got %t", b.config.Agent) } + if b.config.DisableKVM != false { + t.Errorf("Expected Disable KVM toggle to be false, got %t", b.config.DisableKVM) + } if b.config.SCSIController != "lsi" { t.Errorf("Expected SCSI controller to be 'lsi', got %s", b.config.SCSIController) }