From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Wei Liu <wei.liu2@citrix.com>, xen-devel@lists.xen.org
Cc: Ian Jackson <ian.jackson@eu.citrix.com>,
Ian Campbell <ian.campbell@citrix.com>
Subject: Re: [PATCH v2 for-4.5 1/2] libxl: un-constify return value of libxl_basename
Date: Tue, 2 Dec 2014 18:44:50 +0000 [thread overview]
Message-ID: <547E08A2.2030608@citrix.com> (raw)
In-Reply-To: <1417433473-17272-2-git-send-email-wei.liu2@citrix.com>
On 01/12/14 11:31, Wei Liu wrote:
> The string returned is malloc'ed but marked as "const".
>
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> Cc: Ian Campbell <ian.campbell@citrix.com>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> ---
> tools/libxl/libxl.h | 10 ++++++++++
> tools/libxl/libxl_utils.c | 5 ++++-
> tools/libxl/libxl_utils.h | 6 +++++-
> 3 files changed, 19 insertions(+), 2 deletions(-)
>
> diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
> index 41d6e8d..291c190 100644
> --- a/tools/libxl/libxl.h
> +++ b/tools/libxl/libxl.h
> @@ -478,6 +478,16 @@ typedef struct libxl__ctx libxl_ctx;
> #endif
>
> /*
> + * LIBXL_HAVE_CONST_LIBXL_BASENAME_RETURN_VALUE
> + *
> + * The return value of libxl_basename is malloc'ed but the erroneously
> + * marked as "const" in releases before 4.5.
> + */
> +#if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x040500
> +#define LIBXL_HAVE_CONST_LIBXL_BASENAME_RETURN_VALUE 1
> +#endif
This define is currently useless. Only newer code is capable of making
use of newly introduced LIBXL_HAVE_$FOO flags, and with its current
arrangement, this flag is only exposed to code requesting an older API
version.
This instead needs to be LIBXL_HAVE_NONCONST_LIBXL_BASENAME_RETURN_VALUE
which should be 1 for any API version >= 4.5
~Andrew
next prev parent reply other threads:[~2014-12-02 18:44 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-01 11:31 [PATCH v2 for-4.5 0/2] xl/libxl: fix API and two memory leaks Wei Liu
2014-12-01 11:31 ` [PATCH v2 for-4.5 1/2] libxl: un-constify return value of libxl_basename Wei Liu
2014-12-02 18:44 ` Andrew Cooper [this message]
2014-12-03 9:51 ` Ian Campbell
2014-12-01 11:31 ` [PATCH v2 for-4.5 2/2] xl: fix two memory leaks Wei Liu
2014-12-02 14:19 ` Ian Campbell
2014-12-02 14:23 ` Wei Liu
2014-12-01 11:40 ` [PATCH v2 for-4.5 0/2] xl/libxl: fix API and " Ian Campbell
2014-12-01 11:50 ` Wei Liu
2014-12-01 11:51 ` Ian Campbell
2014-12-01 21:54 ` Konrad Rzeszutek Wilk
2014-12-02 15:35 ` Ian Campbell
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=547E08A2.2030608@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=wei.liu2@citrix.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.