forked from djs55/vhd-tool
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from johnelse/sync-trunk-ring3
Sync master with the trunk-ring3 branch
- Loading branch information
Showing
12 changed files
with
158 additions
and
65 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
language: c | ||
install: wget https://raw.githubusercontent.com/ocaml/ocaml-ci-scripts/master/.travis-opam.sh | ||
script: bash -ex .travis-opam.sh | ||
services: docker | ||
install: | ||
- wget https://raw.githubusercontent.com/xenserver/xenserver-build-env/master/utils/travis-build-repo.sh | ||
script: bash travis-build-repo.sh | ||
sudo: true | ||
env: | ||
global: | ||
- PACKAGE=vhd-tool OPAM_LINT=false | ||
matrix: | ||
- OCAML_VERSION=4.01 | ||
- OCAML_VERSION=latest EXTRA_REMOTES=git://github.com/xapi-project/opam-repo-dev | ||
global: | ||
- REPO_PACKAGE_NAME=vhd-tool | ||
- REPO_CONFIGURE_CMD=./configure | ||
- REPO_BUILD_CMD=make | ||
- REPO_TEST_CMD=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
open Lwt | ||
|
||
module Impl = Vhd.F.From_file(Vhd_lwt.IO) | ||
open Impl | ||
open Vhd.F | ||
open Vhd_lwt.IO | ||
|
||
module In = From_input(Input) | ||
open In | ||
|
||
let get_vhd_vsize filename = | ||
Vhd_lwt.IO.openfile filename false >>= fun fd -> | ||
let rec loop = function | ||
| End -> return () | ||
| Cons (hd, tl) -> | ||
begin match hd with | ||
| Fragment.Footer x -> | ||
let size = x.Footer.current_size in | ||
Printf.printf "%Ld\n" size; | ||
exit 0 | ||
| _ -> | ||
() | ||
end; | ||
tl () >>= fun x -> | ||
loop x in | ||
openstream (Input.of_fd (Vhd_lwt.IO.to_file_descr fd)) >>= fun stream -> | ||
loop stream >>= fun () -> Vhd_lwt.IO.close fd | ||
|
||
let _ = | ||
let t = get_vhd_vsize Sys.argv.(1) in | ||
Lwt_main.run t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters