[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH RFC 3/8] golang/xenlight: Add host-related functionality
On 23/01/17 16:43, Ronald Rojas wrote: > Add calls for the following host-related functionality: > - libxl_get_max_cpus > - libxl_get_online_cpus > - libxl_get_max_nodes > - libxl_get_free_memory > - libxl_get_physinfo > - libxl_get_version_info > > Include Golang versions of the following structs: > - libxl_physinfo as Physinfo > - libxl_version_info as VersionInfo > - libxl_hwcap as Hwcap > > Signed-off-by: Ronald Rojas <ronladred@xxxxxxxxx> Mostly looks good! One final comment: [snip] > +//int libxl_get_physinfo(libxl_ctx *ctx, libxl_physinfo *physinfo) > +func (Ctx *Context) GetPhysinfo() (physinfo *Physinfo, err error) { > + err = Ctx.CheckOpen() > + if err != nil { > + return > + } > + var cphys C.libxl_physinfo > + > + ret := C.libxl_get_physinfo(Ctx.ctx, &cphys) So I actually forgot that you're actually supposed to always call "libxl_<type>_init()" on IDL-generated types before using them, and "libxl_<type>_dispose()" when you're done with them. As it happens in this case, the struct contains no pointers to sub-structs; but if that changes in the future, this would leak the memory. Everything else is good, thanks. -George _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |