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
gates / gates (push) Successful in 1m36s
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user