From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:55219) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ri92D-0000TS-Lh for qemu-devel@nongnu.org; Tue, 03 Jan 2012 13:24:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ri92C-0002S1-Lf for qemu-devel@nongnu.org; Tue, 03 Jan 2012 13:24:29 -0500 From: Alexander Graf Date: Tue, 3 Jan 2012 19:38:47 +0100 Message-Id: <1325615927-1096-5-git-send-email-agraf@suse.de> In-Reply-To: <1325615927-1096-1-git-send-email-agraf@suse.de> References: <1325615927-1096-1-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PATCH] PPC: 440: Ignore invalid PCI IRQs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "qemu-devel@nongnu.org Developers" Cc: qemu-ppc@nongnu.org, Hollis Blanchard When running a 440 target, we currently get invalid irq_num values (-1) which completely confuse the IRQ setting code. This is most likely due to the missing qdev conversion. While this shouldn't happen in the first place and should really rather be fixed by converting the target, I dislike segfaults. So for now, let's just print a warning and ignore invalid irq_num values. Signed-off-by: Alexander Graf --- hw/ppc4xx_pci.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/hw/ppc4xx_pci.c b/hw/ppc4xx_pci.c index 2c69210..1bf785b 100644 --- a/hw/ppc4xx_pci.c +++ b/hw/ppc4xx_pci.c @@ -275,6 +275,10 @@ static void ppc4xx_pci_set_irq(void *opaque, int irq_num, int level) qemu_irq *pci_irqs = opaque; DPRINTF("%s: PCI irq %d\n", __func__, irq_num); + if (irq_num < 0) { + fprintf(stderr, "%s: PCI irq %d\n", __func__, irq_num); + return; + } qemu_set_irq(pci_irqs[irq_num], level); } -- 1.6.0.2