From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 2/2] fix compilation with kvm disabled Date: Wed, 08 Jul 2009 15:11:45 +0300 Message-ID: <4A548D01.2050600@redhat.com> References: <1246991791-21741-1-git-send-email-glommer@redhat.com> <1246991791-21741-2-git-send-email-glommer@redhat.com> <1246991791-21741-3-git-send-email-glommer@redhat.com> <20090708075913.GA12440@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Glauber Costa , kvm@vger.kernel.org To: "Michael S. Tsirkin" Return-path: Received: from mx2.redhat.com ([66.187.237.31]:41527 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753709AbZGHMJQ (ORCPT ); Wed, 8 Jul 2009 08:09:16 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n68C9GEP008846 for ; Wed, 8 Jul 2009 08:09:16 -0400 In-Reply-To: <20090708075913.GA12440@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 07/08/2009 10:59 AM, Michael S. Tsirkin wrote: > >> @@ -337,10 +346,12 @@ int msix_init(struct PCIDevice *dev, unsigned short nentries, >> if (nentries> MSIX_MAX_ENTRIES) >> return -EINVAL; >> >> +#ifdef KVM_CAP_IRQCHIP >> if (kvm_enabled()&& qemu_kvm_irqchip_in_kernel()) { >> dev->msix_irq_entries = qemu_malloc(nentries * >> sizeof *dev->msix_irq_entries); >> } >> +#endif >> dev->msix_entry_used = qemu_mallocz(MSIX_MAX_ENTRIES * >> sizeof *dev->msix_entry_used); >> >> @@ -454,10 +465,13 @@ void msix_notify(PCIDevice *dev, unsigned vector) >> msix_set_pending(dev, vector); >> return; >> } >> + >> +#ifdef KVM_CAP_IRQCHIP >> if (kvm_enabled()&& qemu_kvm_irqchip_in_kernel()) { >> kvm_set_irq(dev->msix_irq_entries[vector].gsi, 1, NULL); >> return; >> } >> +#endif >> >> address = pci_get_long(table_entry + MSIX_MSG_UPPER_ADDR); >> address = (address<< 32) | pci_get_long(table_entry + MSIX_MSG_ADDR); >> > > I think it's time we stopped worrying about builds against old kernel > headers or without them. What do we gain from it? > qemu upstream doesn't carry its own headers, so it we want to merge, we need to work against old headers. > I believe that the right thing to do is to define kvm_enabled as a macro > returning 0, and let compiler optimize the code out. > Doesn't work with -O0 (or if it does, we can't count on it). -- error compiling committee.c: too many arguments to function