&& op <> `changing_dynamic_range
then Some (Api_errors.operation_not_allowed, ["Operations on domain 0 are not allowed"])
- (* Check for an error due to VDI caching/reset behaviour *)
- else if op = `checkpoint || op = `snapshot || op = `suspend || op = `snapshot_with_quiesce
- then (* If any vdi exists with on_boot=reset, then disallow checkpoint, snapshot, suspend *)
- if List.exists fst vdis_reset_and_caching
- then Some (Api_errors.vdi_on_boot_mode_incompatable_with_operation,[])
- else None
- else if op = `pool_migrate then
- (* If any vdi exists with on_boot=reset and caching is enabled, disallow migrate *)
- if List.exists (fun (reset,caching) -> reset && caching) vdis_reset_and_caching
- then Some (Api_errors.vdi_on_boot_mode_incompatable_with_operation,[])
- else None
-
(* check PV drivers constraints if needed *)
else if need_pv_drivers_check ~power_state ~op
then check_drivers ~vmr ~vmgmr ~op ~ref
not (List.mem_assoc "feature-quiesce" other || List.mem_assoc "feature-snapshot" other))
vmgmr)
then Some (Api_errors.vm_snapshot_with_quiesce_not_supported, [ ref_str ])
+
+ (* Check for an error due to VDI caching/reset behaviour *)
+ else if op = `checkpoint || op = `snapshot || op = `suspend || op = `snapshot_with_quiesce
+ then (* If any vdi exists with on_boot=reset, then disallow checkpoint, snapshot, suspend *)
+ if List.exists fst vdis_reset_and_caching
+ then Some (Api_errors.vdi_on_boot_mode_incompatable_with_operation,[])
+ else None
+ else if op = `pool_migrate then
+ (* If any vdi exists with on_boot=reset and caching is enabled, disallow migrate *)
+ if List.exists (fun (reset,caching) -> reset && caching) vdis_reset_and_caching
+ then Some (Api_errors.vdi_on_boot_mode_incompatable_with_operation,[])
+ else None
+
else None
let maybe_get_guest_metrics ~__context ~ref =