@@ -2385,54 +2385,6 @@ module VM = struct
2385
2385
Option. is_some
2386
2386
(event_wait internal_updates task timeout is_vm_event vm_has_shutdown)
2387
2387
2388
- (* Mount a filesystem somewhere, with optional type *)
2389
- let mount ?(ty = None ) src dest write =
2390
- let ty = match ty with None -> [] | Some ty -> [" -t" ; ty] in
2391
- run ! Xc_resources. mount
2392
- (ty @ [src; dest; " -o" ; (if write then " rw" else " ro" )])
2393
- |> ignore_string
2394
-
2395
- let timeout = 300.
2396
-
2397
- (* 5 minutes: something is seriously wrong if we hit this timeout *)
2398
-
2399
- exception Umount_timeout
2400
-
2401
- (* * Unmount a mountpoint. Retries every 5 secs for a total of 5mins before
2402
- returning failure *)
2403
- let umount ?(retry = true ) dest =
2404
- let finished = ref false in
2405
- let start = Unix. gettimeofday () in
2406
- while (not ! finished) && Unix. gettimeofday () -. start < timeout do
2407
- try
2408
- run ! Xc_resources. umount [dest] |> ignore_string ;
2409
- finished := true
2410
- with e ->
2411
- if not retry then raise e ;
2412
- debug
2413
- " Caught exception (%s) while unmounting %s: pausing before retrying"
2414
- (Printexc. to_string e) dest ;
2415
- Thread. delay 5.
2416
- done ;
2417
- if not ! finished then raise Umount_timeout
2418
-
2419
- let with_mounted_dir_ro device f =
2420
- let mount_point = Filename. temp_file " xenops_mount_" " " in
2421
- Unix. unlink mount_point ;
2422
- Unix. mkdir mount_point 0o640 ;
2423
- finally
2424
- (fun () ->
2425
- mount ~ty: (Some " ext2" ) device mount_point false ;
2426
- f mount_point
2427
- )
2428
- (fun () ->
2429
- ( try umount mount_point
2430
- with e -> debug " Caught %s" (Printexc. to_string e)
2431
- ) ;
2432
- try Unix. rmdir mount_point
2433
- with e -> debug " Caught %s" (Printexc. to_string e)
2434
- )
2435
-
2436
2388
(* A raw image is a file or device in contrast to a directory where
2437
2389
would need to open a file *)
2438
2390
let is_raw_image path =
0 commit comments