From: Paul Durrant <Paul.Durrant@citrix.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Anthony Perard <anthony.perard@citrix.com>,
Ian Jackson <Ian.Jackson@citrix.com>,
Wei Liu <wei.liu2@citrix.com>
Subject: Re: [PATCH] tools/xenstore: Document failure for xs_{read, directory, read_watch}
Date: Wed, 5 Dec 2018 16:28:00 +0000 [thread overview]
Message-ID: <888139d1a4a64e6980da35e29b689cbb@AMSPEX02CL03.citrite.net> (raw)
In-Reply-To: <20181205162603.25788-1-anthony.perard@citrix.com>
> -----Original Message-----
> From: Anthony PERARD [mailto:anthony.perard@citrix.com]
> Sent: 05 December 2018 16:26
> To: xen-devel@lists.xenproject.org
> Cc: Paul Durrant <Paul.Durrant@citrix.com>; Anthony Perard
> <anthony.perard@citrix.com>; Ian Jackson <Ian.Jackson@citrix.com>; Wei Liu
> <wei.liu2@citrix.com>
> Subject: [PATCH] tools/xenstore: Document failure for
> xs_{read,directory,read_watch}
>
> Those functions can return NULL on failure, document it in the public
> header.
>
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
> ---
> tools/xenstore/include/xenstore.h | 7 +++++--
> tools/xenstore/xs.c | 1 +
> 2 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/tools/xenstore/include/xenstore.h
> b/tools/xenstore/include/xenstore.h
> index 889dc23863..42b2866462 100644
> --- a/tools/xenstore/include/xenstore.h
> +++ b/tools/xenstore/include/xenstore.h
> @@ -103,6 +103,7 @@ void xs_daemon_destroy_postfork(struct xs_handle *);
> /* Get contents of a directory.
> * Returns a malloced array: call free() on it after use.
> * Num indicates size.
> + * Returns NULL on failure.
> */
> char **xs_directory(struct xs_handle *h, xs_transaction_t t,
> const char *path, unsigned int *num);
> @@ -110,6 +111,7 @@ char **xs_directory(struct xs_handle *h,
> xs_transaction_t t,
> /* Get the value of a single file, nul terminated.
> * Returns a malloced value: call free() on it after use.
> * len indicates length in bytes, not including terminator.
> + * Returns NULL on failure.
> */
> void *xs_read(struct xs_handle *h, xs_transaction_t t,
> const char *path, unsigned int *len);
> @@ -196,8 +198,9 @@ int xs_fileno(struct xs_handle *h);
> char **xs_check_watch(struct xs_handle *h);
>
> /* Find out what node change was on (will block if nothing pending).
> - * Returns array containing the path and token. Use XS_WATCH_* to access
> these
> - * elements. Call free() after use.
> + * Returns array containing the path and token, or NULL.
> + * Use XS_WATCH_* to access these elements.
> + * Call free() after use.
> */
> char **xs_read_watch(struct xs_handle *h, unsigned int *num);
>
> diff --git a/tools/xenstore/xs.c b/tools/xenstore/xs.c
> index 77700bff2b..87e43bfe87 100644
> --- a/tools/xenstore/xs.c
> +++ b/tools/xenstore/xs.c
> @@ -680,6 +680,7 @@ char **xs_directory(struct xs_handle *h,
> xs_transaction_t t,
> /* Get the value of a single file, nul terminated.
> * Returns a malloced value: call free() on it after use.
> * len indicates length in bytes, not including the nul.
> + * Returns NULL on failure.
> */
> void *xs_read(struct xs_handle *h, xs_transaction_t t,
> const char *path, unsigned int *len)
> --
> Anthony PERARD
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2018-12-05 16:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-05 16:26 [PATCH] tools/xenstore: Document failure for xs_{read, directory, read_watch} Anthony PERARD
2018-12-05 16:28 ` Paul Durrant [this message]
2018-12-06 11:36 ` Wei Liu
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=888139d1a4a64e6980da35e29b689cbb@AMSPEX02CL03.citrite.net \
--to=paul.durrant@citrix.com \
--cc=Ian.Jackson@citrix.com \
--cc=anthony.perard@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).