mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
nodeinfo: Fix build failure when KVM headers are not available
Compiler error: ../../src/nodeinfo.c: In function 'nodeGetThreadsPerSubcore': ../../src/nodeinfo.c:2393: error: label 'out' defined but not used [-Wunused-label] ../../src/nodeinfo.c:2352: error: unused parameter 'arch' [-Wunused-parameter]
This commit is contained in:
parent
c43c661fe4
commit
88c4c32af1
@ -2341,6 +2341,8 @@ nodeAllocPages(unsigned int npages,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if HAVE_LINUX_KVM_H && defined(KVM_CAP_PPC_SMT)
|
||||||
|
|
||||||
/* Get the number of threads per subcore.
|
/* Get the number of threads per subcore.
|
||||||
*
|
*
|
||||||
* This will be 2, 4 or 8 on POWER hosts, depending on the current
|
* This will be 2, 4 or 8 on POWER hosts, depending on the current
|
||||||
@ -2352,8 +2354,6 @@ int
|
|||||||
nodeGetThreadsPerSubcore(virArch arch)
|
nodeGetThreadsPerSubcore(virArch arch)
|
||||||
{
|
{
|
||||||
int threads_per_subcore = 0;
|
int threads_per_subcore = 0;
|
||||||
|
|
||||||
#if HAVE_LINUX_KVM_H && defined(KVM_CAP_PPC_SMT)
|
|
||||||
const char *kvmpath = "/dev/kvm";
|
const char *kvmpath = "/dev/kvm";
|
||||||
int kvmfd;
|
int kvmfd;
|
||||||
|
|
||||||
@ -2388,8 +2388,19 @@ nodeGetThreadsPerSubcore(virArch arch)
|
|||||||
|
|
||||||
VIR_FORCE_CLOSE(kvmfd);
|
VIR_FORCE_CLOSE(kvmfd);
|
||||||
}
|
}
|
||||||
#endif /* HAVE_LINUX_KVM_H && defined(KVM_CAP_PPC_SMT) */
|
|
||||||
|
|
||||||
out:
|
out:
|
||||||
return threads_per_subcore;
|
return threads_per_subcore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
/* Fallback for nodeGetThreadsPerSubcore() used when KVM headers
|
||||||
|
* are not available on the system */
|
||||||
|
int
|
||||||
|
nodeGetThreadsPerSubcore(virArch arch ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* HAVE_LINUX_KVM_H && defined(KVM_CAP_PPC_SMT) */
|
||||||
|
Loading…
Reference in New Issue
Block a user