Skip to content

Commit 7959e9d

Browse files
committed
Merge pull request xapi-project#1353 from akshayramani/CA-58172
CA-58172:Better text for VDI_ON_BOOT_MODE_INCOMPATABLE_WITH_OPERATION er...
2 parents 7428a4a + 2b11310 commit 7959e9d

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

ocaml/idl/api_errors.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ let vdi_missing = "VDI_MISSING"
204204
let vdi_incompatible_type = "VDI_INCOMPATIBLE_TYPE"
205205
let vdi_not_managed = "VDI_NOT_MANAGED"
206206
let vdi_io_error = "VDI_IO_ERROR"
207-
let vdi_on_boot_mode_incompatable_with_operation = "VDI_ON_BOOT_MODE_INCOMPATABLE_WITH_OPERATION"
207+
let vdi_on_boot_mode_incompatible_with_operation = "VDI_ON_BOOT_MODE_INCOMPATIBLE_WITH_OPERATION"
208208
let vdi_not_in_map = "VDI_NOT_IN_MAP"
209209
let cannot_create_state_file = "CANNOT_CREATE_STATE_FILE"
210210

ocaml/idl/datamodel.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,9 @@ let _ =
889889
error Api_errors.vdi_not_in_map [ "vdi" ]
890890
~doc:"This VDI was not mapped to a destination SR in VM.migrate_send operation" () ;
891891
error Api_errors.vdi_copy_failed []
892-
~doc:"The VDI copy action has failed" ();
892+
~doc:"The VDI copy action has failed" ();
893+
error Api_errors.vdi_on_boot_mode_incompatible_with_operation []
894+
~doc:"This operation is not permitted on VMs containing VDIs in the 'on-boot=reset' mode" ();
893895
error Api_errors.cannot_create_state_file []
894896
~doc:"An HA statefile could not be created, perhaps because no SR with the appropriate capability was found." ();
895897

ocaml/xapi/xapi_vdi.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ let check_operation_error ~__context ?(sr_records=[]) ?(pbd_records=[]) ?(vbd_re
163163
| `snapshot when record.Db_actions.vDI_sharable ->
164164
Some (Api_errors.vdi_is_sharable, [ _ref ])
165165
| `snapshot when reset_on_boot ->
166-
Some (Api_errors.vdi_on_boot_mode_incompatable_with_operation, [])
166+
Some (Api_errors.vdi_on_boot_mode_incompatible_with_operation, [])
167167
| `copy ->
168168
if List.mem record.Db_actions.vDI_type [ `ha_statefile; `redo_log ]
169169
then Some (Api_errors.operation_not_allowed, ["VDI containing HA statefile or redo log cannot be copied (check the VDI's allowed operations)."])

ocaml/xapi/xapi_vm_lifecycle.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,12 +300,12 @@ let check_operation_error ~__context ~vmr ~vmgmr ~ref ~clone_suspended_vm_enable
300300
if op = `checkpoint || op = `snapshot || op = `suspend || op = `snapshot_with_quiesce
301301
then (* If any vdi exists with on_boot=reset, then disallow checkpoint, snapshot, suspend *)
302302
if List.exists fst vdis_reset_and_caching
303-
then Some (Api_errors.vdi_on_boot_mode_incompatable_with_operation,[])
303+
then Some (Api_errors.vdi_on_boot_mode_incompatible_with_operation,[])
304304
else None
305305
else if op = `pool_migrate then
306306
(* If any vdi exists with on_boot=reset and caching is enabled, disallow migrate *)
307307
if List.exists (fun (reset,caching) -> reset && caching) vdis_reset_and_caching
308-
then Some (Api_errors.vdi_on_boot_mode_incompatable_with_operation,[])
308+
then Some (Api_errors.vdi_on_boot_mode_incompatible_with_operation,[])
309309
else None
310310
else None) in
311311

ocaml/xapi/xapi_vm_migrate.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ let migrate_send' ~__context ~vm ~dest ~live ~vdi_map ~vif_map ~options =
289289
(* Block SXM when VM has a VDI with on_boot=reset *)
290290
List.(iter (fun (vdi,_,_,_,_,_,_,_) ->
291291
if (Db.VDI.get_on_boot ~__context ~self:vdi ==`reset) then
292-
raise (Api_errors.Server_error(Api_errors.vdi_on_boot_mode_incompatable_with_operation, [Ref.string_of vdi]))) vdis) ;
292+
raise (Api_errors.Server_error(Api_errors.vdi_on_boot_mode_incompatible_with_operation, [Ref.string_of vdi]))) vdis) ;
293293

294294
let snapshots_vdis = List.filter_map (vdi_filter true) snapshots_vbds in
295295
let total_size = List.fold_left (fun acc (_,_,_,_,_,sz,_,_) -> Int64.add acc sz) 0L (vdis @ snapshots_vdis) in

0 commit comments

Comments
 (0)