Skip to content

Commit

Permalink
kola/spawn: Support enabling swtpm
Browse files Browse the repository at this point in the history
Allow users to create a qemu VM with swtpm through kola spawn.

Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
  • Loading branch information
jepio committed Apr 10, 2024
1 parent d128844 commit fd17331
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/kola/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ func init() {
sv(&kola.QEMUOptions.BIOSImage, "qemu-bios", "", "BIOS to use for QEMU vm")
bv(&kola.QEMUOptions.UseVanillaImage, "qemu-skip-mangle", false, "don't modify CL disk image to capture console log")
sv(&kola.QEMUOptions.ExtraBaseDiskSize, "qemu-grow-base-disk-by", "", "grow base disk by the given size in bytes, following optional 1024-based suffixes are allowed: b (ignored), k, K, M, G, T")
bv(&kola.QEMUOptions.EnableTPM, "qemu-tpm", false, "enable TPM device in QEMU. Requires installing swtpm.")

// BrightBox specific options
sv(&kola.BrightboxOptions.ClientID, "brightbox-client-id", "", "Brightbox client ID")
Expand Down
1 change: 1 addition & 0 deletions platform/machine/qemu/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ type Cluster struct {
func (qc *Cluster) NewMachine(userdata *conf.UserData) (platform.Machine, error) {
options := platform.MachineOptions{
ExtraPrimaryDiskSize: qc.flight.opts.ExtraBaseDiskSize,
EnableTPM: qc.flight.opts.EnableTPM,
}
return qc.NewMachineWithOptions(userdata, options)
}
Expand Down
2 changes: 2 additions & 0 deletions platform/machine/qemu/flight.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ type Options struct {

ExtraBaseDiskSize string

EnableTPM bool

*platform.Options
}

Expand Down

0 comments on commit fd17331

Please sign in to comment.