Skip to content

Commit 93c7638

Browse files
authored
Merge pull request xapi-project#434 from jonludlam/CA-254911
CA-254911: Don't trigger cleanup actions when triggering cleanup actions
2 parents 2826c3d + 2be36c7 commit 93c7638

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

lib/xenops_server.ml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1517,7 +1517,7 @@ and trigger_cleanup_after_failure_atom op t =
15171517
| Parallel (id, description, ops) ->
15181518
List.iter (fun op->trigger_cleanup_after_failure_atom op t) ops
15191519

1520-
and perform ?subtask ?result (op: operation) (t: Xenops_task.task_handle) : unit =
1520+
and perform_exn ?subtask ?result (op: operation) (t: Xenops_task.task_handle) : unit =
15211521
let module B = (val get_backend () : S) in
15221522
let one = function
15231523
| VM_start (id, force) ->
@@ -1758,7 +1758,7 @@ and perform ?subtask ?result (op: operation) (t: Xenops_task.task_handle) : unit
17581758
| Vm.Pause -> [ Atomic (VM_pause id) ]
17591759
in
17601760
let operations = List.concat (List.map operations_of_action actions) in
1761-
List.iter (fun x -> perform x t) operations;
1761+
List.iter (fun x -> perform_exn x t) operations;
17621762
VM_DB.signal id
17631763
| PCI_check_state id ->
17641764
debug "PCI.check_state %s" (PCI_DB.string_of_id id);
@@ -1772,7 +1772,7 @@ and perform ?subtask ?result (op: operation) (t: Xenops_task.task_handle) : unit
17721772
| Needs_unplug -> Some (Atomic(PCI_unplug id))
17731773
| Needs_set_qos -> None in
17741774
let operations = List.filter_map operations_of_request (Opt.to_list request) in
1775-
List.iter (fun x -> perform x t) operations
1775+
List.iter (fun x -> perform_exn x t) operations
17761776
| VBD_check_state id ->
17771777
debug "VBD.check_state %s" (VBD_DB.string_of_id id);
17781778
let vbd_t = VBD_DB.read_exn id in
@@ -1788,7 +1788,7 @@ and perform ?subtask ?result (op: operation) (t: Xenops_task.task_handle) : unit
17881788
| Needs_unplug -> Some (Atomic(VBD_unplug (id, true)))
17891789
| Needs_set_qos -> Some (Atomic(VBD_set_qos id)) in
17901790
let operations = List.filter_map operations_of_request (Opt.to_list request) in
1791-
List.iter (fun x -> perform x t) operations;
1791+
List.iter (fun x -> perform_exn x t) operations;
17921792
(* Needed (eg) to reflect a spontaneously-ejected CD *)
17931793
VBD_DB.signal id
17941794
| VIF_check_state id ->
@@ -1803,7 +1803,7 @@ and perform ?subtask ?result (op: operation) (t: Xenops_task.task_handle) : unit
18031803
| Needs_unplug -> Some (Atomic(VIF_unplug (id, true)))
18041804
| Needs_set_qos -> None in
18051805
let operations = List.filter_map operations_of_request (Opt.to_list request) in
1806-
List.iter (fun x -> perform x t) operations
1806+
List.iter (fun x -> perform_exn x t) operations
18071807
| VUSB_check_state id ->
18081808
debug "VUSB.check_state %s" (VUSB_DB.string_of_id id);
18091809
let vusb_t = VUSB_DB.read_exn id in
@@ -1819,15 +1819,18 @@ and perform ?subtask ?result (op: operation) (t: Xenops_task.task_handle) : unit
18191819
| Needs_unplug -> Some (Atomic(VUSB_unplug id))
18201820
| Needs_set_qos -> None in
18211821
let operations = List.filter_map operations_of_request (Opt.to_list request) in
1822-
List.iter (fun x -> perform x t) operations;
1822+
List.iter (fun x -> perform_exn x t) operations;
18231823
VUSB_DB.signal id
18241824
| Atomic op ->
18251825
let progress_callback = progress_callback 0. 1. t in
18261826
perform_atomic ~progress_callback ?subtask ?result op t
18271827
in
1828+
one op
1829+
1830+
and perform ?subtask ?result (op: operation) (t: Xenops_task.task_handle) : unit =
18281831
let one op =
18291832
try
1830-
one op
1833+
perform_exn ?subtask ?result op t
18311834
with e ->
18321835
Backtrace.is_important e;
18331836
info "Caught %s executing %s: triggering cleanup actions" (Printexc.to_string e) (string_of_operation op);

0 commit comments

Comments
 (0)