Merge pull request #16112 from wanyaoqi/fix/load-deamon-server

fix(host): start daemon guest on guest not running
This commit is contained in:
Zexi Li
2023-03-03 10:29:52 +08:00
committed by GitHub
+3 -1
View File
@@ -607,7 +607,7 @@ func (s *SKVMGuestInstance) ImportServer(pendingDelete bool) {
s.manager.SaveServer(s.Id, s)
s.manager.RemoveCandidateServer(s)
if (s.IsDirtyShotdown() || s.IsDaemon()) && !pendingDelete {
if s.IsDirtyShotdown() && !pendingDelete {
log.Infof("Server dirty shutdown or a daemon %s", s.GetName())
if s.Desc.IsMaster || s.Desc.IsSlave ||
@@ -623,6 +623,8 @@ func (s *SKVMGuestInstance) ImportServer(pendingDelete bool) {
if !pendingDelete {
s.StartMonitor(context.Background(), nil)
}
} else if s.IsDaemon() {
s.StartGuest(context.Background(), nil, jsonutils.NewDict())
} else {
var action = "stopped"
if s.IsSuspend() {