@@ -499,12 +499,9 @@ let snapshot ~__context ~vm ~new_name =
499499(* Snapshot_with_quiesce triggers the VSS plugin which will then calls the VM.snapshot API call. *)
500500(* Thus, to avoid dead-locks, do not put snapshot and snapshot_with_quiesce on the same waiting line *)
501501let snapshot_with_quiesce ~__context ~vm ~new_name =
502- if not (Pool_features. is_enabled ~__context Features. VSS )
503- then raise (Api_errors. Server_error (Api_errors. license_restriction, [] ))
504- else begin
505- TaskHelper. set_cancellable ~__context;
506- Xapi_vm_snapshot. snapshot_with_quiesce ~__context ~vm ~new_name
507- end
502+ Pool_features. assert_enabled ~__context ~f: Features. VSS ;
503+ TaskHelper. set_cancellable ~__context;
504+ Xapi_vm_snapshot. snapshot_with_quiesce ~__context ~vm ~new_name
508505
509506(* As we will destroy the domain ourself, we grab the vm_lock here in order to tell the event thread to *)
510507(* do not look at this domain. The message forwarding layer already checked that the VM reference we *)
@@ -521,16 +518,13 @@ let revert ~__context ~snapshot =
521518(* As the checkpoint operation modify the domain state, we take the vm_lock to do not let the event *)
522519(* thread mess around with that. *)
523520let checkpoint ~__context ~vm ~new_name =
524- if not (Pool_features. is_enabled ~__context Features. Checkpoint ) then
525- raise (Api_errors. Server_error (Api_errors. license_restriction, [] ))
526- else begin
527- Local_work_queue. wait_in_line Local_work_queue. long_running_queue
528- (Printf. sprintf " VM.checkpoint %s" (Context. string_of_task __context))
529- (fun () ->
530- TaskHelper. set_cancellable ~__context;
531- Xapi_vm_snapshot. checkpoint ~__context ~vm ~new_name
532- )
533- end
521+ Pool_features. assert_enabled ~__context ~f: Features. Checkpoint ;
522+ Local_work_queue. wait_in_line Local_work_queue. long_running_queue
523+ (Printf. sprintf " VM.checkpoint %s" (Context. string_of_task __context))
524+ (fun () ->
525+ TaskHelper. set_cancellable ~__context;
526+ Xapi_vm_snapshot. checkpoint ~__context ~vm ~new_name
527+ )
534528
535529let copy ~__context ~vm ~new_name ~sr =
536530 (* See if the supplied SR is suitable: it must exist and be a non-ISO SR *)
0 commit comments