Ian Campbell
2012-Aug-02 09:22 UTC
[PATCH] libxl: const correctness for libxl__xs_path_cleanup
# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1343899348 -3600
# Node ID 075da4778b0a1a84680ef0acd26fcd3b01adeee4
# Parent e638a0aeb9856003661aa75d684855c6fd940b3c
libxl: const correctness for libxl__xs_path_cleanup
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
diff -r e638a0aeb985 -r 075da4778b0a tools/libxl/libxl_device.c
--- a/tools/libxl/libxl_device.c Thu Aug 02 09:59:33 2012 +0100
+++ b/tools/libxl/libxl_device.c Thu Aug 02 10:22:28 2012 +0100
@@ -523,7 +523,7 @@ DEFINE_DEVICES_ADD(nic)
int libxl__device_destroy(libxl__gc *gc, libxl__device *dev)
{
char *be_path = libxl__device_backend_path(gc, dev);
- char *fe_path = libxl__device_frontend_path(gc, dev);
+ const char *fe_path = libxl__device_frontend_path(gc, dev);
xs_transaction_t t = 0;
int rc;
diff -r e638a0aeb985 -r 075da4778b0a tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h Thu Aug 02 09:59:33 2012 +0100
+++ b/tools/libxl/libxl_internal.h Thu Aug 02 10:22:28 2012 +0100
@@ -614,7 +614,7 @@ void libxl__xs_transaction_abort(libxl__
* It mimics xenstore-rm -t behaviour.
*/
_hidden int libxl__xs_path_cleanup(libxl__gc *gc, xs_transaction_t t,
- char *user_path);
+ const char *user_path);
/*
* Event generation functions provided by the libxl event core to the
diff -r e638a0aeb985 -r 075da4778b0a tools/libxl/libxl_xshelp.c
--- a/tools/libxl/libxl_xshelp.c Thu Aug 02 09:59:33 2012 +0100
+++ b/tools/libxl/libxl_xshelp.c Thu Aug 02 10:22:28 2012 +0100
@@ -233,7 +233,8 @@ void libxl__xs_transaction_abort(libxl__
*t = 0;
}
-int libxl__xs_path_cleanup(libxl__gc *gc, xs_transaction_t t, char *user_path)
+int libxl__xs_path_cleanup(libxl__gc *gc, xs_transaction_t t,
+ const char *user_path)
{
unsigned int nb = 0;
char *path, *last, *val;
Ian Jackson
2012-Aug-02 14:17 UTC
Re: [PATCH] libxl: const correctness for libxl__xs_path_cleanup
Ian Campbell writes ("[PATCH] libxl: const correctness for
libxl__xs_path_cleanup"):> libxl: const correctness for libxl__xs_path_cleanup
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
>
> diff -r e638a0aeb985 -r 075da4778b0a tools/libxl/libxl_device.c
> --- a/tools/libxl/libxl_device.c Thu Aug 02 09:59:33 2012 +0100
> +++ b/tools/libxl/libxl_device.c Thu Aug 02 10:22:28 2012 +0100
> @@ -523,7 +523,7 @@ DEFINE_DEVICES_ADD(nic)
> int libxl__device_destroy(libxl__gc *gc, libxl__device *dev)
> {
> char *be_path = libxl__device_backend_path(gc, dev);
> - char *fe_path = libxl__device_frontend_path(gc, dev);
> + const char *fe_path = libxl__device_frontend_path(gc, dev);
I don''t understand why this is needed (or a good thing) for one but
not the other.
Ian.
Ian Campbell
2012-Aug-02 14:21 UTC
Re: [PATCH] libxl: const correctness for libxl__xs_path_cleanup
On Thu, 2012-08-02 at 15:17 +0100, Ian Jackson wrote:> Ian Campbell writes ("[PATCH] libxl: const correctness for libxl__xs_path_cleanup"): > > libxl: const correctness for libxl__xs_path_cleanup > > > > Signed-off-by: Ian Campbell <ian.campbell@citrix.com> > > > > diff -r e638a0aeb985 -r 075da4778b0a tools/libxl/libxl_device.c > > --- a/tools/libxl/libxl_device.c Thu Aug 02 09:59:33 2012 +0100 > > +++ b/tools/libxl/libxl_device.c Thu Aug 02 10:22:28 2012 +0100 > > @@ -523,7 +523,7 @@ DEFINE_DEVICES_ADD(nic) > > int libxl__device_destroy(libxl__gc *gc, libxl__device *dev) > > { > > char *be_path = libxl__device_backend_path(gc, dev); > > - char *fe_path = libxl__device_frontend_path(gc, dev); > > + const char *fe_path = libxl__device_frontend_path(gc, dev); > > I don''t understand why this is needed (or a good thing) for one but > not the other.be_path becomes const in the next patch, after the non-const user is removed.
Ian Jackson
2012-Aug-02 14:46 UTC
Re: [PATCH] libxl: const correctness for libxl__xs_path_cleanup
Ian Campbell writes ("Re: [PATCH] libxl: const correctness for
libxl__xs_path_cleanup"):> On Thu, 2012-08-02 at 15:17 +0100, Ian Jackson wrote:
> > I don''t understand why this is needed (or a good thing) for
one but
> > not the other.
>
> be_path becomes const in the next patch, after the non-const user is
> removed.
OK then:
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Thanks,
Ian.
Ian Campbell
2012-Aug-03 09:01 UTC
Re: [PATCH] libxl: const correctness for libxl__xs_path_cleanup
On Thu, 2012-08-02 at 15:46 +0100, Ian Jackson wrote:> Ian Campbell writes ("Re: [PATCH] libxl: const correctness for libxl__xs_path_cleanup"): > > On Thu, 2012-08-02 at 15:17 +0100, Ian Jackson wrote: > > > I don''t understand why this is needed (or a good thing) for one but > > > not the other. > > > > be_path becomes const in the next patch, after the non-const user is > > removed. > > OK then: > > Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>Applied, thanks,