[gnome-boxes/gnome-3-34] Fix XPath in check_libvirt_kvm



commit 893bef2298bfd4c525fa5ae346ff622765565f0d
Author: Christophe Fergeau <cfergeau redhat com>
Date:   Wed Feb 19 16:27:39 2020 +0100

    Fix XPath in check_libvirt_kvm
    
    gnome-boxes --checks was reporting
    Libvirt KVM guest available: no
    while KVM support was otherwise functional in GNOME-Boxes.
    Turns out it's a bug in the XPath expression check_libvirt_kvm uses,
    here is the XML we want to match:
    
    <capabilities>
      <guest>
        <os_type>hvm</os_type>
        <arch name='x86_64'>
          <emulator>/usr/bin/qemu-system-x86_64</emulator>
          <domain type='qemu'/>
        </arch>
      </guest>
    </capabilities>
    
    The current XPath expression expects 'emulator' to be a child of
    'domain'.

 src/util-app.vala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/util-app.vala b/src/util-app.vala
index 88a9a1d3..dee12a8e 100644
--- a/src/util-app.vala
+++ b/src/util-app.vala
@@ -341,7 +341,7 @@ public async bool check_libvirt_kvm () {
 
             yield exec (argv, null, out standard_output);
             var kvm = extract_xpath (standard_output,
-                                     
"string(/capabilities/guest[os_type='hvm']/arch/domain[@type='kvm']/emulator)");
+                                     
"string(/capabilities/guest[os_type='hvm']/arch/domain[@type='kvm']/../emulator)");
             return kvm.length != 0;
 
         } catch (GLib.SpawnError.NOEXEC error) {


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