From patchwork Tue Dec 8 13:07:29 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 40635 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A90A9B7B3E for ; Wed, 9 Dec 2009 00:49:54 +1100 (EST) Received: from localhost ([127.0.0.1]:45835 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NI0Rq-0006OT-NO for incoming@patchwork.ozlabs.org; Tue, 08 Dec 2009 08:49:50 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHznD-0004Af-Mg for qemu-devel@nongnu.org; Tue, 08 Dec 2009 08:07:51 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHzn8-00043m-HP for qemu-devel@nongnu.org; Tue, 08 Dec 2009 08:07:50 -0500 Received: from [199.232.76.173] (port=56933 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHzn8-00043V-9N for qemu-devel@nongnu.org; Tue, 08 Dec 2009 08:07:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52618) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NHzn7-0004ZB-Pv for qemu-devel@nongnu.org; Tue, 08 Dec 2009 08:07:46 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nB8D7XTa014638 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 8 Dec 2009 08:07:34 -0500 Received: from zweiblum.home.kraxel.org (vpn2-9-91.ams2.redhat.com [10.36.9.91]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nB8D7UGg020365 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 8 Dec 2009 08:07:32 -0500 Message-ID: <4B1E4F91.9010206@redhat.com> Date: Tue, 08 Dec 2009 14:07:29 +0100 From: Gerd Hoffmann User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20090922 Fedora/3.0-3.9.b4.fc12 Lightning/1.0pre Thunderbird/3.0b4 MIME-Version: 1.0 To: "Daniel P. Berrange" Subject: Re: [Qemu-devel] [ANNOUNCE][Call-For-Testing] Release 0.12.0-rc1 of QEMU References: <4B1C3377.1020509@linux.vnet.ibm.com> <20091207183432.GW24530@redhat.com> <4B1E2D36.6030800@redhat.com> <20091208105206.GA16596@redhat.com> <4B1E4BFA.4010207@redhat.com> In-Reply-To: <4B1E4BFA.4010207@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Anthony Liguori , "qemu-devel@nongnu.org" X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org On 12/08/09 13:52, Gerd Hoffmann wrote: >> The latter. The guest does not see it, but it at least does not abort. >> It is the 'does not abort' behaviour I'm interested in - quite OK with >> this returning an error to the monitor client when acpi is disabled. > > Does the attached patch fix it for you? One more fix for the "hw_error() when slots full" case. cheers, Gerd From 1c1de5c577a3241df4fb52cfdf15e97af9283caa Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Tue, 8 Dec 2009 14:05:11 +0100 Subject: [PATCH] pci: don't hw_error() when no slot is available. Signed-off-by: Gerd Hoffmann --- hw/pci.c | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 4f662b7..404eead 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -580,11 +580,13 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus, if (!bus->devices[devfn]) goto found; } - hw_error("PCI: no devfn available for %s, all in use\n", name); + qemu_error("PCI: no devfn available for %s, all in use\n", name); + return NULL; found: ; } else if (bus->devices[devfn]) { - hw_error("PCI: devfn %d not available for %s, in use by %s\n", devfn, + qemu_error("PCI: devfn %d not available for %s, in use by %s\n", devfn, name, bus->devices[devfn]->name); + return NULL; } pci_dev->bus = bus; pci_dev->devfn = devfn; @@ -625,6 +627,9 @@ PCIDevice *pci_register_device(PCIBus *bus, const char *name, pci_dev = do_pci_register_device(pci_dev, bus, name, devfn, config_read, config_write, PCI_HEADER_TYPE_NORMAL); + if (pci_dev == NULL) { + hw_error("PCI: can't register device\n"); + } return pci_dev; } static target_phys_addr_t pci_to_cpu_addr(target_phys_addr_t addr) @@ -1376,6 +1381,8 @@ static int pci_qdev_init(DeviceState *qdev, DeviceInfo *base) pci_dev = do_pci_register_device(pci_dev, bus, base->name, devfn, info->config_read, info->config_write, info->header_type); + if (pci_dev == NULL) + return -1; rc = info->init(pci_dev); if (rc != 0) return rc;