[gnome-boxes/gnome-3-36] Fix XPath in check_libvirt_kvm
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes/gnome-3-36] Fix XPath in check_libvirt_kvm
- Date: Wed, 19 Feb 2020 16:18:27 +0000 (UTC)
commit e157bb28121f36e1fab3fabb5f003ab785a9fa00
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]