Skip to content

Commit 76c6d79

Browse files
committed
chore: cleanup & comments
1 parent 56620d0 commit 76c6d79

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

options.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ func getFirecrackerConfig(vmmID string) (firecracker.Config, error) {
1818
KernelImagePath: "../../linux/vmlinux",
1919
LogPath: fmt.Sprintf("%s.log", socket),
2020
Drives: []models.Drive{{
21-
DriveID: firecracker.String("1"),
22-
// TODO: copy base rootfs and use a temp roots per VM
21+
DriveID: firecracker.String("1"),
2322
PathOnHost: firecracker.String("/tmp/rootfs-" + vmmID + ".ext4"),
2423
IsRootDevice: firecracker.Bool(true),
2524
IsReadOnly: firecracker.Bool(false),

pool.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,22 @@ func fillVMPool(ctx context.Context, WarmVMs chan<- runningFirecracker) {
2020
time.Sleep(time.Second)
2121
continue
2222
}
23+
2324
log.WithField("ip", vm.ip).Info("New VM created and started")
25+
26+
// Don't wait forever, if the VM is not available after 10s, move on
2427
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
2528
defer cancel()
29+
2630
err = waitForVMToBoot(ctx, vm.ip)
2731
if err != nil {
2832
log.WithError(err).Info("VM not ready yet")
2933
vm.vmmCancel()
3034
continue
3135
}
36+
37+
// Add the new microVM to the pool.
38+
// If the pool is full, this line will block until a slot is available.
3239
WarmVMs <- *vm
3340
}
3441
}

0 commit comments

Comments
 (0)