* [PATCH for-4.5] tools/libxl: Fix building against libxl for LIBXL_API_VERSION < 0x040500
@ 2014-10-17 8:56 Andrew Cooper
2014-10-17 10:01 ` Wei Liu
2014-10-17 11:00 ` Ian Jackson
0 siblings, 2 replies; 10+ messages in thread
From: Andrew Cooper @ 2014-10-17 8:56 UTC (permalink / raw)
To: Xen-devel; +Cc: Andrew Cooper, Ian Jackson, Ian Campbell, Wei Liu
c/s 6276f66ebe "libxl: libxl_uuid_copy now takes a ctx argument" introduces
API compatibiltiy for libxl_uuid_copy() which sadly is not valid C. Fix it.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
---
tools/libxl/libxl_uuid.h | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tools/libxl/libxl_uuid.h b/tools/libxl/libxl_uuid.h
index 196b5bc..c5041c7 100644
--- a/tools/libxl/libxl_uuid.h
+++ b/tools/libxl/libxl_uuid.h
@@ -61,7 +61,12 @@ int libxl_uuid_from_string(libxl_uuid *uuid, const char *in);
void libxl_uuid_copy(libxl_ctx *ctx_opt, libxl_uuid *dst,
const libxl_uuid *src);
#if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x040500
-void libxl_uuid_copy(dst, src) libxl_uuid_copy(NULL, dst, src)
+void static inline libxl_uuid_copy_0x040400(libxl_uuid *dst,
+ const libxl_uuid *src)
+{
+ libxl_uuid_copy(NULL, dst, src);
+}
+#define libxl_uuid_copy libxl_uuid_copy_0x040400
#endif
void libxl_uuid_clear(libxl_uuid *uuid);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [PATCH for-4.5] tools/libxl: Fix building against libxl for LIBXL_API_VERSION < 0x040500
2014-10-17 8:56 [PATCH for-4.5] tools/libxl: Fix building against libxl for LIBXL_API_VERSION < 0x040500 Andrew Cooper
@ 2014-10-17 10:01 ` Wei Liu
2014-10-17 11:00 ` Ian Jackson
1 sibling, 0 replies; 10+ messages in thread
From: Wei Liu @ 2014-10-17 10:01 UTC (permalink / raw)
To: Andrew Cooper; +Cc: Wei Liu, Ian Jackson, Ian Campbell, Xen-devel
On Fri, Oct 17, 2014 at 09:56:19AM +0100, Andrew Cooper wrote:
> c/s 6276f66ebe "libxl: libxl_uuid_copy now takes a ctx argument" introduces
> API compatibiltiy for libxl_uuid_copy() which sadly is not valid C. Fix it.
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> CC: Ian Campbell <Ian.Campbell@citrix.com>
> CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
> CC: Wei Liu <wei.liu2@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
> ---
> tools/libxl/libxl_uuid.h | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/tools/libxl/libxl_uuid.h b/tools/libxl/libxl_uuid.h
> index 196b5bc..c5041c7 100644
> --- a/tools/libxl/libxl_uuid.h
> +++ b/tools/libxl/libxl_uuid.h
> @@ -61,7 +61,12 @@ int libxl_uuid_from_string(libxl_uuid *uuid, const char *in);
> void libxl_uuid_copy(libxl_ctx *ctx_opt, libxl_uuid *dst,
> const libxl_uuid *src);
> #if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x040500
> -void libxl_uuid_copy(dst, src) libxl_uuid_copy(NULL, dst, src)
> +void static inline libxl_uuid_copy_0x040400(libxl_uuid *dst,
> + const libxl_uuid *src)
> +{
> + libxl_uuid_copy(NULL, dst, src);
> +}
> +#define libxl_uuid_copy libxl_uuid_copy_0x040400
> #endif
>
> void libxl_uuid_clear(libxl_uuid *uuid);
> --
> 1.7.10.4
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH for-4.5] tools/libxl: Fix building against libxl for LIBXL_API_VERSION < 0x040500
2014-10-17 8:56 [PATCH for-4.5] tools/libxl: Fix building against libxl for LIBXL_API_VERSION < 0x040500 Andrew Cooper
2014-10-17 10:01 ` Wei Liu
@ 2014-10-17 11:00 ` Ian Jackson
2014-10-17 11:01 ` Andrew Cooper
1 sibling, 1 reply; 10+ messages in thread
From: Ian Jackson @ 2014-10-17 11:00 UTC (permalink / raw)
To: Andrew Cooper; +Cc: Wei Liu, Ian Campbell, Xen-devel
Andrew Cooper writes ("[PATCH for-4.5] tools/libxl: Fix building against libxl for LIBXL_API_VERSION < 0x040500"):
> c/s 6276f66ebe "libxl: libxl_uuid_copy now takes a ctx argument" introduces
> API compatibiltiy for libxl_uuid_copy() which sadly is not valid C. Fix it.
...
> #if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x040500
> -void libxl_uuid_copy(dst, src) libxl_uuid_copy(NULL, dst, src)
I think this was intended to read
#define libxl_uuid_copy(dst, src) libxl_uuid_copy(NULL, dst, src)
but should in fact read
#define libxl_uuid_copy(dst, src) libxl_uuid_copy(NULL, (dst), (src))
I don't understand why you want to introduce a function as well as a
macro.
Ian.
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH for-4.5] tools/libxl: Fix building against libxl for LIBXL_API_VERSION < 0x040500
2014-10-17 11:00 ` Ian Jackson
@ 2014-10-17 11:01 ` Andrew Cooper
2014-10-17 11:05 ` Ian Jackson
0 siblings, 1 reply; 10+ messages in thread
From: Andrew Cooper @ 2014-10-17 11:01 UTC (permalink / raw)
To: Ian Jackson; +Cc: Wei Liu, Ian Campbell, Xen-devel
On 17/10/14 12:00, Ian Jackson wrote:
> Andrew Cooper writes ("[PATCH for-4.5] tools/libxl: Fix building against libxl for LIBXL_API_VERSION < 0x040500"):
>> c/s 6276f66ebe "libxl: libxl_uuid_copy now takes a ctx argument" introduces
>> API compatibiltiy for libxl_uuid_copy() which sadly is not valid C. Fix it.
> ...
>> #if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x040500
>> -void libxl_uuid_copy(dst, src) libxl_uuid_copy(NULL, dst, src)
> I think this was intended to read
> #define libxl_uuid_copy(dst, src) libxl_uuid_copy(NULL, dst, src)
> but should in fact read
> #define libxl_uuid_copy(dst, src) libxl_uuid_copy(NULL, (dst), (src))
Does this even work?
Won't the parser complain about passing 3 parameters to a two-parameter
macro?
~Andrew
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH for-4.5] tools/libxl: Fix building against libxl for LIBXL_API_VERSION < 0x040500
2014-10-17 11:01 ` Andrew Cooper
@ 2014-10-17 11:05 ` Ian Jackson
2014-10-17 11:08 ` Ian Jackson
0 siblings, 1 reply; 10+ messages in thread
From: Ian Jackson @ 2014-10-17 11:05 UTC (permalink / raw)
To: Andrew Cooper; +Cc: Wei Liu, Ian Campbell, Xen-devel
Andrew Cooper writes ("Re: [PATCH for-4.5] tools/libxl: Fix building against libxl for LIBXL_API_VERSION < 0x040500"):
> On 17/10/14 12:00, Ian Jackson wrote:
> > I think this was intended to read
> > #define libxl_uuid_copy(dst, src) libxl_uuid_copy(NULL, dst, src)
> > but should in fact read
> > #define libxl_uuid_copy(dst, src) libxl_uuid_copy(NULL, (dst), (src))
>
> Does this even work?
>
> Won't the parser complain about passing 3 parameters to a two-parameter
> macro?
mariner:~> ed t.c
t.c: No such file or directory
a
#define libxl_uuid_copy(dst, src) libxl_uuid_copy(NULL, (dst), (src))
libxl_uuid_copy(1,2)
.
w
91
q
mariner:~> gcc -E t.c
# 1 "t.c"
# 1 "<command-line>"
# 1 "t.c"
libxl_uuid_copy(NULL, (1), (2))
mariner:~>
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH for-4.5] tools/libxl: Fix building against libxl for LIBXL_API_VERSION < 0x040500
2014-10-17 11:05 ` Ian Jackson
@ 2014-10-17 11:08 ` Ian Jackson
2014-10-17 14:19 ` Andrew Cooper
0 siblings, 1 reply; 10+ messages in thread
From: Ian Jackson @ 2014-10-17 11:08 UTC (permalink / raw)
To: Andrew Cooper, Xen-devel, Ian Campbell, Wei Liu
Ian Jackson writes ("Re: [PATCH for-4.5] tools/libxl: Fix building against libxl for LIBXL_API_VERSION < 0x040500"):
> Andrew Cooper writes ("Re: [PATCH for-4.5] tools/libxl: Fix building against libxl for LIBXL_API_VERSION < 0x040500"):
> > On 17/10/14 12:00, Ian Jackson wrote:
> > > I think this was intended to read
> > > #define libxl_uuid_copy(dst, src) libxl_uuid_copy(NULL, dst, src)
> > > but should in fact read
> > > #define libxl_uuid_copy(dst, src) libxl_uuid_copy(NULL, (dst), (src))
Having checked the rules, for C++ this might conceivably have to be
#define libxl_uuid_copy(dst, src) (libxl_uuid_copy(NULL, (dst), (src)))
Ian.
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH for-4.5] tools/libxl: Fix building against libxl for LIBXL_API_VERSION < 0x040500
2014-10-17 11:08 ` Ian Jackson
@ 2014-10-17 14:19 ` Andrew Cooper
2014-10-20 14:46 ` Ian Campbell
0 siblings, 1 reply; 10+ messages in thread
From: Andrew Cooper @ 2014-10-17 14:19 UTC (permalink / raw)
To: Ian Jackson, Xen-devel, Ian Campbell, Wei Liu
On 17/10/14 12:08, Ian Jackson wrote:
> Ian Jackson writes ("Re: [PATCH for-4.5] tools/libxl: Fix building against libxl for LIBXL_API_VERSION < 0x040500"):
>> Andrew Cooper writes ("Re: [PATCH for-4.5] tools/libxl: Fix building against libxl for LIBXL_API_VERSION < 0x040500"):
>>> On 17/10/14 12:00, Ian Jackson wrote:
>>>> I think this was intended to read
>>>> #define libxl_uuid_copy(dst, src) libxl_uuid_copy(NULL, dst, src)
>>>> but should in fact read
>>>> #define libxl_uuid_copy(dst, src) libxl_uuid_copy(NULL, (dst), (src))
> Having checked the rules, for C++ this might conceivably have to be
> #define libxl_uuid_copy(dst, src) (libxl_uuid_copy(NULL, (dst), (src)))
>
> Ian.
Fundamentally, I am not really fussed how this is fixed, although I have
confirmed my patch fixes the libvirt build in the XenServer branch I am
attempting to test Xen-4.5 under.
~Andrew
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH for-4.5] tools/libxl: Fix building against libxl for LIBXL_API_VERSION < 0x040500
2014-10-17 14:19 ` Andrew Cooper
@ 2014-10-20 14:46 ` Ian Campbell
2014-10-23 12:19 ` Andrew Cooper
0 siblings, 1 reply; 10+ messages in thread
From: Ian Campbell @ 2014-10-20 14:46 UTC (permalink / raw)
To: Andrew Cooper; +Cc: Wei Liu, Ian Jackson, Xen-devel
On Fri, 2014-10-17 at 15:19 +0100, Andrew Cooper wrote:
> On 17/10/14 12:08, Ian Jackson wrote:
> > Ian Jackson writes ("Re: [PATCH for-4.5] tools/libxl: Fix building against libxl for LIBXL_API_VERSION < 0x040500"):
> >> Andrew Cooper writes ("Re: [PATCH for-4.5] tools/libxl: Fix building against libxl for LIBXL_API_VERSION < 0x040500"):
> >>> On 17/10/14 12:00, Ian Jackson wrote:
> >>>> I think this was intended to read
> >>>> #define libxl_uuid_copy(dst, src) libxl_uuid_copy(NULL, dst, src)
> >>>> but should in fact read
> >>>> #define libxl_uuid_copy(dst, src) libxl_uuid_copy(NULL, (dst), (src))
> > Having checked the rules, for C++ this might conceivably have to be
> > #define libxl_uuid_copy(dst, src) (libxl_uuid_copy(NULL, (dst), (src)))
> >
> > Ian.
>
> Fundamentally, I am not really fussed how this is fixed, although I have
> confirmed my patch fixes the libvirt build in the XenServer branch I am
> attempting to test Xen-4.5 under.
Ian, are you happy with that or do you want to (ask Andy to) resubmit
with the #define?
Ian.
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH for-4.5] tools/libxl: Fix building against libxl for LIBXL_API_VERSION < 0x040500
2014-10-20 14:46 ` Ian Campbell
@ 2014-10-23 12:19 ` Andrew Cooper
2014-10-23 12:22 ` Ian Campbell
0 siblings, 1 reply; 10+ messages in thread
From: Andrew Cooper @ 2014-10-23 12:19 UTC (permalink / raw)
To: Ian Jackson; +Cc: Wei Liu, Ian Campbell, Xen-devel
On 20/10/14 15:46, Ian Campbell wrote:
> On Fri, 2014-10-17 at 15:19 +0100, Andrew Cooper wrote:
>> On 17/10/14 12:08, Ian Jackson wrote:
>>> Ian Jackson writes ("Re: [PATCH for-4.5] tools/libxl: Fix building against libxl for LIBXL_API_VERSION < 0x040500"):
>>>> Andrew Cooper writes ("Re: [PATCH for-4.5] tools/libxl: Fix building against libxl for LIBXL_API_VERSION < 0x040500"):
>>>>> On 17/10/14 12:00, Ian Jackson wrote:
>>>>>> I think this was intended to read
>>>>>> #define libxl_uuid_copy(dst, src) libxl_uuid_copy(NULL, dst, src)
>>>>>> but should in fact read
>>>>>> #define libxl_uuid_copy(dst, src) libxl_uuid_copy(NULL, (dst), (src))
>>> Having checked the rules, for C++ this might conceivably have to be
>>> #define libxl_uuid_copy(dst, src) (libxl_uuid_copy(NULL, (dst), (src)))
>>>
>>> Ian.
>> Fundamentally, I am not really fussed how this is fixed, although I have
>> confirmed my patch fixes the libvirt build in the XenServer branch I am
>> attempting to test Xen-4.5 under.
> Ian, are you happy with that or do you want to (ask Andy to) resubmit
> with the #define?
>
> Ian.
>
Ping (regarding question)? Whichever fix gets used eventually. this
really needs to get in before the release candidate is cut.
~Andrew
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH for-4.5] tools/libxl: Fix building against libxl for LIBXL_API_VERSION < 0x040500
2014-10-23 12:19 ` Andrew Cooper
@ 2014-10-23 12:22 ` Ian Campbell
0 siblings, 0 replies; 10+ messages in thread
From: Ian Campbell @ 2014-10-23 12:22 UTC (permalink / raw)
To: Andrew Cooper; +Cc: Wei Liu, Ian Jackson, Xen-devel
On Thu, 2014-10-23 at 13:19 +0100, Andrew Cooper wrote:
> Ping (regarding question)? Whichever fix gets used eventually. this
> really needs to get in before the release candidate is cut.
I've applied it locally and kicked off my usual set of tests, I'll push
once those complete (and/or I've finished lunch, whichever comes second)
unless Ian objects before then.
Ian.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2014-10-23 12:22 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-17 8:56 [PATCH for-4.5] tools/libxl: Fix building against libxl for LIBXL_API_VERSION < 0x040500 Andrew Cooper
2014-10-17 10:01 ` Wei Liu
2014-10-17 11:00 ` Ian Jackson
2014-10-17 11:01 ` Andrew Cooper
2014-10-17 11:05 ` Ian Jackson
2014-10-17 11:08 ` Ian Jackson
2014-10-17 14:19 ` Andrew Cooper
2014-10-20 14:46 ` Ian Campbell
2014-10-23 12:19 ` Andrew Cooper
2014-10-23 12:22 ` Ian Campbell
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.