[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 30/34] xen: Add missing includes on different files



On 04/09/2014 05:17 PM, Jan Beulich wrote:
>>>> On 09.04.14 at 18:06, <julien.grall@xxxxxxxxxx> wrote:
>> On 03/27/2014 07:57 AM, Jan Beulich wrote:
>>>>>> On 26.03.14 at 18:41, <julien.grall@xxxxxxxxxx> wrote:
>>>> In file included from multicall.c:41:0:
>>>> ../multicall.c:38:1: error: conflicting types for âcompat_multicallâ
>>>> In file included from ../multicall.c:9:0,
>>>>                  from multicall.c:41:
>>>
>>> Meaning this needs to be dealt with differently: Include the header in
>>> both files _and_ add a declaration of compat_multicall() to it (alongside
>>> the other compat_ ones already there).
>>
>> I gave a look to this solution. It won't works because do_multicall is
>> replaced by the define in compat/multicall.c:26. It will end up to
>> multiple definition of compat_multcall.
>>
>> I'm not sure how to handle it because, AFAIU, compat/multicall.c is
>> defining some macro to redefine the behavior of multicall.c
> 
> Right, but that doesn't prevent the suggested model afaict:
> 
> - compat/multicall.c includes xen/hypercall.h, obtaining proper
>   prototypes for both do_multicall() and compat_multicall()
> - compat/multicall.c re-defines do_multicall (which doesn't affect
>   the prototypes already seen)
> - compat/multicall.c includes multicall.c
> - multicall.c's inclusion of xen/hypercall.h does nothing (thanks
>   to the header guard)
> 
> Did you indeed try this and it didn't work?

I've tried another things. Anyway the version below works for me. Thanks for 
your help.

diff --git a/xen/common/compat/multicall.c b/xen/common/compat/multicall.c
index 95c047a..0399863 100644
--- a/xen/common/compat/multicall.c
+++ b/xen/common/compat/multicall.c
@@ -6,6 +6,7 @@
 #include <xen/types.h>
 #include <xen/multicall.h>
 #include <xen/trace.h>
+#include <xen/hypercall.h>
 
 #define COMPAT
 typedef int ret_t;
@@ -18,7 +19,6 @@ static inline void xlat_multicall_entry(struct mc_state *mcs)
         mcs->compat_call.args[i] = mcs->call.args[i];
 }
 
-DEFINE_XEN_GUEST_HANDLE(multicall_entry_compat_t);
 #define multicall_entry      compat_multicall_entry
 #define multicall_entry_t    multicall_entry_compat_t
 #define do_multicall_call    compat_multicall_call
diff --git a/xen/common/multicall.c b/xen/common/multicall.c
index bb7550b..e39e724 100644
--- a/xen/common/multicall.c
+++ b/xen/common/multicall.c
@@ -6,9 +6,7 @@
 #include <xen/types.h>
 #include <xen/lib.h>
 #include <xen/mm.h>
-#ifndef COMPAT
 #include <xen/hypercall.h>
-#endif
 #include <xen/sched.h>
 #include <xen/event.h>
 #include <xen/multicall.h>
diff --git a/xen/include/xen/hypercall.h b/xen/include/xen/hypercall.h
index a9e5229..baa9cc6 100644
--- a/xen/include/xen/hypercall.h
+++ b/xen/include/xen/hypercall.h
@@ -176,6 +176,11 @@ compat_set_timer_op(
     u32 lo,
     s32 hi);
 
+DEFINE_XEN_GUEST_HANDLE(multicall_entry_compat_t);
+extern int
+compat_multicall(XEN_GUEST_HANDLE(multicall_entry_compat_t) call_list,
+                unsigned int nr_calls);
+
 #endif
 
 void arch_get_xen_caps(xen_capabilities_info_t *info);

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.