Skip to content

Conversation

@kmonticolo
Copy link

Add validation to ensure serial device is defined when vga type is serial.

@kmonticolo
Copy link
Author

fixes #1440

@Tinyblargon Tinyblargon self-requested a review November 2, 2025 20:08
@Tinyblargon Tinyblargon added type/enhancement An improvement of existing functionality modifies/go Pull requests that update Go code size/L Denotes a PR that changes 100-499 lines, ignoring generated files resource/qemu Issue or PR related to Qemu resource test/needen This PR has to be tested labels Nov 28, 2025

func validateVGAAndSerial(d *schema.ResourceData) error {
// Get VGA configuration
vgaList := d.Get("vga").([]interface{})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This panics when "vga" is not defined.

}
}

func validateVGAAndSerial(d *schema.ResourceData) error {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My advise would be to implement the logic by parsing the config defined by:

config := pveSDK.ConfigQemu{

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

modifies/go Pull requests that update Go code resource/qemu Issue or PR related to Qemu resource size/L Denotes a PR that changes 100-499 lines, ignoring generated files test/needen This PR has to be tested type/enhancement An improvement of existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants