~james/core

core/spindle/engine_microvm_linux.go -rw-r--r-- 670 bytes
452f17b7 — james chore(import): snapshot james.dad.town/core at f70c71c7696a 14 hours ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//go:build linux

package spindle

import (
	"context"

	"tangled.org/core/spindle/config"
	"tangled.org/core/spindle/db"
	"tangled.org/core/spindle/engines/microvm"
	"tangled.org/core/spindle/models"
	"tangled.org/core/spindle/quota"
)

// the engine's ssh listener can't import the spindle, so the spindle hands it the key check
func attachDebugAuthorizer(engines map[string]models.Engine, s *Spindle) {
	if eng, ok := engines["microvm"].(*microvm.Engine); ok {
		eng.SetDebugAuthorizer(s)
	}
}

func newMicrovmEngine(ctx context.Context, cfg *config.Config, d *db.DB, qStore quota.ReservationStore) (models.Engine, error) {
	return microvm.New(ctx, cfg, d, qStore)
}