+if ($vmtype =~ /^Desktop$/i) {
+ $vmtype = 0;
+} elsif ($vmtype =~ /^Server$/i) {
+ $vmtype = 1;
+} else {
+ die "$0: --vmtype parameter must be 'Desktop' or 'Server'\n"
+}
+
+# Does qemu-img generally work OK?
+system ("qemu-img create -f qcow2 .test.qcow2 10M >/dev/null") == 0
+ or die "qemu-img command not installed or not working\n";
+
+# Does this version of qemu-img support compat=0.10? RHEL 6
+# did NOT support it.
+my $qemu_img_supports_compat = 0;
+system ("qemu-img create -f qcow2 -o compat=0.10 .test.qcow2 10M >/dev/null") == 0
+ and $qemu_img_supports_compat = 1;
+unlink ".test.qcow2";
+