[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;

On Thu, Oct 12, 2006 at 01:20:01PM +0200, Philippe Berthault wrote:
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.
Dohh, right ! At least it was consistently misuninitialized :-) Applied and commited to CVS, thanks a lot ! Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
participants (2)
-
Daniel Veillard
-
Philippe Berthault