Skip to content

Commit b708663

Browse files
author
Jon Ludlam
committed
Ensure VIF json written to disk before the scripts read it
Signed-off-by: Jon Ludlam <[email protected]>
1 parent b5391d3 commit b708663

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/xenops_server.ml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -912,8 +912,11 @@ let perform_atomic ~progress_callback ?subtask (op: atomic) (t: Xenops_task.t) :
912912
finally
913913
(fun () ->
914914
let vif = VIF_DB.read_exn id in
915-
B.VIF.set_locking_mode t (VIF_DB.vm_of id) vif mode;
916-
VIF_DB.write id {vif with Vif.locking_mode = mode}
915+
(* Nb, this VIF_DB write needs to come before the call to set_locking_mode
916+
as the scripts will read from the disk! *)
917+
VIF_DB.write id {vif with Vif.locking_mode = mode};
918+
B.VIF.set_locking_mode t (VIF_DB.vm_of id) vif mode
919+
917920
) (fun () -> VIF_DB.signal id)
918921
| VIF_set_active (id, b) ->
919922
debug "VIF.set_active %s %b" (VIF_DB.string_of_id id) b;

0 commit comments

Comments
 (0)