Skip to contentSkip to conversation

make_qcow2: Look for qemu-img under /usr as well as /usr/local

PATCH In review Ian Campbell 3 participants 7 messages Sep 18, 2015 – Sep 23, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
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(-)
Osstest/TestSupport.pm +10 -1
index 2ded693..efe138f 100644
@@ -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 ($$$) {
Signature · 1 line
2.5.1
Acked-by on v1 1/1
#1 lore raw

Ian Campbell writes ("[PATCH OSSTEST] make_qcow2: Look for qemu-img under /usr as well as /usr/local"):

Quoted 2 lines

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.

But, why are we executing a utility from /usr/lib/xen/bin ? If this utility is useful to osstest it is presumably useful to users too, and in that case it should be on PATH (under some suitable name).

Ian.

#2 lore raw
Quoted 10 lines · Ian Jackson

Ian Campbell writes ("[PATCH OSSTEST] make_qcow2: Look for qemu-img under /usr as well as /usr/local"):

Quoted 2 lines

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.

But, why are we executing a utility from /usr/lib/xen/bin ? If this utility is useful to osstest it is presumably useful to users too, and in that case it should be on PATH (under some suitable name).

We install qemu-upstream under our own prefix, I think to avoid conficting with the users own qemu installations?

qemu-img comes from there. We do install qemu-xen-img (from trad) into $PATH, but when I wrote this test I thought it preferable to use qemu-img.

Ian.

#3 lore raw

(CCing Stefano)

Ian Campbell writes ("Re: [PATCH OSSTEST] make_qcow2: Look for qemu-img under /usr as well as /usr/local"):

Quoted 12 lines · Ian Jackson
Quoted 10 lines

Ian Campbell writes ("[PATCH OSSTEST] make_qcow2: Look for qemu-img under /usr as well as /usr/local"):

Quoted 2 lines

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.

But, why are we executing a utility from /usr/lib/xen/bin ? If this utility is useful to osstest it is presumably useful to users too, and in that case it should be on PATH (under some suitable name).

Quoted 5 lines

We install qemu-upstream under our own prefix, I think to avoid conficting with the users own qemu installations?

qemu-img comes from there. We do install qemu-xen-img (from trad) into $PATH, but when I wrote this test I thought it preferable to use qemu-img.

Maybe we should be installing qemu-img from our qemu upstream build instead ?

We evidently don't think that there is anything in the qcow block system in trad that we like, because we are only using upstream for qdisk vbd backends now.

Ian.

#4 lore raw
Quoted 21 lines · Ian Jackson

(CCing Stefano)

Ian Campbell writes ("Re: [PATCH OSSTEST] make_qcow2: Look for qemu-img under /usr as well as /usr/local"):

Quoted 12 lines · Ian Jackson
Quoted 10 lines

Ian Campbell writes ("[PATCH OSSTEST] make_qcow2: Look for qemu-img under /usr as well as /usr/local"):

Quoted 2 lines

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.

But, why are we executing a utility from /usr/lib/xen/bin ? If this utility is useful to osstest it is presumably useful to users too, and in that case it should be on PATH (under some suitable name).

Quoted 5 lines

We install qemu-upstream under our own prefix, I think to avoid conficting with the users own qemu installations?

qemu-img comes from there. We do install qemu-xen-img (from trad) into $PATH, but when I wrote this test I thought it preferable to use qemu-img.

Quoted 6 lines

Maybe we should be installing qemu-img from our qemu upstream build instead ?

We evidently don't think that there is anything in the qcow block system in trad that we like, because we are only using upstream for qdisk vbd backends now.

Yes, this is a good idea. Qcow support is much better in upstream QEMU compared to qemu-trad.

#5 lore raw
Quoted 33 lines · Stefano Stabellini
Quoted 32 lines · Ian Jackson

(CCing Stefano)

Ian Campbell writes ("Re: [PATCH OSSTEST] make_qcow2: Look for qemu-img under /usr as well as /usr/local"):

Quoted 16 lines · Ian Jackson
Quoted 7 lines

Ian Campbell writes ("[PATCH OSSTEST] make_qcow2: Look for qemu-img under
/usr as well as /usr/local"):

Quoted 3 lines

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.

Quoted 7 lines

But, why are we executing a utility from /usr/lib/xen/bin ? If this
utility is useful to osstest it is presumably useful to users too, and
in that case it should be on PATH (under some suitable name).

Quoted 8 lines

We install qemu-upstream under our own prefix, I think to avoid conficting
with the users own qemu installations?

qemu-img comes from there. We do install qemu-xen-img (from trad) into
$PATH, but when I wrote this test I thought it preferable to use qemu -img.

Maybe we should be installing qemu-img from our qemu upstream build instead ?

Quoted 6 lines
Quoted 3 lines

We evidently don't think that there is anything in the qcow block system in trad that we like, because we are only using upstream for qdisk vbd backends now.

Yes, this is a good idea. Qcow support is much better in upstream QEMU compared to qemu-trad.

So I think the plan of attack should be:

Make osstest use qemu-xen-img out of $PATH instead of hardcoding the full path to qemu-upstreams's qemu-img (which is in our $libexec). This will cause everything to switch to qemu-trad's version of qemu-xen.

Modify xen.git (and raisin?) to stop installing the qemu-trad version of qemu-img as qemu-xen-img in $PATH and instead start installing qemu -upstream's version with that name.

We also need to check that whatever libraries used by qemu-img are in an appropriate place, or that rpath is used.

Are they any other similar tools which we should consider doing this for?

Who is going to write those patches?

Ian.

#6 lore raw
Quoted 51 lines · Ian Campbell
Quoted 33 lines · Stefano Stabellini
Quoted 32 lines · Ian Jackson

(CCing Stefano)

Ian Campbell writes ("Re: [PATCH OSSTEST] make_qcow2: Look for qemu-img under /usr as well as /usr/local"):

Quoted 16 lines · Ian Jackson
Quoted 7 lines

Ian Campbell writes ("[PATCH OSSTEST] make_qcow2: Look for qemu-img under
/usr as well as /usr/local"):

Quoted 3 lines

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.

Quoted 7 lines

But, why are we executing a utility from /usr/lib/xen/bin ? If this
utility is useful to osstest it is presumably useful to users too, and
in that case it should be on PATH (under some suitable name).

Quoted 8 lines

We install qemu-upstream under our own prefix, I think to avoid conficting
with the users own qemu installations?

qemu-img comes from there. We do install qemu-xen-img (from trad) into
$PATH, but when I wrote this test I thought it preferable to use qemu -img.

Maybe we should be installing qemu-img from our qemu upstream build instead ?

Quoted 6 lines
Quoted 3 lines

We evidently don't think that there is anything in the qcow block system in trad that we like, because we are only using upstream for qdisk vbd backends now.

Yes, this is a good idea. Qcow support is much better in upstream QEMU compared to qemu-trad.

So I think the plan of attack should be:

Make osstest use qemu-xen-img out of $PATH instead of hardcoding the full path to qemu-upstreams's qemu-img (which is in our $libexec). This will cause everything to switch to qemu-trad's version of qemu-xen.

Modify xen.git (and raisin?) to stop installing the qemu-trad version of qemu-img as qemu-xen-img in $PATH and instead start installing qemu -upstream's version with that name.

Quoted 6 lines

We also need to check that whatever libraries used by qemu-img are in an appropriate place, or that rpath is used.

Are they any other similar tools which we should consider doing this for?

Who is going to write those patches?

I volunteering to make the changes to install QEMU's qemu-img in Raisin