From: George Dunlap <george.dunlap@eu.citrix.com>
Date: Tue, 2 Oct 2012 19:19:04 +0200
Subject: Allow xen toolstack to find it's binaries

Closes: #685749
---
 docs/schemas/capability.rng            |  4 ++--
 src/xen/xen_hypervisor.c               |  6 ++----
 tests/xencapsdata/xen-i686-pae-hvm.xml |  6 +++---
 tests/xencapsdata/xen-i686-pae.xml     |  2 +-
 tests/xencapsdata/xen-i686.xml         |  2 +-
 tests/xencapsdata/xen-ia64-be-hvm.xml  |  6 +++---
 tests/xencapsdata/xen-ia64-be.xml      |  2 +-
 tests/xencapsdata/xen-ia64-hvm.xml     |  6 +++---
 tests/xencapsdata/xen-ia64.xml         |  2 +-
 tests/xencapsdata/xen-ppc64.xml        |  2 +-
 tests/xencapsdata/xen-x86_64-hvm.xml   | 10 +++++-----
 tests/xencapsdata/xen-x86_64.xml       |  2 +-
 12 files changed, 24 insertions(+), 26 deletions(-)

diff --git a/docs/schemas/capability.rng b/docs/schemas/capability.rng
index 5f3ec70..3b5fade 100644
--- a/docs/schemas/capability.rng
+++ b/docs/schemas/capability.rng
@@ -293,13 +293,13 @@
 
   <define name='emulator'>
     <element name='emulator'>
-      <ref name='absFilePath'/>
+      <ref name='filePath'/>
     </element>
   </define>
 
   <define name='loader'>
     <element name='loader'>
-      <ref name='absFilePath'/>
+      <ref name='filePath'/>
     </element>
   </define>
 
diff --git a/src/xen/xen_hypervisor.c b/src/xen/xen_hypervisor.c
index c5e649f..dc35f72 100644
--- a/src/xen/xen_hypervisor.c
+++ b/src/xen/xen_hypervisor.c
@@ -2144,11 +2144,9 @@ xenHypervisorBuildCapabilities(virConnectPtr conn, virArch hostarch,
         if ((guest = virCapabilitiesAddGuest(caps,
                                              guest_archs[i].hvm ? "hvm" : "xen",
                                              guest_archs[i].arch,
-                                             (hostarch == VIR_ARCH_X86_64 ?
-                                              "/usr/lib64/xen/bin/qemu-dm" :
-                                              "/usr/lib/xen/bin/qemu-dm"),
+                                             "qemu-dm",
                                              (guest_archs[i].hvm ?
-                                              "/usr/lib/xen-default/boot/hvmloader" :
+                                              "hvmloader" :
                                               NULL),
                                              1,
                                              machines)) == NULL) {
diff --git a/tests/xencapsdata/xen-i686-pae-hvm.xml b/tests/xencapsdata/xen-i686-pae-hvm.xml
index 7cde6df..cf1953d 100644
--- a/tests/xencapsdata/xen-i686-pae-hvm.xml
+++ b/tests/xencapsdata/xen-i686-pae-hvm.xml
@@ -20,7 +20,7 @@
     <os_type>xen</os_type>
     <arch name='i686'>
       <wordsize>32</wordsize>
-      <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
+      <emulator>qemu-dm</emulator>
       <machine>xenpv</machine>
       <domain type='xen'>
       </domain>
@@ -34,8 +34,8 @@
     <os_type>hvm</os_type>
     <arch name='i686'>
       <wordsize>32</wordsize>
-      <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
-      <loader>/usr/lib/xen-default/boot/hvmloader</loader>
+      <emulator>qemu-dm</emulator>
+      <loader>hvmloader</loader>
       <machine>xenfv</machine>
       <domain type='xen'>
       </domain>
diff --git a/tests/xencapsdata/xen-i686-pae.xml b/tests/xencapsdata/xen-i686-pae.xml
index 3dba6eb..c774d6c 100644
--- a/tests/xencapsdata/xen-i686-pae.xml
+++ b/tests/xencapsdata/xen-i686-pae.xml
@@ -20,7 +20,7 @@
     <os_type>xen</os_type>
     <arch name='i686'>
       <wordsize>32</wordsize>
-      <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
+      <emulator>qemu-dm</emulator>
       <machine>xenpv</machine>
       <domain type='xen'>
       </domain>
diff --git a/tests/xencapsdata/xen-i686.xml b/tests/xencapsdata/xen-i686.xml
index 22d7685..bc36cbf 100644
--- a/tests/xencapsdata/xen-i686.xml
+++ b/tests/xencapsdata/xen-i686.xml
@@ -17,7 +17,7 @@
     <os_type>xen</os_type>
     <arch name='i686'>
       <wordsize>32</wordsize>
-      <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
+      <emulator>qemu-dm</emulator>
       <machine>xenpv</machine>
       <domain type='xen'>
       </domain>
diff --git a/tests/xencapsdata/xen-ia64-be-hvm.xml b/tests/xencapsdata/xen-ia64-be-hvm.xml
index e56e306..ddab377 100644
--- a/tests/xencapsdata/xen-ia64-be-hvm.xml
+++ b/tests/xencapsdata/xen-ia64-be-hvm.xml
@@ -17,7 +17,7 @@
     <os_type>xen</os_type>
     <arch name='ia64'>
       <wordsize>64</wordsize>
-      <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
+      <emulator>qemu-dm</emulator>
       <machine>xenpv</machine>
       <domain type='xen'>
       </domain>
@@ -31,8 +31,8 @@
     <os_type>hvm</os_type>
     <arch name='ia64'>
       <wordsize>64</wordsize>
-      <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
-      <loader>/usr/lib/xen-default/boot/hvmloader</loader>
+      <emulator>qemu-dm</emulator>
+      <loader>hvmloader</loader>
       <machine>xenfv</machine>
       <domain type='xen'>
       </domain>
diff --git a/tests/xencapsdata/xen-ia64-be.xml b/tests/xencapsdata/xen-ia64-be.xml
index 017816c..4a548c6 100644
--- a/tests/xencapsdata/xen-ia64-be.xml
+++ b/tests/xencapsdata/xen-ia64-be.xml
@@ -17,7 +17,7 @@
     <os_type>xen</os_type>
     <arch name='ia64'>
       <wordsize>64</wordsize>
-      <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
+      <emulator>qemu-dm</emulator>
       <machine>xenpv</machine>
       <domain type='xen'>
       </domain>
diff --git a/tests/xencapsdata/xen-ia64-hvm.xml b/tests/xencapsdata/xen-ia64-hvm.xml
index 25617fc..32a0056 100644
--- a/tests/xencapsdata/xen-ia64-hvm.xml
+++ b/tests/xencapsdata/xen-ia64-hvm.xml
@@ -17,7 +17,7 @@
     <os_type>xen</os_type>
     <arch name='ia64'>
       <wordsize>64</wordsize>
-      <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
+      <emulator>qemu-dm</emulator>
       <machine>xenpv</machine>
       <domain type='xen'>
       </domain>
@@ -28,8 +28,8 @@
     <os_type>hvm</os_type>
     <arch name='ia64'>
       <wordsize>64</wordsize>
-      <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
-      <loader>/usr/lib/xen-default/boot/hvmloader</loader>
+      <emulator>qemu-dm</emulator>
+      <loader>hvmloader</loader>
       <machine>xenfv</machine>
       <domain type='xen'>
       </domain>
diff --git a/tests/xencapsdata/xen-ia64.xml b/tests/xencapsdata/xen-ia64.xml
index 82ce965..e48b29b 100644
--- a/tests/xencapsdata/xen-ia64.xml
+++ b/tests/xencapsdata/xen-ia64.xml
@@ -17,7 +17,7 @@
     <os_type>xen</os_type>
     <arch name='ia64'>
       <wordsize>64</wordsize>
-      <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
+      <emulator>qemu-dm</emulator>
       <machine>xenpv</machine>
       <domain type='xen'>
       </domain>
diff --git a/tests/xencapsdata/xen-ppc64.xml b/tests/xencapsdata/xen-ppc64.xml
index 91401b9..2799fe8 100644
--- a/tests/xencapsdata/xen-ppc64.xml
+++ b/tests/xencapsdata/xen-ppc64.xml
@@ -17,7 +17,7 @@
     <os_type>xen</os_type>
     <arch name='ppc64'>
       <wordsize>64</wordsize>
-      <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
+      <emulator>qemu-dm</emulator>
       <machine>xenpv</machine>
       <domain type='xen'>
       </domain>
diff --git a/tests/xencapsdata/xen-x86_64-hvm.xml b/tests/xencapsdata/xen-x86_64-hvm.xml
index 493d1ea..9e79899 100644
--- a/tests/xencapsdata/xen-x86_64-hvm.xml
+++ b/tests/xencapsdata/xen-x86_64-hvm.xml
@@ -20,7 +20,7 @@
     <os_type>xen</os_type>
     <arch name='x86_64'>
       <wordsize>64</wordsize>
-      <emulator>/usr/lib64/xen/bin/qemu-dm</emulator>
+      <emulator>qemu-dm</emulator>
       <machine>xenpv</machine>
       <domain type='xen'>
       </domain>
@@ -31,8 +31,8 @@
     <os_type>hvm</os_type>
     <arch name='i686'>
       <wordsize>32</wordsize>
-      <emulator>/usr/lib64/xen/bin/qemu-dm</emulator>
-      <loader>/usr/lib/xen-default/boot/hvmloader</loader>
+      <emulator>qemu-dm</emulator>
+      <loader>hvmloader</loader>
       <machine>xenfv</machine>
       <domain type='xen'>
       </domain>
@@ -49,8 +49,8 @@
     <os_type>hvm</os_type>
     <arch name='x86_64'>
       <wordsize>64</wordsize>
-      <emulator>/usr/lib64/xen/bin/qemu-dm</emulator>
-      <loader>/usr/lib/xen-default/boot/hvmloader</loader>
+      <emulator>qemu-dm</emulator>
+      <loader>hvmloader</loader>
       <machine>xenfv</machine>
       <domain type='xen'>
       </domain>
diff --git a/tests/xencapsdata/xen-x86_64.xml b/tests/xencapsdata/xen-x86_64.xml
index 0c3279b..73e232e 100644
--- a/tests/xencapsdata/xen-x86_64.xml
+++ b/tests/xencapsdata/xen-x86_64.xml
@@ -20,7 +20,7 @@
     <os_type>xen</os_type>
     <arch name='x86_64'>
       <wordsize>64</wordsize>
-      <emulator>/usr/lib64/xen/bin/qemu-dm</emulator>
+      <emulator>qemu-dm</emulator>
       <machine>xenpv</machine>
       <domain type='xen'>
       </domain>
