[PR #192] [MERGED] fix the problem, 1. cdrom triger panic 2. qemut agent can not get right value #296

Closed
opened 2026-02-28 00:41:40 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Telmate/proxmox-api-go/pull/192
Author: @IxaKylin
Created: 9/9/2022
Status: Merged
Merged: 9/10/2022
Merged by: @mleone87

Base: masterHead: master


📝 Commits (2)

  • fd84eae fix the problem, when cdrom is scsi and have no cd, it will triger panic
  • 2becf38 fix the problem fo can not get right agent value

📊 Changes

1 file changed (+10 additions, -2 deletions)

View changed files

📝 proxmox/config_qemu.go (+10 -2)

📄 Description

  1. UpdateConfig format is not right.
  2. fix the problem, when cdrom is scsi and have no cd, it will triger panic.
  3. fix the problem, agent can not get right value when agent have orther parameter.

1662686553031

1662780129971
image

	agent := 0
	if _, isSet := vmConfig["agent"]; isSet {
		switch vmConfig["agent"].(type) {
		case float64:
			agent = int(vmConfig["agent"].(float64))
		case string:
                       // atoi always get 0 
			agent, _ = strconv.Atoi(vmConfig["agent"].(string))
		}

	}


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Telmate/proxmox-api-go/pull/192 **Author:** [@IxaKylin](https://github.com/IxaKylin) **Created:** 9/9/2022 **Status:** ✅ Merged **Merged:** 9/10/2022 **Merged by:** [@mleone87](https://github.com/mleone87) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (2) - [`fd84eae`](https://github.com/Telmate/proxmox-api-go/commit/fd84eaecd7ffe3bbe56c20d895dd283e29dfd0c1) fix the problem, when cdrom is scsi and have no cd, it will triger panic - [`2becf38`](https://github.com/Telmate/proxmox-api-go/commit/2becf38dcc8c8a8bbe5292a13a39292d6ccf0f8c) fix the problem fo can not get right agent value ### 📊 Changes **1 file changed** (+10 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `proxmox/config_qemu.go` (+10 -2) </details> ### 📄 Description 1. UpdateConfig format is not right. 2. fix the problem, when cdrom is scsi and have no cd, it will triger panic. 3. fix the problem, agent can not get right value when agent have orther parameter. ![1662686553031](https://user-images.githubusercontent.com/100996593/189252564-3ede397a-6491-4527-830f-848d13c0b826.png) ![1662780129971](https://user-images.githubusercontent.com/100996593/189466844-d2c4df8f-f924-4d49-b57d-08b26d5ac2a0.png) ![image](https://user-images.githubusercontent.com/100996593/189466863-10544424-fb1f-43de-b512-56c95b5afcc0.png) ``` agent := 0 if _, isSet := vmConfig["agent"]; isSet { switch vmConfig["agent"].(type) { case float64: agent = int(vmConfig["agent"].(float64)) case string: // atoi always get 0 agent, _ = strconv.Atoi(vmConfig["agent"].(string)) } } ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-28 00:41:40 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/proxmox-api-go#296
No description provided.