Skip to content

Commit dd75195

Browse files
authored
CP-308455 VM.sysprep CA-414158 wait for "action" key to disappear (#6604)
The code misses the timeout exception becaue of we are using a module alias.
2 parents f452c9d + b574b9a commit dd75195

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

ocaml/xapi/vm_sysprep.ml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ let find_vdi ~__context ~label =
209209
file. *)
210210
let trigger ~domid ~uuid ~timeout =
211211
let open Ezxenstore_core.Xenstore in
212-
let module Watch = Ezxenstore_core.Watch in
213212
let control = Printf.sprintf "/local/domain/%Ld/control/sysprep" domid in
214213
let domain = Printf.sprintf "/local/domain/%Ld" domid in
215214
with_xs (fun xs ->
@@ -219,17 +218,19 @@ let trigger ~domid ~uuid ~timeout =
219218
debug "%s: notified domain %Ld" __FUNCTION__ domid ;
220219
try
221220
(* wait for sysprep to start, then domain to dissapear *)
222-
Watch.(
221+
Ezxenstore_core.Watch.(
223222
wait_for ~xs ~timeout:5.0
224223
(value_to_become (control // "action") "running")
225224
) ;
226225
debug "%s: sysprep is runnung; waiting for sysprep to finish"
227226
__FUNCTION__ ;
228-
Watch.(wait_for ~xs ~timeout (key_to_disappear (control // "action"))) ;
227+
Ezxenstore_core.Watch.(
228+
wait_for ~xs ~timeout (key_to_disappear (control // "action"))
229+
) ;
229230
debug "%s sysprep is finished" __FUNCTION__ ;
230-
Watch.(wait_for ~xs ~timeout (key_to_disappear domain)) ;
231+
Ezxenstore_core.Watch.(wait_for ~xs ~timeout (key_to_disappear domain)) ;
231232
true
232-
with Watch.Timeout _ ->
233+
with Ezxenstore_core.Watch.Timeout _ ->
233234
debug "%s: sysprep timeout" __FUNCTION__ ;
234235
false
235236
)

0 commit comments

Comments
 (0)