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

[Libvir] Bug correction in virDomainGetVcpus() function



In the virXen_getvcpusinfo() function of xen_internal.c source file, the vcpu number stored in the virVcpuInfo structure is the xen domain id instead of the vcpu id.

Here the patch of the correction.

--- libvirt-0.1.7/src/xen_internal.c	2006-09-29 10:18:17.000000000 +0200
+++ libvirt-0.1.8/src/xen_internal.c	2006-10-12 11:29:40.000000000 +0200
@@ -1012,7 +1012,7 @@
         ret = xenHypervisorDoV2Dom(handle, &op);
         if (ret < 0)
             return(-1);
-        ipt->number = id;
+        ipt->number = vcpu;
         if (op.u.getvcpuinfo.online) {
             if (op.u.getvcpuinfo.running) ipt->state = VIR_VCPU_RUNNING;
             if (op.u.getvcpuinfo.blocked) ipt->state = VIR_VCPU_BLOCKED;
@@ -1054,7 +1054,7 @@
             ret = xenHypervisorDoV1Op(handle, &op);
             if (ret < 0)
                 return(-1);
-            ipt->number = id;
+            ipt->number = vcpu;
             if (op.u.getvcpuinfo.online) {
                 if (op.u.getvcpuinfo.running) ipt->state = VIR_VCPU_RUNNING;
                 if (op.u.getvcpuinfo.blocked) ipt->state = VIR_VCPU_BLOCKED;
@@ -1078,7 +1078,7 @@
             ret = xenHypervisorDoV0Op(handle, &op);
             if (ret < 0)
                 return(-1);
-            ipt->number = id;
+            ipt->number = vcpu;
             if (op.u.getvcpuinfo.online) {
                 if (op.u.getvcpuinfo.running) ipt->state = VIR_VCPU_RUNNING;
                 if (op.u.getvcpuinfo.blocked) ipt->state = VIR_VCPU_BLOCKED;

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