Daniel Henrique Barboza
0137bf0dab
virhostcpu.c: fix 'die_id' parsing for Power hosts
...
Commit 7b79ee2f78 makes assumptions about die_id parsing in
the sysfs that aren't true for Power hosts. In both Power8
and Power9, running 5.6 and 4.18 kernel respectively,
'die_id' is set to -1:
$ cat /sys/devices/system/cpu/cpu0/topology/die_id
-1
This breaks virHostCPUGetDie() parsing because it is trying to
retrieve an unsigned integer, causing problems during VM start:
virFileReadValueUint:4128 : internal error: Invalid unsigned integer
value '-1' in file '/sys/devices/system/cpu/cpu0/topology/die_id'
This isn't necessarily a PowerPC only behavior. Linux kernel commit
0e344d8c70 added in the former Documentation/cputopology.txt, now
Documentation/admin-guide/cputopology.rst, that:
To be consistent on all architectures, include/linux/topology.h
provides default definitions for any of the above macros that are
not defined by include/asm-XXX/topology.h:
1) topology_physical_package_id: -1
2) topology_die_id: -1
(...)
This means that it might be expected that an architecture that
does not implement the die_id element will mark it as -1 in
sysfs.
It is not required to change die_id implementation from uInt to
Int because of that. Instead, let's change the parsing of the
die_id in virHostCPUGetDie() to read an integer value and, in
case it's -1, default it to zero like in case of file not found.
This is enough to solve the issue Power hosts are experiencing.
Fixes: 7b79ee2f78bbf2af76df2f6466919e19ae05aeeb
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-03-17 10:07:22 +01:00
..
2020-01-07 14:42:26 +00:00
2020-01-07 14:42:26 +00:00
2020-02-24 23:15:49 +01:00
2020-03-11 14:44:04 +00:00
2020-03-05 16:22:27 +01:00
2020-03-05 16:22:27 +01:00
2020-01-29 14:51:39 +00:00
2020-01-30 12:32:03 +01:00
2020-01-29 14:51:40 +00:00
2020-03-13 17:26:55 +01:00
2019-10-15 16:14:18 +02:00
2019-12-20 09:38:43 +01:00
2019-11-12 16:15:58 +01:00
2019-10-16 12:06:44 +02:00
2020-02-24 20:25:48 +01:00
2019-10-16 12:06:44 +02:00
2020-03-10 17:10:57 +01:00
2019-11-15 12:58:00 +01:00
2020-02-03 19:44:38 +01:00
2020-02-03 19:44:38 +01:00
2020-02-23 14:02:24 +01:00
2020-02-24 23:15:49 +01:00
2019-11-15 12:58:43 +01:00
2019-11-15 12:58:05 +01:00
2020-02-24 23:15:49 +01:00
2020-02-24 23:15:49 +01:00
2020-03-10 17:10:21 +01:00
2020-01-06 17:30:17 +01:00
2020-03-13 17:26:55 +01:00
2019-10-16 12:06:44 +02:00
2019-12-20 09:38:43 +01:00
2020-02-24 23:15:50 +01:00
2020-01-17 10:02:01 +00:00
2019-10-15 11:25:22 +02:00
2019-11-12 17:54:01 +01:00
2019-09-10 09:47:13 +02:00
2020-02-04 14:00:45 +00:00
2020-03-12 08:04:40 +01:00
2020-01-29 14:51:39 +00:00
2019-11-12 16:15:58 +01:00
2020-01-17 10:02:01 +00:00
2020-03-13 17:26:55 +01:00
2020-03-13 17:26:55 +01:00
2020-02-07 15:03:53 +00:00
2019-12-18 14:04:59 +00:00
2020-02-07 15:03:53 +00:00
2020-02-07 15:03:53 +00:00
2020-02-24 03:19:25 +01:00
2020-02-07 15:03:53 +00:00
2020-03-11 14:44:04 +00:00
2020-03-11 14:44:04 +00:00
2019-10-21 12:51:59 +02:00
2020-03-05 12:23:04 +00:00
2020-03-13 17:26:55 +01:00
2020-02-04 14:00:45 +00:00
2019-10-24 19:35:34 +02:00
2020-02-24 23:15:49 +01:00
2019-10-16 12:06:44 +02:00
2019-10-16 12:06:43 +02:00
2019-10-21 12:51:59 +02:00
2019-10-16 12:06:43 +02:00
2020-02-04 14:00:45 +00:00
2020-02-24 23:15:49 +01:00
2020-02-24 23:15:50 +01:00
2020-02-04 13:45:33 +01:00
2020-02-04 13:45:33 +01:00
2019-10-15 16:14:19 +02:00
2019-10-15 16:14:18 +02:00
2020-02-24 17:25:07 +00:00
2020-02-24 17:25:07 +00:00
2020-03-17 10:07:22 +01:00
2020-01-16 15:11:55 +00:00
2020-01-29 14:51:39 +00:00
2020-01-07 17:00:10 +01:00
2020-01-07 17:00:10 +01:00
2019-10-14 10:54:42 +01:00
2019-10-14 10:54:42 +01:00
2020-01-17 10:02:01 +00:00
2020-02-04 14:00:44 +00:00
2019-10-18 18:49:54 +01:00
2019-12-12 14:24:35 +01:00
2019-10-15 11:25:22 +02:00
2020-03-05 11:31:38 +01:00
2020-02-04 13:45:32 +01:00
2020-01-17 10:02:01 +00:00
2020-02-24 23:15:50 +01:00
2019-12-12 14:24:35 +01:00
2019-10-15 11:25:22 +02:00
2019-11-12 16:15:58 +01:00
2020-03-05 11:31:38 +01:00
2020-03-13 17:26:55 +01:00
2020-01-29 14:51:40 +00:00
2019-11-12 16:15:58 +01:00
2020-02-24 20:25:48 +01:00
2020-01-17 10:02:01 +00:00
2020-03-05 18:06:21 +01:00
2020-01-03 15:42:13 +00:00
2020-02-24 23:15:50 +01:00
2020-02-24 23:15:50 +01:00
2020-03-05 11:31:38 +01:00
2020-01-29 14:51:40 +00:00
2020-02-25 10:02:15 +00:00
2019-11-25 15:29:51 -05:00
2020-02-24 23:15:49 +01:00
2020-02-20 23:07:53 -05:00
2020-02-24 23:15:49 +01:00
2019-10-16 12:06:44 +02:00
2020-01-29 14:51:40 +00:00
2019-11-25 15:29:56 -05:00
2019-11-25 15:29:56 -05:00
2019-11-25 15:29:56 -05:00
2019-11-25 15:29:56 -05:00
2019-11-25 15:29:56 -05:00
2020-02-20 23:13:15 -05:00
2020-02-20 23:13:15 -05:00
2020-02-24 23:15:49 +01:00
2019-10-15 11:25:22 +02:00
2020-02-24 23:15:50 +01:00
2020-01-30 12:32:03 +01:00
2020-02-24 23:15:50 +01:00
2020-01-30 12:32:03 +01:00
2019-10-23 14:30:47 +02:00
2020-03-05 12:23:04 +00:00
2020-02-24 23:15:50 +01:00
2020-02-24 23:15:50 +01:00
2019-12-17 10:04:43 +01:00
2019-12-17 10:04:43 +01:00
2020-02-02 16:36:58 +01:00
2020-01-17 10:02:01 +00:00
2020-03-13 17:26:55 +01:00
2020-02-24 23:15:50 +01:00
2020-02-24 23:15:50 +01:00
2020-02-24 23:15:50 +01:00
2020-03-13 17:26:55 +01:00
2019-10-15 11:25:22 +02:00
2020-02-24 23:15:50 +01:00
2020-02-24 23:15:49 +01:00
2020-03-13 17:26:55 +01:00
2020-02-24 23:15:50 +01:00
2020-02-03 19:44:38 +01:00
2020-02-24 23:15:49 +01:00
2019-10-15 16:14:18 +02:00
2020-02-24 23:15:50 +01:00
2020-02-24 23:15:50 +01:00
2019-11-12 16:15:58 +01:00
2020-02-24 23:15:49 +01:00
2019-10-16 12:06:44 +02:00
2019-11-12 16:15:58 +01:00
2019-11-12 16:15:58 +01:00
2020-02-24 23:15:50 +01:00
2019-10-21 12:51:59 +02:00
2020-01-17 15:52:37 +01:00
2020-02-24 23:15:50 +01:00
2020-01-29 14:51:39 +00:00
2020-02-07 15:03:54 +00:00
2020-01-29 14:51:40 +00:00
2020-01-29 14:51:40 +00:00
2019-10-21 12:51:58 +02:00
2020-02-24 23:15:50 +01:00
2020-03-16 15:51:44 +01:00
2020-03-16 15:51:44 +01:00
2020-02-04 14:00:45 +00:00
2020-01-17 09:58:43 +00:00
2020-02-04 14:00:44 +00:00
2020-02-24 23:15:50 +01:00
2020-02-02 16:36:58 +01:00
2019-10-16 12:06:44 +02:00
2020-03-06 16:47:20 +01:00
2020-03-05 12:23:02 +00:00
2020-03-05 12:23:04 +00:00
2020-03-05 12:23:04 +00:00
2020-01-17 10:02:01 +00:00
2019-10-15 11:25:22 +02:00
2020-01-07 16:40:41 +01:00
2019-10-15 16:14:18 +02:00
2019-10-21 12:51:59 +02:00
2020-02-24 23:15:49 +01:00
2020-02-24 23:15:50 +01:00
2020-02-24 23:15:49 +01:00
2020-01-27 11:02:03 +00:00
2020-02-24 23:15:49 +01:00
2019-10-16 12:06:44 +02:00
2020-03-13 17:26:55 +01:00
2020-03-12 08:04:40 +01:00
2020-02-24 20:25:48 +01:00
2019-10-15 16:14:18 +02:00
2019-11-12 16:15:58 +01:00
2020-01-17 13:16:58 +00:00
2020-01-29 14:51:40 +00:00
2020-02-24 23:15:49 +01:00
2019-10-24 19:35:34 +02:00