xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: George Dunlap <george.dunlap@citrix.com>
To: Ronald Rojas <ronladred@gmail.com>,
	xen-devel@lists.xen.org, ian.jackson@eu.citrix.com,
	wei.liu2@citrix.com
Subject: Re: [PATCH RFC 3/8] golang/xenlight: Add host-related functionality
Date: Wed, 1 Feb 2017 15:53:13 +0000	[thread overview]
Message-ID: <973985e7-ea81-3da3-e5c5-47fe13d9ee7a@citrix.com> (raw)
In-Reply-To: <20170123164337.4205-3-ronladred@gmail.com>

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@gmail.com>

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@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-02-01 15:53 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-23 16:43 [PATCH RFC 1/8] golang/xenlight: Create stub package Ronald Rojas
2017-01-23 16:43 ` [PATCH RFC 2/8] golang/xenlight: Add error constants and standard handling Ronald Rojas
2017-01-27 12:22   ` George Dunlap
2017-01-23 16:43 ` [PATCH RFC 3/8] golang/xenlight: Add host-related functionality Ronald Rojas
2017-02-01 15:53   ` George Dunlap [this message]
2017-02-01 15:58   ` George Dunlap
2017-02-01 16:05   ` George Dunlap
2017-01-23 16:43 ` [PATCH RFC 4/8] golang/xenlight: Implement libxl_domain_info and libxl_domain_unpause Ronald Rojas
2017-02-01 16:16   ` George Dunlap
2017-01-23 16:43 ` [PATCH RFC 5/8] golang/xenlight: Add tests host related functinality functions Ronald Rojas
2017-02-01 17:39   ` George Dunlap
2017-01-23 16:43 ` [PATCH RFC 6/8] golang/xenlight: Implement libxl_bitmap and helper operations Ronald Rojas
2017-02-01 17:59   ` George Dunlap
2017-01-23 16:43 ` [PATCH RFC 7/8] golang/xenlight: Implement libxl_scheduler enumeration Ronald Rojas
2017-02-01 18:13   ` George Dunlap
2017-01-23 16:43 ` [PATCH RFC 8/8] golang/xenlight: Implement cpupool operations Ronald Rojas
2017-01-25 16:55 ` [PATCH RFC 1/8] golang/xenlight: Create stub package Wei Liu
2017-01-26  8:13   ` Ronald Rojas
2017-01-25 17:16 ` George Dunlap
2017-01-26  8:26   ` Ronald Rojas
2017-01-26 10:44   ` Ian Jackson
2017-01-26 11:26     ` George Dunlap
2017-01-27 11:43 ` George Dunlap
2017-01-27 19:40 ` George Dunlap
  -- strict thread matches above, loose matches on Subject: below --
2017-01-18 19:56 Ronald Rojas
2017-01-18 19:56 ` [PATCH RFC 3/8] golang/xenlight: Add host-related functionality Ronald Rojas
2017-01-19 17:51   ` George Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=973985e7-ea81-3da3-e5c5-47fe13d9ee7a@citrix.com \
    --to=george.dunlap@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=ronladred@gmail.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).