Commit ff4a8a3a authored by Leonid Podolny's avatar Leonid Podolny Committed by Daniel P. Berrange

Fix segfault in GetIOThreadInfo

The pointers calculation included a typo which caused segfaults.
Signed-off-by: default avatarLeonid Podolny <leonid@podolny.net>
parent 9730c832
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment