[Pkg-libvirt-commits] [libguestfs] 21/61: v2v: Add some assertions to check the source was created correctly.
Hilko Bengen
bengen at moszumanska.debian.org
Fri Oct 31 19:09:37 UTC 2014
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to annotated tag debian/1%1.28.2-1
in repository libguestfs.
commit 5cbdae01f0463c5218a2f2cf6c8a45cdde412fd1
Author: Richard W.M. Jones <rjones at redhat.com>
Date: Wed Oct 22 12:35:53 2014 +0100
v2v: Add some assertions to check the source was created correctly.
(cherry picked from commit dbe35729a3fbb7150275584dd0c5aa7d86c8e03e)
---
v2v/v2v.ml | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/v2v/v2v.ml b/v2v/v2v.ml
index 6f98a8c..48fb8c6 100644
--- a/v2v/v2v.ml
+++ b/v2v/v2v.ml
@@ -73,6 +73,17 @@ let rec main () =
if verbose then printf "%s%!" (string_of_source source);
+ assert (source.s_dom_type <> "");
+ assert (source.s_name <> "");
+ assert (source.s_memory > 0L);
+ assert (source.s_vcpu >= 1);
+ if source.s_disks = [] then
+ error (f_"source has no hard disks!");
+ List.iter (
+ fun disk ->
+ assert (disk.s_qemu_uri <> "");
+ ) source.s_disks;
+
(* Map source name. *)
let source =
match output_name with
--
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