[Pkg-libvirt-commits] [libguestfs] 05/63: v2v: Give a reasonable, early failure if output format is not raw or qcow2.
Hilko Bengen
bengen at moszumanska.debian.org
Fri Oct 3 14:43:23 UTC 2014
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to annotated tag debian/1%1.27.39-1
in repository libguestfs.
commit 379f335059f31338e207d8d2b2c17d55334bcafe
Author: Richard W.M. Jones <rjones at redhat.com>
Date: Tue Sep 2 14:32:54 2014 +0100
v2v: Give a reasonable, early failure if output format is not raw or qcow2.
See comment in the code for reasoning.
Thanks: Shahar Havivi for discovering this.
---
v2v/v2v.ml | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/v2v/v2v.ml b/v2v/v2v.ml
index 4d3f6ae..38994f3 100644
--- a/v2v/v2v.ml
+++ b/v2v/v2v.ml
@@ -160,6 +160,16 @@ let rec main () =
| None, None ->
error (f_"disk %s (%s) has no defined format, you have to either define the original format in the source metadata, or use the '-of' option to force the output format") ov.ov_sd ov.ov_source.s_qemu_uri in
+ (* What really happens here is that the call to #disk_create
+ * below fails if the format is not raw or qcow2. We would
+ * have to extend libguestfs to support further formats, which
+ * is trivial, but we'd want to check that the files being
+ * created by qemu-img really work. In any case, fail here,
+ * early, not below, later.
+ *)
+ if format <> "raw" && format <> "qcow2" then
+ error (f_"output format should be 'raw' or 'qcow2'.\n\nUse the '-of <format>' option to select a different output format for the converted guest.\n\nOther output formats are not supported at the moment, although might be considered in future.");
+
(* output#prepare_targets will fill in the target_file field. *)
{ target_file = ""; target_format = format; target_overlay = ov }
) overlays in
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git
More information about the Pkg-libvirt-commits
mailing list