KVM: Fix compilation on non-x86
PATCH 1/1 KVM: Fix compilation on non-x86
Commit 84b058d broke compilation for KVM on non-x86 targets, which don't have KVM_CAP_IRQ_ROUTING defined.
Fix by not using the unavailable constant when it's not around.
--- kvm-all.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
kvm-all.c +4 -0
@@ -1305,7 +1305,11 @@ int kvm_has_many_ioeventfds(void)int kvm_has_gsi_routing (void ) { +#ifdef KVM_CAP_IRQ_ROUTING return kvm_check_extension (kvm_state,KVM_CAP_IRQ_ROUTING ); +#else +return false; +#endif }int kvm_allows_irq0_override (void )
Signature · 1 line
1.6.0.2
Quoted 16 lines · Alexander Graf
Commit 84b058d broke compilation for KVM on non-x86 targets, which don't have
KVM_CAP_IRQ_ROUTINGdefined.Fix by not using the unavailable constant when it's not around.
Signed-off-by Alexander Graf <[email protected]>--- kvm-all.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)kvm-all.c +0
-0@@ -1305,7 +1305,11 @@ int kvm_has_many_ioeventfds(void)
kvm-all.c int kvm_has_many_ioeventfds(void) · line 1315
Quoted 10 lines
kvm-all.c +4
-0int kvm_has_gsi_routing (void ) { +#ifdef KVM_CAP_IRQ_ROUTING return kvm_check_extension (kvm_state,KVM_CAP_IRQ_ROUTING ); +#else +return false; +#endif }int kvm_allows_irq0_override (void )
Yep, thanks.
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux
Quoted 26 lines · Jan Kiszka
Quoted 25 lines · Alexander Graf
Commit 84b058d broke compilation for KVM on non-x86 targets, which don't have
KVM_CAP_IRQ_ROUTINGdefined.Fix by not using the unavailable constant when it's not around.
Signed-off-by Alexander Graf<[email protected]>--- kvm-all.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)kvm-all.c +4
-0@@ -1305,7 +1305,11 @@ int kvm_has_many_ioeventfds(void)int kvm_has_gsi_routing (void ) { +#ifdef KVM_CAP_IRQ_ROUTING return kvm_check_extension (kvm_state,KVM_CAP_IRQ_ROUTING ); +#else +return false; +#endif }
Quoted 2 lines
kvm-all.c int kvm_has_many_ioeventfds(void) · line 1315
Quoted 1 line
kvm-all.c +0
-0int kvm_allows_irq0_override (void )Yep, thanks.
Btw, I really dislike the concept of conditional CAP defines. If a CAP isn't available, we get false returned from the kernel anyway. And if a CAP is architecture specific, we should rather be #ifdefing on TARGET_XXX rather than the CAP.
Alex
Quoted 27 lines · Alexander Graf
Quoted 26 lines · Jan Kiszka
Quoted 25 lines · Alexander Graf
Commit 84b058d broke compilation for KVM on non-x86 targets, which don't have
KVM_CAP_IRQ_ROUTINGdefined.Fix by not using the unavailable constant when it's not around.
Signed-off-by Alexander Graf<[email protected]>--- kvm-all.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)kvm-all.c +4
-0@@ -1305,7 +1305,11 @@ int kvm_has_many_ioeventfds(void)int kvm_has_gsi_routing (void ) { +#ifdef KVM_CAP_IRQ_ROUTING return kvm_check_extension (kvm_state,KVM_CAP_IRQ_ROUTING ); +#else +return false; +#endif }
Quoted 7 lines
Quoted 2 lines
kvm-all.c int kvm_has_many_ioeventfds(void) · line 1315
Quoted 1 line
kvm-all.c +0
-0int kvm_allows_irq0_override (void )Yep, thanks.
Btw, I really dislike the concept of conditional CAP defines. If a CAP isn't available, we get false returned from the kernel anyway. And if a CAP is architecture specific, we should rather be #ifdefing on
TARGET_XXXrather than the CAP.
Yes, I hate it generally as well. There are cases (IIRC) where it is really useless. The use case here is that it allows to disable certain conceptually generic parts in kvm-all during build time. If it's worth it, that's a different question.
Jan
Marcelo Tosatti
AppliedQuoted 6 lines · Alexander Graf
Commit 84b058d broke compilation for KVM on non-x86 targets, which don't have
KVM_CAP_IRQ_ROUTINGdefined.Fix by not using the unavailable constant when it's not around.
Signed-off-by Alexander Graf <[email protected]>
Applied, thanks.