Skip to content

Commit f6be3e7

Browse files
committed
Merge pull request xapi-project#48 from sharady/CA-182497-tampa-bugfix
CA-182497: Raise an API error when xs-tools iso mounted on a VM
2 parents 7dd54cb + aba9f86 commit f6be3e7

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

ocaml/idl/api_errors.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ let patch_precheck_failed_prerequisite_missing = "PATCH_PRECHECK_FAILED_PREREQUI
307307
let patch_precheck_failed_wrong_server_version = "PATCH_PRECHECK_FAILED_WRONG_SERVER_VERSION"
308308
let patch_precheck_failed_wrong_server_build = "PATCH_PRECHECK_FAILED_WRONG_SERVER_BUILD"
309309
let patch_precheck_failed_vm_running = "PATCH_PRECHECK_FAILED_VM_RUNNING"
310+
let patch_precheck_tools_iso_mounted = "PATCH_PRECHECK_FAILED_ISO_MOUNTED"
310311
let patch_apply_failed = "PATCH_APPLY_FAILED"
311312
let patch_apply_failed_backup_files_exist = "PATCH_APPLY_FAILED_BACKUP_FILES_EXIST"
312313
let cannot_find_oem_backup_partition = "CANNOT_FIND_OEM_BACKUP_PARTITION"

ocaml/idl/datamodel.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -976,6 +976,8 @@ let _ =
976976
~doc:"The patch precheck stage failed: the server is of an incorrect build." ();
977977
error Api_errors.patch_precheck_failed_vm_running [ "patch" ]
978978
~doc:"The patch precheck stage failed: there are one or more VMs still running on the server. All VMs must be suspended before the patch can be applied." ();
979+
error Api_errors.patch_precheck_tools_iso_mounted ["patch"]
980+
~doc:"XenServer Tools ISO must be ejected from all running VMs." ();
979981

980982
error Api_errors.cannot_find_oem_backup_partition []
981983
~doc:"The backup partition to stream the updat to cannot be found" ();

ocaml/xapi/xapi_pool_patch.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,8 @@ let parse_patch_precheck_xml patch = function
621621
<info>Any message in text - for errors that don't fit into another category</info>
622622
</error> *)
623623
raise (Api_errors.Server_error (Api_errors.patch_precheck_failed_unknown_error, [Ref.string_of patch; info]))
624+
| Element("error" , [("errorcode","PATCH_PRECHECK_FAILED_ISO_MOUNTED")], [Element ("info",_, [PCData info])]) ->
625+
raise (Api_errors.Server_error (Api_errors.patch_precheck_tools_iso_mounted, [Ref.string_of patch; info]))
624626
| Element ("error", [("errorcode", "PATCH_PRECHECK_FAILED_PREREQUISITE_MISSING")], children) ->
625627
(* <error errorcode="PATCH_PRECHECK_FAILED_PREREQUISITE_MISSING">
626628
<prerequisite uuid="ABCD1234-FEED-DEAD-BEEF-000000000000" />

0 commit comments

Comments
 (0)