Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CA-88840:User Friendly error message when cross/intrapool migration fails #1061

Merged
merged 1 commit into from
May 10, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ocaml/idl/api_errors.ml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -462,3 +462,4 @@ let vm_has_checkpoint = "VM_HAS_CHECKPOINT"


let mirror_failed = "MIRROR_FAILED" let mirror_failed = "MIRROR_FAILED"
let too_many_storage_migrates = "TOO_MANY_STORAGE_MIGRATES" let too_many_storage_migrates = "TOO_MANY_STORAGE_MIGRATES"
let unimplemented_in_sm_backend = "UNIMPLEMENTED_IN_SM_BACKEND"
3 changes: 2 additions & 1 deletion ocaml/idl/datamodel.ml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -410,7 +410,8 @@ let _ =
~doc:"You attempted an operation that was explicitly blocked (see the blocked_operations field of the given object)." (); ~doc:"You attempted an operation that was explicitly blocked (see the blocked_operations field of the given object)." ();
error Api_errors.not_implemented ["function"] error Api_errors.not_implemented ["function"]
~doc:"The function is not implemented" (); ~doc:"The function is not implemented" ();

error Api_errors.unimplemented_in_sm_backend ["message"]
~doc:"You have attempted a function which is not implemented" ();
(* DB errors *) (* DB errors *)
error Api_errors.handle_invalid ["class"; "handle"] error Api_errors.handle_invalid ["class"; "handle"]
~doc:"You gave an invalid object reference. The object may have recently been deleted. The class parameter gives the type of reference given, and the handle parameter echoes the bad value given." (); ~doc:"You gave an invalid object reference. The object may have recently been deleted. The class parameter gives the type of reference given, and the handle parameter echoes the bad value given." ();
Expand Down
3 changes: 2 additions & 1 deletion ocaml/xapi/storage_migrate.ml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -651,7 +651,8 @@ let wrap ~dbg f =
| Backend_error(code, params) | Backend_error(code, params)
| Api_errors.Server_error(code, params) -> | Api_errors.Server_error(code, params) ->
raise (Backend_error(code, params)) raise (Backend_error(code, params))
| e -> | Unimplemented msg -> raise (Unimplemented msg)
| e ->
raise (Internal_error(Printexc.to_string e))) in raise (Internal_error(Printexc.to_string e))) in
let _ = Thread.create let _ = Thread.create
(Debug.with_thread_associated dbg (fun () -> (Debug.with_thread_associated dbg (fun () ->
Expand Down
1 change: 1 addition & 0 deletions ocaml/xapi/xapi_vm_migrate.ml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@ let migrate_send' ~__context ~vm ~dest ~live ~vdi_map ~vif_map ~options =
TaskHelper.exn_if_cancelling ~__context; TaskHelper.exn_if_cancelling ~__context;
begin match e with begin match e with
| Storage_interface.Backend_error(code, params) -> raise (Api_errors.Server_error(code, params)) | Storage_interface.Backend_error(code, params) -> raise (Api_errors.Server_error(code, params))
| Storage_interface.Unimplemented(code) -> raise (Api_errors.Server_error(Api_errors.unimplemented_in_sm_backend, [code]))
| _ -> raise e | _ -> raise e
end end


Expand Down