From 3aec590debd61d27b3fbc16b61953309656ced77 Mon Sep 17 00:00:00 2001 From: Thales Maciel Date: Wed, 22 Apr 2026 12:45:27 -0300 Subject: [PATCH] vmservice: delete dead guestWaitForSSH + guestDial seams MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit VMService carried guestWaitForSSH and guestDial fields + matching constructor args ever since the daemon split, but nothing on VMService ever read them. The live guest-SSH path runs on *Daemon (d.waitForGuestSSH / d.dialGuest in guest_ssh.go); WorkspaceService reaches those through closures wired in wireServices. So the VMService copies were refactor residue: they made the service look more decoupled than it actually is, and any future test that stubbed VMService.guestDial would be stubbing nothing. Delete the fields, the deps entries, the newVMService assignments, and the wireServices passes. Real seams on *Daemon are unchanged — those are the ones tests (e.g. workspace_test.go) already set directly. Co-Authored-By: Claude Opus 4.7 (1M context) --- internal/daemon/daemon.go | 2 -- internal/daemon/vm_service.go | 8 -------- 2 files changed, 10 deletions(-) diff --git a/internal/daemon/daemon.go b/internal/daemon/daemon.go index ed9f715..68eb77c 100644 --- a/internal/daemon/daemon.go +++ b/internal/daemon/daemon.go @@ -653,8 +653,6 @@ func wireServices(d *Daemon) { net: d.net, img: d.img, ws: d.ws, - guestWaitForSSH: d.guestWaitForSSH, - guestDial: d.guestDial, capHooks: d.buildCapabilityHooks(), beginOperation: d.beginOperation, vsockHostDevice: defaultVsockHostDevice, diff --git a/internal/daemon/vm_service.go b/internal/daemon/vm_service.go index 30d9d09..fdd7d95 100644 --- a/internal/daemon/vm_service.go +++ b/internal/daemon/vm_service.go @@ -8,7 +8,6 @@ import ( "log/slog" "strings" "sync" - "time" "banger/internal/daemon/opstate" "banger/internal/firecracker" @@ -63,9 +62,6 @@ type VMService struct { img *ImageService ws *WorkspaceService - // Test seams. - guestWaitForSSH func(context.Context, string, string, time.Duration) error - guestDial func(context.Context, string, string) (guestSSHClient, error) // vsockHostDevice is the path preflight + doctor expect to find for // the vhost-vsock device. Defaults to defaultVsockHostDevice; tests // point at a tempfile so RequireFile passes without needing the @@ -105,8 +101,6 @@ type vmServiceDeps struct { net *HostNetwork img *ImageService ws *WorkspaceService - guestWaitForSSH func(context.Context, string, string, time.Duration) error - guestDial func(context.Context, string, string) (guestSSHClient, error) capHooks capabilityHooks beginOperation func(name string, attrs ...any) *operationLog vsockHostDevice string @@ -126,8 +120,6 @@ func newVMService(deps vmServiceDeps) *VMService { net: deps.net, img: deps.img, ws: deps.ws, - guestWaitForSSH: deps.guestWaitForSSH, - guestDial: deps.guestDial, capHooks: deps.capHooks, beginOperation: deps.beginOperation, vsockHostDevice: vsockPath,