[libvirt] [PATCH] Fix segfault in GetIOThreadInfo

The pointers calculation included a typo which caused segfaults. Signed-off-by: Leonid Podolny <leonid@podolny.net> --- domain.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/domain.go b/domain.go index 515138a..74061c2 100644 --- a/domain.go +++ b/domain.go @@ -3887,7 +3887,7 @@ func (d *Domain) GetIOThreadInfo(flags DomainModificationImpact) ([]DomainIOThre info := make([]DomainIOThreadInfo, int(ret)) for i := 0; i < int(ret); i++ { - cinfo := (*(**C.virDomainIOThreadInfo)(unsafe.Pointer(uintptr(unsafe.Pointer(cinfolist)) + (unsafe.Sizeof(*cinfolist) + uintptr(i))))) + cinfo := (*(**C.virDomainIOThreadInfo)(unsafe.Pointer(uintptr(unsafe.Pointer(cinfolist)) + (unsafe.Sizeof(*cinfolist) * uintptr(i))))) ncpus := int(cinfo.cpumaplen * 8) cpumap := make([]bool, ncpus) -- 2.11.0

On Wed, Jan 18, 2017 at 12:46:53PM -0500, Leonid Podolny wrote:
The pointers calculation included a typo which caused segfaults.
Signed-off-by: Leonid Podolny <leonid@podolny.net> --- domain.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Already responded to your other posting, but thanks again, I've applied this to git master. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://entangle-photo.org -o- http://search.cpan.org/~danberr/ :|
participants (2)
-
Daniel P. Berrange
-
Leonid Podolny