Skip to content

Commit 614c905

Browse files
author
David Scott
committed
Log the PV label info when we open a physical device
This will help debug problems where the PV label later turns out to be different to what we expect. Signed-off-by: David Scott <[email protected]>
1 parent b3c56a5 commit 614c905

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

xenvmd/xenvmd.ml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,21 +138,22 @@ module VolumeManager = struct
138138
let myvg, myvg_u = Lwt.task ()
139139
let lock = Lwt_mutex.create ()
140140

141-
let vgopen ~devices:devices' =
141+
let vgopen ~devices =
142142
Lwt_list.map_s
143143
(fun filename -> Block.connect filename >>= function
144144
| `Error _ -> fatal_error_t ("open " ^ filename)
145145
| `Ok x -> return x
146-
) devices'
146+
) devices
147147
>>= fun devices' ->
148148
let module Label_IO = Lvm.Label.Make(Block) in
149149
Lwt_list.iter_s
150-
(fun device ->
150+
(fun (filename, device) ->
151151
Label_IO.read device >>= function
152152
| `Error (`Msg m) ->
153153
error "Failed to read PV label from device: %s" m;
154154
fail (Failure "Failed to read PV label from device")
155155
| `Ok label ->
156+
info "opened %s: %s" filename (Lvm.Label.to_string label);
156157
begin match Lvm.Label.Label_header.magic_of label.Lvm.Label.label_header with
157158
| Some `Lvm ->
158159
error "Device has normal LVM PV label. I will only open devices with the new PV label.";
@@ -163,7 +164,7 @@ module VolumeManager = struct
163164
error "Device has an unrecognised LVM PV label. I will only open devices with the new PV label.";
164165
fail (Failure "Device has wrong PV label")
165166
end
166-
) devices'
167+
) (List.combine devices devices')
167168
>>= fun () ->
168169
Vg_IO.connect ~flush_interval:5. devices' `RW >>|= fun vg ->
169170
Lwt.wakeup_later myvg_u vg;

0 commit comments

Comments
 (0)