[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH RFC 1/8] golang/xenlight: Create stub package



On Mon, Jan 23, 2017 at 4:43 PM, Ronald Rojas <ronladred@xxxxxxxxx> wrote:

> +func (Ctx *Context) Open() (err error) {
> +       if Ctx.ctx != nil {
> +               return
> +       }
> +
> +       ret := C.libxl_ctx_alloc(unsafe.Pointer(&Ctx.ctx), C.LIBXL_VERSION, 
> 0, nil)

Just discovered there's a bug here (in code that I wrote obviously) --
you can't pass the last argument as nil; you have to include a logger.
Otherwise if you ever get an error you'll get a NULL dereference. :-)

I think the fastest thing to do to begin with would be to create a
"null" logger that just throws away all the data.  Then at some point
(possibly not in your internship) someone can think about what a
proper logging interface looks like.

 -George

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.