install page: say when the host has too little swap behind the guest (R-1192 follow-up); restore record log says when a cut restore was put back; unreleased
gates / gates (push) Successful in 1m36s

This commit is contained in:
2026-10-21 22:11:16 +02:00
parent d582feb245
commit 37b79caad9
11 changed files with 78 additions and 6 deletions
@@ -192,3 +192,26 @@ func procMemTotalMB() int64 {
}
return 0
}
// hostSwapShort (R-1192 follow-up, night 2026-10-21) asks the agent whether the HOST's swap is below this guest's RAM
// — the guest swap fix (swap = RAM) puts a memory burst there, and a host with none gets nothing from it. False when
// it cannot tell (an older agent, an agent that does not answer within 2 s): the install page then shows only the
// overcommit sentence, as before.
func (s *Server) hostSwapShort() bool {
agent, err := s.memAgentForResize()
if err != nil || agent == nil {
return false
}
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
defer cancel()
info, err := agent.GuestMemory(ctx)
if err != nil {
return false
}
return swapShort(info)
}
// swapShort: the host's swap is known and below the guest's RAM.
func swapShort(info agentapi.GuestMemoryInfo) bool {
return info.HostSwapMB != nil && info.AllocatedMB > 0 && *info.HostSwapMB < info.AllocatedMB
}