Skip to contentSkip to conversation

libxl: expose #define to 4.5 and above

PATCH Applied Wei Liu 4 participants 5 messages Dec 3, 2014 – Dec 4, 2014

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

PATCH 1/1 libxl: expose #define to 4.5 and above

In e3abab74 (libxl: un-constify return value of libxl_basename), the macro was exposed to releases < 4.5. However only new code is able to make use of that macro so it should be exposed to releases >= 4.5.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
Cc Andrew Cooper <[email protected]>
---
 tools/libxl/libxl.h       |    6 +++---
 tools/libxl/libxl_utils.c |    2 +-
 tools/libxl/libxl_utils.h |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)
tools/libxl/libxl.h +3 -3
index 291c190..0a123f1 100644
@@ -478,13 +478,13 @@ typedef struct libxl__ctx libxl_ctx;
 #endif
 
 /*
- * LIBXL_HAVE_CONST_LIBXL_BASENAME_RETURN_VALUE
+ * LIBXL_HAVE_NONCONST_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
+#if !defined(LIBXL_API_VERSION) || LIBXL_API_VERSION >= 0x040500
+#define LIBXL_HAVE_NONCONST_LIBXL_BASENAME_RETURN_VALUE 1
 #endif
 
 /*
tools/libxl/libxl_utils.c +1 -1
index 22119fc..7095b58 100644
@@ -19,7 +19,7 @@
 
 #include "libxl_internal.h"
 
-#ifdef LIBXL_HAVE_CONST_LIBXL_BASENAME_RETURN_VALUE
+#ifndef LIBXL_HAVE_NONCONST_LIBXL_BASENAME_RETURN_VALUE
 const
 #endif
 char *libxl_basename(const char *name)
tools/libxl/libxl_utils.h +1 -1
index 8277eb9..acacdd9 100644
@@ -18,7 +18,7 @@
 
 #include "libxl.h"
 
-#ifdef LIBXL_HAVE_CONST_LIBXL_BASENAME_RETURN_VALUE
+#ifndef LIBXL_HAVE_NONCONST_LIBXL_BASENAME_RETURN_VALUE
 const
 #endif
 char *libxl_basename(const char *name); /* returns string from strdup */
Signature · 1 line
1.7.10.4
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Wei Liu

In e3abab74 (libxl: un-constify return value of libxl_basename), the macro was exposed to releases < 4.5. However only new code is able to make use of that macro so it should be exposed to releases >= 4.5.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
Cc Andrew Cooper <[email protected]>

Konrad, given that the original patch is in 4.5 (as of yesterday) we should obviously take this one too.

Quoted 53 lines
---
 tools/libxl/libxl.h       |    6 +++---
 tools/libxl/libxl_utils.c |    2 +-
 tools/libxl/libxl_utils.h |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)
tools/libxl/libxl.h +3 -3
index 291c190..0a123f1 100644
@@ -478,13 +478,13 @@ typedef struct libxl__ctx libxl_ctx;
 #endif
 
 /*
- * LIBXL_HAVE_CONST_LIBXL_BASENAME_RETURN_VALUE
+ * LIBXL_HAVE_NONCONST_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
+#if !defined(LIBXL_API_VERSION) || LIBXL_API_VERSION >= 0x040500
+#define LIBXL_HAVE_NONCONST_LIBXL_BASENAME_RETURN_VALUE 1
 #endif
 
 /*
tools/libxl/libxl_utils.c +1 -1
index 22119fc..7095b58 100644
@@ -19,7 +19,7 @@
 
 #include "libxl_internal.h"
 
-#ifdef LIBXL_HAVE_CONST_LIBXL_BASENAME_RETURN_VALUE
+#ifndef LIBXL_HAVE_NONCONST_LIBXL_BASENAME_RETURN_VALUE
 const
 #endif
 char *libxl_basename(const char *name)
tools/libxl/libxl_utils.h +1 -1
index 8277eb9..acacdd9 100644
@@ -18,7 +18,7 @@
 
 #include "libxl.h"
 
-#ifdef LIBXL_HAVE_CONST_LIBXL_BASENAME_RETURN_VALUE
+#ifndef LIBXL_HAVE_NONCONST_LIBXL_BASENAME_RETURN_VALUE
 const
 #endif
 char *libxl_basename(const char *name); /* returns string from strdup */
#2 lore raw
Quoted 10 lines · Ian Campbell
Quoted 8 lines · Wei Liu

In e3abab74 (libxl: un-constify return value of libxl_basename), the macro was exposed to releases < 4.5. However only new code is able to make use of that macro so it should be exposed to releases >= 4.5.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
Cc Andrew Cooper <[email protected]>
Quoted 4 lines

Konrad, given that the original patch is in 4.5 (as of yesterday) we should obviously take this one too.

Right. Release-Acked-by: Konrad Rzeszutek Wilk <[email protected]>

Quoted 56 lines
Quoted 54 lines
---
 tools/libxl/libxl.h       |    6 +++---
 tools/libxl/libxl_utils.c |    2 +-
 tools/libxl/libxl_utils.h |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)
tools/libxl/libxl.h +3 -3
index 291c190..0a123f1 100644
@@ -478,13 +478,13 @@ typedef struct libxl__ctx libxl_ctx;
 #endif
 
 /*
- * LIBXL_HAVE_CONST_LIBXL_BASENAME_RETURN_VALUE
+ * LIBXL_HAVE_NONCONST_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
+#if !defined(LIBXL_API_VERSION) || LIBXL_API_VERSION >= 0x040500
+#define LIBXL_HAVE_NONCONST_LIBXL_BASENAME_RETURN_VALUE 1
 #endif
 
 /*
tools/libxl/libxl_utils.c +1 -1
index 22119fc..7095b58 100644
@@ -19,7 +19,7 @@
 
 #include "libxl_internal.h"
 
-#ifdef LIBXL_HAVE_CONST_LIBXL_BASENAME_RETURN_VALUE
+#ifndef LIBXL_HAVE_NONCONST_LIBXL_BASENAME_RETURN_VALUE
 const
 #endif
 char *libxl_basename(const char *name)
tools/libxl/libxl_utils.h +1 -1
index 8277eb9..acacdd9 100644
@@ -18,7 +18,7 @@
 
 #include "libxl.h"
 
-#ifdef LIBXL_HAVE_CONST_LIBXL_BASENAME_RETURN_VALUE
+#ifndef LIBXL_HAVE_NONCONST_LIBXL_BASENAME_RETURN_VALUE
 const
 #endif
 char *libxl_basename(const char *name); /* returns string from strdup */
Applied
#3 lore raw
Quoted 11 lines · Konrad Rzeszutek Wilk
Quoted 10 lines · Ian Campbell
Quoted 8 lines · Wei Liu

In e3abab74 (libxl: un-constify return value of libxl_basename), the macro was exposed to releases < 4.5. However only new code is able to make use of that macro so it should be exposed to releases >= 4.5.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
Cc Andrew Cooper <[email protected]>
Quoted 6 lines
Quoted 4 lines

Konrad, given that the original patch is in 4.5 (as of yesterday) we should obviously take this one too.

Right. Release-Acked-by: Konrad Rzeszutek Wilk <[email protected]>

Applied, thanks.

Reviewed-by on v1 1/1
#4 lore raw
In reply to Wei Liu
Quoted 7 lines · Wei Liu

In e3abab74 (libxl: un-constify return value of libxl_basename), the macro was exposed to releases < 4.5. However only new code is able to make use of that macro so it should be exposed to releases >= 4.5.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
Quoted 53 lines
---
 tools/libxl/libxl.h       |    6 +++---
 tools/libxl/libxl_utils.c |    2 +-
 tools/libxl/libxl_utils.h |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)
tools/libxl/libxl.h +3 -3
index 291c190..0a123f1 100644
@@ -478,13 +478,13 @@ typedef struct libxl__ctx libxl_ctx;
 #endif
 
 /*
- * LIBXL_HAVE_CONST_LIBXL_BASENAME_RETURN_VALUE
+ * LIBXL_HAVE_NONCONST_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
+#if !defined(LIBXL_API_VERSION) || LIBXL_API_VERSION >= 0x040500
+#define LIBXL_HAVE_NONCONST_LIBXL_BASENAME_RETURN_VALUE 1
 #endif
 
 /*
tools/libxl/libxl_utils.c +1 -1
index 22119fc..7095b58 100644
@@ -19,7 +19,7 @@
 
 #include "libxl_internal.h"
 
-#ifdef LIBXL_HAVE_CONST_LIBXL_BASENAME_RETURN_VALUE
+#ifndef LIBXL_HAVE_NONCONST_LIBXL_BASENAME_RETURN_VALUE
 const
 #endif
 char *libxl_basename(const char *name)
tools/libxl/libxl_utils.h +1 -1
index 8277eb9..acacdd9 100644
@@ -18,7 +18,7 @@
 
 #include "libxl.h"
 
-#ifdef LIBXL_HAVE_CONST_LIBXL_BASENAME_RETURN_VALUE
+#ifndef LIBXL_HAVE_NONCONST_LIBXL_BASENAME_RETURN_VALUE
 const
 #endif
 char *libxl_basename(const char *name); /* returns string from strdup */