diff mbox series

[v3,3/5] xen: Fix build when !CONFIG_GRANT_TABLE

Message ID 834f7995ae80a3b37b6d508d1c989b4ee391f61b.1621017334.git.connojdavis@gmail.com (mailing list archive)
State Superseded
Headers show
Series Minimal build for RISCV | expand

Commit Message

Connor Davis May 14, 2021, 6:53 p.m. UTC
Move struct grant_table; in grant_table.h above
ifdef CONFIG_GRANT_TABLE. This fixes the following:

/build/xen/include/xen/grant_table.h:84:50: error: 'struct grant_table'
declared inside parameter list will not be visible outside of this
definition or declaration [-Werror]
   84 | static inline int mem_sharing_gref_to_gfn(struct grant_table *gt,
      |

Signed-off-by: Connor Davis <connojdavis@gmail.com>
---
 xen/include/xen/grant_table.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Jan Beulich May 17, 2021, 11:22 a.m. UTC | #1
On 14.05.2021 20:53, Connor Davis wrote:
> Move struct grant_table; in grant_table.h above
> ifdef CONFIG_GRANT_TABLE. This fixes the following:
> 
> /build/xen/include/xen/grant_table.h:84:50: error: 'struct grant_table'
> declared inside parameter list will not be visible outside of this
> definition or declaration [-Werror]
>    84 | static inline int mem_sharing_gref_to_gfn(struct grant_table *gt,
>       |

There must be more to this, as e.g. the PV shim does get built with
!GRANT_TABLE. Nevertheless, ...

> Signed-off-by: Connor Davis <connojdavis@gmail.com>

... since the potential of breaking the build is obvious enough,
Acked-by: Jan Beulich <jbeulich@suse.com>

Jan
Connor Davis May 17, 2021, 11:46 p.m. UTC | #2
On 5/17/21 5:22 AM, Jan Beulich wrote:
> On 14.05.2021 20:53, Connor Davis wrote:
>> Move struct grant_table; in grant_table.h above
>> ifdef CONFIG_GRANT_TABLE. This fixes the following:
>>
>> /build/xen/include/xen/grant_table.h:84:50: error: 'struct grant_table'
>> declared inside parameter list will not be visible outside of this
>> definition or declaration [-Werror]
>>     84 | static inline int mem_sharing_gref_to_gfn(struct grant_table *gt,
>>        |
> There must be more to this, as e.g. the PV shim does get built with
> !GRANT_TABLE. Nevertheless, ...
>
You are right... you're comment made me realize I had only tested this

with XEN_TARGET_ARCH=riscv64. I will rework this.

>> Signed-off-by: Connor Davis <connojdavis@gmail.com>
> ... since the potential of breaking the build is obvious enough,
> Acked-by: Jan Beulich <jbeulich@suse.com>
>
> Jan


Thanks,

Connor
Connor Davis May 18, 2021, 3:58 a.m. UTC | #3
On 5/17/21 5:22 AM, Jan Beulich wrote:
> On 14.05.2021 20:53, Connor Davis wrote:
>> Move struct grant_table; in grant_table.h above
>> ifdef CONFIG_GRANT_TABLE. This fixes the following:
>>
>> /build/xen/include/xen/grant_table.h:84:50: error: 'struct grant_table'
>> declared inside parameter list will not be visible outside of this
>> definition or declaration [-Werror]
>>     84 | static inline int mem_sharing_gref_to_gfn(struct grant_table *gt,
>>        |
> There must be more to this, as e.g. the PV shim does get built with
> !GRANT_TABLE. Nevertheless, ...
>
Can you elaborate? I tested all defconfigs with and without grant tables

enabled on x86 and ARM and they all build fine.

>> Signed-off-by: Connor Davis <connojdavis@gmail.com>
> ... since the potential of breaking the build is obvious enough,
> Acked-by: Jan Beulich <jbeulich@suse.com>
>
> Jan


Thanks,

Connor
Jan Beulich May 18, 2021, 6:31 a.m. UTC | #4
On 18.05.2021 05:58, Connor Davis wrote:
> 
> On 5/17/21 5:22 AM, Jan Beulich wrote:
>> On 14.05.2021 20:53, Connor Davis wrote:
>>> Move struct grant_table; in grant_table.h above
>>> ifdef CONFIG_GRANT_TABLE. This fixes the following:
>>>
>>> /build/xen/include/xen/grant_table.h:84:50: error: 'struct grant_table'
>>> declared inside parameter list will not be visible outside of this
>>> definition or declaration [-Werror]
>>>     84 | static inline int mem_sharing_gref_to_gfn(struct grant_table *gt,
>>>        |
>> There must be more to this, as e.g. the PV shim does get built with
>> !GRANT_TABLE. Nevertheless, ...
>>
> Can you elaborate? I tested all defconfigs with and without grant tables
> 
> enabled on x86 and ARM and they all build fine.

I'm confused: Everything building fine supports my statement, so if
more elaboration was needed, it would be you to make more precise
the conditions upon which a build failure would occur. But this is
largely moot now, since I did commit your change yesterday already,
for, as said, the potential of breaking the build being obvious
enough.

Jan
diff mbox series

Patch

diff --git a/xen/include/xen/grant_table.h b/xen/include/xen/grant_table.h
index 63b6dc78f4..9f8b7e66c1 100644
--- a/xen/include/xen/grant_table.h
+++ b/xen/include/xen/grant_table.h
@@ -28,9 +28,10 @@ 
 #include <public/grant_table.h>
 #include <asm/grant_table.h>
 
-#ifdef CONFIG_GRANT_TABLE
 struct grant_table;
 
+#ifdef CONFIG_GRANT_TABLE
+
 extern unsigned int opt_max_grant_frames;
 
 /* Create/destroy per-domain grant table context. */