mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-08-30 17:13:08 +08:00
fix(host): delete container snapshot panic (#20440)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user