[libvirt] [PATCH 2/5] vcpupin: implement the code to support new API for the qemu driver
Eric Blake
eblake at redhat.com
Fri Jun 24 16:38:21 UTC 2011
On 06/24/2011 02:57 AM, Taku Izumi wrote:
>
> This patch implements the code to address the new API (virDomainGetVcpupinInfo)
> in the qemu driver.
>
> Signed-off-by: Taku Izumi <izumi.taku at jp.fujitsu.com>
> ---
> src/qemu/qemu_driver.c | 112 +++++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 112 insertions(+)
>
> Index: libvirt/src/qemu/qemu_driver.c
> ===================================================================
> --- libvirt.orig/src/qemu/qemu_driver.c
> +++ libvirt/src/qemu/qemu_driver.c
> @@ -3088,6 +3088,117 @@ qemudDomainPinVcpu(virDomainPtr dom,
> }
>
> static int
> +qemudDomainGetVcpupinInfo(virDomainPtr dom,
> + int maxinfo,
Same name change as in patch 1/5.
ACK; here's what I'm squashing in.
diff --git i/src/qemu/qemu_driver.c w/src/qemu/qemu_driver.c
index c156ea2..d9099d5 100644
--- i/src/qemu/qemu_driver.c
+++ w/src/qemu/qemu_driver.c
@@ -3167,7 +3167,7 @@ qemudDomainPinVcpu(virDomainPtr dom,
static int
qemudDomainGetVcpupinInfo(virDomainPtr dom,
- int maxinfo,
+ int ncpumaps,
unsigned char *cpumaps,
int maplen,
unsigned int flags) {
@@ -3241,17 +3241,17 @@ qemudDomainGetVcpupinInfo(virDomainPtr dom,
maxcpu = hostcpus;
/* Clamp to actual number of vcpus */
- if (maxinfo > targetDef->vcpus)
- maxinfo = targetDef->vcpus;
+ if (ncpumaps > targetDef->vcpus)
+ ncpumaps = targetDef->vcpus;
- if (maxinfo < 1) {
+ if (ncpumaps < 1) {
goto cleanup;
}
/* initialize cpumaps */
- memset(cpumaps, 0xff, maplen * maxinfo);
+ memset(cpumaps, 0xff, maplen * ncpumaps);
if (maxcpu % 8) {
- for (vcpu = 0; vcpu < maxinfo; vcpu++) {
+ for (vcpu = 0; vcpu < ncpumaps; vcpu++) {
cpumap = VIR_GET_CPUMAP(cpumaps, maplen, vcpu);
cpumap[maplen - 1] &= (1 << maxcpu % 8) - 1;
}
@@ -3268,7 +3268,7 @@ qemudDomainGetVcpupinInfo(virDomainPtr dom,
VIR_UNUSE_CPU(cpumap, pcpu);
}
}
- ret = maxinfo;
+ ret = ncpumaps;
cleanup:
if (vm)
--
Eric Blake eblake at redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110624/c5d007cc/attachment-0001.sig>
More information about the libvir-list
mailing list