xen-devel.lists.xenproject.org archive mirror
 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 4/5] xenstore: add explicit memory context parameter to get_node()
Date: Tue, 19 Jul 2016 11:05:05 +0100	[thread overview]
Message-ID: <20160719100505.GL13180@citrix.com> (raw)
In-Reply-To: <1468827089-9054-5-git-send-email-jgross@suse.com>

On Mon, Jul 18, 2016 at 09:31:28AM +0200, Juergen Gross wrote:
> Add a parameter to xenstored get_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.
> 
> This requires adding the temporary context to errno_from_parents() and
> ask_parents(), too.
> 
> When calling get_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  | 33 ++++++++++++++++++---------------
>  tools/xenstore/xenstored_core.h  |  1 +
>  tools/xenstore/xenstored_watch.c |  2 +-
>  3 files changed, 20 insertions(+), 16 deletions(-)
> 
> diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
> index e5c74f4..095ba00 100644
> --- a/tools/xenstore/xenstored_core.c
> +++ b/tools/xenstore/xenstored_core.c
> @@ -517,13 +517,14 @@ static char *get_parent(const void *mem, const char *node)
>  }
>  
>  /* What do parents say? */
> -static enum xs_perm_type ask_parents(struct connection *conn, const char *name)
> +static enum xs_perm_type ask_parents(struct connection *conn, const void *mem,
> +				     const char *name)

mem -> ctx or context here and other places.

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:05 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
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 [this message]
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=20160719100505.GL13180@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 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).