From patchwork Tue Jun 5 19:03:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 163145 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 37E56B6F9F for ; Wed, 6 Jun 2012 05:04:16 +1000 (EST) Received: from localhost ([::1]:47558 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sbz38-0000Gv-22 for incoming@patchwork.ozlabs.org; Tue, 05 Jun 2012 15:04:14 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53206) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sbz30-0000GD-OU for qemu-devel@nongnu.org; Tue, 05 Jun 2012 15:04:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sbz2v-0008KR-S5 for qemu-devel@nongnu.org; Tue, 05 Jun 2012 15:04:06 -0400 Received: from david.siemens.de ([192.35.17.14]:15025) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sbz2v-0008KK-Hl for qemu-devel@nongnu.org; Tue, 05 Jun 2012 15:04:01 -0400 Received: from mail1.siemens.de (localhost [127.0.0.1]) by david.siemens.de (8.13.6/8.13.6) with ESMTP id q55J3wA2023766; Tue, 5 Jun 2012 21:03:58 +0200 Received: from mchn199C.mchp.siemens.de ([139.25.109.49]) by mail1.siemens.de (8.13.6/8.13.6) with ESMTP id q55J3vJi015523; Tue, 5 Jun 2012 21:03:57 +0200 Message-ID: <4FCE581D.8020309@siemens.com> Date: Tue, 05 Jun 2012 21:03:57 +0200 From: Jan Kiszka User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Anthony Liguori References: <20120604233318.4C32E40771@buildbot.b1-systems.de> <4FCD58B7.9080802@suse.de> <4FCDB5D8.60701@web.de> In-Reply-To: <4FCDB5D8.60701@web.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 192.35.17.14 Cc: agraf@suse.de, Avi Kivity , Ben Collins , =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= , qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH v2] kvm: Fix build for non-CAP_IRQ_ROUTING targets X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org A type definition and a KVMState field initialization escaped the required wrapping with KVM_CAP_IRQ_ROUTING. Also, we need to provide a dummy kvm_irqchip_release_virq as virtio-pci references (but does not use) it. Signed-off-by: Jan Kiszka Tested-by: Andreas Färber --- Changes in v2: - include the missing kvm_irqchip_release_virq that Ben Collins found kvm-all.c | 16 +++++++++++----- 1 files changed, 11 insertions(+), 5 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 489ee53..4ea7d85 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -62,11 +62,6 @@ typedef struct KVMSlot typedef struct kvm_dirty_log KVMDirtyLog; -typedef struct KVMMSIRoute { - struct kvm_irq_routing_entry kroute; - QTAILQ_ENTRY(KVMMSIRoute) entry; -} KVMMSIRoute; - struct KVMState { KVMSlot slots[32]; @@ -867,6 +862,11 @@ int kvm_irqchip_set_irq(KVMState *s, int irq, int level) } #ifdef KVM_CAP_IRQ_ROUTING +typedef struct KVMMSIRoute { + struct kvm_irq_routing_entry kroute; + QTAILQ_ENTRY(KVMMSIRoute) entry; +} KVMMSIRoute; + static void set_gsi(KVMState *s, unsigned int gsi) { s->used_gsi_bitmap[gsi / 32] |= 1U << (gsi % 32); @@ -1129,6 +1129,10 @@ static void kvm_init_irq_routing(KVMState *s) { } +void kvm_irqchip_release_virq(KVMState *s, int virq) +{ +} + int kvm_irqchip_send_msi(KVMState *s, MSIMessage msg) { abort(); @@ -1286,7 +1290,9 @@ int kvm_init(void) s->pit_state2 = kvm_check_extension(s, KVM_CAP_PIT_STATE2); #endif +#ifdef KVM_CAP_IRQ_ROUTING s->direct_msi = (kvm_check_extension(s, KVM_CAP_SIGNAL_MSI) > 0); +#endif ret = kvm_arch_init(s); if (ret < 0) {