]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
cpu_conf: Fix XPath for parsing TSC frequency
authorJiri Denemark <jdenemar@redhat.com>
Thu, 6 Jun 2019 07:29:38 +0000 (09:29 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Thu, 6 Jun 2019 07:40:40 +0000 (09:40 +0200)
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>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/conf/cpu_conf.c

index dc46e7f57a46f224aee103435319e37dfb125e1e..825df88246f48d87900662111b04c3a360558f5f 100644 (file)
@@ -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;