* [Qemu-devel] [PATCH] KVM: Fix compilation on non-x86
@ 2012-01-25 17:33 Alexander Graf
2012-01-25 17:40 ` Jan Kiszka
2012-02-06 18:33 ` Marcelo Tosatti
0 siblings, 2 replies; 5+ messages in thread
From: Alexander Graf @ 2012-01-25 17:33 UTC (permalink / raw)
To: qemu-ppc; +Cc: jan.kiszka, aliguori, mtosatti, qemu-devel Developers, kvm
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.
Signed-off-by: Alexander Graf <agraf@suse.de>
---
kvm-all.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/kvm-all.c b/kvm-all.c
index e411d3c..831f39a 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -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)
--
1.6.0.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] KVM: Fix compilation on non-x86
2012-01-25 17:33 [Qemu-devel] [PATCH] KVM: Fix compilation on non-x86 Alexander Graf
@ 2012-01-25 17:40 ` Jan Kiszka
2012-01-25 17:45 ` Alexander Graf
2012-02-06 18:33 ` Marcelo Tosatti
1 sibling, 1 reply; 5+ messages in thread
From: Jan Kiszka @ 2012-01-25 17:40 UTC (permalink / raw)
To: Alexander Graf
Cc: aliguori@us.ibm.com, mtosatti@redhat.com, qemu-ppc@nongnu.org,
qemu-devel Developers, kvm@vger.kernel.org
On 2012-01-25 18:33, Alexander Graf wrote:
> 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.
>
> Signed-off-by: Alexander Graf <agraf@suse.de>
> ---
> kvm-all.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/kvm-all.c b/kvm-all.c
> index e411d3c..831f39a 100644
> --- a/kvm-all.c
> +++ b/kvm-all.c
> @@ -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)
Yep, thanks.
Jan
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] KVM: Fix compilation on non-x86
2012-01-25 17:40 ` Jan Kiszka
@ 2012-01-25 17:45 ` Alexander Graf
2012-01-25 17:59 ` Jan Kiszka
0 siblings, 1 reply; 5+ messages in thread
From: Alexander Graf @ 2012-01-25 17:45 UTC (permalink / raw)
To: Jan Kiszka
Cc: aliguori@us.ibm.com, mtosatti@redhat.com, qemu-ppc@nongnu.org,
qemu-devel Developers, kvm@vger.kernel.org
On 01/25/2012 06:40 PM, Jan Kiszka wrote:
> On 2012-01-25 18:33, Alexander Graf wrote:
>> 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.
>>
>> Signed-off-by: Alexander Graf<agraf@suse.de>
>> ---
>> kvm-all.c | 4 ++++
>> 1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/kvm-all.c b/kvm-all.c
>> index e411d3c..831f39a 100644
>> --- a/kvm-all.c
>> +++ b/kvm-all.c
>> @@ -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)
> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] KVM: Fix compilation on non-x86
2012-01-25 17:45 ` Alexander Graf
@ 2012-01-25 17:59 ` Jan Kiszka
0 siblings, 0 replies; 5+ messages in thread
From: Jan Kiszka @ 2012-01-25 17:59 UTC (permalink / raw)
To: Alexander Graf
Cc: aliguori@us.ibm.com, mtosatti@redhat.com, qemu-ppc@nongnu.org,
qemu-devel Developers, kvm@vger.kernel.org
[-- Attachment #1: Type: text/plain, Size: 1450 bytes --]
On 2012-01-25 18:45, Alexander Graf wrote:
> On 01/25/2012 06:40 PM, Jan Kiszka wrote:
>> On 2012-01-25 18:33, Alexander Graf wrote:
>>> 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.
>>>
>>> Signed-off-by: Alexander Graf<agraf@suse.de>
>>> ---
>>> kvm-all.c | 4 ++++
>>> 1 files changed, 4 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/kvm-all.c b/kvm-all.c
>>> index e411d3c..831f39a 100644
>>> --- a/kvm-all.c
>>> +++ b/kvm-all.c
>>> @@ -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)
>> 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.
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
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] KVM: Fix compilation on non-x86
2012-01-25 17:33 [Qemu-devel] [PATCH] KVM: Fix compilation on non-x86 Alexander Graf
2012-01-25 17:40 ` Jan Kiszka
@ 2012-02-06 18:33 ` Marcelo Tosatti
1 sibling, 0 replies; 5+ messages in thread
From: Marcelo Tosatti @ 2012-02-06 18:33 UTC (permalink / raw)
To: Alexander Graf; +Cc: jan.kiszka, aliguori, qemu-ppc, qemu-devel Developers, kvm
On Wed, Jan 25, 2012 at 06:33:03PM +0100, Alexander Graf wrote:
> 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.
>
> Signed-off-by: Alexander Graf <agraf@suse.de>
Applied, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-02-06 18:40 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-25 17:33 [Qemu-devel] [PATCH] KVM: Fix compilation on non-x86 Alexander Graf
2012-01-25 17:40 ` Jan Kiszka
2012-01-25 17:45 ` Alexander Graf
2012-01-25 17:59 ` Jan Kiszka
2012-02-06 18:33 ` Marcelo Tosatti
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).