[libvirt] [PATCH] cpu_conf: Fix XPath for parsing TSC frequency

Jiri Denemark posted 1 patch 2 weeks ago
Test syntax-check passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/3ea90614a378f58638a74c785fbb0c033d512072.1559806382.git.jdenemar@redhat.com
src/conf/cpu_conf.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

[libvirt] [PATCH] cpu_conf: Fix XPath for parsing TSC frequency

Posted by Jiri Denemark 2 weeks ago
Due to this bug the following command would fail on any host where TSC
frequency can be probed:

    $ virsh capabilities | virsh cpu-baseline /dev/stdin
    error: unsupported configuration: Invalid TSC frequency

https://bugzilla.redhat.com/show_bug.cgi?id=1641702

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/conf/cpu_conf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c
index dc46e7f57a..825df88246 100644
--- a/src/conf/cpu_conf.c
+++ b/src/conf/cpu_conf.c
@@ -417,8 +417,8 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt,
             if (VIR_ALLOC(tsc) < 0)
                 goto cleanup;
 
-            if (virXPathULongLong("./counter[@name='tsc']/@frequency", ctxt,
-                                  &tsc->frequency) < 0) {
+            if (virXPathULongLong("string(./counter[@name='tsc']/@frequency)",
+                                  ctxt, &tsc->frequency) < 0) {
                 virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
                                _("Invalid TSC frequency"));
                 goto cleanup;
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] cpu_conf: Fix XPath for parsing TSC frequency

Posted by Ján Tomko 2 weeks ago
On Thu, Jun 06, 2019 at 09:33:02AM +0200, Jiri Denemark wrote:
>Due to this bug the following command would fail on any host where TSC
>frequency can be probed:
>
>    $ virsh capabilities | virsh cpu-baseline /dev/stdin
>    error: unsupported configuration: Invalid TSC frequency
>
>https://bugzilla.redhat.com/show_bug.cgi?id=1641702
>
>Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
>---
> src/conf/cpu_conf.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list