Skip to content

Commit

Permalink
Merge pull request #874 from yomimono/block_of_file
Browse files Browse the repository at this point in the history
allow access to xen block devices other than the first
  • Loading branch information
djs55 committed Dec 17, 2017
2 parents 76bd99a + bf0c3ba commit 0983925
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/mirage.ml
Original file line number Diff line number Diff line change
Expand Up @@ -391,12 +391,9 @@ class block_conf file =
| `Unix | `MacOSX | `Virtio | `Ukvm ->
Fpath.(to_string (root / b.filename)) (* open the file directly *)
| `Xen | `Qubes ->
(* We need the xenstore id *)
(* Taken from https://github.com/mirage/mirage-block-xen/blob/
a64d152586c7ebc1d23c5adaa4ddd440b45a3a83/lib/device_number.ml#L64 *)
(if b. number < 16
then (202 lsl 8) lor (b.number lsl 4)
else (1 lsl 28) lor (b.number lsl 8)) |> string_of_int
(* don't try to infer anything about this filename - let
mirage-block-xen do that for us; it has better heuristics *)
b.filename

method! connect i s _ =
Fmt.strf "%s.connect %S" s
Expand Down

0 comments on commit 0983925

Please sign in to comment.