fix(host): delete container snapshot panic (#20440)

This commit is contained in:
Zexi Li
2024-06-03 09:51:14 +08:00
committed by GitHub
parent fdfd90d51a
commit fd14d75b34
+2 -9
View File
@@ -1256,15 +1256,8 @@ func (m *SGuestManager) DeleteSnapshot(ctx context.Context, params interface{})
return nil, hostutils.ParamsError
}
if len(delParams.ConvertSnapshot) > 0 || delParams.BlockStream {
guest, _ := m.GetKVMServer(delParams.Sid)
return guest.ExecDeleteSnapshotTask(ctx, delParams.Disk, delParams.DeleteSnapshot,
delParams.ConvertSnapshot, delParams.BlockStream)
} else {
res := jsonutils.NewDict()
res.Set("deleted", jsonutils.JSONTrue)
return res, delParams.Disk.DeleteSnapshot(delParams.DeleteSnapshot, "", false)
}
guest, _ := m.GetServer(delParams.Sid)
return guest.DeleteSnapshot(ctx, delParams)
}
func (m *SGuestManager) DoMemorySnapshot(ctx context.Context, params interface{}) (jsonutils.JSONObject, error) {