From 345c959db9506187c5833ff9b4f5fbb5048fbf12 Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Mon, 7 Aug 2006 17:37:42 +0000 Subject: [PATCH] * include/libvirt/libvirt.h.in: previous change to libvirt.h should have gone on .in too Daniel --- ChangeLog | 5 +++++ include/libvirt/libvirt.h.in | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/ChangeLog b/ChangeLog index 1efed88a54..d7f94ac09c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Aug 7 18:47:48 CEST 2006 Daniel Veillard + + * include/libvirt/libvirt.h.in: previous change to libvirt.h should + have gone on .in too + Fri Aug 4 20:19:23 EDT 2006 Daniel Berrange * src/libvirt.c: Fix off-by-one in validated VCPU number (it is diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in index 3f8a504ca7..a78452b480 100644 --- a/include/libvirt/libvirt.h.in +++ b/include/libvirt/libvirt.h.in @@ -167,6 +167,18 @@ struct _virNodeInfo { unsigned int threads;/* number of threads per core */ }; + +/** + * VIR_NODEINFO_MAXCPUS: + * @nodeinfo: virNodeInfo instance + * + * This macro is to calculate the total number of CPUs supported + * but not neccessarily active in the host. + */ + + +#define VIR_NODEINFO_MAXCPUS(nodeinfo) ((nodeinfo).nodes*(nodeinfo).sockets*(nodeinfo).cores*(nodeinfo).threads) + /** * virNodeInfoPtr: * @@ -339,6 +351,18 @@ int virDomainPinVcpu (virDomainPtr domain, #define VIR_UNUSE_CPU(cpumap,cpu) (cpumap[(cpu)/8] &= ~(1<<((cpu)%8))) +/** + * VIR_CPU_MAPLEN + * @cpu: number of physical CPUs + * + * This macro is to be used in conjonction with virDomainPinVcpu() API. + * It returns the length (in bytes) required to store the complete + * CPU map between a single virtual & all physical CPUs of a domain. + */ + +#define VIR_CPU_MAPLEN(cpu) (((cpu)+7)/8) + + int virDomainGetVcpus (virDomainPtr domain, virVcpuInfoPtr info, int maxinfo,