From patchwork Thu Mar 12 13:36:57 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yang X-Patchwork-Id: 11374 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n2CDc9B9026123 for ; Thu, 12 Mar 2009 13:38:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756741AbZCLNhg (ORCPT ); Thu, 12 Mar 2009 09:37:36 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756062AbZCLNhg (ORCPT ); Thu, 12 Mar 2009 09:37:36 -0400 Received: from mga02.intel.com ([134.134.136.20]:36451 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756574AbZCLNhG (ORCPT ); Thu, 12 Mar 2009 09:37:06 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 12 Mar 2009 06:31:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.38,350,1233561600"; d="scan'208";a="393900981" Received: from syang10-desktop.sh.intel.com (HELO syang10-desktop) ([10.239.13.189]) by orsmga002.jf.intel.com with ESMTP; 12 Mar 2009 06:45:33 -0700 Received: from yasker by syang10-desktop with local (Exim 4.69) (envelope-from ) id 1Lhl5o-0007u3-Hj; Thu, 12 Mar 2009 21:37:00 +0800 From: Sheng Yang To: Avi Kivity , Marcelo Tosatti , Anthony Liguori Cc: kvm@vger.kernel.org, Sheng Yang Subject: [PATCH 14/16] kvm: fix irq 0 assignment Date: Thu, 12 Mar 2009 21:36:57 +0800 Message-Id: <1236865019-30321-15-git-send-email-sheng@linux.intel.com> X-Mailer: git-send-email 1.5.6.3 In-Reply-To: <1236865019-30321-1-git-send-email-sheng@linux.intel.com> References: <1236865019-30321-1-git-send-email-sheng@linux.intel.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Shouldn't update assigned irq if host irq is 0, which means uninitialized or don't support INTx. Signed-off-by: Sheng Yang --- qemu/hw/device-assignment.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/qemu/hw/device-assignment.c b/qemu/hw/device-assignment.c index 1cd4cf7..69f8e3a 100644 --- a/qemu/hw/device-assignment.c +++ b/qemu/hw/device-assignment.c @@ -590,6 +590,10 @@ static int assign_irq(AssignedDevInfo *adev) AssignedDevice *dev = adev->assigned_dev; int irq, r = 0; + /* IRQ PIN 0 means not use INTx */ + if (pci_read_byte(dev->pdev, PCI_INTERRUPT_PIN) == 0) + return 0; + irq = pci_map_irq(&dev->dev, dev->intpin); irq = piix_get_irq(irq);