Skip to content

Commit

Permalink
incusd/device/tpm: Wait for swtpm to be ready
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Graber <[email protected]>
  • Loading branch information
stgraber committed Dec 2, 2024
1 parent c2f4950 commit c819edb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/server/device/tpm.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,9 @@ func (d *tpm) startVM() (*deviceConfig.RunConfig, error) {
return nil, fmt.Errorf("Failed to save swtpm state for device %q: %w", d.name, err)
}

// swtpm unfortunately isn't always immediately ready for QEMU...
time.Sleep(time.Second)

revert.Success()

return &runConf, nil
Expand Down

0 comments on commit c819edb

Please sign in to comment.