xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: ian.jackson@eu.citrix.com, xen-devel@lists.xen.org
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [PATCH OSSTEST] make_qcow2: Look for qemu-img under /usr as well as /usr/local
Date: Fri, 18 Sep 2015 16:34:43 +0100	[thread overview]
Message-ID: <1442590483-26187-1-git-send-email-ian.campbell@citrix.com> (raw)

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>
---
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

             reply	other threads:[~2015-09-18 15:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-18 15:34 Ian Campbell [this message]
2015-09-22 15:41 ` [PATCH OSSTEST] make_qcow2: Look for qemu-img under /usr as well as /usr/local Ian Jackson
2015-09-22 15:58   ` Ian Campbell
2015-09-22 16:06     ` Ian Jackson
2015-09-22 21:36       ` Stefano Stabellini
2015-09-23  8:25         ` Ian Campbell
2015-09-23 18:18           ` Stefano Stabellini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1442590483-26187-1-git-send-email-ian.campbell@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).