From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37491) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJLcv-0002Gr-VW for qemu-devel@nongnu.org; Wed, 03 Oct 2012 05:52:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TJLcq-00070C-4S for qemu-devel@nongnu.org; Wed, 03 Oct 2012 05:52:25 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:35729) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJLcp-000706-U6 for qemu-devel@nongnu.org; Wed, 03 Oct 2012 05:52:20 -0400 Received: by pbbrp2 with SMTP id rp2so9810016pbb.4 for ; Wed, 03 Oct 2012 02:52:19 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <506C0ACC.1060900@redhat.com> Date: Wed, 03 Oct 2012 11:52:12 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <20121002191609.31100.77382.stgit@bling.home> <20121002192147.31100.41594.stgit@bling.home> <87d310643a.fsf@codemonkey.ws> <1349208745.2759.12.camel@ul30vt.home> In-Reply-To: <1349208745.2759.12.camel@ul30vt.home> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/6] pci-assign: Add support for no-route List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Williamson Cc: jan.kiszka@siemens.com, qemu-devel@nongnu.org, Anthony Liguori , mst@redhat.com Il 02/10/2012 22:12, Alex Williamson ha scritto: > On Tue, 2012-10-02 at 14:55 -0500, Anthony Liguori wrote: >> Alex Williamson writes: >> >>> In the event that a pci-assign device is added to a chipset that >>> hasn't yet implemented the INTx routing interface, exit gracefully >>> instead of killing the VM. I'm sure we'll implement this for q35, >>> but there's no reason for such a harsh response. >>> >>> Signed-off-by: Alex Williamson >>> --- >>> >>> hw/kvm/pci-assign.c | 6 ++++++ >>> 1 file changed, 6 insertions(+) >>> >>> diff --git a/hw/kvm/pci-assign.c b/hw/kvm/pci-assign.c >>> index 05b93d9..7ce0f37 100644 >>> --- a/hw/kvm/pci-assign.c >>> +++ b/hw/kvm/pci-assign.c >>> @@ -887,6 +887,12 @@ static int assign_intx(AssignedDevice *dev) >>> >>> intx_route = pci_device_route_intx_to_irq(&dev->dev, dev->intpin); >>> assert(intx_route.mode != PCI_INTX_INVERTED); >>> + if (intx_route.mode == PCI_INTX_NOROUTE) { >>> + error_report("pci-assign: chipset provides no INTx routing " >>> + "information, but device supports INTx interrupt mode.\n"); >>> + pci_device_set_intx_routing_notifier(&dev->dev, NULL); >>> + return -ENOTSUP; >>> + } >> >> Please don't use error_report() in new code. Propagate an Error object >> using error_setg() and friends. > > That doesn't really seem to be an option since this function is called > both from the driver initfn and the interrupt routing change notifier. > Neither of those give me an Error object... suggestions? Thanks, Both assigned_dev_update_irq_routing and assigned_dev_update_msi would have to print the error themselves (qerror_report_err + error_free). Looks like a waste of time, frankly. Paolo