[libvirt] [Patch] Fix vcpupin to inactive domains on Xend3.0.3.

Hi, I made the patch that corrected the following problem. It is that when I execute the "virsh vcpupin" command to inactive domains on Xend3.0.3, Libvirt outputs the following Segmentation fault. # virsh vcpupin guest_dom 0 0,1,2 Segmentation fault Signed-off-by: Tomohiro Takahashi <takatom@jp.fujitsu.com> Thanks, Tomohiro Takahashi --- xm_internal.c.org 2009-04-07 21:50:17.000000000 +0900 +++ xm_internal.c 2009-04-13 20:53:22.000000000 +0900 @@ -1700,7 +1700,8 @@ int xenXMDomainPinVcpu(virDomainPtr doma ret = 0; cleanup: - VIR_FREE(mapstr); + if( *mapstr != '\0' ) + VIR_FREE(mapstr); VIR_FREE(cpuset); xenUnifiedUnlock(priv); return (ret);

On Tue, Apr 14, 2009 at 04:41:50PM +0900, Takahashi Tomohiro wrote:
Hi,
I made the patch that corrected the following problem. It is that when I execute the "virsh vcpupin" command to inactive domains on Xend3.0.3, Libvirt outputs the following Segmentation fault.
# virsh vcpupin guest_dom 0 0,1,2 Segmentation fault
Yup there is a bug there, but the patch is wrong, it will lead to a memory leak instead of fixing the real problem which is that virDomainCpuSetParse() override the mapstr pointer, and the VIR_FREE is being passed the wrong pointer. The following patch fixes the problem for me, thanks, Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

Hi Daniel-san, Thank you for your reply. I see. And I checked this problem is solved by your patch. Thanks, Tomohiro Takahashi. Daniel Veillard wrote:
On Tue, Apr 14, 2009 at 04:41:50PM +0900, Takahashi Tomohiro wrote:
Hi,
I made the patch that corrected the following problem. It is that when I execute the "virsh vcpupin" command to inactive domains on Xend3.0.3, Libvirt outputs the following Segmentation fault.
# virsh vcpupin guest_dom 0 0,1,2 Segmentation fault
Yup there is a bug there, but the patch is wrong, it will lead to a memory leak instead of fixing the real problem which is that virDomainCpuSetParse() override the mapstr pointer, and the VIR_FREE is being passed the wrong pointer. The following patch fixes the problem for me,
thanks,
Daniel

On Wed, Apr 15, 2009 at 09:52:39AM +0900, Takahashi Tomohiro wrote:
Hi Daniel-san,
Thank you for your reply.
I see. And I checked this problem is solved by your patch.
Okay, good, applied and commited, thanks ! Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/
participants (2)
-
Daniel Veillard
-
Takahashi Tomohiro