From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:50141) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rq6uT-0005CC-8y for qemu-devel@nongnu.org; Wed, 25 Jan 2012 12:45:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rq6uN-0004mq-DQ for qemu-devel@nongnu.org; Wed, 25 Jan 2012 12:45:25 -0500 Message-ID: <4F203FAD.2080605@suse.de> Date: Wed, 25 Jan 2012 18:45:17 +0100 From: Alexander Graf MIME-Version: 1.0 References: <1327512783-29868-1-git-send-email-agraf@suse.de> <4F203EA8.4060104@siemens.com> In-Reply-To: <4F203EA8.4060104@siemens.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] KVM: Fix compilation on non-x86 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 >> --- >> 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