From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH] KVM: Fix compilation on non-x86 Date: Wed, 25 Jan 2012 18:59:15 +0100 Message-ID: <4F2042F3.2040404@web.de> References: <1327512783-29868-1-git-send-email-agraf@suse.de> <4F203EA8.4060104@siemens.com> <4F203FAD.2080605@suse.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig7398B97C05B5208BA3634316" Cc: "qemu-ppc@nongnu.org" , qemu-devel Developers , "kvm@vger.kernel.org" , "mtosatti@redhat.com" , "aliguori@us.ibm.com" To: Alexander Graf Return-path: Received: from fmmailgate05.web.de ([217.72.192.243]:36731 "EHLO fmmailgate05.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750772Ab2AYR7y (ORCPT ); Wed, 25 Jan 2012 12:59:54 -0500 Received: from moweb002.kundenserver.de (moweb002.kundenserver.de [172.19.20.108]) by fmmailgate05.web.de (Postfix) with ESMTP id E003C6948809 for ; Wed, 25 Jan 2012 18:59:52 +0100 (CET) In-Reply-To: <4F203FAD.2080605@suse.de> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig7398B97C05B5208BA3634316 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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 >>> --- >>> 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. >=20 > 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 --------------enig7398B97C05B5208BA3634316 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk8gQvYACgkQitSsb3rl5xRjygCgjucwrnbrewhPms59GZZ+U55b 3FAAnRUQCAzDT7GVF4kjQUJnVoH8rv6h =Zkew -----END PGP SIGNATURE----- --------------enig7398B97C05B5208BA3634316--