All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: "qemu-ppc@nongnu.org" <qemu-ppc@nongnu.org>,
	qemu-devel Developers <qemu-devel@nongnu.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"mtosatti@redhat.com" <mtosatti@redhat.com>,
	"aliguori@us.ibm.com" <aliguori@us.ibm.com>
Subject: Re: [PATCH] KVM: Fix compilation on non-x86
Date: Wed, 25 Jan 2012 18:45:17 +0100	[thread overview]
Message-ID: <4F203FAD.2080605@suse.de> (raw)
In-Reply-To: <4F203EA8.4060104@siemens.com>

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


WARNING: multiple messages have this Message-ID (diff)
From: Alexander Graf <agraf@suse.de>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: "aliguori@us.ibm.com" <aliguori@us.ibm.com>,
	"mtosatti@redhat.com" <mtosatti@redhat.com>,
	"qemu-ppc@nongnu.org" <qemu-ppc@nongnu.org>,
	qemu-devel Developers <qemu-devel@nongnu.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [Qemu-devel] [PATCH] KVM: Fix compilation on non-x86
Date: Wed, 25 Jan 2012 18:45:17 +0100	[thread overview]
Message-ID: <4F203FAD.2080605@suse.de> (raw)
In-Reply-To: <4F203EA8.4060104@siemens.com>

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

  reply	other threads:[~2012-01-25 17:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-25 17:33 [PATCH] KVM: Fix compilation on non-x86 Alexander Graf
2012-01-25 17:33 ` [Qemu-devel] " Alexander Graf
2012-01-25 17:40 ` Jan Kiszka
2012-01-25 17:40   ` [Qemu-devel] " Jan Kiszka
2012-01-25 17:45   ` Alexander Graf [this message]
2012-01-25 17:45     ` Alexander Graf
2012-01-25 17:59     ` Jan Kiszka
2012-01-25 17:59       ` [Qemu-devel] " Jan Kiszka
2012-02-06 18:33 ` Marcelo Tosatti
2012-02-06 18:33   ` [Qemu-devel] " Marcelo Tosatti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F203FAD.2080605@suse.de \
    --to=agraf@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.