xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Dario Faggioli <dario.faggioli@citrix.com>
To: Lasya <comethalley61@gmail.com>,
	xen-devel@lists.xenproject.org, george.dunlap@citrix.com,
	lars.kurth@citrix.com, wei.liu2@citrix.com,
	ian.campbell@citrix.com
Subject: Re: [PATCH v3] dom variable error handled in Xenstore
Date: Wed, 28 Oct 2015 02:00:47 +0100	[thread overview]
Message-ID: <1445994047.2937.238.camel@citrix.com> (raw)
In-Reply-To: <1445991143-9165-1-git-send-email-comethalley61@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 2413 bytes --]

On Wed, 2015-10-28 at 05:42 +0530, Lasya wrote:
> xc_dom_allocate function in build function in init-xenstore-domain.c
> returns NULL on failure. 
> In that case, variable rv is set to ENOMEM and directed to failure
> path err.  
> 
> 
So, about the subject line:
 - we want tags (as in "tag: does some stuff"), in order to help people
   figure out quickly (and/or filter in their mail readers) what
   component of Xen the patch is about. In your case, a suitable tag
   would be "tools/xenstore:", or even just "xenstore:";
 - it should hint at and summarize very very briefly what is being
   done. In this case, for instance, something like this:
   "xenstore: check for domain allocation errors".

About the actual changelog:
 - wrap lines a bit more, ideally around 70 characters per line. The
   point being, it should display well in things like `git log', which
   typically indents it a bit;
 - it should describe what the patch does, at a higher abstraction
   level (e.g., why the patch is necessary, why a particular approach
   has been taken, etc.). What you have up here, can pretty much all
   be inferred already reading the code. So, for instance, something
   like this:
   "When building xenstore domain, failure at allocating the memory
    for it was not handled. Fix that"
 - since you are (I think) fixing an issue identified by Coverity,
   you should mention the Coverity ID in the changelog somehow as well.

About the code:

> Signed-off-by: Lasya Venneti <comethalley61@gmail.com>

> diff --git a/tools/xenstore/init-xenstore-domain.c 
> @@ -42,6 +42,10 @@ static int build(xc_interface *xch, int argc,
> char** argv)
>  	snprintf(cmdline, 512, "--event %d --internal-db", rv);
>  
>  	dom = xc_dom_allocate(xch, cmdline, NULL);
> +	if (dom == NULL) {
> +		rv = ENOMEM;
> +		goto err;
> +	}
>
On what basis did you decide that ENOMEM was a good return value?

I mean, have you checked what kind of value / error code is being
returned in the other cases (e.g., , xc_domain_setmaxmem(),
xc_domain_max_vcpus(), etc), if something goes wrong?

Thanks and Regards,
Dario
-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

  reply	other threads:[~2015-10-28  1:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-28  0:12 [PATCH v3] dom variable error handled in Xenstore Lasya
2015-10-28  1:00 ` Dario Faggioli [this message]
2015-10-28 19:12   ` Lasya Venneti
2015-10-29 10:07     ` Wei Liu
2015-10-29 10:11       ` Dario Faggioli
2015-10-29 14:58         ` Lasya Venneti
2015-10-30 14:28           ` Dario Faggioli
2015-11-02 12:03             ` Ian Campbell
2015-10-29 10:08     ` Dario Faggioli

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=1445994047.2937.238.camel@citrix.com \
    --to=dario.faggioli@citrix.com \
    --cc=comethalley61@gmail.com \
    --cc=george.dunlap@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=lars.kurth@citrix.com \
    --cc=wei.liu2@citrix.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 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).