From patchwork Tue Jan 3 18:38:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 134051 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7B1A9B6F99 for ; Wed, 4 Jan 2012 05:25:10 +1100 (EST) Received: from localhost ([::1]:44498 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ri92i-0001eS-Nd for incoming@patchwork.ozlabs.org; Tue, 03 Jan 2012 13:25:00 -0500 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 Received: from cantor2.suse.de ([195.135.220.15]:54562 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ri92C-0002Rn-Fl; Tue, 03 Jan 2012 13:24:28 -0500 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 72A9D8C5DF; Tue, 3 Jan 2012 19:24:27 +0100 (CET) From: Alexander Graf To: "qemu-devel@nongnu.org Developers" Date: Tue, 3 Jan 2012 19:38:47 +0100 Message-Id: <1325615927-1096-5-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1325615927-1096-1-git-send-email-agraf@suse.de> References: <1325615927-1096-1-git-send-email-agraf@suse.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 195.135.220.15 Cc: qemu-ppc@nongnu.org, Hollis Blanchard Subject: [Qemu-devel] [PATCH] PPC: 440: Ignore invalid PCI IRQs 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 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); }