Skip to content

Support qcow2 format in VDI export/import #6396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 10 commits into from
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ DUNE_IU_PACKAGES3=-j $(JOBS) --destdir=$(DESTDIR) --prefix=$(OPTDIR) --libdir=$(
install-dune3:
dune install $(DUNE_IU_PACKAGES3)

DUNE_IU_PACKAGES4=-j $(JOBS) --destdir=$(DESTDIR) --prefix=$(PREFIX) --libdir=$(LIBDIR) --libexecdir=/usr/libexec --mandir=$(MANDIR) vhd-tool forkexec
DUNE_IU_PACKAGES4=-j $(JOBS) --destdir=$(DESTDIR) --prefix=$(PREFIX) --libdir=$(LIBDIR) --libexecdir=/usr/libexec --mandir=$(MANDIR) vhd-tool qcow-tool forkexec
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any particular reason you want to package it here? If it's going to be used as a library there's no need for this. For using the binaries in hosts, they can be generated as part of xapi-tools (so a change in the dune file)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No particular reason. I just follow what has been done (anyway as I think I understood how it was done with vhd-tool). And also as it looks like it was not maintained anymore so I did that. But yes I can also update the mirage package to compile and use it.


install-dune4:
dune install $(DUNE_IU_PACKAGES4)
Expand Down
28 changes: 28 additions & 0 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,34 @@
)
)

(package
(name qcow-tool)
(synopsis "Manipulate .qcow files")
(tags ("org.mirage" "org:xapi-project"))
(depends
asetmap
astring
cmdliner
cstruct
ezjsonm
fmt
io-page
logs
lwt
mirage-block
mirage-block-combinators
mirage-block-unix
mirage-time
mirage-types-lwt
ounit
prometheus
result
sexplib
sha
unix-type-representations
)
)

(package
(name vhd-tool)
(synopsis "Manipulate .vhd files")
Expand Down
37 changes: 30 additions & 7 deletions ocaml/qcow-tool/cli/dune
Original file line number Diff line number Diff line change
@@ -1,8 +1,31 @@
(executable
(name main)
(public_name qcow-tool)
(package qcow-tool)
(libraries qcow io-page logs logs.fmt sha unix-type-representations
cmdliner sexplib mirage-block-combinators)
(preprocess
(pps ppx_sexp_conv)))
(name main)
(libraries
astring
cmdliner
cstruct
cstruct-lwt
fmt
io-page logs
logs.fmt
lwt
lwt.unix
mirage-block
mirage-block-unix
mirage-block-combinators
mirage-time
qcow
sexplib
sha
unix-type-representations
)
(preprocess
(pps ppx_sexp_conv)
)
)

(install
(package qcow-tool)
(section bin)
(files (main.exe as qcow-tool))
)
2 changes: 0 additions & 2 deletions ocaml/qcow-tool/dune-project

This file was deleted.

28 changes: 20 additions & 8 deletions ocaml/qcow-tool/lib/dune
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
(library
(name qcow)
(public_name qcow)
(libraries astring cstruct logs lwt mirage-block mirage-block-unix
mirage-types.lwt prometheus io-page sexplib stdlib-shims
mirage-time)
(wrapped false)
(preprocess
(pps ppx_sexp_conv)))
(name qcow)
(libraries
astring
cstruct
logs
lwt
mirage-block
mirage-block-unix
mirage-types.lwt
prometheus
io-page
sexplib
stdlib-shims
mirage-time fmt
)
(wrapped false)
(preprocess
(pps ppx_sexp_conv)
)
)

(rule
(targets qcow_word_size.ml)
Expand Down
44 changes: 0 additions & 44 deletions ocaml/qcow-tool/qcow-tool.opam

This file was deleted.

63 changes: 0 additions & 63 deletions ocaml/qcow-tool/qcow.opam

This file was deleted.

48 changes: 48 additions & 0 deletions qcow-tool.opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
synopsis: "Manipulate .qcow files"
maintainer: ["Xapi project maintainers"]
authors: ["xen-api@lists.xen.org"]
license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception"
tags: ["org.mirage" "org:xapi-project"]
homepage: "https://xapi-project.github.io/"
bug-reports: "https://github.com/xapi-project/xen-api/issues"
depends: [
"dune" {>= "3.15"}
"asetmap"
"astring"
"cmdliner"
"cstruct"
"ezjsonm"
"fmt"
"io-page"
"logs"
"lwt"
"mirage-block"
"mirage-block-combinators"
"mirage-block-unix"
"mirage-time"
"mirage-types-lwt"
"ounit"
"prometheus"
"result"
"sexplib"
"sha"
"unix-type-representations"
"odoc" {with-doc}
]
build: [
["dune" "subst"] {dev}
[
"dune"
"build"
"-p"
name
"-j"
jobs
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
]
dev-repo: "git+https://github.com/xapi-project/xen-api.git"