[libvirt] [PATCH 2/2] qemu: fixing internationalization problem with sched kernel entry.

Julio Faracco jcfaracco at gmail.com
Wed Jun 14 16:25:03 UTC 2017

In qemuGetSchedInfo(), libvirt is trying to parse some field of /proc/*/sched.
Some fields are floating point numbers and their separator is always a dot.
When you change the locale of the system, you can change the mantissa
separator (to a comma separator) of floating point numbers and it affects the

This commit introduces the virStrToDoubleSafe() to avoid comma as a separator.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1457634
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1457481

Signed-off-by: Julio Faracco <jcfaracco at gmail.com>
 src/qemu/qemu_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index ba1dba5..f1b104f 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1369,7 +1369,7 @@ qemuGetSchedInfo(unsigned long long *cpuWait,
             while (*line == ' ')
-            if (virStrToDouble(line, NULL, &val) < 0) {
+            if (virStrToDoubleSafe(line, NULL, &val) < 0) {
                                _("Unable to parse sched info value '%s'"),

More information about the libvir-list mailing list