func (p *policy) finishColdStart(c cache.Container) (bool, error) {
	g, ok := p.allocations.grants[c.GetCacheID()]
	if !ok {
		log.Warn("coldstart: no grant found, nothing to do...")
		return false, policyError("coldstart: no grant found for %s", c.PrettyName())
	}
	log.Info("restoring memset to grant %v", g)
	g.RestoreMemset()
	g.ClearTimer()
	return true, nil
}
finish an ongoing coldstart for the container.
package topologyaware
import (
	"time"
	"github.com/intel/cri-resource-manager/pkg/cri/resource-manager/cache"
	"github.com/intel/cri-resource-manager/pkg/cri/resource-manager/events"
)
func (p *policy) triggerColdStart(c cache.Container) error {
	log.Info("coldstart: triggering coldstart for %s...", c.PrettyName())
	g, ok := p.allocations.grants[c.GetCacheID()]
	if !ok {
		log.Warn("coldstart: no grant found, nothing to do...")
		return nil
	}
	coldStart := g.ColdStart()
	if coldStart <= 0 {
		log.Info("coldstart: no coldstart, nothing to do...")
		return nil
	}
	duration := coldStart
	timer := time.AfterFunc(duration, func() {
		e := &events.Policy{
			Type:   ColdStartDone,
			Source: PolicyName,
			Data:   c.GetID(),
		}
		if err := p.options.SendEvent(e); err != nil {
			log.Error("Ouch... we'should retry this later.")
		}
	})
	g.AddTimer(timer)
	return nil
}