func (c *VirConnection) SetErrorFunc(cb ErrorCallback, opaque func()) { c.UnsetErrorFunc() context := &errorContext{ cb: cb, f: opaque, } goCallbackId := registerCallbackId(context) callbackPtr := unsafe.Pointer(C.errorConnCallback_cgo) C.virConnSetErrorFunc_cgo(c.ptr, C.long(goCallbackId), C.virErrorFunc(callbackPtr)) connData := getConnectionData(c) connData.errCallbackId = &goCallbackId }
func init() { // libvirt won't print to stderr C.virSetErrorFunc(nil, C.virErrorFunc(unsafe.Pointer(C.virErrorFuncDummy))) }
func init() { C.virSetErrorFunc(nil, C.virErrorFunc(unsafe.Pointer(C.errorGlobalCallback_cgo))) }
func init() { // Supress the native error output. There's no way to do this per // connection, so we have to do this globally. C.virSetErrorFunc(nil, C.virErrorFunc(unsafe.Pointer(C.emptyErrorFunc))) }