Skip to content

Commit

Permalink
Merge pull request #86 from hannesm/easy
Browse files Browse the repository at this point in the history
adapt to mirage-block 2.0.0 API
  • Loading branch information
hannesm committed Nov 1, 2019
2 parents 00fe6b8 + 11479f7 commit 6128149
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 23 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ env:
global:
- PACKAGE="mirage-block-xen"
matrix:
- DISTRO="alpine" OCAML_VERSION="4.04"
- DISTRO="alpine" OCAML_VERSION="4.05"
- DISTRO="alpine" OCAML_VERSION="4.06"
- DISTRO="ubuntu" OCAML_VERSION="4.07"
- DISTRO="alpine" OCAML_VERSION="4.07"
- DISTRO="ubuntu" OCAML_VERSION="4.08"
5 changes: 2 additions & 3 deletions lib/back/blkback.ml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ end
open Lwt
open Blkproto

module OS = Os_xen
module Gntref = OS.Xen.Gntref

type ops = {
Expand Down Expand Up @@ -102,7 +101,7 @@ let is_writable req = match req.Req.op with
Log.err (fun f -> f "FATAL: unhandled request type %s" (Req.string_of_op op));
failwith "unhandled request type"

module Make(A: ACTIVATIONS)(X: Xs_client_lwt.S)(B: Mirage_block_lwt.S) = struct
module Make(A: ACTIVATIONS)(X: Xs_client_lwt.S)(B: Mirage_block.S) = struct

module BlockError = struct
open Lwt
Expand Down Expand Up @@ -307,7 +306,7 @@ let init xe domid ring_info ops =
on_cancel th (fun () ->
let counter = ref 0 in
Ring.Rpc.Back.ack_requests ring (fun _ -> incr counter);
if !counter <> 0 then Log.err (fun f-> f "FATAL: before unmapping, there were %d outstanding requests on the ring. Events lOSt?" !(counter));
if !counter <> 0 then Log.err (fun f-> f "FATAL: before unmapping, there were %d outstanding requests on the ring. Events lost?" !(counter));
let () = OS.Xen.Import.Local_mapping.unmap_exn mapping in ()
);
th, stats
Expand Down
2 changes: 1 addition & 1 deletion lib/back/dune
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
(flags :standard -w -3)
(libraries logs lwt cstruct io-page shared-memory-ring
shared-memory-ring-lwt mirage-block-xen xen-evtchn xenstore
xenstore.client mirage-block-lwt rresult mirage-xen)
xenstore.client mirage-block rresult mirage-xen)
(wrapped false))
2 changes: 0 additions & 2 deletions lib/core/blkproto.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*)

module OS = Os_xen

let ( >>= ) x f = match x with
| Error _ as y -> y
| Ok x -> f x
Expand Down
2 changes: 1 addition & 1 deletion lib/core/blkproto.mli
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ end

module Req : sig
type seg = {
gref : Os_xen.Xen.Gntref.t;
gref : OS.Xen.Gntref.t;
first_sector : int;
last_sector : int;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/core/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
(name mirage_block_xen)
(public_name mirage-block-xen)
(modules Blkproto Device_number)
(libraries cstruct io-page mirage-xen.internals)
(libraries cstruct io-page mirage-xen)
(wrapped false)
(preprocess
(pps ppx_cstruct)))
8 changes: 1 addition & 7 deletions lib/front/blkfront.ml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,12 @@ open Lwt
open Printf
open Mirage_block
open Blkproto
open Os_xen

module OS = Os_xen
open OS

let src = Logs.Src.create "blkfront" ~doc:"Mirage Xen blkfront"

module Log = (val Logs.src_log src : Logs.LOG)

type 'a io = 'a Lwt.t

type page_aligned_buffer = Cstruct.t

type transport = {
backend_id: int;
backend: string;
Expand Down
2 changes: 1 addition & 1 deletion lib/front/blkfront.mli
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*)
include Mirage_block_lwt.S
include Mirage_block.S
val connect : string -> t Lwt.t
2 changes: 1 addition & 1 deletion lib/front/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
(name mirage_block_xen_front)
(public_name mirage-block-xen.front)
(modules Blkfront Block)
(libraries logs stringext lwt cstruct mirage-block-lwt io-page
(libraries logs stringext lwt cstruct mirage-block io-page
io-page-xen shared-memory-ring shared-memory-ring-lwt mirage-block-xen
xen-evtchn mirage-xen)
(wrapped false))
6 changes: 3 additions & 3 deletions mirage-block-xen.opam
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ homepage: "https://github.com/mirage/mirage-block-xen"
doc: "https://mirage.github.io/mirage-block-xen/"
bug-reports: "https://github.com/mirage/mirage-block-xen/issues"
depends: [
"ocaml" {>= "4.02.0"}
"ocaml" {>= "4.06.0"}
"dune"
"cmdliner"
"logs"
Expand All @@ -16,10 +16,10 @@ depends: [
"cstruct" {>= "1.9.0"}
"ppx_cstruct" {build & >= "3.6.0"}
"shared-memory-ring-lwt"
"mirage-block-lwt" {>= "1.0.0"}
"mirage-block" {>= "2.0.0"}
"ipaddr"
"io-page-xen" {>= "2.0.0"}
"mirage-xen" {>= "4.0.0"}
"mirage-xen" {>= "5.0.0"}
"rresult"
]
build: [
Expand Down

0 comments on commit 6128149

Please sign in to comment.