rgbkrk/libvirt-go

support for golang 1.6

anuaimi opened this issue · 3 comments

I tried to run the tests with gaoling 1.6 and there was an error with TestDomainEventRegister. It seems to be the only error though

--- FAIL: TestDomainEventRegister (0.00s)
panic: runtime error: cgo argument has Go pointer to Go pointer [recovered]
panic: runtime error: cgo argument has Go pointer to Go pointer

goroutine 82 [running]:
panic(0x5d5160, 0xc82000ada0)
/usr/local/go/src/runtime/panic.go:464 +0x3e6
testing.tRunner.func1(0xc8200aab40)
/usr/local/go/src/testing/testing.go:467 +0x192
panic(0x5d5160, 0xc82000ada0)
/usr/local/go/src/runtime/panic.go:426 +0x4e9
_/vagrant._cgoCheckPointer0(0x58d080, 0xc82000ad80, 0xc82000ad90, 0x1, 0x1, 0x57a0e0)
??:0 +0x4d
_/vagrant.(*VirConnection).DomainEventRegister(0xc820047e80, 0x0, 0x0, 0xc820024078, 0xc82000ad70, 0x13)
/vagrant/libvirt.go:885 +0x25f
_/vagrant.TestDomainEventRegister(0xc8200aab40)
/vagrant/libvirt_test.go:839 +0x23b
testing.tRunner(0xc8200aab40, 0x90fc20)
/usr/local/go/src/testing/testing.go:473 +0x98
created by testing.RunTests
/usr/local/go/src/testing/testing.go:582 +0x892
exit status 2
FAIL _/vagrant 0.046s

Can we have a conditional build that doesn't support domain events? Without having cgo use a go-pointer, this is pretty difficult to solve, because the libvirt C bindings need to make the callback to Go code........ unless we used some complicated multi-threaded solution that allowed a Cgo thread to wakeup when the notification was received in C-land.............

@rgbkrk @anuaimi I've pushed a fix. Review please? #65

conversation resumed in #69