File tree Expand file tree Collapse file tree 1 file changed +20
-12
lines changed Expand file tree Collapse file tree 1 file changed +20
-12
lines changed Original file line number Diff line number Diff line change @@ -41,20 +41,28 @@ let vgs copts noheadings nosuffix units fields vg_names =
4141 let local_device = match info with
4242 | Some info -> info.local_device (* If we've got a default, use that *)
4343 | None -> failwith " Need to know the local device!" in
44- Lwt. catch
45- (fun () ->
46- with_block local_device
47- (fun x ->
48- Vg_IO. connect [ x ] `RO >> |= fun vg ->
49- return (Vg_IO. metadata_of vg)
44+ (* First try a network connection to get the most up to date information.
45+ We currently don't replay the redo log when opening the VG read/only--
46+ see [mirage/mirage-block-volume#68]. *)
47+ Lwt. catch Client. get
48+ (fun e ->
49+ stderr " WARNING: failed to contact xenvmd; falling back to reading the disk metadata"
50+ >> = fun () ->
51+ Lwt. catch
52+ (fun () ->
53+ with_block local_device
54+ (fun x ->
55+ Vg_IO. connect [ x ] `RO >> |= fun vg ->
56+ return (Vg_IO. metadata_of vg)
57+ )
5058 )
59+ (fun _ ->
60+ stderr " Volume group \" %s\" not found" vg_name
61+ >> = fun () ->
62+ stderr " Skipping volume group %s" vg_name
63+ >> = fun () ->
64+ exit 1 )
5165 )
52- (fun _ ->
53- stderr " Volume group \" %s\" not found" vg_name
54- >> = fun () ->
55- stderr " Skipping volume group %s" vg_name
56- >> = fun () ->
57- exit 1 )
5866 >> = fun vg ->
5967 Lwt. return (info,vg)) vg_names >> = fun vgs ->
6068 let rows = List. concat (List. map do_row vgs) in
You can’t perform that action at this time.
0 commit comments