Skip to content

Commit

Permalink
Merge pull request #221 from mabeett/UpdateConfig_lost_settings
Browse files Browse the repository at this point in the history
config_qemu.go/UpdateConfig() lost settings
  • Loading branch information
mleone87 authored Dec 9, 2022
2 parents f357e13 + 7a6b5a5 commit 0e9a016
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions proxmox/config_qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,9 @@ func (config ConfigQemu) UpdateConfig(vmr *VmRef, client *Client) (err error) {
if config.Agent != 0 {
configParams["agent"] = config.Agent
}
if config.QemuOs != "" {
configParams["ostype"] = config.QemuOs
}
if config.QemuCores != 0 {
configParams["cores"] = config.QemuCores
}
Expand Down Expand Up @@ -326,6 +329,10 @@ func (config ConfigQemu) UpdateConfig(vmr *VmRef, client *Client) (err error) {
configParams["startup"] = config.Startup
}

if config.QemuIso != "" {
configParams["ide2"] = config.QemuIso + ",media=cdrom"
}

if config.Bios != "" {
configParams["bios"] = config.Bios
}
Expand Down Expand Up @@ -366,6 +373,11 @@ func (config ConfigQemu) UpdateConfig(vmr *VmRef, client *Client) (err error) {
configParams["scsihw"] = config.Scsihw
}

err = config.CreateQemuMachineParam(configParams)
if err != nil {
log.Printf("[ERROR] %q", err)
}

// Create disks config.
configParamsDisk := map[string]interface{}{
"vmid": vmr.vmId,
Expand Down

0 comments on commit 0e9a016

Please sign in to comment.