Skip to content

Commit

Permalink
v2v: Add some assertions to check the source was created correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
rwmjones committed Oct 22, 2014
1 parent e1eccae commit dbe3572
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions v2v/v2v.ml
Expand Up @@ -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
Expand Down

0 comments on commit dbe3572

Please sign in to comment.