mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
util:hostcpu: Report physical address size based on Architecture
The function virHostCPUGetPhysAddrSize was introduced with commitbe1b7d5b18
fails on architectures other than x86 and SuperH. The commit8417c1394c
fixed the issue only for s390 but the problem is still seen on other architectures like ppc which does not report Physical address size in their cpuinfo output. command: systemctl restart libvirtd.service Output : <snip> dnsmasq[2377]: read /var/lib/libvirt/dnsmasq/default.addnhosts - 0 addresses dnsmasq-dhcp[2377]: read /var/lib/libvirt/dnsmasq/default.hostsfile libvirtd[3163]: libvirt version: 9.8.0 libvirtd[3163]: hostname: xxxxxxxxxx libvirtd[3163]: internal error: Missing or invalid CPU address size in /proc/cpuinfo libvirtd.service: Deactivated successfully. </snip> This patch fixes this issue by returning the size=0 for architectures other than x86 and SuperH. Signed-off-by: Narayana Murty N <nnmlinux@linux.ibm.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
8ff149516f
commit
9df1e7d814
@ -103,6 +103,9 @@ typedef enum {
|
|||||||
#define ARCH_IS_MIPS64(arch) ((arch) == VIR_ARCH_MIPS64 ||\
|
#define ARCH_IS_MIPS64(arch) ((arch) == VIR_ARCH_MIPS64 ||\
|
||||||
(arch) == VIR_ARCH_MIPS64EL)
|
(arch) == VIR_ARCH_MIPS64EL)
|
||||||
|
|
||||||
|
#define ARCH_IS_SH4(arch) ((arch) == VIR_ARCH_SH4 ||\
|
||||||
|
(arch) == VIR_ARCH_SH4EB)
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
VIR_ARCH_LITTLE_ENDIAN,
|
VIR_ARCH_LITTLE_ENDIAN,
|
||||||
VIR_ARCH_BIG_ENDIAN,
|
VIR_ARCH_BIG_ENDIAN,
|
||||||
|
@ -1650,7 +1650,7 @@ virHostCPUGetPhysAddrSize(const virArch hostArch,
|
|||||||
{
|
{
|
||||||
g_autoptr(FILE) cpuinfo = NULL;
|
g_autoptr(FILE) cpuinfo = NULL;
|
||||||
|
|
||||||
if (ARCH_IS_S390(hostArch)) {
|
if (!(ARCH_IS_X86(hostArch) || ARCH_IS_SH4(hostArch))) {
|
||||||
/* Ensure size is set to 0 as physical address size is unknown */
|
/* Ensure size is set to 0 as physical address size is unknown */
|
||||||
*size = 0;
|
*size = 0;
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user