Re: [PATCH 2/5] vcpupin: implement the code to support new API for the qemu driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
> ---
>  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@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]