[gnome-boxes] Fix XPath in check_libvirt_kvm



commit d7497c9e08c04dad61d11d157bd67b348285bc83
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 2439e77c..dd8595a0 100644
--- a/src/util-app.vala
+++ b/src/util-app.vala
@@ -357,7 +357,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]