]> xenbits.xensource.com Git - osstest.git/commitdiff
make_qcow2: Look for qemu-img under /usr as well as /usr/local
authorIan Campbell <ian.campbell@citrix.com>
Fri, 18 Sep 2015 15:34:43 +0000 (16:34 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 25 Sep 2015 11:27:44 +0000 (12:27 +0100)
Older Xen's installed in /usr by default, so we need to check where
qemu-img if we want these tests to work on those versions.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Osstest/TestSupport.pm

index 168aa9c80eb781ddf807723ac40fb4827fedf587..2b67e32de88c3b3fbc5df43e1f31fcdb835ab39b 100644 (file)
@@ -1647,7 +1647,16 @@ sub make_vhd ($$$) {
 sub make_qcow2 ($$$) {
     my ($ho, $gho, $disk_mb) = @_;
     # upstream qemu's version. Seems preferable to qemu-xen-img from qemu-trad.
-    my $qemu_img = "/usr/local/lib/xen/bin/qemu-img";
+    my $qemu_img;
+    foreach (qw(/usr/local /usr)) {
+       my $try = "$_/lib/xen/bin/qemu-img";
+        if (target_file_exists($ho, $try)) {
+            $qemu_img=$try;
+            last;
+        }
+    }
+    die "no qemu-img" unless $qemu_img;
+
     target_cmd_root($ho, "$qemu_img create -f qcow2 $gho->{Rootimg} ${disk_mb}M");
 }
 sub make_raw ($$$) {