[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH OSSTEST] make_qcow2: Look for qemu-img under /usr as well as /usr/local



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@xxxxxxxxxx>
---
Only tested with perl -c.

See
http://logs.test-lab.xenproject.org/osstest/logs/61955/test-amd64-amd64-xl-qcow2/info.html
for a current instance of this failure with 4.2
---
 Osstest/TestSupport.pm | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index 2ded693..efe138f 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -1616,7 +1616,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 ($$$) {
-- 
2.5.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.