Skip to content
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
11 changes: 7 additions & 4 deletions lib/cancellable_subprocess.ml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,13 @@ let run (task: Xenops_task.t) ?env ?stdin fds ?(syslog_stdout=NoSyslogging) cmd
| Unix.WEXITED n -> raise (Spawn_internal_error(err,out,Unix.WEXITED n))
| Unix.WSTOPPED n -> raise (Spawn_internal_error(err,out,Unix.WSTOPPED n))
| Unix.WSIGNALED n ->
debug "Subprocess exitted with signal %d and cancel requested; raising Cancelled" n;
if !cancelled
then Xenops_task.raise_cancelled task
else raise (Spawn_internal_error(err,out,Unix.WSIGNALED n))
if !cancelled then begin
debug "Subprocess %s exited with signal %d and cancel requested; raising Cancelled" cmd n;
Xenops_task.raise_cancelled task
end else begin
debug "Subprocess %s exited with signal %d" cmd n;
raise (Spawn_internal_error(err,out,Unix.WSIGNALED n))
end
end
| Success(_,Failure(_,exn))
| Failure(_, exn) ->
Expand Down
16 changes: 14 additions & 2 deletions lib/suspend_image.ml
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,20 @@ let with_conversion_script task name hvm fd f =
debug "Spawned threads for conversion script and %s" name;
let rec handle_threads () = match (!conv_st, !f_st) with
| Thread_failure e, _ ->
`Error (Failure (Printf.sprintf "Conversion script thread caught exception: %s"
(Printexc.to_string e)))
begin match e with
| Forkhelpers.Spawn_internal_error(_,_,status) ->
begin match status with
| Unix.WEXITED n ->
`Error (Failure (Printf.sprintf "Conversion script exited with code %d" n))
| Unix.WSIGNALED n ->
`Error (Failure (Printf.sprintf "Conversion script exited with signal %s" (Unixext.string_of_signal n)))
| Unix.WSTOPPED n ->
`Error (Failure (Printf.sprintf "Conversion script stopped with signal %s" (Unixext.string_of_signal n)))
end
| _ ->
`Error (Failure (Printf.sprintf "Conversion script thread caught exception: %s"
(Printexc.to_string e)))
end
| _, Thread_failure e ->
`Error (Failure (Printf.sprintf "Thread executing %s caught exception: %s"
name (Printexc.to_string e)))
Expand Down
2 changes: 1 addition & 1 deletion xc/domain.ml
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ let restore_common (task: Xenops_task.t) ~xc ~xs ~hvm ~store_port ~store_domid ~
debug "Detected legacy suspend image! Piping through conversion tool.";
let (store_mfn, console_mfn) =
begin match
with_conversion_script task "xenguest" hvm fd (fun pipe_r ->
with_conversion_script task "XenguestHelper" hvm fd (fun pipe_r ->
restore_libxc_record task ~hvm ~store_port ~console_port
~extras xenguest_path domid uuid pipe_r
)
Expand Down