diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2006-08-07 14:35:20 +0000 |
---|---|---|
committer | Daniel P. Berrange <berrange@redhat.com> | 2006-08-07 14:35:20 +0000 |
commit | f7e0594f87a0cb4d8cebbf03d54a61dd3cc08d63 (patch) | |
tree | 16d7ec3f0620ebb307bf55d19a3b8ac96878043b /include | |
parent | d7815361f8dcefb54a4377ebf5e28201517e453d (diff) | |
download | libvirt-f7e0594f87a0cb4d8cebbf03d54a61dd3cc08d63.tar.gz |
Added vcpuinfo vcpupin commands to virsh. Fixed off by one bug in virDomainVcpuPin method
Diffstat (limited to 'include')
-rw-r--r-- | include/libvirt/libvirt.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/libvirt/libvirt.h b/include/libvirt/libvirt.h index 2db8beba03..f846fe0351 100644 --- a/include/libvirt/libvirt.h +++ b/include/libvirt/libvirt.h @@ -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, |