Skip to content

Commit b8e9b19

Browse files
JAORMXclaude
andcommitted
Migrate to propolis hypervisor.Backend abstraction
Replace removed propolis.WithRunnerPath/WithLibDir options with the new libkrun.NewBackend() pattern and switch vm.PID() to vm.ID(). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8760cb3 commit b8e9b19

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

pkg/infra/vm/propolis.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313

1414
"github.com/stacklok/propolis"
1515
"github.com/stacklok/propolis/hooks"
16+
"github.com/stacklok/propolis/hypervisor/libkrun"
1617
propolisssh "github.com/stacklok/propolis/ssh"
1718

1819
"github.com/stacklok/waggle/pkg/domain/environment"
@@ -94,12 +95,14 @@ func (p *PropolisProvider) CreateVM(ctx context.Context, env *environment.Enviro
9495
)
9596
}
9697

98+
var backendOpts []libkrun.Option
9799
if opts.RunnerPath != "" {
98-
propolisOpts = append(propolisOpts, propolis.WithRunnerPath(opts.RunnerPath))
100+
backendOpts = append(backendOpts, libkrun.WithRunnerPath(opts.RunnerPath))
99101
}
100102
if opts.LibDir != "" {
101-
propolisOpts = append(propolisOpts, propolis.WithLibDir(opts.LibDir))
103+
backendOpts = append(backendOpts, libkrun.WithLibDir(opts.LibDir))
102104
}
105+
propolisOpts = append(propolisOpts, propolis.WithBackend(libkrun.NewBackend(backendOpts...)))
103106

104107
// Start the VM.
105108
vm, err := propolis.Run(ctx, opts.ImageRef, propolisOpts...)
@@ -117,7 +120,7 @@ func (p *PropolisProvider) CreateVM(ctx context.Context, env *environment.Enviro
117120

118121
slog.Info("microVM created successfully",
119122
"env_id", env.ID,
120-
"pid", vm.PID(),
123+
"id", vm.ID(),
121124
)
122125

123126
return &Handle{

0 commit comments

Comments
 (0)