All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Juergen Gross <jgross@suse.com>
Cc: wei.liu2@citrix.com, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org
Subject: Re: [PATCH v2 3/5] xenstore: add explicit memory context parameter to read_node()
Date: Tue, 19 Jul 2016 11:04:56 +0100	[thread overview]
Message-ID: <20160719100456.GK13180@citrix.com> (raw)
In-Reply-To: <1468827089-9054-4-git-send-email-jgross@suse.com>

On Mon, Jul 18, 2016 at 09:31:27AM +0200, Juergen Gross wrote:
> Add a parameter to xenstored read_node() function to explicitly
> specify the memory context to be used for allocations. This will make
> it easier to avoid memory leaks by using a context which is freed
> soon.
> 
> When calling read_node() select a sensible memory context for the new
> parameter by preferring a temporary one.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>
> ---
>  tools/xenstore/xenstored_core.c | 24 +++++++++++++-----------
>  1 file changed, 13 insertions(+), 11 deletions(-)
> 
> diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
> index 9448ee8..e5c74f4 100644
> --- a/tools/xenstore/xenstored_core.c
> +++ b/tools/xenstore/xenstored_core.c
> @@ -398,7 +398,8 @@ bool is_child(const char *child, const char *parent)
>  }
>  
>  /* If it fails, returns NULL and sets errno. */
> -static struct node *read_node(struct connection *conn, const char *name)
> +static struct node *read_node(struct connection *conn, const void *mem,
> +			      const char *name)

Same here: mem -> ctx or context.

Reviewed-by: Wei Liu <wei.liu2@citrix.com>

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

  reply	other threads:[~2016-07-19 10:04 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-18  7:31 [PATCH v2 0/5] xenstore: fix memory leak of xenstored Juergen Gross
2016-07-18  7:31 ` [PATCH v2 1/5] xenstore: call each xenstored command function with temporary context Juergen Gross
2016-07-19 10:04   ` Wei Liu
2016-07-19 10:35   ` Ian Jackson
2016-07-18  7:31 ` [PATCH v2 2/5] xenstore: add explicit memory context parameter to get_parent() Juergen Gross
2016-07-19 10:04   ` Wei Liu
2016-07-19 10:37     ` Ian Jackson
2016-07-19 10:37   ` Ian Jackson
2016-07-18  7:31 ` [PATCH v2 3/5] xenstore: add explicit memory context parameter to read_node() Juergen Gross
2016-07-19 10:04   ` Wei Liu [this message]
2016-07-19 10:38     ` Ian Jackson
2016-07-18  7:31 ` [PATCH v2 4/5] xenstore: add explicit memory context parameter to get_node() Juergen Gross
2016-07-19 10:05   ` Wei Liu
2016-07-19 10:39     ` Ian Jackson
2016-07-18  7:31 ` [PATCH v2 5/5] xenstore: use temporary memory context for firing watches Juergen Gross
2016-07-19 10:23   ` Wei Liu
2016-07-19 10:40     ` Ian Jackson

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=20160719100456.GK13180@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jgross@suse.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 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.