All of lore.kernel.org
 help / color / mirror / Atom feed
From: George Dunlap <george.dunlap@citrix.com>
To: Nick Rosbrook <rosbrookn@gmail.com>
Cc: Nick Rosbrook <rosbrookn@ainfosec.com>,
	Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [Xen-devel] [PATCH v4 3/3] golang/xenlight: Implement DomainCreateNew
Date: Wed, 11 Mar 2020 15:10:36 +0000	[thread overview]
Message-ID: <bd6f753d-d949-110a-c981-d7561fb4569d@citrix.com> (raw)
In-Reply-To: <CAEBZRSfBMyaaM60uyD+AxM0m0AMLGTriKBVvuAoEX7ki7a0JAQ@mail.gmail.com>

On 3/11/20 2:59 PM, Nick Rosbrook wrote:
> Looks good, I just have two small comments:
> 
>> diff --git a/tools/golang/xenlight/xenlight.go b/tools/golang/xenlight/xenlight.go
>> index 56fa31fd7b..808b4a327c 100644
>> --- a/tools/golang/xenlight/xenlight.go
>> +++ b/tools/golang/xenlight/xenlight.go
>> @@ -1111,3 +1111,24 @@ func (Ctx *Context) PrimaryConsoleGetTty(domid uint32) (path string, err error)
>>         path = C.GoString(cpath)
>>         return
>>  }
>> +
>> +// int libxl_domain_create_new(libxl_ctx *ctx, libxl_domain_config *d_config,
>> +//                             uint32_t *domid,
>> +//                             const libxl_asyncop_how *ao_how,
>> +//                             const libxl_asyncprogress_how *aop_console_how)
> 
> Conventionally, we want to have comments for exported functions along
> the lines of:
> 
>     // DomainCreateNew creates a new domain with config, and returns
> its Domid on success.
>     // A non-nil error is returned if config cannot be marshaled, or
> an error occurs within libxl.
> 
> Besides being easier to read, it makes documentation more clear on
> godoc/pkg.go.dev.

Yes, absolutely, that's something we need to change before we declare
"1.0".  But that should probably be done in a series which changes all
such comments together.

>> +func (Ctx *Context) DomainCreateNew(config *DomainConfig) (Domid, error) {
> 
> Capitalizing "Ctx" here is a little weird to me. Since it's only the
> receiver name, there's no effect, but since capitalized identifiers
> have special-meaning in other contexts, I would avoid doing this.

I c&p'd this from another method and just changed the signature.  It
probably would be good to make all of them lower-case.  I may change
this one on check in though.

> I only point those out in case you want to change it on check-in. Besides that,
> 
> Reviewed-by: Nick Rosbrook <rosbrookn@ainfosec.com>

Thanks!

 -George

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2020-03-11 15:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-09 14:49 [Xen-devel] [PATCH v4 1/3] golang/xenlight: Don't try to marshall zero-length arrays in fromC George Dunlap
2020-03-09 14:49 ` [Xen-devel] [PATCH v4 2/3] golang/xenlight: Notify xenlight of SIGCHLD George Dunlap
2020-03-11 14:32   ` Nick Rosbrook
2020-03-09 14:49 ` [Xen-devel] [PATCH v4 3/3] golang/xenlight: Implement DomainCreateNew George Dunlap
2020-03-11 14:59   ` Nick Rosbrook
2020-03-11 15:10     ` George Dunlap [this message]
2020-03-11 14:17 ` [Xen-devel] [PATCH v4 1/3] golang/xenlight: Don't try to marshall zero-length arrays in fromC Nicholas Rosbrook

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=bd6f753d-d949-110a-c981-d7561fb4569d@citrix.com \
    --to=george.dunlap@citrix.com \
    --cc=rosbrookn@ainfosec.com \
    --cc=rosbrookn@gmail.com \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.