@@ -122,7 +122,7 @@ type Uuid C.libxl_uuid
type Context struct {
ctx *C.libxl_ctx
- logger *C.xentoollog_logger_stdiostream
+ logger *C.xentoollog_logger
}
type Hwcap []C.uint32_t
@@ -847,14 +847,15 @@ func (Ctx *Context) Open() (err error) {
return
}
- Ctx.logger = C.xtl_createlogger_stdiostream(C.stderr, C.XTL_ERROR, 0)
+ Ctx.logger = (*C.xentoollog_logger)(unsafe.Pointer(
+ C.xtl_createlogger_stdiostream(C.stderr, C.XTL_ERROR, 0)))
if Ctx.logger == nil {
err = fmt.Errorf("Cannot open stdiostream")
return
}
ret := C.libxl_ctx_alloc(&Ctx.ctx, C.LIBXL_VERSION,
- 0, (*C.xentoollog_logger)(unsafe.Pointer(Ctx.logger)))
+ 0, Ctx.logger)
if ret != 0 {
err = Error(-ret)
@@ -869,7 +870,7 @@ func (Ctx *Context) Close() (err error) {
if ret != 0 {
err = Error(-ret)
}
- C.xtl_logger_destroy((*C.xentoollog_logger)(unsafe.Pointer(Ctx.logger)))
+ C.xtl_logger_destroy(Ctx.logger)
return
}