Skip to content

Commit 35528f3

Browse files
committed
CA-21237: also report the windows error code if VM.snapshot_with_quiesce fails.
Signed-off-by: Thomas Gazagnaire <[email protected]>
1 parent 7f42d0d commit 35528f3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ocaml/xapi/xapi_vm_snapshot.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ let wait_for_snapshot ~__context ~vm ~xs ~domid ~new_name =
107107
| "snapshot-error" ->
108108
(* If an error was occured we get the error type and return *)
109109
let error_str = xs.Xs.read (snapshot_path ~xs ~domid "error") in
110+
let error_code () = try xs.Xs.read (snapshot_path ~xs ~domid "error/code") with _ -> "0" in
110111
error "wait_for_snapshot: %s" error_str;
111112
if List.mem error_str [
112113
Api_errors.xen_vss_req_error_init_failed;
@@ -117,7 +118,7 @@ let wait_for_snapshot ~__context ~vm ~xs ~domid ~new_name =
117118
Api_errors.xen_vss_req_error_preparing_writers;
118119
Api_errors.xen_vss_req_error_creating_snapshot;
119120
Api_errors.xen_vss_req_error_creating_snapshot_xml_string ]
120-
then raise (Api_errors.Server_error (error_str, [ Ref.string_of vm ]))
121+
then raise (Api_errors.Server_error (error_str, [ Ref.string_of vm; error_code () ]))
121122
else raise (Api_errors.Server_error (Api_errors.vm_snapshot_with_quiesce_failed, [ Ref.string_of vm; error_str ]))
122123

123124
| e ->

0 commit comments

Comments
 (0)