Skip to content

Handle plateform args comming from cloned template#188

Open
AtaxyaNetwork wants to merge 3 commits intovatesfr:mainfrom
AtaxyaNetwork:platformargs
Open

Handle plateform args comming from cloned template#188
AtaxyaNetwork wants to merge 3 commits intovatesfr:mainfrom
AtaxyaNetwork:platformargs

Conversation

@AtaxyaNetwork
Copy link
Collaborator

Before, when creating an image, platform args was either defined by the user, or arbitrary default args was used.

Now, platform args from the template are reused to build the image for the user. This make creating windows image (which need viridian and other things) easier.

User can still override platform args if they want

Fix #155

Also, output is telling us when existing platform args are used:

==> xenserver-iso.template: Using existing platform args: map[acpi:1 acpi_laptop_slate:1 apic:true cores-per-socket:2 device_id:0002 hpet:true nx:true pae:true secureboot:auto vga:std videoram:8 viridian:true viridian_apic_assist:true viridian_crash_ctl:true viridian_reference_tsc:true viridian_stimer:true viridian_time_ref_count:true vtpm:true]

err = c.GetClient().VM.SetPlatform(c.GetSessionRef(), instance, config.PlatformArgs)
// If user didn't set platform args, use existing ones from the template
platformArgs := config.PlatformArgs
if platformArgs == nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

At this point config.PlatformArgs == nil means it can be != nil but with a lenght of zero. i.e. it's empty. In that cas we VM.SetPlatform with no plaform args. Is it expected?

…aults

- Use len(platformArgs) == 0 instead of nil check to also handle explicit
  empty platform_args config
- Remove spurious \n from ui.Say (ui.Say adds its own newline)
- Replace inaccurate comment with accurate one
- Remove hardcoded platform arg defaults from xva builder (consistent with
  iso builder; step_create_instance now inherits from template for both)
@nathanael-h
Copy link
Member

@gCyrille do you wanna re-review?

@nathanael-h nathanael-h requested a review from gCyrille March 13, 2026 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keep cloned template platform args

3 participants