[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2 4/5] xenstore: add explicit memory context parameter to get_node()



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@xxxxxxxx>
> ---
>  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@xxxxxxxxxx>

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.