@@ -90,16 +90,12 @@ const (
9090)
9191
9292type ConfidentialLCOWOptions struct {
93- GuestStateFile string // The vmgs file to load
94- UseGuestStateFile bool // Use a vmgs file that contains a kernel and initrd, required for SNP
95- SecurityPolicy string // Optional security policy
96- SecurityPolicyEnabled bool // Set when there is a security policy to apply on actual SNP hardware, use this rathen than checking the string length
97- SecurityPolicyEnforcer string // Set which security policy enforcer to use (open door, standard or rego). This allows for better fallback mechanic.
98- UVMReferenceInfoFile string // Filename under `BootFilesPath` for (potentially signed) UVM image reference information.
99- BundleDirectory string // pod bundle directory
100- DmVerityRootFsVhd string // The VHD file (bound to the vmgs file via embedded dmverity hash data file) to load.
101- DmVerityMode bool // override to be able to turn off dmverity for debugging
102- DmVerityCreateArgs string // set dm-verity args when booting with verity in non-SNP mode
93+ * ConfidentialCommonOptions
94+ UseGuestStateFile bool // Use a vmgs file that contains a kernel and initrd, required for SNP
95+ BundleDirectory string // pod bundle directory
96+ DmVerityRootFsVhd string // The VHD file (bound to the vmgs file via embedded dmverity hash data file) to load.
97+ DmVerityMode bool // override to be able to turn off dmverity for debugging
98+ DmVerityCreateArgs string // set dm-verity args when booting with verity in non-SNP mode
10399}
104100
105101// OptionsLCOW are the set of options passed to CreateLCOW() to create a utility vm.
@@ -177,8 +173,10 @@ func NewDefaultOptionsLCOW(id, owner string) *OptionsLCOW {
177173 EnableScratchEncryption : false ,
178174 DisableTimeSyncService : false ,
179175 ConfidentialLCOWOptions : & ConfidentialLCOWOptions {
180- SecurityPolicyEnabled : false ,
181- UVMReferenceInfoFile : UVMReferenceInfoFile ,
176+ ConfidentialCommonOptions : & ConfidentialCommonOptions {
177+ SecurityPolicyEnabled : false ,
178+ UVMReferenceInfoFile : UVMReferenceInfoFile ,
179+ },
182180 },
183181 }
184182
@@ -350,7 +348,7 @@ func makeLCOWVMGSDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_
350348 }
351349
352350 // The kernel and minimal initrd are combined into a single vmgs file.
353- vmgsTemplatePath := filepath .Join (opts .BootFilesPath , opts .GuestStateFile )
351+ vmgsTemplatePath := filepath .Join (opts .BootFilesPath , opts .GuestStateFilePath )
354352 if _ , err := os .Stat (vmgsTemplatePath ); os .IsNotExist (err ) {
355353 return nil , fmt .Errorf ("the GuestState vmgs file '%s' was not found" , vmgsTemplatePath )
356354 }
@@ -367,7 +365,7 @@ func makeLCOWVMGSDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_
367365 return nil , err
368366 }
369367
370- vmgsFileFullPath := filepath .Join (opts .BundleDirectory , opts .GuestStateFile )
368+ vmgsFileFullPath := filepath .Join (opts .BundleDirectory , opts .GuestStateFilePath )
371369 if err := copyfile .CopyFile (ctx , vmgsTemplatePath , vmgsFileFullPath , true ); err != nil {
372370 return nil , fmt .Errorf ("failed to copy VMGS template file: %w" , err )
373371 }
0 commit comments